/* ─────────────────────────────────────────────────────────────────────────────
   StreamHub — Liquid Glass Media Hosting & Streaming Homepage Styling
   Mathematical Implementation Specification & High Performance Cloud Drive
   ───────────────────────────────────────────────────────────────────────────── */

/* ─── 1. MATHEMATICAL DESIGN TOKENS — LIQUID GLASS SYSTEM ─────────────────── */
:root {
  /* Midnight Dark Canvas */
  --bg-base: #050914;
  --bg-deep: #080F20;
  --bg-elevated: #0C1830;

  /* Liquid Glass Translucencies */
  --glass-fill: rgba(153, 190, 255, 0.075);
  --glass-fill-strong: rgba(153, 190, 255, 0.13);
  --glass-fill-hover: rgba(153, 190, 255, 0.19);

  --glass-border: rgba(215, 235, 255, 0.24);
  --glass-border-bright: rgba(230, 245, 255, 0.48);

  /* High Contrast Accessible Typography */
  --text-primary: #F4F8FF;
  --text-secondary: #B7C6DF;
  --text-muted: #8295B4;

  /* Vibrant Accents */
  --accent-blue: #477DFF;
  --accent-cyan: #32DFFF;
  --accent-violet: #9561FF;
  --accent-pink: #F05DCA;

  /* Primary Violet-Blue-Cyan Gradient */
  --gradient-primary: linear-gradient(115deg, #9B55FF 0%, #477DFF 52%, #22D8F5 100%);

  /* Atmospheric Radial Illumination */
  --gradient-atmosphere:
    radial-gradient(
      ellipse at 15% 25%,
      rgba(71, 125, 255, 0.22) 0%,
      transparent 45%
    ),
    radial-gradient(
      ellipse at 85% 20%,
      rgba(149, 97, 255, 0.19) 0%,
      transparent 42%
    ),
    radial-gradient(
      ellipse at 55% 85%,
      rgba(50, 223, 255, 0.11) 0%,
      transparent 45%
    );

  /* Mathematical Radii */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* Blurs & Shadows */
  --blur-glass: 18px;
  --blur-heavy: 28px;
  --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.28);
  --shadow-glow: 0 0 24px rgba(71, 125, 255, 0.22);

  /* Legacy & Semantic Mapping */
  --bg: var(--bg-base);
  --card-bg: var(--glass-fill);
  --card-hover: var(--glass-fill-hover);
  --border: var(--glass-border);
  --border-hover: var(--glass-border-bright);
  --primary: var(--accent-blue);
  --primary-hover: var(--accent-cyan);
  --primary-glow: var(--shadow-glow);
  --accent: var(--accent-cyan);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.18);
  --text: var(--text-primary);
  --text-dim: var(--text-muted);

  /* Grid Metrics */
  --sidebar-width: clamp(160px, 13.2vw, 210px);
  --header-height: 72px;
}

/* ─── 2. RESET & BASE FOUNDATIONS ─────────────────────────────────────────── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100vh;
  background-color: var(--bg-base);
  background-image: var(--gradient-atmosphere);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Eye-Comfort Night Shield Mode */
