/* ==========================================================================
   Portal Arsip Dokumentasi Sekolah - Modern Styling System
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-base: #0a0f1d;
  --bg-surface: #111827;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-glass: rgba(15, 23, 42, 0.65);
  
  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.35);
  --border-focus: rgba(129, 140, 248, 0.6);

  /* Primary Brand Gradients */
  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  
  --grad-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
  --grad-cyan: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  --grad-glow: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 70%);

  /* Typography */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Text Colors */
  --text-main: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 35px -5px rgba(99, 102, 241, 0.3);

  /* Transitions */
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 0.2s var(--ease-smooth);
  --transition-normal: 0.3s var(--ease-smooth);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-base);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(99, 102, 241, 0.08) 0%, transparent 35%),
    radial-gradient(circle at 85% 25%, rgba(6, 182, 212, 0.06) 0%, transparent 35%),
    radial-gradient(circle at 50% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
  background-attachment: fixed;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
  background: #27354f;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--grad-primary);
  color: #fff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
  transition: transform var(--transition-normal);
}

.nav-brand:hover .brand-icon {
  transform: rotate(5deg) scale(1.05);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.brand-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Search Bar in Navbar */
.nav-search-wrap {
  flex: 1;
  max-width: 520px;
  position: relative;
  display: flex;
  align-items: center;
}

.nav-search-wrap input {
  width: 100%;
  padding: 0.65rem 2.8rem 0.65rem 2.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  color: #fff;
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: all var(--transition-fast);
}

.nav-search-wrap input:focus {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.search-icon {
  position: absolute;
  left: 0.9rem;
  color: var(--text-muted);
  pointer-events: none;
}

.search-clear-btn {
  position: absolute;
  right: 2.2rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem;
}

.search-clear-btn:hover {
  color: #fff;
}

.search-shortcut {
  position: absolute;
  right: 0.9rem;
  padding: 0.15rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
}

.btn-primary {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.78rem;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  position: relative;
  padding: 3.5rem 2rem 2.5rem;
  text-align: center;
  overflow: hidden;
}

.hero-background-glow {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 350px;
  background: radial-gradient(ellipse at top, rgba(99, 102, 241, 0.2) 0%, rgba(6, 182, 212, 0.08) 50%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 1rem;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #a5b4fc;
  margin-bottom: 1.25rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: #fff;
  margin-bottom: 1rem;
}

.gradient-text {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 2.5rem;
  font-weight: 400;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.metric-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  transition: all var(--transition-normal);
  text-align: left;
}

.metric-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-md);
}

.metric-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  flex-shrink: 0;
}

.icon-violet { background: rgba(139, 92, 246, 0.15); color: #c084fc; }
.icon-cyan { background: rgba(6, 182, 212, 0.15); color: #38bdf8; }
.icon-emerald { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.icon-amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

.metric-info {
  display: flex;
  flex-direction: column;
}

.metric-value {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.metric-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ==========================================================================
   Breadcrumb Bar
   ========================================================================== */
.breadcrumb-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 2rem;
  background: rgba(30, 41, 59, 0.4);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1.5rem;
}

.breadcrumb-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  color: var(--accent-cyan);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  transition: all var(--transition-fast);
}

.breadcrumb-back-btn:hover {
  background: rgba(6, 182, 212, 0.12);
  color: #fff;
}

.breadcrumb-divider {
  color: var(--text-dim);
}

.breadcrumb-current {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
}

.breadcrumb-actions {
  margin-left: auto;
}

/* ==========================================================================
   Toolbar Section
   ========================================================================== */
.toolbar-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0 2rem 1.5rem;
}

.filter-tabs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(15, 23, 42, 0.7);
  padding: 0.3rem;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
}

.tab-btn {
  padding: 0.5rem 1rem;
  background: none;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  color: #fff;
}

.tab-btn.active {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.select-wrapper select {
  padding: 0.55rem 1.8rem 0.55rem 1rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 0.825rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.select-wrapper select:focus {
  border-color: var(--accent-primary);
  color: #fff;
}

.view-toggle {
  display: flex;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.2rem;
}

.view-btn {
  padding: 0.4rem 0.6rem;
  background: none;
  border: none;
  color: var(--text-dim);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.view-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* ==========================================================================
   Section Header & Views
   ========================================================================== */
.section-header {
  padding: 0 2rem 1.25rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.section-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Folder View Grid */
.folder-view-container {
  padding-bottom: 3rem;
}

.folders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.25rem;
  padding: 0 2rem;
}

/* Folder Card */
.folder-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.4rem;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 180px;
  transition: all var(--transition-normal);
  backdrop-filter: blur(14px);
}

.folder-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--grad-primary);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.folder-card:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 12px 28px -6px rgba(0, 0, 0, 0.5), 0 0 20px -3px rgba(99, 102, 241, 0.15);
}

