/*
 * assets/css/app.css — School Library Automation System v2.1
 * Updated: resource_type badges, collection symbol, barcode print styles
 */

/* ── Google Font ─────────────────────────────────────────────────────────── */
* { font-family: 'Sarabun', 'Segoe UI', sans-serif; }

/* ── DataTables ──────────────────────────────────────────────────────────── */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  border-radius: .5rem;
  border: 1px solid var(--lib-border, #e2e8f0);
  padding: .3rem .6rem;
  font-family: 'Sarabun', sans-serif;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--lib-primary, #1a3c5e) !important;
  color: #fff !important;
  border-color: var(--lib-primary, #1a3c5e) !important;
  border-radius: .375rem;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: #f0f4f8 !important;
  color: var(--lib-primary, #1a3c5e) !important;
  border-color: #e2e8f0 !important;
  border-radius: .375rem;
}

/* ── SweetAlert2 ─────────────────────────────────────────────────────────── */
.swal2-popup,
.swal2-title,
.swal2-html-container { font-family: 'Sarabun', sans-serif !important; }

/* ── Form focus ──────────────────────────────────────────────────────────── */
.form-control:focus,
.form-select:focus {
  border-color: var(--lib-primary, #1a3c5e);
  box-shadow: 0 0 0 .2rem rgba(26, 60, 94, .12);
}

/* ── Sidebar scrollbar ───────────────────────────────────────────────────── */
#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.2);
  border-radius: 2px;
}

/* ── Collection Symbol display ───────────────────────────────────────────── */
.collection-symbol {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--lib-accent, #e8a020);
  font-family: 'Sarabun', serif;
  letter-spacing: .02em;
}

/* ── Resource type badge colors ──────────────────────────────────────────── */
.rt-book        { background: #6c757d; color: #fff; }
.rt-reference   { background: #0d6efd; color: #fff; }
.rt-thesis      { background: #ffc107; color: #212529; }
.rt-research    { background: #0dcaf0; color: #212529; }
.rt-journal     { background: #198754; color: #fff; }
.rt-fiction     { background: #dc3545; color: #fff; }
.rt-easy        { background: #fd7e14; color: #fff; }
.rt-short_story { background: #6f42c1; color: #fff; }
.rt-audiovisual { background: #212529; color: #fff; }

/* ── Call number display ─────────────────────────────────────────────────── */
.call-number-display {
  font-family: 'Courier New', monospace;
  font-weight: 700;
  color: var(--lib-primary, #1a3c5e);
  font-size: 1rem;
  line-height: 1.4;
}

/* ── Barcode label (screen preview) ─────────────────────────────────────── */
.barcode-card {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: .5rem .75rem;
  text-align: center;
  display: inline-block;
  min-width: 160px;
}
.barcode-card .bc-title {
  font-size: .65rem;
  color: #6c757d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
  margin-bottom: .2rem;
}
.barcode-card .bc-call {
  font-family: 'Courier New', monospace;
  font-size: .82rem;
  font-weight: 700;
  color: #1a3c5e;
  margin-bottom: .1rem;
}
.barcode-card .bc-code {
  font-family: monospace;
  font-size: .65rem;
  color: #495057;
  margin-top: .15rem;
}

/* ── Fade-in ─────────────────────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.lib-card, .stat-card { animation: fadeInUp .2s ease both; }

/* ── Truncate 2 lines ────────────────────────────────────────────────────── */
.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Utility ─────────────────────────────────────────────────────────────── */
.min-width-0    { min-width: 0; }
.font-monospace { font-family: 'Courier New', monospace !important; }

/* ── Print: global ───────────────────────────────────────────────────────── */
@media print {
  #sidebar, #sidebar-overlay, #topnav, .lib-footer {
    display: none !important;
  }
  #main-content {
    margin-left: 0 !important;
    margin-top:  0 !important;
    padding: 0 !important;
  }
  .lib-card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    break-inside: avoid;
  }
  .no-print   { display: none !important; }
  .print-only { display: block !important; }
  table { font-size: .78rem; }
  a[href]::after { content: none !important; }
}

/* ── Report print ────────────────────────────────────────────────────────── */
.print-only { display: none; }

/* ── Report card hover ───────────────────────────────────────────────────── */
.report-card {
  transition: transform .15s, box-shadow .15s;
  cursor: pointer;
}
.report-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.12) !important;
}
