/* ==========================================================================
   Design System for Ecosistema Digital IBBY México - Biblioteca BS
   Aesthetic: Premium Sober Light Theme
   Colors: Sober Purple (#5A3D73), Forest Emerald (#0A4E35), Matte Gold (#B48D1D)
   ========================================================================== */

:root {
  --bg-primary: #FAF9F8;
  --bg-secondary: #FFFFFF;
  --accent-purple: #5A3D73;      /* Sober, readable purple */
  --accent-emerald: #0A4E35;     /* Sober forest emerald */
  --accent-gold: #B48D1D;        /* Matte, high-contrast gold */
  
  --text-primary: #1C1824;       /* High-contrast charcoal */
  --text-secondary: #4E4759;     /* Deep gray for body text */
  --text-muted: #7E768A;         /* Slate gray for secondary text */
  
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(90, 61, 115, 0.08);
  --glass-shadow: rgba(28, 24, 36, 0.04);
  --glass-blur: blur(8px);
  
  --transition-smooth: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  --border-radius-lg: 16px;
  --border-radius-md: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Typography styles */
.playfair {
  font-family: 'Playfair Display', serif;
}
.outfit {
  font-family: 'Outfit', sans-serif;
}

/* Background Particle Simulation styling */
#particles-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.particle {
  position: absolute;
  background-color: var(--accent-gold);
  border-radius: 50%;
  opacity: 0.15;
  animation: floatUp 8s infinite linear;
}

@keyframes floatUp {
  0% {
    transform: translateY(100vh) translateX(0) scale(1);
    opacity: 0;
  }
  50% {
    opacity: 0.3;
  }
  100% {
    transform: translateY(-10vh) translateX(50px) scale(0.5);
    opacity: 0;
  }
}

/* Glassmorphism Panel Utility */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px 0 var(--glass-shadow);
  border-radius: var(--border-radius-lg);
  padding: 24px;
}

/* Header & Navigation */
.main-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.araucaria-icon {
  font-size: 32px;
  animation: sway 6s ease-in-out infinite alternate;
  display: inline-block;
  transform-origin: bottom center;
}

@keyframes sway {
  0% { transform: rotate(-5deg); }
  100% { transform: rotate(5deg); }
}

.title-sub h1 {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-purple);
}

.title-sub span {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: var(--border-radius-md);
  transition: var(--transition-smooth);
}

.nav-btn:hover, .nav-btn.active {
  color: var(--accent-purple);
  background: rgba(90, 61, 115, 0.08);
}

.admin-btn {
  border: 1px solid var(--accent-purple);
  color: var(--accent-purple);
}

.admin-btn:hover {
  background: var(--accent-purple);
  color: var(--bg-secondary);
}

.staff-badge {
  background-color: var(--accent-gold);
  color: var(--bg-primary);
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 4px;
  letter-spacing: 1px;
}

/* Layout Views */
.content-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 80px 24px;
}

.app-view {
  display: none;
  animation: fadeIn 0.4s ease-out forwards;
}

.app-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hero Section */
.hero-section {
  text-align: center;
  margin-bottom: 40px;
}

.hero-section h2 {
  font-size: 42px;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.hero-section p {
  color: var(--text-secondary);
  font-size: 16px;
  max-width: 600px;
  margin: 0 auto;
}

/* Controls (Search and Filters) */
.controls-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 40px;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--text-muted);
}

.search-box input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 16px 48px 16px 48px;
  border-radius: 30px;
  font-size: 16px;
  font-family: 'Outfit', sans-serif;
  transition: var(--transition-smooth);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent-purple);
  box-shadow: 0 0 12px rgba(90, 61, 115, 0.12);
}

.clear-btn {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  padding: 0 4px;
}

.stage-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-pill {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  font-family: 'Outfit', sans-serif;
  transition: var(--transition-smooth);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.filter-pill:hover, .filter-pill.active {
  background: var(--accent-purple);
  border-color: var(--accent-purple);
  color: var(--bg-secondary);
}

/* Catalog Grid */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 30px;
}