body.night-shield {
  filter: sepia(0.22) saturate(0.92) contrast(0.98);
  transition: filter 0.3s ease;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─── 3. LIQUID GLASS PHYSICS ─────────────────────────────────────────────── */
.glass-panel {
  background: var(--glass-fill);
  backdrop-filter: blur(var(--blur-glass)) saturate(155%);
  -webkit-backdrop-filter: blur(var(--blur-glass)) saturate(155%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.19),
    inset 0 -1px 0 rgba(100, 170, 255, 0.08),
    var(--shadow-glass);
  transition: background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

.glass-panel:hover {
  background: var(--glass-fill-hover);
  border-color: var(--glass-border-bright);
}

/* Fallback for browsers lacking backdrop-filter */
@supports not (backdrop-filter: blur(10px)) {
  .glass-panel, .sidebar, .top-header, .item-card, .cat-pill {
    background: rgba(12, 24, 48, 0.95) !important;
  }
}

/* ─── 4. DESKTOP MATHEMATICAL GRID LAYOUT ─────────────────────────────────── */
.app-shell {
  min-height: 100vh;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 10px;
  position: relative;
  z-index: 10;
}

/* ─── 5. FLOATING GLASS HEADER ────────────────────────────────────────────── */
.top-header {
  grid-column: 1 / -1;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-radius: var(--radius-lg);
  background: var(--glass-fill-strong);
  backdrop-filter: blur(var(--blur-heavy)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--blur-heavy)) saturate(160%);
  border: 1px solid var(--glass-border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    inset 0 -1px 0 rgba(100, 170, 255, 0.1),
    var(--shadow-glass);
  gap: 16px;
  position: sticky;
  top: 12px;
  z-index: 100;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
}

.brand-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(71, 125, 255, 0.4);
  color: #fff;
}

.brand-icon-wrap svg {
  width: 22px;
  height: 22px;
}

.brand-text {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(115deg, #FFFFFF 0%, #B7C6DF 40%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Top Header Primary Navigation */
.header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}

.header-nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.header-nav-btn:hover {
  color: var(--text-primary);
  background: var(--glass-fill);
  border-color: rgba(255, 255, 255, 0.12);
}

.header-nav-btn.active {
  color: #fff;
  background: var(--glass-fill-strong);
  border-color: var(--glass-border-bright);
  box-shadow: 0 2px 10px rgba(71, 125, 255, 0.25);
}

/* Search Bar with Ctrl+K */
.search-bar {
  position: relative;
  flex: 1;
  max-width: 380px;
}

.search-bar svg.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-bar input {
  width: 100%;
  background: rgba(15, 25, 50, 0.5);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  padding: 9px 68px 9px 40px;
  color: var(--text-primary);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: all 0.22s ease;
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

.search-bar input:focus {
  background: rgba(20, 35, 70, 0.75);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(50, 223, 255, 0.2);
}

.kbd-badge {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  pointer-events: none;
  font-family: monospace;
}

.clear-search-btn {
  position: absolute;
  right: 48px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 2px;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 4px 18px rgba(71, 125, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 24px rgba(71, 125, 255, 0.5);
  border-color: rgba(255, 255, 255, 0.45);
}

.btn-secondary {
  background: var(--glass-fill);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
}

.btn-secondary:hover {
  background: var(--glass-fill-hover);
  border-color: var(--glass-border-bright);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.28);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: var(--glass-fill-hover);
  color: var(--text-primary);
  border-color: var(--glass-border-bright);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

/* User Pill */
.user-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 12px 5px 6px;
  border-radius: var(--radius-pill);
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: all 0.2s;
}

.user-pill:hover {
  background: var(--glass-fill-hover);
  border-color: var(--glass-border-bright);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(71, 125, 255, 0.3);
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ─── 6. LEFT SIDEBAR ─────────────────────────────────────────────────────── */
.sidebar {
  width: 100%;
  background: var(--glass-fill);
  backdrop-filter: blur(var(--blur-glass)) saturate(155%);
  -webkit-backdrop-filter: blur(var(--blur-glass)) saturate(155%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  height: calc(100vh - 100px);
  position: sticky;
  top: 92px;
  overflow-y: auto;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.19),
    var(--shadow-glass);
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 10px 6px 10px;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  list-style: none;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  width: 100%;
  text-decoration: none;
}

.sidebar-item svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: color 0.2s;
  flex-shrink: 0;
}

.sidebar-item:hover {
  background: var(--glass-fill);
  color: var(--text-primary);
  border-color: rgba(215, 235, 255, 0.15);
}

.sidebar-item:hover svg {
  color: var(--accent-cyan);
}

.sidebar-item.active {
  background: linear-gradient(115deg, rgba(155, 85, 255, 0.22) 0%, rgba(71, 125, 255, 0.26) 100%);
  color: #fff;
  border: 1px solid var(--glass-border-bright);
  box-shadow: 0 4px 16px rgba(71, 125, 255, 0.25);
}

.sidebar-item.active svg {
  color: var(--accent-cyan);
}

/* Cloud Storage Widget */
.storage-widget {
  background: rgba(12, 24, 48, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.storage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.storage-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.storage-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: rgba(50, 223, 255, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(50, 223, 255, 0.3);
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 7px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-pill);
  transition: width 0.4s ease;
  box-shadow: 0 0 10px rgba(50, 223, 255, 0.4);
}

.storage-numbers {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ─── 7. MAIN CONTENT AREA ────────────────────────────────────────────────── */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
  overflow-y: auto;
}

/* ─── 8. HERO BANNER — CINEMATIC LIQUID GLASS ─────────────────────────────── */
.hero-banner {
  position: relative;
  height: 390px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 16px 48px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  z-index: 1;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(5, 9, 20, 0.97) 0%,
    rgba(5, 9, 20, 0.78) 36%,
    rgba(5, 9, 20, 0.25) 68%,
    rgba(5, 9, 20, 0.04) 100%
  );
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
  padding: 0 44px;
  width: min(520px, 48%);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hero-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: rgba(149, 97, 255, 0.25);
  border: 1px solid rgba(149, 97, 255, 0.45);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  width: fit-content;
  box-shadow: 0 0 12px rgba(149, 97, 255, 0.35);
}

.hero-title {
  font-size: clamp(26px, 3.2vw, 40px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: #fff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
}

.hero-quality-badge {
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(50, 223, 255, 0.2);
  border: 1px solid rgba(50, 223, 255, 0.45);
  color: var(--accent-cyan);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.hero-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}

/* Hero Carousel Controls */
.hero-controls {
  position: absolute;
  right: 28px;
  bottom: 24px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-arrow-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(15, 25, 50, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.hero-arrow-btn:hover {
  background: var(--glass-fill-hover);
  border-color: var(--glass-border-bright);
  transform: scale(1.08);
}

.hero-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: all 0.25s ease;
}

.hero-dot.active {
  width: 22px;
  border-radius: 4px;
  background: var(--gradient-primary);
  box-shadow: 0 0 8px rgba(71, 125, 255, 0.5);
}

/* ─── 9. CATEGORY FILTER BAR ──────────────────────────────────────────────── */
.category-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px;
  scrollbar-width: none;
}

.category-filter-bar::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  height: 48px;
  padding: 0 20px;
  border-radius: var(--radius-pill);
  background: var(--glass-fill);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.cat-pill:hover {
  background: var(--glass-fill-hover);
  color: var(--text-primary);
  border-color: var(--glass-border-bright);
  transform: translateY(-1px);
}

.cat-pill.active {
  background: var(--gradient-primary);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 18px rgba(71, 125, 255, 0.4);
}

.cat-count {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
}

/* ─── 10. SECTION HEADERS ─────────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-heading-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-icon {
  font-size: 20px;
  line-height: 1;
}

.section-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.section-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-cyan);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
  cursor: pointer;
}

.section-link:hover {
  color: #fff;
  text-shadow: 0 0 10px rgba(50, 223, 255, 0.6);
}

/* ─── 11. TRENDING NOW — 6-CARD RESPONSIVE GRID ───────────────────────────── */
.trending-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.trending-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    var(--shadow-glass);
}

.trending-card:hover {
  transform: translateY(-3px);
  border-color: var(--glass-border-bright);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 12px 32px rgba(0, 0, 0, 0.5),
    var(--shadow-glow);
}

.trending-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: 145px;
  overflow: hidden;
  background: #000;
}

.trending-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.trending-card:hover .trending-thumb {
  transform: scale(1.035);
}

.trending-quality-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(5, 9, 20, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--accent-cyan);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  z-index: 2;
}

.trending-duration-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(5, 9, 20, 0.85);
  backdrop-filter: blur(8px);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 700;
  z-index: 2;
}

