/* MeetingFlow AI — Executive Dark Studio Design System & Motion Framework */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Executive Dark Palette */
  --bg-deep: #050811;
  --bg-base: #070a14;
  --bg-surface: #0e1526;
  --bg-surface-elevated: #131c33;
  --bg-card: rgba(14, 21, 38, 0.72);
  --bg-card-hover: rgba(19, 28, 51, 0.85);

  /* Accents & Gradients */
  --brand-primary: #6366f1;
  --brand-violet: #8b5cf6;
  --brand-cyan: #06b6d4;
  --brand-emerald: #10b981;
  --brand-rose: #f43f5e;
  --brand-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
  --brand-glow: 0 0 25px -4px rgba(99, 102, 241, 0.45);

  /* Borders & Shadows */
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-glow: rgba(99, 102, 241, 0.35);
  --glass-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.05);
  --glass-shadow-hover: 0 20px 48px -10px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(99, 102, 241, 0.3);
}

/* Base Document */
html, body {
  font-family: var(--font-sans);
  background-color: var(--bg-deep);
  color: #f1f5f9;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Sleek Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(7, 10, 20, 0.6);
}
::-webkit-scrollbar-thumb {
  background: rgba(51, 65, 85, 0.5);
  border-radius: 9999px;
  transition: background 0.2s ease;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.8);
}

/* ----------------- AURORA BACKGROUND ANIMATION ----------------- */
.aurora-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: -10;
  transform: translateZ(0);
}

.aurora-blob {
  position: absolute;
  filter: blur(100px);
  opacity: 0.18;
  border-radius: 50%;
  will-change: transform;
}

.aurora-blob-1 {
  width: 55vw;
  height: 55vw;
  top: -15vw;
  left: -10vw;
  background: radial-gradient(circle, #6366f1 0%, transparent 70%);
  animation: auroraDrift1 26s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}

.aurora-blob-2 {
  width: 50vw;
  height: 50vw;
  top: 10vw;
  right: -10vw;
  background: radial-gradient(circle, #8b5cf6 0%, transparent 70%);
  animation: auroraDrift2 30s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}

.aurora-blob-3 {
  width: 60vw;
  height: 45vw;
  bottom: -15vw;
  left: 20vw;
  background: radial-gradient(circle, #06b6d4 0%, transparent 70%);
  animation: auroraDrift3 34s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}

@keyframes auroraDrift1 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(8vw, 12vh) scale(1.12); }
  100% { transform: translate(-6vw, 18vh) scale(0.95); }
}

@keyframes auroraDrift2 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-10vw, -8vh) scale(1.15); }
  100% { transform: translate(-18vw, 10vh) scale(0.92); }
}

@keyframes auroraDrift3 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-8vw, -12vh) scale(1.08); }
  100% { transform: translate(12vw, -16vh) scale(1.02); }
}

/* Subtle Grid Texture */
.grid-mesh {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(ellipse at 50% 30%, black 40%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, black 40%, transparent 80%);
  z-index: -9;
}

/* ----------------- GLASS CARD ELEVATION & MOTION ----------------- */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--glass-shadow);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
              border-color 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
              background 0.28s ease;
  will-change: transform, box-shadow;
}

.glass-card:hover {
  transform: translateY(-2px);
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  box-shadow: var(--glass-shadow-hover);
}

.glass-header {
  background: rgba(7, 10, 20, 0.78);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 24px -2px rgba(0, 0, 0, 0.45);
}

/* ----------------- STAGGERED ENTRANCE ANIMATIONS ----------------- */
.rise-in {
  animation: riseIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.stagger-1 { animation-delay: 0.06s; }
.stagger-2 { animation-delay: 0.12s; }
.stagger-3 { animation-delay: 0.18s; }
.stagger-4 { animation-delay: 0.24s; }

@keyframes riseIn {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ----------------- MODERN TAB PILLS ----------------- */
.nav-tab-btn {
  position: relative;
  transition: all 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
  color: #94a3b8;
  font-weight: 500;
  border: 1px solid transparent;
}

.nav-tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab-btn.active {
  color: #ffffff;
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.45);
  box-shadow: 0 4px 16px -2px rgba(99, 102, 241, 0.35);
}

.nav-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--brand-gradient);
  border-radius: 9999px;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.8);
}