.book-card {
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.book-card:hover {
  transform: translateY(-8px);
  border-color: rgba(212, 175, 55, 0.4);
  box-shadow: 0 12px 24px var(--glass-shadow);
}

.book-cover-container {
  aspect-ratio: 2/3;
  width: 100%;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  position: relative;
  background-color: var(--bg-secondary);
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  margin-bottom: 12px;
}

.book-cover-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.book-card:hover .book-cover-container img {
  transform: scale(1.05);
}

.availability-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 4px;
  letter-spacing: 1px;
}

.available {
  background-color: #27ae60;
  color: white;
}

.borrowed {
  background-color: #c0392b;
  color: white;
}

.book-info h4 {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 4px;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-info p {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 6px;
}

.book-tag {
  font-size: 10px;
  font-weight: 500;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.2);
  color: var(--accent-gold);
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
}

/* Spinner */
.spinner-container {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 0;
}

.spinner {
  border: 4px solid rgba(255, 255, 255, 0.1);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border-left-color: var(--accent-gold);
  animation: spin 1s linear infinite;
  margin: 0 auto 16px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Pagination */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 50px;
}

.pag-btn {
  background: var(--bg-secondary);
  border: 1px solid rgba(212, 175, 55, 0.2);
  color: var(--text-primary);
  padding: 10px 20px;
  border-radius: 25px;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  transition: var(--transition-smooth);
}

.pag-btn:hover:not(:disabled) {
  border-color: var(--accent-gold);
  background: rgba(212, 175, 55, 0.1);
}

.pag-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.page-indicator {
  font-size: 15px;
  color: var(--text-secondary);
}

/* About View Elements */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}

@media (max-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
}

.about-card h2 {
  font-size: 28px;
  color: var(--accent-gold);
  margin-bottom: 16px;
}

.about-card h3 {
  font-size: 20px;
  color: var(--text-primary);
  margin-top: 24px;
  margin-bottom: 8px;
}

.about-card p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

.araucaria-visual-container {
  text-align: center;
}

.araucaria-visual-container svg {
  margin-bottom: 16px;
}

.araucaria-visual-container .caption {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}

.branch {
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: draw 4s ease-out forwards;
}

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

.branch-2, .branch-4, .branch-6 {
  transform-origin: 100px 140px;
  animation: branchOscillateRight 6s ease-in-out infinite alternate;
}

.branch-3, .branch-5, .branch-7 {
  transform-origin: 100px 140px;
  animation: branchOscillateLeft 6s ease-in-out infinite alternate;
}

@keyframes branchOscillateRight {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(3deg); }
}

@keyframes branchOscillateLeft {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(-3deg); }
}

.bunkos-section h2 {
  color: var(--accent-gold);
  margin-bottom: 12px;
  font-size: 24px;
}

.bunkos-section p {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Login Portal */
.login-card-container {
  display: flex;
  justify-content: center;
  padding: 40px 0;
}

.login-card {
  width: 100%;
  max-width: 420px;
}

.login-card h2 {
  font-size: 26px;
  text-align: center;
  color: var(--accent-gold);
  margin-bottom: 8px;
}

.login-card .subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.form-group input {
  background: rgba(15, 5, 28, 0.45);
  border: 1px solid rgba(212, 175, 55, 0.15);
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: var(--border-radius-md);
  font-size: 15px;
  transition: var(--transition-smooth);
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.15);
}

.submit-btn {
  width: 100%;
  background: var(--accent-gold);
  color: var(--bg-primary);
  border: none;
  padding: 14px;
  border-radius: var(--border-radius-md);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  margin-top: 10px;
}