.trending-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 9, 20, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 2;
}

.trending-card:hover .trending-play-overlay {
  opacity: 1;
}

.play-circle-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 16px rgba(71, 125, 255, 0.5);
  transform: scale(0.9);
  transition: transform 0.2s ease;
}

.trending-card:hover .play-circle-btn {
  transform: scale(1);
}

.trending-info {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.trending-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trending-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ─── 12. LOWER TWO-COLUMN SPLIT (70% / 30%) ──────────────────────────────── */
.lower-split-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.70fr) minmax(0, 0.30fr);
  gap: 16px;
}

/* Continue Watching Section */
.continue-watching-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.continue-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.continue-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    var(--shadow-glass);
}

.continue-card:hover {
  transform: translateY(-3px);
  border-color: var(--glass-border-bright);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.continue-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: 125px;
  overflow: hidden;
  background: #000;
}

.continue-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.continue-card:hover .continue-thumb {
  transform: scale(1.035);
}

.continue-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.18);
  z-index: 3;
}

.continue-progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  box-shadow: 0 0 8px rgba(50, 223, 255, 0.6);
}

.continue-info {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.continue-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.continue-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* Top Music Panel */
.music-panel {
  background: var(--glass-fill);
  backdrop-filter: blur(var(--blur-glass)) saturate(155%);
  -webkit-backdrop-filter: blur(var(--blur-glass)) saturate(155%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    var(--shadow-glass);
}

.music-track-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.music-track-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  height: 52px;
}

.music-track-row:hover {
  background: var(--glass-fill-hover);
  border-color: var(--glass-border);
}

.music-rank {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-muted);
  width: 16px;
  text-align: center;
}