/* ----------------- INTERACTIVE BUTTONS & BLOOMS ----------------- */
.btn-primary-gradient {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #4338ca 100%);
  background-size: 200% 200%;
  box-shadow: 0 4px 18px 0 rgba(79, 70, 229, 0.4);
  transition: all 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.btn-primary-gradient:hover:not(:disabled) {
  background-position: right center;
  box-shadow: 0 6px 24px 0 rgba(99, 102, 241, 0.6), 0 0 12px 0 rgba(139, 92, 246, 0.3);
  transform: translateY(-1.5px);
}

.btn-primary-gradient:active:not(:disabled) {
  transform: translateY(0.5px) scale(0.98);
}

.btn-pdf-download {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  box-shadow: 0 4px 14px 0 rgba(124, 58, 237, 0.35);
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.btn-pdf-download:hover {
  background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
  box-shadow: 0 6px 20px 0 rgba(124, 58, 237, 0.55);
  transform: translateY(-1px);
}

/* ----------------- RECORDING PULSE BEACONS ----------------- */
@keyframes pulseRing {
  0% {
    transform: scale(0.92);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  65% {
    transform: scale(1.06);
    box-shadow: 0 0 0 18px rgba(239, 68, 68, 0);
  }
  100% {
    transform: scale(0.92);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.recording-pulse-ring {
  animation: pulseRing 1.9s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

.live-beacon {
  animation: liveStatusBlink 1.4s ease-in-out infinite;
}

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

.shimmer-loader {
  background: linear-gradient(90deg, rgba(30, 41, 59, 0.5) 0%, rgba(51, 65, 85, 0.7) 50%, rgba(30, 41, 59, 0.5) 100%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite linear;
}

/* ----------------- SPRING MODALS ----------------- */
.modal-spring {
  animation: modalSpring 0.32s cubic-bezier(0.34, 1.45, 0.64, 1) both;
}

@keyframes modalSpring {
  0% {
    opacity: 0;
    transform: scale(0.94) translateY(8px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Visualizer Waveform Canvas */
canvas#inperson-canvas, canvas#virtual-canvas {
  filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.35));
}

/* Quick Prompt Chips */
.quick-chip {
  transition: all 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.65);
}

.quick-chip:hover {
  border-color: rgba(99, 102, 241, 0.55);
  background: rgba(99, 102, 241, 0.14);
  color: #c7d2fe;
  transform: translateY(-1px);
}

/* Action Items Checklist */
.action-checkbox:checked + .action-text {
  text-decoration: line-through;
  color: #64748b;
}

/* Code & Mono Styling */
code, pre, .font-mono {
  font-family: var(--font-mono);
}

/* Chat Bubbles */
.chat-bubble-user {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.92) 0%, rgba(99, 102, 241, 0.92) 100%);
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.3);
}

.chat-bubble-ai {
  background: rgba(26, 36, 56, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

/* ----------------- ACCESSIBILITY: REDUCED MOTION ----------------- */
@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;
  }
  .aurora-blob {
    animation: none !important;
  }
}


/* ----------------- DEVICE RESPONSIVENESS & SAFE AREAS ----------------- */

/* Safe-area insets for notches & home indicator */
.header-safe {
  padding-top: max(0.65rem, env(safe-area-inset-top));
  padding-left: max(0.75rem, env(safe-area-inset-left));
  padding-right: max(0.75rem, env(safe-area-inset-right));
}

.main-safe {
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
}

/* Hide scrollbar for clean horizontal tab swipe */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Dynamic Viewport Height Modals */
.modal-dvh {
  max-height: 90vh;
  max-height: 90dvh;
}

/* Fluid Typography and Padding for Mobile (<640px) */
@media (max-width: 640px) {
  /* Throttle Aurora blobs on low-end mobile GPUs */
  .aurora-blob {
    filter: blur(50px) !important;
    opacity: 0.12 !important;
  }
  .aurora-blob-1 { width: 75vw; height: 75vw; }
  .aurora-blob-2 { width: 70vw; height: 70vw; }
  .aurora-blob-3 { width: 80vw; height: 60vw; }

  /* Compact glass card padding */
  .glass-card {
    padding: 1rem !important;
    border-radius: 1rem !important;
  }

  /* Touch Target Optimizations (WCAG 2.5.5) */
  .nav-tab-btn {
    min-height: 42px;
  }
  
  /* Modal responsive sizing */
  .modal-spring {
    margin-left: 0.5rem !important;
    margin-right: 0.5rem !important;
    padding: 1.15rem !important;
    max-height: 88dvh !important;
  }
}

/* Tablets (641px - 1024px) */
@media (min-width: 641px) and (max-width: 1024px) {
  .glass-card {
    padding: 1.25rem;
  }
}
