/* Custom Design System & Utility Enhancements for Dreamsmore AI */

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

:root {
  --color-primary: #003d9b;
  --color-primary-container: #0052cc;
  --color-on-primary-container: #c4d2ff;
  --color-surface: #f9f9f9;
  --color-surface-bright: #ffffff;
  --color-surface-container-low: #f3f3f4;
  --color-surface-container-lowest: #ffffff;
  --color-surface-container: #eeeeee;
  --color-surface-container-high: #e8e8e8;
  --color-surface-container-highest: #e2e2e2;
  --color-on-surface: #1a1c1c;
  --color-on-surface-variant: #434654;
  --color-secondary: #555f6c;
  --color-secondary-container: #d9e3f2;
  --color-slate-border: #D0D5DD;
  --color-outline: #737685;
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(255, 255, 255, 0.6);
  --card-shadow: 0 4px 20px -2px rgba(0, 30, 80, 0.08);
}

.dark {
  --color-primary: #5b92ff;
  --color-primary-container: #0040a2;
  --color-on-primary-container: #dae2ff;
  --color-surface: #0f131a;
  --color-surface-bright: #171c26;
  --color-surface-container-low: #151a24;
  --color-surface-container-lowest: #1b212e;
  --color-surface-container: #222938;
  --color-surface-container-high: #2a3345;
  --color-surface-container-highest: #333d52;
  --color-on-surface: #f0f2f8;
  --color-on-surface-variant: #b0b8c8;
  --color-secondary: #94a3b8;
  --color-secondary-container: #1e293b;
  --color-slate-border: #2d3748;
  --color-outline: #64748b;
  --glass-bg: rgba(21, 26, 36, 0.75);
  --glass-border: rgba(255, 255, 255, 0.1);
  --card-shadow: 0 4px 25px -2px rgba(0, 0, 0, 0.4);
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--color-surface);
  color: var(--color-on-surface);
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* Glassmorphism Panel */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
}

/* Creative Animated Aurora Mesh Hero Banner Background */
.creative-hero-bg {
  position: relative;
  background: linear-gradient(135deg, #001233 0%, #002878 35%, #0052cc 70%, #0077ff 100%);
  overflow: hidden;
  box-shadow: 0 20px 40px -10px rgba(0, 60, 180, 0.35);
}

.creative-hero-bg::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 30%, rgba(0, 240, 255, 0.25) 0%, transparent 40%),
              radial-gradient(circle at 75% 70%, rgba(130, 0, 255, 0.3) 0%, transparent 45%),
              radial-gradient(circle at 50% 80%, rgba(0, 255, 170, 0.2) 0%, transparent 40%);
  animation: rotateAurora 18s linear infinite;
  pointer-events: none;
}

@keyframes rotateAurora {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.1); }
  100% { transform: rotate(360deg) scale(1); }
}

/* Levitating & Bouncing Card Physics Animations */
@keyframes levitateBounce1 {
  0%, 100% {
    transform: translateY(0px) rotate(-3deg) scale(1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 240, 255, 0.3);
  }
  50% {
    transform: translateY(-16px) rotate(-1deg) scale(1.03);
    box-shadow: 0 30px 50px rgba(0, 0, 0, 0.5), 0 0 35px rgba(0, 240, 255, 0.6);
  }
}

@keyframes levitateBounce2 {
  0%, 100% {
    transform: translateY(0px) rotate(4deg) scale(1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 0 0 20px rgba(160, 32, 240, 0.3);
  }
  50% {
    transform: translateY(-20px) rotate(6deg) scale(1.04);
    box-shadow: 0 32px 55px rgba(0, 0, 0, 0.55), 0 0 40px rgba(160, 32, 240, 0.65);
  }
}

@keyframes levitateBounce3 {
  0%, 100% {
    transform: translateY(0px) rotate(-2deg) scale(1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 255, 170, 0.3);
  }
  50% {
    transform: translateY(-14px) rotate(-4deg) scale(1.03);
    box-shadow: 0 28px 45px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 255, 170, 0.6);
  }
}

@keyframes levitateBounce4 {
  0%, 100% {
    transform: translateY(0px) rotate(5deg) scale(1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 200, 0, 0.3);
  }
  50% {
    transform: translateY(-18px) rotate(3deg) scale(1.04);
    box-shadow: 0 30px 50px rgba(0, 0, 0, 0.55), 0 0 35px rgba(255, 200, 0, 0.6);
  }
}

.levitate-card-1 {
  animation: levitateBounce1 4.5s ease-in-out infinite;
  transition: transform 0.3s ease;
}

.levitate-card-2 {
  animation: levitateBounce2 5.2s ease-in-out infinite 0.6s;
  transition: transform 0.3s ease;
}

.levitate-card-3 {
  animation: levitateBounce3 4.8s ease-in-out infinite 1.2s;
  transition: transform 0.3s ease;
}

.levitate-card-4 {
  animation: levitateBounce4 5.5s ease-in-out infinite 0.3s;
  transition: transform 0.3s ease;
}