.music-art-wrap {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #111;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.music-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.music-details {
  flex: 1;
  min-width: 0;
}

.music-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-artist {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-play-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.music-track-row:hover .music-play-btn {
  background: var(--gradient-primary);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(71, 125, 255, 0.4);
}

.music-play-btn svg {
  width: 14px;
  height: 14px;
}

/* ─── 13. CLOUD DRIVE VAULT & EXPLORER SECTION ────────────────────────────── */
.vault-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 10px;
}

/* Path Bar & Breadcrumbs */
.path-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--glass-fill);
  backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  gap: 16px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  overflow-x: auto;
  white-space: nowrap;
}

.crumb {
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}

.crumb:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.crumb.active {
  color: var(--accent-cyan);
  font-weight: 700;
  cursor: default;
}

.crumb-sep {
  color: var(--text-muted);
  font-size: 11px;
}

.path-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sort-select {
  background: rgba(15, 25, 50, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}

.sort-select:focus {
  border-color: var(--accent-cyan);
}

/* View switcher */
.view-toggle {
  display: flex;
  background: rgba(15, 25, 50, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
}

.view-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.view-btn svg {
  width: 15px;
  height: 15px;
}

.view-btn.active {
  background: var(--glass-fill-hover);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Batch Action Bar */
.batch-bar {
  background: rgba(71, 125, 255, 0.14);
  border: 1px solid rgba(71, 125, 255, 0.35);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.batch-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-cyan);
}

.batch-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Trash Header Bar */
.trash-header-bar {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.trash-info-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.trash-info-notice svg {
  width: 16px;
  height: 16px;
  color: var(--danger);
}

/* Content Area & Items Grid */
.content-view {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

/* Item Card (Folder & File) */
.item-card {
  background: var(--glass-fill);
  backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  position: relative;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    var(--shadow-glass);
}

.item-card:hover {
  background: var(--glass-fill-hover);
  border-color: var(--glass-border-bright);
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 12px 30px rgba(0, 0, 0, 0.45);
}

.item-card.selected {
  border-color: var(--accent-cyan);
  background: rgba(50, 223, 255, 0.12);
}

.item-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.item-checkbox {
  width: 17px;
  height: 17px;
  accent-color: var(--accent-blue);
  cursor: pointer;
}

.item-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-icon-wrap svg {
  width: 22px;
  height: 22px;
}

/* File Type Colors */
.icon-folder { background: rgba(71, 125, 255, 0.18); color: var(--accent-cyan); }
.icon-video { background: rgba(149, 97, 255, 0.18); color: var(--accent-violet); }
.icon-audio { background: rgba(240, 93, 202, 0.18); color: var(--accent-pink); }
.icon-image { background: rgba(50, 223, 255, 0.18); color: var(--accent-cyan); }
.icon-document { background: rgba(245, 158, 11, 0.18); color: #f59e0b; }
.icon-archive { background: rgba(16, 185, 129, 0.18); color: #10b981; }
.icon-generic { background: rgba(148, 163, 184, 0.18); color: #94a3b8; }

.item-card-meta {
  flex: 1;
}

.item-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.item-subtext {
  font-size: 11.5px;
  color: var(--text-muted);
}

.star-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 15px;
  transition: color 0.2s;
}

.star-btn.starred {
  color: #fbbf24;
}

/* Table View */
.items-table-container {
  background: var(--glass-fill);
  backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-glass);
}

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

.items-table th {
  padding: 12px 16px;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(15, 25, 50, 0.4);
}

.items-table td {
  padding: 11px 16px;
  border-bottom: 1px solid rgba(215, 235, 255, 0.08);
  color: var(--text-primary);
}

.items-table tr:hover td {
  background: var(--glass-fill-hover);
}

.table-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.table-icon svg {
  width: 16px;
  height: 16px;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  background: var(--glass-fill);
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-lg);
}

.empty-icon {
  font-size: 42px;
  margin-bottom: 12px;
}

/* ─── 14. DRAG & DROP OVERLAY ─────────────────────────────────────────────── */
.dropzone-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 9, 20, 0.88);
  backdrop-filter: blur(16px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.dropzone-box {
  border: 2px dashed var(--accent-cyan);
  background: rgba(50, 223, 255, 0.08);
  border-radius: var(--radius-xl);
  padding: 60px 80px;
  text-align: center;
  box-shadow: 0 0 50px rgba(50, 223, 255, 0.25);
}

.dropzone-box svg {
  width: 56px;
  height: 56px;
  color: var(--accent-cyan);
  margin-bottom: 14px;
}

/* ─── 15. MODALS & UNIVERSAL MEDIA PREVIEW ────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 9, 20, 0.82);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 1050;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-dialog {
  width: 100%;
  max-width: 480px;
  background: var(--bg-deep);
  border: 1px solid var(--glass-border-bright);
  border-radius: var(--radius-lg);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 24px 64px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: modalPop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  0% { transform: scale(0.94); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
}

.modal-close-btn:hover {
  color: #fff;
}

.modal-body {
  padding: 20px;
}

.modal-body label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.modal-body input[type="text"],
.modal-body input[type="password"],
.modal-body input[type="number"],
.modal-body select {
  width: 100%;
  background: rgba(15, 25, 50, 0.7);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  outline: none;
}

.modal-body input:focus, .modal-body select:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(50, 223, 255, 0.2);
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--glass-border);
  background: rgba(10, 18, 38, 0.6);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Media Preview Dialog */
.preview-dialog {
  width: 95vw;
  max-width: 1100px;
  max-height: 92vh;
  background: var(--bg-deep);
  border: 1px solid var(--glass-border-bright);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
}

.preview-header {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--glass-border);
}

.preview-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 70%;
}

.preview-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.preview-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  min-height: 480px;
}

.preview-body video, .preview-body audio, .preview-body img {
  max-width: 100%;
  max-height: 75vh;
  border-radius: var(--radius-sm);
}

/* ─── 16. FLOATING UPLOAD DRAWER & TOASTS ──────────────────────────────────── */
.upload-drawer {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 360px;
  background: var(--bg-deep);
  border: 1px solid var(--glass-border-bright);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  overflow: hidden;
}

.upload-drawer-header {
  padding: 12px 16px;
  background: rgba(15, 25, 50, 0.7);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--glass-border);
  font-size: 13px;
  font-weight: 700;
}

