/* ============================================
   LibraryHub - Main Stylesheet
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --primary: #1a1a2e;
  --secondary: #16213e;
  --accent: #e94560;
  --gold: #f4a623;
  --teal: #0f9b8e;
  --light-bg: #f8f7f4;
  --card-bg: #ffffff;
  --text-dark: #1a1a2e;
  --text-muted: #6c757d;
  --border: #e9ecef;
  --shadow: 0 4px 24px rgba(26,26,46,0.10);
  --shadow-lg: 0 12px 40px rgba(26,26,46,0.18);
  --radius: 16px;
  --radius-sm: 8px;
  --font-display: 'Playfair Display', serif;
  --font-body: 'DM Sans', sans-serif;
  --transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}

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

body {
  font-family: var(--font-body);
  background: var(--light-bg);
  color: var(--text-dark);
  line-height: 1.6;
  font-size: 15px;
}

/* ---- Navbar ---- */
.navbar-hub {
  background: var(--primary);
  padding: 0 0;
  box-shadow: 0 2px 20px rgba(0,0,0,0.2);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.navbar-hub .navbar-brand {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: #fff !important;
  letter-spacing: -0.5px;
}
.navbar-hub .navbar-brand span { color: var(--accent); }
.navbar-hub .nav-link {
  color: rgba(255,255,255,0.8) !important;
  font-weight: 500;
  transition: var(--transition);
  padding: 1rem 1rem !important;
  position: relative;
}
.navbar-hub .nav-link:hover { color: #fff !important; }
.navbar-hub .nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 1rem; right: 1rem;
  height: 3px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}
.navbar-hub .btn-nav {
  background: var(--accent);
  color: #fff !important;
  border-radius: 8px;
  padding: 0.4rem 1.2rem !important;
  font-weight: 600;
  margin: 0.5rem 0.3rem;
  transition: var(--transition);
}
.navbar-hub .btn-nav:hover { background: #c73652; transform: translateY(-1px); }

/* ---- Hero Section ---- */
.hero-section {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, #0d3b66 100%);
  color: white;
  padding: 80px 0 60px;
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at 60% 40%, rgba(233,69,96,0.15) 0%, transparent 50%),
              radial-gradient(circle at 20% 80%, rgba(15,155,142,0.1) 0%, transparent 40%);
}
.hero-section h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  line-height: 1.15;
  margin-bottom: 1rem;
}
.hero-section h1 span { color: var(--accent); }
.hero-section p { font-size: 1.1rem; opacity: 0.85; max-width: 540px; }
.hero-section .hero-img {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 45%;
  object-fit: cover;
  opacity: 0.15;
}

/* ---- Cards ---- */
.card-hub {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: var(--transition);
  overflow: hidden;
}
.card-hub:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}
.card-hub .card-header-hub {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 1.2rem 1.5rem;
  font-weight: 600;
  font-size: 1.05rem;
}
.card-hub .card-body { padding: 1.5rem; }

/* ---- Auth Forms ---- */
.auth-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.auth-card {
  background: white;
  border-radius: 24px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  position: relative;
}
.auth-card .brand-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}
.auth-card .brand-logo h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--primary);
}
.auth-card .brand-logo h2 span { color: var(--accent); }
.auth-card h4 {
  font-family: var(--font-display);
  color: var(--text-dark);
  margin-bottom: 0.3rem;
}
.auth-card p.sub { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }

/* ---- Form Controls ---- */
.form-control-hub {
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: var(--transition);
  width: 100%;
  background: #fff;
}
.form-control-hub:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(233,69,96,0.12);
}
.form-label-hub {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-dark);
  margin-bottom: 0.4rem;
  display: block;
}
.input-icon-wrap { position: relative; }
.input-icon-wrap .icon {
  position: absolute;
  left: 0.9rem; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
}
.input-icon-wrap .form-control-hub { padding-left: 2.6rem; }

