/* ==========================================================================
   Bella Cloud File Browser - Premium Glassmorphism & Multi-Theme System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root, [data-theme="dark"] {
  /* Dark Theme Palette */
  --bg-main: #0a0d14;
  --bg-surface: #111726;
  --bg-surface-elevated: #182238;
  --bg-surface-hover: #1f2c47;
  --bg-glass: rgba(17, 23, 38, 0.78);
  --bg-glass-card: rgba(24, 34, 56, 0.65);
  --bg-glass-input: rgba(10, 13, 20, 0.65);

  /* Borders & Glows */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);
  --border-active: rgba(6, 182, 212, 0.6);

  /* Brand Accent Gradients */
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --accent-cyan: #06b6d4;
  --accent-cyan-light: #22d3ee;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-purple: #a855f7;

  --grad-primary: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
  --grad-glow: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(6, 182, 212, 0.15));
  --grad-card-hover: linear-gradient(180deg, rgba(30, 42, 68, 0.7) 0%, rgba(20, 28, 45, 0.85) 100%);

  /* Text Colors */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-on-primary: #ffffff;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.3);
  --shadow-glow-cyan: 0 0 25px rgba(6, 182, 212, 0.3);

  /* Special Components */
  --orb-1: radial-gradient(circle, rgba(99, 102, 241, 0.14) 0%, rgba(99, 102, 241, 0) 70%);
  --orb-2: radial-gradient(circle, rgba(6, 182, 212, 0.12) 0%, rgba(6, 182, 212, 0) 70%);
  --modal-backdrop: rgba(5, 7, 12, 0.85);
  --code-bg: #090c13;
  --code-header-bg: #111726;
  --code-text: #e2e8f0;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  /* Light Theme Palette */
  --bg-main: #f4f6fb;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #edf2f9;
  --bg-surface-hover: #e2e8f0;
  --bg-glass: rgba(255, 255, 255, 0.85);
  --bg-glass-card: rgba(255, 255, 255, 0.88);
  --bg-glass-input: rgba(243, 246, 251, 0.9);

  /* Borders & Glows */
  --border-subtle: rgba(15, 23, 42, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);
  --border-active: rgba(6, 182, 212, 0.6);

  /* Brand Accent Gradients */
  --primary: #4f46e5;
  --primary-light: #6366f1;
  --primary-dark: #4338ca;
  --accent-cyan: #0891b2;
  --accent-cyan-light: #06b6d4;
  --accent-emerald: #059669;
  --accent-amber: #d97706;
  --accent-rose: #e11d48;
  --accent-purple: #9333ea;

  --grad-primary: linear-gradient(135deg, #4f46e5 0%, #0891b2 100%);
  --grad-glow: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(8, 145, 178, 0.12));
  --grad-card-hover: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(241, 245, 249, 0.95) 100%);

  /* Text Colors */
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --text-on-primary: #ffffff;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 25px rgba(79, 70, 229, 0.2);
  --shadow-glow-cyan: 0 0 25px rgba(8, 145, 178, 0.2);

  /* Special Components */
  --orb-1: radial-gradient(circle, rgba(79, 70, 229, 0.08) 0%, rgba(79, 70, 229, 0) 70%);
  --orb-2: radial-gradient(circle, rgba(8, 145, 178, 0.08) 0%, rgba(8, 145, 178, 0) 70%);
  --modal-backdrop: rgba(15, 23, 42, 0.6);
  --code-bg: #1e293b;
  --code-header-bg: #0f172a;
  --code-text: #f8fafc;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100vh;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Background Ambient Orbs */
.bg-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.ambient-orb-1 {
  position: absolute;
  top: -15%;
  left: 20%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: var(--orb-1);
  filter: blur(80px);
  animation: floatOrb 20s infinite alternate ease-in-out;
}
.ambient-orb-2 {
  position: absolute;
  bottom: -10%;
  right: 15%;
  width: 700px;
  height: 700px;
  border-radius: 50%;
  background: var(--orb-2);
  filter: blur(100px);
  animation: floatOrb 25s infinite alternate-reverse ease-in-out;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(50px, -30px) scale(1.08); }
  100% { transform: translate(-40px, 40px) scale(0.95); }
}