.submit-btn:hover {
  background: #f1c40f;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.error-msg {
  background-color: rgba(192, 57, 43, 0.15);
  border: 1px solid rgba(192, 57, 43, 0.3);
  color: #e74c3c;
  padding: 12px;
  border-radius: var(--border-radius-md);
  font-size: 13px;
  margin-bottom: 16px;
  text-align: center;
}

/* Admin Dashboard */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(212, 175, 55, 0.1);
  padding-bottom: 16px;
  margin-bottom: 30px;
}

.admin-header h2 {
  font-size: 32px;
  color: var(--accent-gold);
}

.logout-btn {
  background: transparent;
  border: 1px solid rgba(192, 57, 43, 0.5);
  color: #e74c3c;
  padding: 8px 16px;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.logout-btn:hover {
  background: #e74c3c;
  color: white;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

@media (max-width: 768px) {
  .stats-row {
    grid-template-columns: 1fr;
  }
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.stat-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--accent-gold);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 13px;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 1px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 30px;
  margin-bottom: 40px;
}

@media (max-width: 992px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

.admin-actions-card h3, .admin-scanner-card h3, .loans-section-card h3 {
  font-size: 20px;
  margin-bottom: 16px;
  color: var(--text-primary);
  border-left: 3px solid var(--accent-gold);
  padding-left: 10px;
}

.circulation-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 24px;
}

.circ-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 500;
  padding: 12px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition-smooth);
}

.circ-tab-btn.active {
  color: var(--accent-gold);
  border-bottom-color: var(--accent-gold);
  font-weight: 600;
}

.circ-form {
  animation: fadeIn 0.3s ease-out forwards;
}

.submit-btn.checkout {
  background-color: var(--accent-purple);
  color: white;
}
.submit-btn.checkout:hover {
  background-color: #8e44ad;
  box-shadow: 0 4px 15px rgba(142, 68, 173, 0.3);
}

.submit-btn.checkin {
  background-color: #1abc9c;
  color: white;
}
.submit-btn.checkin:hover {
  background-color: #16a085;
  box-shadow: 0 4px 15px rgba(22, 160, 133, 0.3);
}

.circ-alert {
  padding: 16px;
  border-radius: var(--border-radius-md);
  margin-top: 24px;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  animation: fadeIn 0.3s ease-out;
}

.circ-alert.alert-success {
  background: rgba(39, 174, 96, 0.15);
  border: 1px solid rgba(39, 174, 96, 0.3);
  color: #2ecc71;
}

.circ-alert.alert-error {
  background: rgba(192, 57, 43, 0.15);
  border: 1px solid rgba(192, 57, 43, 0.3);
  color: #e74c3c;
}

/* Scanner View */
.admin-scanner-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
}

.scanner-viewport-container {
  aspect-ratio: 4/3;
  background-color: #0b0314;
  border: 1px dashed rgba(212, 175, 55, 0.2);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  position: relative;
}

#scanner-reader {
  width: 100%;
  height: 100%;
}

.scanner-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  flex-direction: column;
  gap: 16px;
}

.camera-icon {
  font-size: 48px;
  opacity: 0.5;
}

.start-scanner-btn {
  background: transparent;
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  padding: 10px 20px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition-smooth);
}

.start-scanner-btn:hover {
  background: var(--accent-gold);
  color: var(--bg-primary);
}

.stop-scanner-btn {
  width: 100%;
  margin-top: 12px;
  background: rgba(192, 57, 43, 0.1);
  border: 1px solid rgba(192, 57, 43, 0.3);
  color: #e74c3c;
  padding: 12px;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  font-weight: bold;
}

.stop-scanner-btn:hover {
  background: #e74c3c;
  color: white;
}

/* Loans Table */
.loans-section-card {
  width: 100%;
}

.table-container {
  width: 100%;
  overflow-x: auto;
}

.loans-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.loans-table th, .loans-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.loans-table th {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  background: rgba(15, 5, 28, 0.3);
}

.loans-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.table-btn {
  background: transparent;
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  transition: var(--transition-smooth);
}