.levitate-card-1:hover, .levitate-card-2:hover, .levitate-card-3:hover, .levitate-card-4:hover {
  animation-play-state: paused;
  transform: scale(1.08) translateY(-10px) z-index: 30;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background-color: rgba(115, 118, 133, 0.3);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background-color: rgba(115, 118, 133, 0.6);
}

/* Shimmer animation */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.shimmer-bg {
  background: linear-gradient(90deg, 
    rgba(255,255,255,0) 0%, 
    rgba(0, 82, 204, 0.15) 50%, 
    rgba(255,255,255,0) 100%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* Material Symbols */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  user-select: none;
}

.icon-fill {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Tab Page Visibility */
.view-page {
  display: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.view-page.active-view {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Modal Overlay */
.modal-overlay {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  transform: scale(0.95) translateY(10px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.open .modal-card {
  transform: scale(1) translateY(0);
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 84px;
  right: 20px;
  z-index: 100;
  display: flex;
  flex-col: gap-2;
  pointer-events: none;
}

@media (min-width: 768px) {
  #toast-container {
    bottom: 24px;
  }
}

.toast-msg {
  pointer-events: auto;
  animation: slideUpToast 0.3s ease forwards;
}

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

/* Toggled from app.js to show/hide header chrome by auth state.
   Needs !important because Tailwind's utility classes on the same elements
   (flex, md:flex) also set `display` and the CDN build loads after this file,
   so without it the Sign In button stayed visible while signed in. */
.chrome-hidden {
  display: none !important;
}

/* ---------------------------------------------------------------------------
   Generation waiting state
   A video takes ~2 minutes. The old screen was a bare spinner with invented
   copy ("8K on GPU farm"), which was both dull and untrue. This gives honest
   stage feedback with enough motion to not feel frozen.
--------------------------------------------------------------------------- */
.gen-orb {
  position: absolute;
  border-radius: 9999px;
  filter: blur(48px);
  opacity: 0.35;
  pointer-events: none;
}
.gen-orb-a {
  width: 220px; height: 220px;
  background: var(--color-primary, #0052cc);
  top: -60px; left: -50px;
  animation: gen-drift-a 9s ease-in-out infinite alternate;
}
.gen-orb-b {
  width: 180px; height: 180px;
  background: #00e08a;
  bottom: -50px; right: -40px;
  animation: gen-drift-b 11s ease-in-out infinite alternate;
}
@keyframes gen-drift-a {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(40px, 30px) scale(1.15); }
}
@keyframes gen-drift-b {
  from { transform: translate(0, 0) scale(1.1); }
  to   { transform: translate(-35px, -25px) scale(0.95); }
}

.gen-dot {
  width: 7px; height: 7px;
  border-radius: 9999px;
  background: currentColor;
  opacity: 0.25;
  flex-shrink: 0;
  transition: opacity 0.3s, transform 0.3s;
}
/* Current stage: pulsing. Completed stages: solid and full opacity. */
.gen-step.is-active { color: var(--color-primary, #0052cc); font-weight: 600; }
.gen-step.is-active .gen-dot { opacity: 1; animation: gen-pulse 1.2s ease-in-out infinite; }
.gen-step.is-done { color: var(--color-primary, #0052cc); }
.gen-step.is-done .gen-dot { opacity: 1; transform: scale(1.15); }
@keyframes gen-pulse {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%      { transform: scale(1.6); opacity: 0.5; }
}

@media (prefers-reduced-motion: reduce) {
  .gen-orb, .gen-step.is-active .gen-dot { animation: none; }
}

/* ---------------------------------------------------------------------------
   Mobile bottom navigation
   The old icons were 18px grey glyphs with 8px labels: hard to hit and hard to
   tell which tab was active. Bigger glyphs, a real active pill, and a colour
   change so the current tab is obvious at a glance.
--------------------------------------------------------------------------- */
.mob-nav-item {
  color: #6b7280;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.mob-nav-item .material-symbols-outlined {
  transition: transform 0.18s ease, color 0.18s ease;
}
.mob-nav-item:active .material-symbols-outlined {
  transform: scale(0.88);
}
.mob-nav-item.active {
  color: var(--color-primary, #0052cc);
  background: rgba(0, 82, 204, 0.10);
  font-weight: 700;
}
.mob-nav-item.active .material-symbols-outlined {
  font-variation-settings: 'FILL' 1;
  transform: translateY(-1px) scale(1.06);
}
/* Small dot under the active tab, the standard mobile affordance. */
.mob-nav-item.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  width: 5px;
  height: 5px;
  border-radius: 9999px;
  background: var(--color-primary, #0052cc);
}
.dark .mob-nav-item { color: #9ca3af; }
.dark .mob-nav-item.active {
  color: #7aa7ff;
  background: rgba(122, 167, 255, 0.16);
}
.dark .mob-nav-item.active::after { background: #7aa7ff; }

@media (prefers-reduced-motion: reduce) {
  .mob-nav-item .material-symbols-outlined { transition: none; }
}