.folder-card:hover::before {
  opacity: 1;
}

.folder-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.9rem;
}

.folder-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.12);
  color: #818cf8;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-normal);
}

.folder-card:hover .folder-icon-wrap {
  transform: scale(1.08);
  background: rgba(99, 102, 241, 0.22);
}

.folder-seq-badge {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-dim);
  padding: 0.2rem 0.55rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
}

.folder-top-badges {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.folder-date-badge {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  color: #38bdf8;
  padding: 0.2rem 0.55rem;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: 6px;
}

.file-date {
  color: #38bdf8 !important;
  font-weight: 600 !important;
}

.file-folder-badge {
  font-size: 0.72rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.folder-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
  margin-bottom: 0.8rem;
}

.folder-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: auto;
}

.f-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
}

.f-badge-files {
  background: rgba(6, 182, 212, 0.1);
  color: #38bdf8;
}

.f-badge-size {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
}

.f-badge-videos {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.28);
}

.folder-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.1rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.f-explore-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: gap var(--transition-fast);
}

.folder-card:hover .f-explore-text {
  gap: 0.5rem;
}

.f-drive-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

.f-drive-btn:hover {
  color: #fff;
}

/* ==========================================================================
   Folder Header Card (in Files View)
   ========================================================================== */
.folder-header-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 0 2rem 1.75rem;
  padding: 1.5rem 1.8rem;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
}

.folder-header-meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.folder-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-cyan);
  letter-spacing: 0.05em;
}

.fhc-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
}

.fhc-badges {
  display: flex;
  gap: 0.5rem;
}

.fhc-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: var(--text-secondary);
}

.fhc-search-wrap input {
  padding: 0.6rem 1.2rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: #fff;
  font-size: 0.85rem;
  outline: none;
  min-width: 280px;
}

.fhc-search-wrap input:focus {
  border-color: var(--accent-primary);
}

/* ==========================================================================
   Files Grid & Media Card
   ========================================================================== */
.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.25rem;
  padding: 0 2rem;
}

.file-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
  cursor: pointer;
}

.file-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: var(--shadow-md);
}

.file-thumb-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #0f172a;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease-smooth);
}

.file-card:hover .file-thumb {
  transform: scale(1.06);
}

/* Fallback / Video / Doc icon when image isn't loaded */
.file-placeholder-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--text-dim);
}

.file-placeholder-icon svg {
  width: 42px;
  height: 42px;
}