.table-btn:hover {
  background: var(--accent-gold);
  color: var(--bg-primary);
}

/* Offline Sync Banner */
.offline-sync-indicator {
  border: 1px solid rgba(243, 156, 18, 0.4);
  background-color: rgba(243, 156, 18, 0.1);
  padding: 16px;
  margin-top: 30px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.text-warning {
  color: #f39c12;
}

.sync-btn {
  background: #f39c12;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.sync-btn:hover {
  background: #e67e22;
}

/* Book Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  background: rgba(10, 3, 18, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
  animation: fadeIn 0.3s ease-out;
}

.modal-card {
  width: 100%;
  max-width: 800px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  border-color: rgba(212, 175, 55, 0.3);
}

.close-modal-btn {
  position: absolute;
  right: 20px;
  top: 20px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
}

.close-modal-btn:hover {
  color: var(--text-primary);
}

.modal-body {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 30px;
}

@media (max-width: 768px) {
  .modal-body {
    grid-template-columns: 1fr;
  }
}

.modal-cover-area {
  width: 100%;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  background-color: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-cover-area img {
  max-width: 100%;
  max-height: 420px;
  object-fit: contain;
  display: block;
  border-radius: 8px;
}

.modal-info-area {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.modal-info-area h2 {
  font-size: 26px;
  color: var(--text-primary);
  margin-top: 10px;
  margin-bottom: 4px;
}

.modal-info-area .author-label {
  font-size: 16px;
  color: var(--accent-gold);
  margin-bottom: 20px;
}

.metadata-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: 100%;
  margin-bottom: 24px;
  font-size: 14px;
}

.metadata-grid div {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding-bottom: 8px;
}

.metadata-grid strong {
  color: var(--text-secondary);
  font-weight: 500;
}

.metadata-grid span {
  color: var(--text-primary);
}

.badge {
  font-size: 11px;
  font-weight: bold;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
}

/* MARC Details View */
.marc-view-toggle {
  width: 100%;
  margin-top: 10px;
}

.marc-toggle-btn {
  background: transparent;
  border: 1px dashed rgba(212,175,55,0.3);
  color: var(--text-secondary);
  width: 100%;
  padding: 12px;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  transition: var(--transition-smooth);
}

.marc-toggle-btn:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.marc-details-block {
  width: 100%;
  background: rgba(15, 5, 28, 0.5);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--border-radius-md);
  padding: 16px;
  margin-top: 16px;
  animation: fadeIn 0.3s ease-out;
}

.marc-details-block h4 {
  font-size: 14px;
  color: var(--accent-gold);
  margin-bottom: 12px;
}

.marc-row {
  display: flex;
  font-family: monospace;
  font-size: 13px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.02);
}

.marc-tag {
  color: var(--accent-purple);
  font-weight: bold;
  width: 50px;
}

.marc-data {
  color: #2ecc71;
  word-break: break-all;
}

/* Helper utilities */
.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hide {
  display: none !important;
}

.text-center {
  text-align: center;
}

.font-bold {
  font-weight: bold;
}

.font-medium {
  font-weight: 500;
}

/* Logo Styling */
.header-logo {
  height: 48px;
  width: auto;
  object-fit: contain;
  transition: var(--transition-smooth);
}

.header-logo:hover {
  transform: scale(1.05);
}

/* About Visual Split Sitemap Layout */
.about-sitemap-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 30px;
  max-width: 1200px;
  margin: 30px auto;
  align-items: start;
}

@media (max-width: 900px) {
  .about-sitemap-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* Sidebar Menu */
.sitemap-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-secondary);
  padding: 16px;
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 12px var(--glass-shadow);
}

@media (max-width: 900px) {
  .sitemap-sidebar {
    flex-direction: row;
    overflow-x: auto;
    padding: 12px;
    gap: 10px;
    white-space: nowrap;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }
}