/* App Wrapper */
.app-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ==========================================================================
   Header & Navbar
   ========================================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.85rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: var(--shadow-glow);
  font-size: 1.3rem;
  transition: transform var(--transition-normal);
}
.brand-section:hover .brand-logo {
  transform: scale(1.05) rotate(-3deg);
}

.brand-info h1 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.badge-readonly {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.brand-info p {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Nav Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.server-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
}

/* Theme Toggle Button */
.theme-toggle-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
}
[data-theme="dark"] .theme-icon-moon {
  display: block;
  color: #818cf8;
}
[data-theme="dark"] .theme-icon-sun {
  display: none;
}
[data-theme="light"] .theme-icon-sun {
  display: block;
  color: #f59e0b;
}
[data-theme="light"] .theme-icon-moon {
  display: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  font-family: inherit;
  white-space: nowrap;
}
.btn-primary {
  background: var(--grad-primary);
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}
.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
  background: var(--bg-surface-elevated);
  border-color: rgba(99, 102, 241, 0.3);
}
.btn-danger-outline {
  background: transparent;
  color: var(--accent-rose);
  border-color: rgba(244, 63, 94, 0.3);
}
.btn-danger-outline:hover {
  background: rgba(244, 63, 94, 0.1);
  border-color: var(--accent-rose);
}
.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}
.btn-icon:hover {
  color: var(--text-main);
  background: var(--bg-surface-elevated);
  border-color: rgba(99, 102, 241, 0.3);
}
.btn-icon.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.main-wrapper {
  flex: 1;
  max-width: 1560px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.75rem 3rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Breadcrumb & Navigation Bar */
.explorer-top-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg-glass-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.breadcrumb-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
}
.breadcrumb-crumb {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.breadcrumb-crumb:hover {
  color: var(--text-main);
  background: var(--bg-surface-hover);
}
.breadcrumb-crumb.active {
  color: var(--primary);
  font-weight: 600;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
}
.breadcrumb-separator {
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* Search and View Controls */
.controls-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 0.85rem;
  color: var(--text-dim);
  pointer-events: none;
  font-size: 0.9rem;
}
.search-input {
  background: var(--bg-glass-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.5rem 2.2rem 0.5rem 2.4rem;
  color: var(--text-main);
  font-size: 0.85rem;
  width: 240px;
  font-family: inherit;
  transition: all var(--transition-fast);
}
.search-input:focus {
  outline: none;
  border-color: var(--border-active);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.25);
  width: 290px;
}
.search-clear {
  position: absolute;
  right: 0.6rem;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  display: none;
}
.search-input:not(:placeholder-shown) + .search-clear {
  display: block;
}

/* Filter Toolbar */
.toolbar-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.filter-pills {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 2px;
}
.filter-pills::-webkit-scrollbar {
  height: 4px;
}
.filter-pills::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 4px;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.filter-pill:hover {
  color: var(--text-main);
  background: var(--bg-surface-elevated);
}
.filter-pill.active {
  background: var(--grad-primary);
  color: white;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.35);
}
.pill-count {
  font-size: 0.7rem;
  opacity: 0.85;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
}

.stats-summary {
  font-size: 0.8rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.stats-highlight {
  color: var(--text-muted);
  font-weight: 600;
}

/* ==========================================================================
   File Explorer Grid View
   ========================================================================== */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem;
}

