/* ============================================================
   LibraryMS — Premium Modern UI 2.0 (Glassmorphism & App-Style)
   ============================================================ */

/* ── Imports ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Brand Colors (Vivid Palette) */
  --primary:        #4f46e5;
  --primary-lt:     #818cf8;
  --primary-glow:   rgba(79, 70, 229, 0.4);
  
  --secondary:      #10b981;
  --secondary-lt:   #34d399;
  
  --accent:         #f59e0b;
  --danger:         #f43f5e;
  --info:           #0ea5e9;
  
  /* Modern Neutral Palette */
  --bg-deep:        #0f172a;
  --bg-surface:     #1e293b;
  --bg-glass:       rgba(30, 41, 59, 0.6);
  --bg-glass-heavy: rgba(15, 23, 42, 0.8);
  
  --border-glass:   rgba(255, 255, 255, 0.08);
  --border-active:  rgba(99, 102, 241, 0.5);
  
  --text-main:      #f8fafc;
  --text-dim:       #94a3b8;
  --text-muted:     #64748b;

  /* Elevations & Effects */
  --shadow-sm:      0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md:      0 8px 20px -4px rgba(0, 0, 0, 0.3);
  --shadow-lg:      0 20px 40px -12px rgba(0, 0, 0, 0.5);
  --shadow-glow:    0 0 25px var(--primary-glow);
  
  --glass-filter:   blur(16px) saturate(180%);
  --radius-sm:      10px;
  --radius-md:      16px;
  --radius-lg:      24px;
  --transition:     all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  --sidebar-width:  280px;
  --topbar-height:  72px;
}

/* ── Global Styles ───────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-deep);
  background-image: 
    radial-gradient(at 0% 0%, rgba(79, 70, 229, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.1) 0px, transparent 50%);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}
h1, h2, h3, h4, h5, h6 { font-family: 'Outfit', sans-serif; font-weight: 700; margin-bottom: 0.5rem; letter-spacing: -0.01em; }
a { text-decoration: none; color: inherit; transition: var(--transition); }
button { cursor: pointer; border: none; background: none; transition: var(--transition); font-family: 'Outfit', sans-serif; }

/* ── Typography Utils ────────────────────────────────── */
.text-gradient {
  background: linear-gradient(135deg, #fff 0%, var(--primary-lt) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.text-dim { color: var(--text-dim) !important; }

/* ── Layout Elements ─────────────────────────────────── */
#wrapper { display: flex; min-height: 100vh; }
#page-content { flex: 1; margin-left: var(--sidebar-width); display: flex; flex-direction: column; min-width: 0; transition: var(--transition); }
.main-content { padding: 2.5rem; flex: 1; }

.top-bar {
  height: var(--topbar-height);
  background: var(--bg-glass-heavy);
  backdrop-filter: var(--glass-filter);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  position: sticky;
  top: 0; z-index: 50;
}

/* Sidebar (Glass Design) */
.sidebar-nav {
  width: var(--sidebar-width);
  background: var(--bg-glass-heavy);
  backdrop-filter: var(--glass-filter);
  border-right: 1px solid var(--border-glass);
  position: fixed;
  height: 100vh;
  z-index: 100;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}
.sidebar-brand {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 0%, var(--primary-lt) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  border-bottom: 1px solid var(--border-glass);
  flex-shrink: 0;
}
.sidebar-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.sidebar-menu { list-style: none; padding: 1.5rem 1rem; flex: 1; }
.sidebar-menu li { margin-bottom: 0.5rem; }
.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  color: var(--text-dim);
  font-weight: 500;
  border-radius: var(--radius-md);
}
.sidebar-menu a:hover, .sidebar-menu a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 10px rgba(255,255,255,0.02);
}
.sidebar-menu a.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.2) 0%, rgba(79, 70, 229, 0.4) 100%);
  border: 1px solid rgba(79, 70, 229, 0.3);
}
.sidebar-menu i { font-size: 1.25rem; width: 24px; text-align: center; color: var(--primary-lt); }