.sitemap-sidebar-btn {
  background: transparent;
  border: 1px solid transparent;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  cursor: pointer;
  border-radius: var(--border-radius-md);
  transition: var(--transition-smooth);
  width: 100%;
}

.sitemap-sidebar-btn .icon {
  font-size: 24px;
  transition: var(--transition-smooth);
}

.sitemap-sidebar-btn .btn-text {
  display: flex;
  flex-direction: column;
  font-family: 'Outfit', sans-serif;
}

.sitemap-sidebar-btn .title {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
}

.sitemap-sidebar-btn .desc {
  font-size: 11px;
  color: var(--text-muted);
}

.sitemap-sidebar-btn:hover {
  background: rgba(90, 61, 115, 0.04);
  border-color: var(--glass-border);
}

.sitemap-sidebar-btn.active {
  background: rgba(90, 61, 115, 0.08);
  border-color: var(--accent-purple);
}

.sitemap-sidebar-btn.active .icon {
  transform: scale(1.1);
}

/* Content Viewport */
.sitemap-content-viewport {
  position: relative;
  min-height: 450px;
}

.sitemap-section {
  display: none;
}

.sitemap-section.active {
  display: block;
}

/* Slide and Fade animation */
.animate-slide-fade {
  animation: slideFadeIn 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes slideFadeIn {
  from {
    opacity: 0;
    transform: translateX(15px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Gallery Library Grid */
.sitemap-grid-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 15px;
}

.gallery-item-card {
  background: var(--bg-secondary);
  border-radius: var(--border-radius-md);
  border: 1px solid var(--glass-border);
  overflow: hidden;
  box-shadow: 0 2px 8px var(--glass-shadow);
  transition: var(--transition-smooth);
}

.gallery-item-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  transition: var(--transition-smooth);
  border-bottom: 1px solid var(--glass-border);
}

.gallery-item-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(90, 61, 115, 0.08);
}

.gallery-item-card:hover img {
  transform: scale(1.03);
}

.gallery-item-card .caption {
  padding: 12px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.gallery-item-card .caption strong {
  color: var(--accent-purple);
}

.sitemap-content-viewport ul {
  padding-left: 20px;
  margin-top: 10px;
  color: var(--text-secondary);
}

.sitemap-content-viewport li {
  margin-bottom: 8px;
}

/* Fluid Transitions for Catalog cards */
.book-card {
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.book-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 12px 30px rgba(90, 61, 115, 0.1);
}

/* Search Type Select dropdown */
.search-type-select:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 12px rgba(90, 61, 115, 0.12);
}

/* Fallback Book Cover Styling */
.book-cover-container {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: var(--border-radius-md);
  background: #eaeaea;
}

.book-cover-fallback {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  text-align: center;
  z-index: 1;
}

.fallback-inner {
  border: 1px solid rgba(255, 255, 255, 0.25);
  width: 100%;
  height: 100%;
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
  border-radius: 4px;
}

.fallback-title {
  font-size: 13px;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  margin-top: 10px;
}

.fallback-author {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.75);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 4px;
}

.fallback-branding {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #ffd700; /* Gold */
  font-weight: 700;
  margin-bottom: 5px;
}

.real-cover {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
}

.real-cover.loaded {
  opacity: 1;
}

/* Catalog Layout & Sidebar Popularity */
.catalog-layout {
  display: flex;
  gap: 30px;
  align-items: flex-start;
  margin-top: 20px;
}

.catalog-main {
  flex: 3;
}

.catalog-sidebar {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  box-shadow: 0 4px 15px var(--glass-shadow);
  position: sticky;
  top: 100px;
}

@media (max-width: 900px) {
  .catalog-layout {
    flex-direction: column;
    align-items: stretch;
  }
  .catalog-sidebar {
    position: static;
  }
}

.popularity-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.popularity-item:hover {
  background: rgba(90, 61, 115, 0.04) !important;
  transform: translateX(4px);
}

/* Member View & Dashboard styling */
.member-login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 380px;
  padding: 40px 0;
}