/* ---- Buttons ---- */
.btn-primary-hub {
  background: linear-gradient(135deg, var(--accent), #c73652);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}
.btn-primary-hub:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(233,69,96,0.4);
  color: white;
}
.btn-secondary-hub {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}
.btn-secondary-hub:hover {
  background: var(--secondary);
  transform: translateY(-2px);
  color: white;
}
.btn-outline-hub {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.4rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}
.btn-outline-hub:hover { background: var(--accent); color: white; }

/* ---- Sidebar ---- */
.dashboard-wrapper { display: flex; min-height: 100vh; }
.sidebar {
  width: 260px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--secondary) 100%);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: var(--transition);
}
.sidebar-brand {
  padding: 1.5rem 1.2rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  text-align: center;
}
.sidebar-brand h3 {
  font-family: var(--font-display);
  color: white;
  font-size: 1.3rem;
  margin: 0;
}
.sidebar-brand h3 span { color: var(--accent); }
.sidebar-menu { padding: 1rem 0; }
.sidebar-menu .menu-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.75rem 1.3rem;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--transition);
  border-left: 3px solid transparent;
}
.sidebar-menu .menu-item:hover {
  background: rgba(255,255,255,0.08);
  color: white;
  border-left-color: var(--accent);
}
.sidebar-menu .menu-item.active {
  background: rgba(233,69,96,0.2);
  color: white;
  border-left-color: var(--accent);
}
.sidebar-menu .menu-item i { width: 20px; text-align: center; font-size: 1rem; }
.sidebar-menu .menu-section {
  padding: 1rem 1.3rem 0.3rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.35);
  font-weight: 600;
}
.main-content { flex: 1; min-width: 0; padding: 2rem; }

/* ---- Page Title ---- */
.page-title {
  margin-bottom: 1.5rem;
}
.page-title h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--text-dark);
  margin: 0;
}
.page-title p { color: var(--text-muted); margin: 0.2rem 0 0; }

/* ---- Stats Cards ---- */
.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.stat-icon.red    { background: rgba(233,69,96,0.12); color: var(--accent); }
.stat-icon.blue   { background: rgba(13,110,253,0.12); color: #0d6efd; }
.stat-icon.green  { background: rgba(15,155,142,0.12); color: var(--teal); }
.stat-icon.gold   { background: rgba(244,166,35,0.12); color: var(--gold); }
.stat-info h3 { font-size: 1.8rem; font-weight: 700; margin: 0; line-height: 1; }
.stat-info p { color: var(--text-muted); font-size: 0.85rem; margin: 0.2rem 0 0; }

/* ---- Seat Grid ---- */
.seat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 1rem;
}
.seat-box {
  aspect-ratio: 1;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
  font-weight: 600;
  font-size: 0.85rem;
  position: relative;
}
.seat-box.available {
  background: rgba(15,155,142,0.08);
  border-color: var(--teal);
  color: var(--teal);
}
.seat-box.available:hover {
  background: var(--teal);
  color: white;
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(15,155,142,0.3);
}
.seat-box.booked {
  background: rgba(233,69,96,0.08);
  border-color: var(--accent);
  color: var(--accent);
  cursor: not-allowed;
  opacity: 0.6;
}
.seat-box.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(233,69,96,0.35);
}
.seat-box i { font-size: 1.5rem; margin-bottom: 0.2rem; }
.seat-box .seat-price {
  font-size: 0.72rem;
  font-weight: 400;
  opacity: 0.9;
}

/* ---- Library List Card ---- */
.library-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 1px solid var(--border);
}
.library-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.library-card .lib-cover {
  height: 140px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: white;
  position: relative;
}
.library-card .lib-cover .lib-badge {
  position: absolute;
  top: 1rem; right: 1rem;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(6px);
  color: white;
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}
.library-card .lib-body { padding: 1.2rem; }
.library-card .lib-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
}
.library-card .lib-meta {
  color: var(--text-muted);
  font-size: 0.83rem;
  margin-bottom: 0.8rem;
}
.library-card .lib-meta i { color: var(--accent); margin-right: 0.3rem; }
.lib-seats-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.seat-badge {
  background: rgba(15,155,142,0.1);
  color: var(--teal);
  border-radius: 6px;
  padding: 0.2rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
}
.seat-badge.full { background: rgba(233,69,96,0.1); color: var(--accent); }