.file-placeholder-icon span {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Badges on thumbnail */
.file-badge-type {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  padding: 0.2rem 0.5rem;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 6px;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
  z-index: 2;
}

.badge-jpg, .badge-png { background: rgba(16, 185, 129, 0.85); color: #fff; }
.badge-video { background: rgba(245, 158, 11, 0.85); color: #fff; }
.badge-archive { background: rgba(139, 92, 246, 0.85); color: #fff; }
.badge-doc { background: rgba(59, 130, 246, 0.85); color: #fff; }

.file-overlay-actions {
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 29, 0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  transition: opacity var(--transition-fast);
  z-index: 3;
}

.file-card:hover .file-overlay-actions {
  opacity: 1;
}

.overlay-action-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.overlay-action-btn:hover {
  background: var(--accent-primary);
  transform: scale(1.1);
  border-color: var(--accent-primary);
}

.file-info {
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.file-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Load More Container */
.load-more-container {
  display: flex;
  justify-content: center;
  padding: 2.5rem 0 1rem;
}

/* ==========================================================================
   Lightbox / Media Viewer Modal
   ========================================================================== */
.lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity var(--transition-normal);
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 15, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.lightbox-content {
  position: relative;
  z-index: 101;
  display: flex;
  flex-direction: column;
  width: 95vw;
  height: 92vh;
  max-width: 1400px;
}

.lightbox-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  margin-bottom: 0.75rem;
}

.lb-file-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow: hidden;
}

.lb-filename {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 400px;
}

.lb-folder-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}

.lb-filesize {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.lb-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lb-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.lb-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.lb-btn-primary {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.lb-btn-primary:hover {
  filter: brightness(1.15);
}

.lb-close-btn {
  padding: 0.4rem 0.75rem;
  font-size: 1.3rem;
  line-height: 1;
}

.lightbox-stage {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.lb-media-wrapper {
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.lb-media-wrapper img {
  max-width: 100%;
  max-height: calc(92vh - 140px);
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  user-select: none;
}

.lb-media-wrapper iframe {
  width: 80vw;
  height: 70vh;
  border: none;
  border-radius: 8px;
}

.lb-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 10;
}

.lb-nav-btn:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  transform: translateY(-50%) scale(1.1);
}

.lb-prev-btn { left: 1.25rem; }
.lb-next-btn { right: 1.25rem; }

.lightbox-bottombar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem;
}

.lb-counter {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.25rem;
  background: #1e293b;
  border: 1px solid var(--accent-emerald);
  border-radius: 12px;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.3s var(--ease-smooth);
}

.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--accent-emerald);
  border-radius: 50%;
  color: #042f2e;
  font-size: 0.8rem;
  font-weight: 800;
}

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

/* ==========================================================================
   Footer
   ========================================================================== */
.app-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  background: rgba(10, 15, 29, 0.85);
  padding: 2rem;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  max-width: 1300px;
  margin: 0 auto;
}

.footer-logo {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.footer-tagline {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.footer-right {
  display: flex;
  gap: 0.75rem;
}

.footer-badge {
  font-size: 0.75rem;
  padding: 0.3rem 0.7rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  color: var(--text-secondary);
}

/* Helper Utilities */
.hidden {
  display: none !important;
}

/* Skeleton Loading Shimmer */
.skeleton {
  background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Utility Visibility */
.mobile-only {
  display: none !important;
}
.desktop-only {
  display: inline !important;
}

.nav-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.nav-icon-btn:hover, .nav-icon-btn:active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* Touch active micro-animations */
.folder-card:active, .file-card:active, .btn:active, .tab-btn:active, .playlist-item:active {
  transform: scale(0.97) !important;
}

/* ==========================================================================
   Responsive Breakpoints & Mobile Optimization
   ========================================================================== */
@media (max-width: 900px) {
  /* Video Player Modal: Stacked Layout on Tablet / Mobile */
  .video-modal-content {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    border-radius: 0;
  }

  .video-topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
    border-radius: 0;
    margin-bottom: 0;
    border-left: none;
    border-right: none;
    border-top: none;
  }

  .v-meta {
    justify-content: space-between;
  }

  .v-title {
    max-width: calc(100vw - 120px);
    font-size: 0.95rem;
  }

  .player-engine-switcher {
    width: 100%;
    justify-content: center;
    order: 2;
  }

  .v-actions {
    width: 100%;
    justify-content: space-between;
    order: 3;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .v-actions .btn {
    padding: 0.4rem 0.7rem;
    font-size: 0.75rem;
  }

  .video-main-layout {
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .video-cinema-stage {
    flex: none;
    width: 100%;
  }

  .video-screen-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    min-height: 220px;
    max-height: 48vh;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .video-stage-subbar {
    padding: 0.6rem 1rem;
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
  }

  .video-nav-controls {
    justify-content: space-between;
  }

  .video-tips {
    text-align: center;
    font-size: 0.72rem;
  }

  .video-playlist-drawer {
    width: 100%;
    max-height: 340px;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
  }

  .playlist-header {
    padding: 0.75rem 1rem;
  }
}

@media (max-width: 768px) {
  .mobile-only {
    display: flex !important;
  }
  .desktop-only {
    display: none !important;
  }

  /* Navbar */
  .navbar {
    padding: 0.65rem 1rem;
    gap: 0.75rem;
  }

  .brand-icon {
    width: 36px;
    height: 36px;
  }

  .brand-title {
    font-size: 1.05rem;
  }

  /* Expandable Search on Mobile */
  .nav-search-wrap {
    display: none;
  }

  .nav-search-wrap.mobile-expanded {
    display: flex;
    position: absolute;
    top: 0.5rem;
    left: 0.75rem;
    right: 0.75rem;
    z-index: 100;
    max-width: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  }

  .nav-search-wrap.mobile-expanded input {
    background: #0d1527;
    border-color: var(--accent-primary);
  }

  /* Hero Section */
  .hero-section {
    padding: 2rem 1rem 1.25rem;
  }

  .hero-title {
    font-size: 1.85rem;
    line-height: 1.2;
  }

  .hero-desc {
    font-size: 0.88rem;
    margin-bottom: 1.5rem;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }

  .metric-card {
    padding: 0.8rem 0.85rem;
    gap: 0.65rem;
    border-radius: 12px;
  }

  .metric-icon {
    width: 38px;
    height: 38px;
  }

  .metric-value {
    font-size: 1.15rem;
  }

  .metric-label {
    font-size: 0.72rem;
  }

  /* Toolbar & Filter Tabs */
  .toolbar-section {
    padding: 0 1rem 1rem;
    gap: 0.75rem;
  }

  .toolbar-left {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .toolbar-left::-webkit-scrollbar {
    display: none;
  }

  .filter-tabs {
    white-space: nowrap;
    width: max-content;
    padding: 0.25rem;
  }

  .tab-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.78rem;
  }

  .toolbar-right {
    width: 100%;
    justify-content: space-between;
  }

  .select-wrapper {
    flex: 1;
  }

  .select-wrapper select {
    width: 100%;
  }

  /* Folder View Grid on Mobile */
  .folders-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
    padding: 0 1rem;
  }

  .folder-card {
    padding: 1.1rem;
    min-height: auto;
  }

  .folder-title {
    font-size: 1rem;
  }

  /* Files Gallery Grid on Mobile - Beautiful 2-Columns */
  .files-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 0 1rem;
  }

  .file-info {
    padding: 0.65rem 0.75rem;
  }

  .file-name {
    font-size: 0.78rem;
  }

  .file-details {
    font-size: 0.7rem;
  }

  /* Folder Header Card */
  .folder-header-card {
    margin: 0 1rem 1.25rem;
    padding: 1rem 1.1rem;
    border-radius: 14px;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
  }

  .fhc-title {
    font-size: 1.25rem;
  }

  .fhc-search-wrap {
    width: 100%;
  }

  .fhc-search-wrap input {
    width: 100%;
    min-width: 0;
  }

  /* Lightbox on Mobile */
  .lightbox-content {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }

  .lightbox-topbar {
    border-radius: 0;
    margin-bottom: 0;
    padding: 0.6rem 0.85rem;
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
  }

  .lb-file-info {
    justify-content: space-between;
  }

  .lb-filename {
    max-width: 220px;
    font-size: 0.85rem;
  }

  .lb-actions {
    justify-content: space-between;
  }

  .lb-nav-btn {
    width: 38px;
    height: 38px;
  }

  .lb-prev-btn { left: 0.5rem; }
  .lb-next-btn { right: 0.5rem; }

  /* Breadcrumb Bar */
  .breadcrumb-bar {
    padding: 0.65rem 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .breadcrumb-actions {
    width: 100%;
    margin-left: 0;
  }

  .breadcrumb-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Footer */
  .app-footer {
    padding: 1.5rem 1rem;
  }

  .footer-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .footer-right {
    flex-wrap: wrap;
    gap: 0.4rem;
  }
}

/* ==========================================================================
   Video Player Modal & Cinema Stage
   ========================================================================== */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity var(--transition-normal);
}

.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 14, 0.94);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
}

.video-modal-content {
  position: relative;
  z-index: 151;
  display: flex;
  flex-direction: column;
  width: 96vw;
  height: 94vh;
  max-width: 1500px;
}

/* Video Topbar */
.video-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.85rem 1.4rem;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  margin-bottom: 0.85rem;
  backdrop-filter: blur(16px);
}