.member-dashboard {
  animation: slideFadeIn 0.4s ease-out forwards;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-top: 20px;
}

@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.recommendations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
}

.campaign-item {
  border-left: 3px solid var(--accent-purple);
  padding-left: 12px;
  margin-bottom: 16px;
}

.campaign-item:last-child {
  margin-bottom: 0;
}

.circ-alert {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.4;
  margin-top: 10px;
}

.circ-alert.success {
  background: rgba(42, 115, 95, 0.08);
  color: var(--success-color);
  border: 1px solid rgba(42, 115, 95, 0.15);
}

.circ-alert.error {
  background: rgba(166, 61, 64, 0.08);
  color: var(--danger-color);
  border: 1px solid rgba(166, 61, 64, 0.15);
}

.status-active {
  background: rgba(42, 115, 95, 0.08);
  color: var(--success-color);
  border: 1px solid rgba(42, 115, 95, 0.15);
}

.status-suspended {
  background: rgba(166, 61, 64, 0.08);
  color: var(--danger-color);
  border: 1px solid rgba(166, 61, 64, 0.15);
}

/* Animations */
.animate-fade {
  animation: fadeIn 0.3s ease-out forwards;
}

.animate-tab {
  animation: tabFadeIn 0.3s ease-out forwards;
}

/* Mobile & Tablet Responsive Improvements */
@media (max-width: 900px) {
  .sitemap-sidebar-btn {
    width: auto !important;
    flex-shrink: 0;
    padding: 8px 14px !important;
    gap: 8px !important;
  }
  .sitemap-sidebar-btn .desc {
    display: none !important;
  }
  .sitemap-sidebar-btn .title {
    font-size: 13px !important;
  }
  .sitemap-sidebar-btn .icon {
    font-size: 18px !important;
  }
}

@media (max-width: 600px) {
  .catalog-filters {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    padding-bottom: 8px !important;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
  }
  .filter-pill {
    flex-shrink: 0 !important;
    scroll-snap-align: start;
    padding: 6px 12px !important;
    font-size: 12px !important;
  }
  
  /* Mobile padding tweaks for about sitemap section content */
  .sitemap-content-viewport {
    padding: 16px !important;
  }
  
  .sitemap-grid-gallery {
    grid-template-columns: 1fr !important;
    gap: 15px !important;
  }
}

/* ==========================================================================
   Home View (Inicio) Landing Page Styles
   ========================================================================== */
.home-top-section {
  padding: 40px;
  border-radius: var(--border-radius-lg);
  margin-bottom: 30px;
  background: #EAEAEA;
  border: 1px solid var(--glass-border);
}

.top-hero-content {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 30px;
  align-items: center;
}

.top-hero-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ibby-main-heading {
  font-size: 52px;
  font-weight: 800;
  color: #000085;
  text-align: center;
  margin-bottom: 20px;
  letter-spacing: -1px;
}

.ibby-mission-p {
  font-size: 20px;
  line-height: 1.65;
  color: #1b4685;
  text-align: center;
  max-width: 580px;
  font-weight: 400;
}

.top-hero-slider-wrap {
  position: relative;
  width: 320px;
  height: 260px;
  justify-self: center;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.hero-slider {
  position: relative;
  width: 100%;
  height: 100%;
}

.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
  pointer-events: none;
}

.hero-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Recommendations Section */
.home-section-recommendations {
  background-color: #F9F6EA !important;
  padding: 40px 30px;
  border-radius: var(--border-radius-lg);
  margin-bottom: 30px;
  border: 1px solid rgba(0,0,0,0.04);
}

.rec-header {
  text-align: center;
  margin-bottom: 30px;
}

.rec-main-title {
  font-size: 30px;
  font-weight: 800;
  color: #000085;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.rec-subtitle {
  font-size: 18px;
  color: #1b4685;
  font-weight: 600;
  margin-bottom: 4px;
}