/* Sidebar Footer & Logout */
.sidebar-footer {
  margin-top: auto;
  padding: 1.5rem;
  border-top: 1px solid var(--border-glass);
}
.sidebar-logout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.85rem;
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.2);
  color: var(--danger);
  border-radius: var(--radius-md);
  font-weight: 700;
  transition: var(--transition);
}
.sidebar-logout-btn:hover {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 4px 15px rgba(244, 63, 94, 0.3);
  transform: translateY(-2px);
}

/* ── Modern Cards & Panels ───────────────────────────── */
.card-panel {
  background: var(--bg-glass);
  backdrop-filter: var(--glass-filter);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}
.card-panel:hover { border-color: var(--border-active); box-shadow: var(--shadow-lg); }

.card-panel-header { font-family: 'Outfit', sans-serif; font-size: 1.25rem; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 0.75rem; }

/* ── Premium Stat Cards ──────────────────────────────── */
.stat-card {
  background: var(--bg-glass);
  backdrop-filter: var(--glass-filter);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
.stat-card::after {
  content: '';
  position: absolute;
  width: 150px; height: 150px;
  background: radial-gradient(circle, var(--stat-color, var(--primary)) 0%, transparent 70%);
  opacity: 0.15;
  top: -75px; right: -75px;
  transition: var(--transition);
}
.stat-card:hover::after { opacity: 0.3; transform: scale(1.2); }

.stat-icon {
  width: 64px; height: 64px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  box-shadow: inset 0 0 15px rgba(255,255,255,0.05);
  transition: var(--transition);
}
.stat-card:hover .stat-icon { transform: scale(1.1) rotate(-5deg); border-color: var(--stat-color); }

.stat-card-blue   { --stat-color: var(--primary-lt); }
.stat-card-green  { --stat-color: var(--secondary-lt); }
.stat-card-red    { --stat-color: var(--danger); }
.stat-card-orange { --stat-color: var(--accent); }

.stat-value { font-family: 'Outfit', sans-serif; font-size: 2rem; font-weight: 800; color: #fff; line-height: 1; }
.stat-label { font-size: 0.9rem; color: var(--text-dim); margin-top: 0.35rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

/* ── Home Page Revamp ─────────────────────────────────── */
.hero-section {
  position: relative;
  min-height: 100vh;
  padding: 120px 0 100px;
  display: flex;
  align-items: center;
  text-align: center;
  background: linear-gradient(rgba(15, 23, 42, 0.75), rgba(15, 23, 42, 0.75)), url('../images/hero-bg.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}
.hero-title {
  font-size: clamp(2.5rem, 8vw, 5rem);
  line-height: 1.05;
  font-weight: 800;
  margin-bottom: 2rem;
  letter-spacing: -0.03em;
}
.hero-highlight {
  display: block;
  background: linear-gradient(135deg, #fff 0%, var(--primary-lt) 50%, var(--secondary-lt) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-dim);
  max-width: 700px;
  margin: 0 auto 3rem;
  line-height: 1.8;
}

/* Modern Hero Search */
.hero-search-container {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  z-index: 10;
}
.hero-search-glass {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  padding: 8px;
  display: flex;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.hero-search-glass input {
  flex: 1;
  background: none;
  border: none;
  color: #fff;
  padding: 0 1.5rem;
  font-size: 1.1rem;
}
.hero-search-glass input:focus { outline: none; }
.hero-search-glass button {
  padding: 0.75rem 2rem;
  border-radius: 100px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 15px var(--primary-glow);
}

/* Category Cards 2.0 */
.category-card {
  background: var(--bg-glass);
  backdrop-filter: var(--glass-filter);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem;
  text-align: center;
  transition: var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}
.category-card:hover {
  transform: translateY(-10px) scale(1.02);
  border-color: var(--primary-lt);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}
.category-card i {
  font-size: 3rem;
  background: linear-gradient(135deg, var(--primary-lt) 0%, var(--secondary-lt) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: var(--transition);
}
.category-card span { font-family: 'Outfit'; font-size: 1.15rem; font-weight: 700; }

/* ── Buttons & Inputs ────────────────────────────────── */
.btn {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  transition: var(--transition);
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #312e81 100%);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: var(--shadow-glow); }

.btn-glass {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(5px);
  border: 1px solid var(--border-glass);
  color: #fff;
}
.btn-glass:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--primary-lt); }

.custom-input {
  background: rgba(15, 23, 42, 0.4) !important;
  border: 1px solid var(--border-glass) !important;
  border-radius: var(--radius-md) !important;
  color: #fff !important;
  padding: 1rem 1.25rem !important;
  transition: var(--transition);
}
.custom-input:focus {
  background: rgba(15, 23, 42, 0.6) !important;
  border-color: var(--primary-lt) !important;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15) !important;
}

/* ── Tables Modernization ────────────────────────────── */
.table-responsive {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  background: rgba(15, 23, 42, 0.3);
  overflow: hidden;
}
.table { color: var(--text-main); margin-bottom: 0; }
.table thead th {
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid var(--border-glass);
  color: var(--text-dim);
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 1.25rem 1rem;
}
.table tbody td {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  vertical-align: middle;
}
.table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }

/* ── AUTH PAGES (Full-Page Image bg) ── */
.auth-body { 
  background: linear-gradient(rgba(15, 23, 42, 0.7), rgba(15, 23, 42, 0.7)), url('../images/auth-bg.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-container { 
  width: 100%; 
  padding: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.auth-card { 
  width: 100%; 
  max-width: 480px;
  background: rgba(30, 41, 59, 0.45);
  backdrop-filter: blur(25px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 3rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.1) 0%, transparent 60%);
  z-index: -1;
}

.auth-logo-float {
  display: block;
  text-align: center;
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--primary-lt) 0%, var(--secondary-lt) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 15px var(--primary-glow));
}

.auth-title { font-size: 2.25rem; font-weight: 800; text-align: center; margin-bottom: 0.5rem; color: #fff; letter-spacing: -0.02em; }
.auth-subtitle { color: var(--text-dim); text-align: center; margin-bottom: 2.5rem; font-size: 1rem; }

/* Form Controls Customization */
.auth-input-group { position: relative; margin-bottom: 1.25rem; }
.auth-input-group i { 
  position: absolute; left: 1.25rem; top: 1.1rem; 
  color: var(--text-dim); font-size: 1.15rem; z-index: 5;
}

.auth-input {
  background: rgba(15, 23, 42, 0.4) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
  border-radius: var(--radius-md) !important;
  padding: 1.1rem 1.1rem 1.1rem 3.25rem !important;
  font-size: 0.95rem !important;
  transition: all 0.3s ease !important;
  width: 100%;
}
.auth-input:focus {
  background: rgba(15, 23, 42, 0.6) !important;
  border-color: var(--primary-lt) !important;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2) !important;
}

.auth-btn {
  background: linear-gradient(135deg, var(--primary) 0%, #312e81 100%) !important;
  border: none !important;
  padding: 1rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.05em;
  border-radius: var(--radius-md) !important;
  margin-top: 1rem !important;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3) !important;
}
.auth-btn:hover { transform: translateY(-3px) !important; box-shadow: var(--shadow-glow) !important; }

@media (max-width: 576px) {
  .auth-card { padding: 2rem 1.5rem; border-radius: var(--radius-md); }
  .auth-title { font-size: 1.75rem; }
}

/* ── Responsive & Mobile ────────────────────────────── */
@media (max-width: 992px) {
  :root { --sidebar-width: 0px; }
  #page-content { margin-left: 0; }
  
  .sidebar-nav {
    transform: translateX(-100%);
    width: 280px;
    box-shadow: 20px 0 50px rgba(0,0,0,0.5);
  }
  .sidebar-nav.show { transform: translateX(0); }
  
  .main-content { padding: 1.5rem 1rem; }
  .top-bar { padding: 0 1rem; }
  
  .hero-title { font-size: 3rem; }
  .stat-card { padding: 1.25rem; flex-direction: column; text-align: center; }
  .stat-icon { margin: 0 auto; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 2.25rem; }
  .hero-search-glass { flex-direction: column; border-radius: var(--radius-md); padding: 1.5rem; gap: 1rem; }
  .hero-search-glass input { padding: 0; text-align: center; }
  .hero-search-glass button { width: 100%; }
  
  .stat-card { flex-direction: row; text-align: left; }
  .stat-icon { margin: 0; }
  
  .btn { width: 100%; }
  .btn-sm { width: auto; }
}

/* Sidebar Toggle Overlay */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 90;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.sidebar-overlay.show { display: block; opacity: 1; }