.upload-queue-list {
  max-height: 220px;
  overflow-y: auto;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border-bright);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ─── 17. MATHEMATICAL RESPONSIVE BREAKPOINTS ─────────────────────────────── */

/* Desktop & Laptop (1024px to 1439px) */
@media (max-width: 1439px) {
  .trending-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .continue-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .hero-content {
    width: min(480px, 55%);
  }
}

/* Tablet (768px to 1023px) */
@media (max-width: 1023px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 10px;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 250px;
    height: 100vh;
    transform: translateX(-105%);
    z-index: 1050;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar.open .mobile-close-btn {
    display: flex !important;
  }
  .mobile-menu-btn {
    display: flex !important;
  }
  .trending-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .lower-split-grid {
    grid-template-columns: 1fr;
  }
  .continue-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .hero-banner {
    height: 340px;
  }
  .hero-content {
    width: 70%;
    padding: 0 28px;
  }
  .header-nav {
    display: none;
  }
}

/* Mobile (< 768px) */
@media (max-width: 767px) {
  .top-header {
    padding: 0 12px;
    height: 60px;
  }
  .search-bar {
    max-width: 160px;
  }
  .kbd-badge {
    display: none;
  }
  .hero-banner {
    height: 310px;
    border-radius: var(--radius-lg);
  }
  .hero-content {
    width: 100%;
    padding: 0 18px;
  }
  .hero-title {
    font-size: 22px;
  }
  .trending-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .continue-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .items-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .category-filter-bar {
    gap: 8px;
  }
  .cat-pill {
    height: 42px;
    padding: 0 14px;
    font-size: 12.5px;
  }
  .user-name {
    display: none;
  }
}
