/**
 * Lumina Gallery Design System & Theme Engine
 * Original, Modern, Mobile-First Visual Experience
 */

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

:root {
  /* Color Palette - Light Mode (Porcelain & Obsidian) */
  --bg-main: #f8fafc;
  --bg-sidebar: rgba(255, 255, 255, 0.88);
  --bg-header: rgba(248, 250, 252, 0.85);
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-tertiary: #e2e8f0;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  --text-quaternary: #cbd5e1;

  /* Lumina Signature Accents */
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-secondary: #06b6d4;
  --accent-subtle: rgba(99, 102, 241, 0.12);
  --accent-glow: rgba(99, 102, 241, 0.35);
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  --accent-gradient-hover: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #db2777 100%);

  --danger: #f43f5e;
  --danger-hover: #e11d48;
  --danger-subtle: rgba(244, 63, 94, 0.12);

  --success: #10b981;
  --warning: #f59e0b;

  --border-light: rgba(15, 23, 42, 0.08);
  --border-subtle: rgba(15, 23, 42, 0.04);
  --border-focus: rgba(99, 102, 241, 0.4);

  --glass-bg: rgba(255, 255, 255, 0.82);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-blur: blur(20px) saturate(190%);

  --modal-bg: #ffffff;
  --overlay-bg: rgba(15, 23, 42, 0.6);
  --viewer-bg: rgba(8, 11, 20, 0.97);

  /* Elevation & Shadows */
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
  --shadow-md: 0 4px 16px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 32px -4px rgba(15, 23, 42, 0.12), 0 4px 12px -2px rgba(15, 23, 42, 0.06);
  --shadow-glow: 0 0 24px rgba(99, 102, 241, 0.35);
  --shadow-viewer: 0 25px 60px -10px rgba(0, 0, 0, 0.8);

  /* Geometry */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Typography */
  --font-system: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Layout Specs */
  --sidebar-width: 260px;
  --header-height: 60px;
  --tab-bar-height: 68px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* Fluid Transitions */
  --ease-lumina: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-quick: 0.16s;
  --duration-normal: 0.26s;
  --duration-slow: 0.4s;
}

/* Lumina Obsidian Dark Mode (Default / Native) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-main: #07090e;
    --bg-sidebar: rgba(11, 15, 25, 0.82);
    --bg-header: rgba(7, 9, 14, 0.82);
    --bg-card: #0f1420;
    --bg-card-hover: #171f30;
    --bg-tertiary: #1e273b;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --text-quaternary: #475569;

    --accent: #818cf8;
    --accent-hover: #a5b4fc;
    --accent-secondary: #38bdf8;
    --accent-subtle: rgba(129, 140, 248, 0.16);
    --accent-glow: rgba(129, 140, 248, 0.4);
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    --accent-gradient-hover: linear-gradient(135deg, #818cf8 0%, #a78bfa 50%, #f472b6 100%);

    --border-light: rgba(255, 255, 255, 0.08);
    --border-subtle: rgba(255, 255, 255, 0.04);
    --border-focus: rgba(129, 140, 248, 0.5);

    --glass-bg: rgba(15, 20, 32, 0.78);
    --glass-border: rgba(255, 255, 255, 0.09);

    --modal-bg: #0f1420;
    --overlay-bg: rgba(3, 5, 8, 0.82);
    --viewer-bg: rgba(4, 6, 10, 0.98);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.7);
  }
}

[data-theme="dark"] {
  --bg-main: #07090e;
  --bg-sidebar: rgba(11, 15, 25, 0.82);
  --bg-header: rgba(7, 9, 14, 0.82);
  --bg-card: #0f1420;
  --bg-card-hover: #171f30;
  --bg-tertiary: #1e273b;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --text-quaternary: #475569;

  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --accent-secondary: #38bdf8;
  --accent-subtle: rgba(129, 140, 248, 0.16);
  --accent-glow: rgba(129, 140, 248, 0.4);
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  --accent-gradient-hover: linear-gradient(135deg, #818cf8 0%, #a78bfa 50%, #f472b6 100%);

  --border-light: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.04);
  --border-focus: rgba(129, 140, 248, 0.5);

  --glass-bg: rgba(15, 20, 32, 0.78);
  --glass-border: rgba(255, 255, 255, 0.09);

  --modal-bg: #0f1420;
  --overlay-bg: rgba(3, 5, 8, 0.82);
  --viewer-bg: rgba(4, 6, 10, 0.98);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.7);
}

/* Base Reset & Core Foundation */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-family: var(--font-system);
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-main);
  color: var(--text-primary);
  overflow-x: hidden;
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.03) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.03) 0px, transparent 50%);
  background-attachment: fixed;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity var(--duration-quick) ease, color var(--duration-quick) ease;
}

a:hover {
  opacity: 0.9;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

img, video {
  max-width: 100%;
  display: block;
}

/* Custom Scrollbar for sleek modern feel */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

@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;
  }
}