.file-card {
  position: relative;
  background: var(--bg-glass-card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all var(--transition-normal);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.file-card:hover {
  transform: translateY(-3px);
  border-color: rgba(99, 102, 241, 0.4);
  background: var(--grad-card-hover);
  box-shadow: var(--shadow-md);
}

.card-thumb-wrapper {
  height: 120px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.card-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-smooth);
}
.file-card:hover .card-thumb-img {
  transform: scale(1.06);
}

.card-icon {
  font-size: 2.75rem;
  color: var(--text-muted);
  transition: transform var(--transition-normal);
}
.file-card:hover .card-icon {
  transform: scale(1.1);
}

/* Custom Icon Colors */
.icon-folder { color: #f59e0b; }
.icon-image { color: #06b6d4; }
.icon-video { color: #ec4899; }
.icon-audio { color: #a855f7; }
.icon-document { color: #ef4444; }
.icon-code { color: #10b981; }
.icon-archive { color: #eab308; }

.card-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.card-filename {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  margin-top: 0.25rem;
  opacity: 0.85;
  transition: opacity var(--transition-fast);
}
.file-card:hover .card-actions {
  opacity: 1;
}

/* ==========================================================================
   File Explorer List / Table View
   ========================================================================== */
.file-table-wrapper {
  background: var(--bg-glass-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.file-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.file-table th {
  background: var(--bg-surface);
  padding: 0.85rem 1.25rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  user-select: none;
}
.file-table th:hover {
  color: var(--text-main);
}
.file-table td {
  padding: 0.85rem 1.25rem;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
.file-table tr.table-row-item {
  cursor: pointer;
  transition: background var(--transition-fast);
}
.file-table tr.table-row-item:hover {
  background: var(--bg-surface-hover);
}

.table-file-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
  color: var(--text-main);
}
.table-file-cell i {
  font-size: 1.25rem;
}
.table-muted {
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4.5rem 1rem;
  text-align: center;
  gap: 1rem;
}
.empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--text-dim);
}
.empty-state h3 {
  font-size: 1.15rem;
  font-weight: 600;
}
.empty-state p {
  color: var(--text-dim);
  font-size: 0.88rem;
  max-width: 360px;
}

/* ==========================================================================
   Preview Modal System
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--modal-backdrop);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 1000px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95) translateY(10px);
  transition: all var(--transition-normal);
}
.modal-overlay.active .modal-dialog {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 1rem 1.5rem;
  background: var(--bg-surface-elevated);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.modal-title-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow: hidden;
}
.modal-filename {
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.modal-filemeta {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.modal-body {
  flex: 1;
  overflow: auto;
  position: relative;
  background: var(--bg-surface-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 380px;
}

/* Image Preview */
.preview-image-container {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  overflow: auto;
}
.preview-image-container img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-normal);
}

/* Code & Text Preview */
.code-viewer-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--code-bg);
  font-family: 'JetBrains Mono', Consolas, Monaco, monospace;
}
.code-viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: var(--code-header-bg);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  color: var(--text-dim);
}
.code-viewer-content {
  flex: 1;
  padding: 1.25rem;
  overflow: auto;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--code-text);
  white-space: pre;
  tab-size: 4;
}

/* Media Players */
.media-player-container {
  width: 100%;
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.media-player-container video {
  max-width: 100%;
  max-height: 65vh;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  outline: none;
}
.media-player-container audio {
  width: 100%;
  max-width: 500px;
}

/* PDF Embed */
.pdf-viewer-frame {
  width: 100%;
  height: 75vh;
  border: none;
}

/* ==========================================================================
   Login / Lock Screen
   ========================================================================== */
.login-screen-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-glass-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  text-align: center;
  animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all var(--transition-normal);
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--grad-primary);
}

.login-icon-box {
  width: 68px;
  height: 68px;
  margin: 0 auto 1.5rem auto;
  border-radius: 50%;
  background: var(--grad-glow);
  border: 1px solid var(--border-focus);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--primary);
  box-shadow: var(--shadow-glow);
}

.login-title {
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  letter-spacing: -0.02em;
}
.login-subtitle {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 2rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  text-align: left;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.input-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrapper i.input-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-dim);
}
.input-field {
  width: 100%;
  background: var(--bg-glass-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem 0.75rem 2.6rem;
  color: var(--text-main);
  font-size: 0.95rem;
  font-family: inherit;
  transition: all var(--transition-fast);
}
.input-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

.toggle-password {
  position: absolute;
  right: 0.85rem;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
}

.error-alert {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fda4af;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.shake {
  animation: shakeAnim 0.4s ease-in-out;
}
@keyframes shakeAnim {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

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

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.toast {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  color: var(--text-main);
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
  .navbar {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
  }
  .main-wrapper {
    padding: 1rem;
  }
  .search-input {
    width: 100%;
  }
  .search-input:focus {
    width: 100%;
  }
  .file-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
  }
  .card-thumb-wrapper {
    height: 90px;
  }
}