/* ---- Tables ---- */
.table-hub {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.table-hub thead th {
  background: var(--primary);
  color: white;
  padding: 0.9rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.table-hub tbody tr {
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.table-hub tbody tr:hover { background: #fafafa; }
.table-hub tbody td {
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  vertical-align: middle;
}
.table-hub tbody tr:last-child { border-bottom: none; }

/* ---- Modals ---- */
.modal-hub .modal-content {
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.modal-hub .modal-header {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 1.2rem 1.5rem;
}
.modal-hub .modal-header .btn-close { filter: invert(1); }
.modal-hub .modal-body { padding: 1.5rem; }
.modal-hub .modal-footer {
  border-top: 1px solid var(--border);
  padding: 1rem 1.5rem;
}

/* ---- Alerts ---- */
.alert { border-radius: var(--radius-sm); border: none; font-size: 0.9rem; }
.alert-success { background: rgba(15,155,142,0.12); color: #0a6b62; }
.alert-danger  { background: rgba(233,69,96,0.12); color: #a01a2b; }
.alert-info    { background: rgba(13,110,253,0.12); color: #084298; }
.alert-warning { background: rgba(244,166,35,0.12); color: #7a4e00; }

/* ---- Badges ---- */
.badge { padding: 0.4em 0.75em; border-radius: 6px; font-weight: 600; font-size: 0.8em; }

/* ---- Plan Cards ---- */
.plan-card {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 2px solid transparent;
  cursor: pointer;
}
.plan-card:hover, .plan-card.selected {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.plan-header {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 1.5rem;
  text-align: center;
}
.plan-header h4 { font-family: var(--font-display); font-size: 1.3rem; margin: 0 0 0.3rem; }
.plan-price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}
.plan-price span { font-size: 0.9rem; color: rgba(255,255,255,0.7); font-weight: 400; }
.plan-body { background: white; padding: 1.2rem; }
.plan-body ul { list-style: none; padding: 0; margin: 0; }
.plan-body ul li {
  padding: 0.4rem 0;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-dark);
}
.plan-body ul li i { color: var(--teal); }

/* ---- Responsive ---- */
@media (max-width: 991px) {
  .sidebar { width: 220px; }
  .main-content { padding: 1.2rem; }
}
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -260px;
    height: 100%;
    z-index: 999;
  }
  .sidebar.open { left: 0; }
  .sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 998;
  }
  .sidebar-overlay.show { display: block; }
  .main-content { padding: 1rem; }
  .dashboard-wrapper { display: block; }
  .page-title h2 { font-size: 1.4rem; }
  .seat-grid { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); }
  .auth-card { padding: 1.8rem 1.2rem; }
  .hero-section { padding: 50px 0 40px; }
}
@media (max-width: 480px) {
  .stat-card { flex-direction: column; text-align: center; }
  .seat-box { font-size: 0.75rem; }
}

/* ---- Misc ---- */
.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-state i { font-size: 3rem; margin-bottom: 1rem; color: var(--border); }
.loading-spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.overlay-loading {
  position: fixed; inset: 0;
  background: rgba(26,26,46,0.7);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  flex-direction: column;
  gap: 1rem;
}
.overlay-loading .spinner {
  width: 50px; height: 50px;
  border: 4px solid rgba(255,255,255,0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.overlay-loading p { color: white; font-weight: 500; }

/* ---- Toggle Mobile Menu ---- */
.toggle-sidebar {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.4rem;
  padding: 0.5rem;
  cursor: pointer;
}
@media (max-width: 768px) { .toggle-sidebar { display: block; } }