.rec-italic {
  font-size: 14px;
  color: #1b4685;
  font-style: italic;
}

.rec-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}

.rec-card {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  background: #ffffff;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.rec-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.rec-card.card-green {
  background-color: #1ca049;
}

.rec-card.card-pink {
  background-color: #f52599;
}

.rec-card.card-orange {
  background-color: #ff6700;
}

.rec-card-header {
  padding: 16px 12px;
  text-align: center;
  color: #ffffff;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.5px;
}

.rec-card-body {
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  flex: 1;
}

.rec-cover-img {
  max-height: 380px;
  width: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

.rec-card-body:hover .rec-cover-img {
  transform: scale(1.03);
}

.rec-card-footer {
  padding: 12px;
  text-align: center;
  background: rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rec-book-title {
  color: #ffffff;
  font-weight: 700;
  font-size: 16px;
}

.rec-book-author {
  color: rgba(255,255,255,0.85);
  font-size: 13px;
}

.rec-catalog-btn-container {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.catalog-outline-btn {
  background: transparent;
  color: #000085;
  border: 2px solid #000085;
  padding: 10px 32px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.catalog-outline-btn:hover {
  background: #000085;
  color: #ffffff;
}

/* Blue & Green Section Banners */
.home-banner-blue {
  background-color: #194c92;
  color: #ffffff;
  border-radius: var(--border-radius-lg);
  padding: 40px 60px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  margin-bottom: 24px;
}

.home-banner-green {
  background-color: #1fa054;
  color: #ffffff;
  border-radius: var(--border-radius-lg);
  padding: 40px 60px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  align-items: center;
  margin-bottom: 30px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.home-banner-green:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(31, 160, 84, 0.3);
}

.banner-blue-text h2,
.banner-green-text h2 {
  font-size: 28px;
  line-height: 1.3;
  margin-bottom: 12px;
  color: #ffffff;
}

.banner-blue-text p,
.banner-green-text p {
  font-size: 16px;
  margin-bottom: 24px;
  color: rgba(255,255,255,0.9);
}

.banner-white-btn {
  background: transparent;
  color: #ffffff;
  border: 2px solid #ffffff;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.banner-white-btn:hover {
  background: #ffffff;
  color: #1C1824;
}

.banner-blue-img-wrap,
.banner-green-img-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
}

.banner-img {
  max-width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

/* Home Gallery Grid Edge-to-Edge */
.home-gallery-section {
  margin-top: 30px;
  margin-bottom: 0;
}

.home-gallery-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
}

.home-gallery-grid img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.home-gallery-grid img:hover {
  transform: scale(1.04);
  z-index: 2;
  filter: brightness(1.05);
}

/* Newsletter Subscription Banner */
.home-newsletter-banner {
  background-color: #8566ff;
  padding: 24px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0;
  color: #ffffff;
  border-radius: 0 0 8px 8px;
}

.newsletter-icon {
  display: flex;
  align-items: center;
  color: #ffffff;
}

.newsletter-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #ffffff;
}

.newsletter-btn {
  background-color: #000085;
  color: #ffffff;
  border: none;
  padding: 10px 24px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.newsletter-btn:hover {
  background-color: #1b4685;
  transform: translateY(-2px);
}

@media (max-width: 900px) {
  .top-hero-content {
    grid-template-columns: 1fr;
  }
  .rec-cards-grid {
    grid-template-columns: 1fr;
  }
  .home-banner-blue,
  .home-banner-green {
    grid-template-columns: 1fr;
    padding: 30px;
    text-align: center;
  }
  .banner-blue-text,
  .banner-green-text {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .home-gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .home-newsletter-banner {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

@media (max-width: 600px) {
  .home-top-section {
    padding: 24px;
  }
  .ibby-main-heading {
    font-size: 32px;
  }
  .ibby-mission-p {
    font-size: 15px;
  }
  .home-section-recommendations {
    padding: 24px 16px;
  }
  .home-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