.v-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  overflow: hidden;
}

.v-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.v-title-wrap {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.v-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 380px;
}

.v-submeta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.15rem;
}

.v-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
}

.v-badge-folder { background: rgba(99, 102, 241, 0.18); color: #a5b4fc; }
.v-badge-size { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.v-badge-format { background: rgba(245, 158, 11, 0.18); color: #fbbf24; }

/* Engine Switcher */
.player-engine-switcher {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.4);
  padding: 0.3rem 0.5rem;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
}

.engine-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 600;
  margin-right: 0.2rem;
}

.engine-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.engine-pill:hover {
  color: #fff;
}

.engine-pill.active {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
}

.v-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-close {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-close:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

/* Video Main Layout (Stage + Playlist) */
.video-main-layout {
  display: flex;
  gap: 1rem;
  flex: 1;
  min-height: 0;
}

.video-cinema-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.video-screen-container {
  position: relative;
  flex: 1;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.75), 0 0 30px rgba(99, 102, 241, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-iframe-player {
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
}

.video-html5-player {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  outline: none;
}

.video-loader {
  position: absolute;
  inset: 0;
  background: #040711;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  z-index: 5;
  transition: opacity 0.3s;
}

.video-loader.loaded {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.video-stage-subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0.5rem 0.2rem;
  color: var(--text-muted);
  font-size: 0.825rem;
}

.video-nav-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.v-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.v-nav-btn:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.v-counter-badge {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
}

.video-tips {
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* Video Playlist Drawer */
.video-playlist-drawer {
  width: 330px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(16px);
}

.playlist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.playlist-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.playlist-count {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  font-weight: 600;
}

.playlist-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.playlist-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.playlist-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

.playlist-item.active {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.4);
}

.pl-play-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.playlist-item.active .pl-play-icon {
  background: var(--accent-primary);
  color: #fff;
}

.pl-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
}

.pl-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pl-sub {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
}

.video-section-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.85rem;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #fbbf24;
  margin-bottom: 0.75rem;
}
