/* ========================================
   Casea AI - Main Stylesheet
   ======================================== */

/* CSS Variables */
:root {
  --primary: #00ced1;
  --primary-dark: #00a8ab;
  --secondary: #007fff;
  --accent: #8b5cf6;
  
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(20, 20, 30, 0.8);
  --bg-glass: rgba(255, 255, 255, 0.05);
  
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #6a6a7a;
  
  --border-color: rgba(255, 255, 255, 0.1);
  --border-glow: rgba(0, 206, 209, 0.3);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(0, 206, 209, 0.2);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 30px;
  
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  
  --navbar-height: 70px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Utility Classes */
.hidden { display: none !important; }
.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========================================
   Loading Screen
   ======================================== */
.loading-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.5s, visibility 0.5s;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-avatar {
  width: 200px;
  height: 200px;
  margin-bottom: 2rem;
}

.loading-avatar canvas {
  width: 100%;
  height: 100%;
}

.loading-screen h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.loading-screen p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.loading-bar {
  width: 200px;
  height: 4px;
  background: var(--bg-glass);
  border-radius: 2px;
  overflow: hidden;
}

.loading-progress {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  animation: loading 2s ease-in-out infinite;
}

@keyframes loading {
  0% { width: 0%; margin-left: 0; }
  50% { width: 100%; margin-left: 0; }
  100% { width: 0%; margin-left: 100%; }
}

/* ========================================
   Modal & Auth
   ======================================== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  max-width: 800px;
  width: 90%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
}

.auth-left {
  background: linear-gradient(135deg, rgba(0, 206, 209, 0.1), rgba(0, 127, 255, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.auth-left canvas {
  width: 250px;
  height: 250px;
}

.auth-right {
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-right h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.auth-right p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 1rem;
  background: white;
  color: #333;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.google-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.google-btn svg {
  width: 20px;
  height: 20px;
}

.skip-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.auth-note {
  margin-top: 1.5rem;
  font-size: 0.85rem;
  text-align: center;
  color: var(--text-muted);
}

/* ========================================
   Navigation
   ======================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-height);
  background: rgba(10, 10, 15, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 1000;
}

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

.casea-perfect-mini {
    width: 45px; height: 45px; /* Size of the mini avatar */
    position: relative; overflow: hidden; border-radius: 50%; flex-shrink: 0;
}
.casea-perfect-mini iframe {
    position: absolute; top: 0; left: 0;
    width: 300px; height: 300px; /* Original size of your avatar */
    transform: scale(0.15); /* 45 / 300 = 0.15 */
    transform-origin: 0 0;
    border: none; background: transparent; pointer-events: none;
}
.chat-sidebar .casea-perfect-mini {
    width: 80px; height: 80px;
    margin: 0 auto; display: block;
}
.chat-sidebar .casea-perfect-mini iframe {
    transform: scale(0.266); /* 80 / 300 */
}

.brand-text {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  position: relative;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  padding: 0.35rem 0;
  transition: color 0.35s ease, text-shadow 0.35s ease, filter 0.35s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--secondary), transparent);
  opacity: 0;
  transform: scaleX(0.35);
  transform-origin: center;
  box-shadow: 0 0 12px rgba(0, 206, 209, 0.65);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.nav-links a:hover {
  color: #e2f7ff;
  text-shadow: 0 0 14px rgba(0, 206, 209, 0.45);
  filter: brightness(1.08);
}

.nav-links a:hover::after {
  opacity: 1;
  transform: scaleX(1);
}

/* Google giriş — kosmik düymə */
.nav-google-cosmic {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(0, 206, 209, 0.35);
  background: linear-gradient(135deg, rgba(61, 155, 196, 0.35), rgba(0, 206, 209, 0.25));
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(0, 206, 209, 0.2);
  transition: box-shadow 0.3s ease, transform 0.2s ease, border-color 0.3s ease;
}

.nav-google-cosmic:hover {
  box-shadow: 0 0 28px rgba(0, 255, 255, 0.45);
  border-color: rgba(0, 255, 255, 0.55);
  transform: translateY(-1px);
}

/* Mikrofon qonaq kilidi */
.casea-mic-locked,
.nav-mic-button.casea-mic-locked {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
  filter: grayscale(0.4);
  pointer-events: auto;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Language Selector */
.lang-selector {
  position: relative;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
}

.lang-btn:hover {
  border-color: var(--border-glow);
}

.lang-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s;
  min-width: 150px;
}

.lang-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-dropdown button {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: background 0.2s;
}

.lang-dropdown button:hover {
  background: var(--bg-glass);
}

/* Voice Toggle */
.voice-toggle {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.voice-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.voice-toggle.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 206, 209, 0.4); }
  50% { box-shadow: 0 0 0 10px rgba(0, 206, 209, 0); }
}

/* User Profile */
.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-profile img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--primary);
}

.user-profile button {
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.user-profile button:hover {
  border-color: #ff4444;
  color: #ff4444;
}

/* ========================================
   Hero Section - Caspian Sea Background
   ======================================== */
.hero {
  min-height: 100vh;
  padding: calc(var(--navbar-height) + 2rem) 2rem 4rem;
  display: flex;
  align-items: center;
  position: relative;
  /* TASK 3: Force hero background image with !important */
  background: 
    linear-gradient(180deg, rgba(0,10,15,0.6) 0%, rgba(0,15,30,0.4) 100%),
    url('../assets/hero-caspian.jpg') center/cover no-repeat !important;
}

.hero-content {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-text h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.hero-text > p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 500px;
}

.hero-stats {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
}

.stat {
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.hero-actions {
  display: flex;
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  border-radius: var(--radius-xl);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border: none;
  box-shadow: 0 4px 20px rgba(0, 206, 209, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 206, 209, 0.4);
}

.btn-secondary {
  background: transparent;
  color: white;
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  border-color: var(--primary);
  background: rgba(0, 206, 209, 0.1);
}

/* Hero Avatar - iframe embedded original Casea */
.hero-avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.avatar-container {
  position: relative;
  width: 400px;
  height: 400px;
  z-index: 10;
}



.avatar-info {
  margin-top: 1.5rem;
  text-align: center;
}

.avatar-info h3 {
  font-size: 1.75rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.avatar-info p {
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* ========================================
   Section Headers
   ======================================== */
section {
  padding: 5rem 2rem;
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3rem;
}

.section-header h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* ========================================
   Map Section
   ======================================== */
/* TASK 2: Map section - seamless transition, no black line */
.map-section {
  background: var(--bg-secondary);
  padding-bottom: 60px;
  margin-bottom: 0 !important;
}

/* TASK 1 & 2: Map Container with fixed height and spacing */
.map-container {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  height: 550px !important;
  min-height: 550px;
  max-height: 600px;
  position: relative;
  overflow: hidden;
  /* TASK 3: Visual separation */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border-radius: 15px;
}

/* TASK 1: Mapbox fixed dimensions */
.mapbox {
  background: var(--bg-card);
  border-radius: 15px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  height: 100% !important;
  width: 100%;
}

/* TASK 1: Xweather Container fixed dimensions */
#xweather-container,
.xweather-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 550px !important;
  min-height: 550px;
  background: var(--bg-card);
  border-radius: 15px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  z-index: 100;
}

/* TASK 1: Iframe styling */
.xweather-container iframe,
#xweather-container iframe {
  width: 100% !important;
  height: 100% !important;
  border: none !important;
  border-radius: 15px;
  display: block;
}

/* TASK 4: Xweather Attribution */
.xweather-attribution {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 4px;
  z-index: 101;
  backdrop-filter: blur(4px);
}

/* TASK: Return to Map Button */
.map-overlay-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(10, 15, 30, 0.95);
  color: #00ced1;
  border: 1px solid rgba(0, 206, 209, 0.3);
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  z-index: 9999;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.map-overlay-btn:hover {
  background: rgba(0, 206, 209, 0.2);
  border-color: rgba(0, 206, 209, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 206, 209, 0.3);
}

.map-overlay-btn:active {
  transform: translateY(0);
}

/* TASK 1: Map container needs relative positioning for button */
.map-container {
  position: relative;
}

/* TASK 1: Fullscreen Button - positioned inside wrapper */
#fullscreen-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  left: auto;
  z-index: 2000;
  padding: 10px 12px;
  background: rgba(8, 12, 24, 0.62);
  color: rgba(229, 231, 235, 0.95);
  border: 1px solid rgba(0, 240, 255, 0.18);
  border-radius: 14px;
  cursor: pointer;
  transition: 0.3s;
  font-size: 13px;
  font-weight: 500;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(0, 240, 255, 0.10);
}

#fullscreen-btn:hover {
  background: rgba(0, 240, 255, 0.08);
  border-color: rgba(0, 240, 255, 0.30);
  transform: translateY(-1px);
}

/* TASK 1: Fullscreen Utility Class */
.map-fullscreen-mode {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 99999 !important;
  border-radius: 0 !important;
  margin: 0 !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
}

/* Legacy sidebar layer UI removed (Command Center replaces it) */

.layer-toggle input[type="radio"] {
  border-radius: 50%;
}

.layer-toggle input[type="checkbox"]:checked,
.layer-toggle input[type="radio"]:checked {
  background: var(--primary);
  border-color: var(--primary);
}

.layer-toggle input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #000;
  font-size: 14px;
  font-weight: bold;
}

.layer-toggle input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background: #000;
  border-radius: 50%;
}

.layer-toggle span {
  font-size: 14px;
  color: var(--text-primary);
  user-select: none;
}

/* TASK 2: Layer Groups */
.layer-group {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.layer-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.layer-group-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

/* TASK 2: Opacity Controls */
.opacity-control {
  margin-left: 1.5rem;
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
}

.opacity-control label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.opacity-control input[type="range"] {
  width: 100%;
  height: 4px;
  background: var(--border-color);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.opacity-control input[type="range"]::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  -webkit-appearance: none;
}

.opacity-control input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

/* Map Legend */
.map-legend {
  font-family: 'Inter', sans-serif;
}

/* ========================================
   Data Section
   ======================================== */
/* TASK 2: Data section with top spacing to separate from map */
/* TASK 2: Data section - seamless with map section above */
.data-section {
  background: var(--bg-primary);
  padding-top: 60px;
  margin-top: 0 !important;
}

.data-grid {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.data-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
}

.data-card h3 {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.data-card canvas {
  max-height: 250px;
}

/* ========================================
   Chat Section
   ======================================== */
.chat-section {
  background: 
    radial-gradient(ellipse at 50% 100%, rgba(0, 206, 209, 0.05) 0%, transparent 50%),
    var(--bg-secondary);
  min-height: 100vh;
}

.chat-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
  height: calc(100vh - 300px);
  min-height: 500px;
}

.chat-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
}

.casea-profile {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  border: 1px solid var(--border-color);
}

/* Mini avatar in chat profile */
.casea-profile .mini-avatar-wrapper {
  margin: 0 auto 1rem auto;
}

.casea-profile h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.casea-profile .badge {
  display: inline-block;
  background: linear-gradient(135deg, rgba(0, 206, 209, 0.2), rgba(0, 127, 255, 0.2));
  color: var(--primary);
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.casea-profile > p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.capabilities {
  margin-top: 1.5rem;
  text-align: left;
}

.capabilities h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.capabilities ul {
  list-style: none;
}

.capabilities li {
  padding: 0.4rem 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.capabilities li::before {
  content: '✓';
  color: var(--primary);
}

/* Chat History */
.chat-history {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  flex: 1;
}

.chat-history h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Chat Main */
.chat-main {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message {
  display: flex;
  gap: 0.75rem;
  max-width: 80%;
}

.message.user-message {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.message-avatar canvas {
  width: 100%;
  height: 100%;
}

.user-message .message-avatar {
  background: var(--text-muted);
}

.message-content {
  background: var(--bg-glass);
  padding: 1rem;
  border-radius: 18px;
  border-bottom-left-radius: 4px;
}

.user-message .message-content {
  background: linear-gradient(135deg, rgba(0, 206, 209, 0.2), rgba(0, 127, 255, 0.2));
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 4px;
}

.message-content p {
  font-size: 0.95rem;
  line-height: 1.5;
}

.message-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 0.25rem;
  padding: 0.5rem 0;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Chat Input */
.chat-input-area {
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.quick-actions button {
  padding: 0.5rem 1rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.quick-actions button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.input-wrapper {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 0.5rem;
}

.voice-btn,
.send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.voice-btn {
  background: transparent;
  color: var(--text-muted);
}

.voice-btn:hover {
  background: var(--bg-card);
  color: var(--primary);
}

.voice-btn.recording {
  background: #ff4444;
  color: white;
  animation: pulse 1.5s infinite;
}

.send-btn {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
}

.send-btn:hover {
  transform: scale(1.05);
}

.chat-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1rem;
  padding: 0 0.5rem;
  outline: none;
}

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

/* ========================================
   Footer (NASA-punk / telemetry strip)
   ======================================== */
.footer {
  --footer-spacex-orange: #ff5a2c;
  --footer-spacex-glow: rgba(255, 90, 44, 0.55);
  position: relative;
  padding: 1.5rem 2rem 1.35rem;
  background: rgba(10, 12, 16, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(0, 242, 255, 0.22);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
}

.footer-brand-col {
  flex: 1 1 0;
  min-width: 0;
  text-align: left;
}

.footer-logo {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  display: inline-block;
}

.footer-tagline {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #9ca3af;
  max-width: 20rem;
}

.footer-support-wrap {
  flex: 0 0 auto;
  text-align: center;
}

.footer-support-link {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--footer-spacex-orange);
  text-decoration: none;
  text-shadow:
    0 0 10px var(--footer-spacex-glow),
    0 0 22px rgba(255, 90, 44, 0.22);
  transition:
    color 0.25s ease,
    text-shadow 0.25s ease,
    filter 0.25s ease;
}

.footer-support-link:hover {
  color: #ff7a4d;
  text-shadow:
    0 0 14px rgba(255, 122, 77, 0.75),
    0 0 28px rgba(255, 90, 44, 0.35);
  filter: brightness(1.08);
}

.footer-support-link:focus-visible {
  outline: 1px solid var(--footer-spacex-orange);
  outline-offset: 4px;
}

.footer-contact-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.footer-contact-email-row {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s ease;
}

.footer-contact-email-row:hover .footer-contact-email {
  color: #e8eaed;
}

.footer-contact-email-row:focus-visible {
  outline: 1px solid rgba(200, 205, 212, 0.45);
  outline-offset: 3px;
  border-radius: 2px;
}

.footer-contact-mail-icon {
  flex-shrink: 0;
  color: #9aa3b2;
  opacity: 0.9;
}

.footer-contact-email-row:hover .footer-contact-mail-icon {
  color: #c8cdd4;
}

.footer-contact-email {
  font-size: 0.8125rem;
  color: #c8cdd4;
  letter-spacing: 0.02em;
  user-select: text;
}

.footer-linkedin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #b8c0cc;
  text-decoration: none;
  transition: color 0.2s ease, filter 0.2s ease;
}

.footer-linkedin:hover {
  color: #2d9cdb;
  filter: drop-shadow(0 0 6px rgba(45, 156, 219, 0.45));
}

.footer-linkedin:focus-visible {
  outline: 1px solid rgba(45, 156, 219, 0.7);
  outline-offset: 3px;
  border-radius: 2px;
}

.footer-bottom {
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
}

.footer-copyright {
  font-size: 0.75rem;
  line-height: 1.5;
  color: #8b9199;
  margin: 0;
}

/* ========================================
   Toast Notifications
   ======================================== */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: toastIn 0.3s ease;
  max-width: 400px;
}

.toast.success { border-left: 3px solid #22c55e; }
.toast.error { border-left: 3px solid #ef4444; }
.toast.info { border-left: 3px solid var(--primary); }

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1024px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .hero-text > p {
    margin-left: auto;
    margin-right: auto;
  }
  
  .hero-actions {
    justify-content: center;
  }
  
  .hero-avatar {
    order: -1;
  }
  
  .avatar-container {
    width: 300px;
    height: 300px;
  }
  
  .map-container {
    grid-template-columns: 1fr;
    height: auto;
  }
  
  .mapbox {
    height: 400px;
  }
  
  .chat-container {
    grid-template-columns: 1fr;
    height: auto;
  }
  
  .chat-sidebar {
    display: none;
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: 0 1rem;
  }
  
  .nav-links {
    display: none;
  }
  
  .hero-stats {
    justify-content: center;
    gap: 1.5rem;
  }
  
  .stat-value {
    font-size: 1.5rem;
  }
  
  .data-grid {
    grid-template-columns: 1fr;
  }
  
  .modal-content {
    grid-template-columns: 1fr;
  }
  
  .auth-left {
    display: none;
  }
  
  .footer-top {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer-brand-col {
    flex: none;
    text-align: center;
    width: 100%;
  }

  .footer-support-wrap {
    flex: none;
  }

  .footer-contact-col {
    flex: none;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ========================================
   TASK 1: SCOPED NATIVE AVATAR STYLES
   ======================================== */

/* --- BUG FIX 1: MINI AVATAR WRAPPER & SCALER --- */
/* Wrapper for navbar/chat avatars */
.casea-mini-wrapper {
  width: 50px;
  height: 50px;
  overflow: hidden;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}

/* Chat version slightly larger */
.casea-mini-wrapper.chat-mini-wrapper {
  width: 60px;
  height: 60px;
  margin: 0 auto 1rem auto;
}

/* Scale down the hero avatar clone */
.casea-mini-wrapper .casea-hero-avatar {
  width: 300px !important;
  height: 300px !important;
  transform: scale(0.16);
  transform-origin: top left;
  position: absolute;
  top: 0;
  left: 0;
}

/* Chat version slightly different scale */
.casea-mini-wrapper.chat-mini-wrapper .casea-hero-avatar {
  transform: scale(0.2);
}

/* --- HERO AVATAR (~300-400px) - DO NOT MODIFY --- */
.casea-hero-avatar {
  width: 320px;
  height: 320px;
}

.casea-hero-avatar .scoped-avatar-container {
  width: 100%;
  height: 100%;
  position: relative;
  background: transparent;
}

.casea-hero-avatar .scoped-avatar-container canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Responsive scaling */
@media (max-width: 768px) {
  .casea-hero-avatar {
    width: 260px;
    height: 260px;
  }
}

/* ========================================
   Audio-Reactive Avatar Animation
   ======================================== */

/* Pulse animation when speaking */
.casea-mini-wrapper.casea-speaking,
.casea-hero-avatar.casea-speaking {
  animation: avatar-pulse 0.6s infinite alternate ease-in-out;
  filter: drop-shadow(0 0 15px #00ced1);
}

@keyframes avatar-pulse {
  from {
    transform: scale(1);
    opacity: 0.9;
  }
  to {
    transform: scale(1.05);
    opacity: 1;
  }
}

/* ========================================
   Floating Chat Widget
   ======================================== */

/* Floating Toggle Button */
.chat-toggle-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  padding: 14px 24px;
  background: linear-gradient(135deg, #00a8b5 0%, #008b8b 100%);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 168, 181, 0.4);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-toggle-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 168, 181, 0.5);
}

.chat-toggle-btn.hidden {
  display: none !important;
}

/* Floating Chat Panel */
.floating-chat-panel {
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: 380px;
  height: 550px;
  background: var(--bg-card, #1a1d23);
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-color, #2a2e3a);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: bottom right;
}

.floating-chat-panel.hidden {
  opacity: 0;
  visibility: hidden;
  transform: scale(0.9) translateY(20px);
  pointer-events: none;
}

/* Floating Chat Header */
.floating-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, #00a8b5 0%, #008b8b 100%);
  color: white;
  flex-shrink: 0;
}

.floating-chat-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.casea-mini-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.casea-mini-avatar iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.floating-chat-close {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.floating-chat-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Floating Chat Messages */
.floating-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: var(--bg-primary, #12151c);
}

.floating-chat-messages .message {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  animation: message-slide-in 0.3s ease;
}

@keyframes message-slide-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.floating-chat-messages .message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00a8b5 0%, #008b8b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}

.floating-chat-messages .message.user-message .message-avatar {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}

.floating-chat-messages .message-content {
  flex: 1;
  background: var(--bg-card, #1a1d23);
  padding: 12px 14px;
  border-radius: 14px;
  border-top-left-radius: 4px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary, #e8eaed);
  max-width: calc(100% - 50px);
}

.floating-chat-messages .message.user-message .message-content {
  background: linear-gradient(135deg, #00a8b5 0%, #008b8b 100%);
  color: white;
  border-radius: 14px;
  border-top-right-radius: 4px;
}

.floating-chat-messages .message-time {
  display: block;
  font-size: 11px;
  color: var(--text-secondary, #9aa0a6);
  margin-top: 6px;
}

.floating-chat-messages .message.user-message .message-time {
  color: rgba(255, 255, 255, 0.7);
}

/* Floating Chat Input Area */
.floating-chat-input-area {
  padding: 16px;
  background: var(--bg-card, #1a1d23);
  border-top: 1px solid var(--border-color, #2a2e3a);
  flex-shrink: 0;
}

.floating-chat-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.floating-chat-quick-actions button {
  padding: 6px 12px;
  background: rgba(0, 168, 181, 0.1);
  border: 1px solid rgba(0, 168, 181, 0.3);
  border-radius: 16px;
  font-size: 12px;
  color: #00a8b5;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.floating-chat-quick-actions button:hover {
  background: rgba(0, 168, 181, 0.2);
  border-color: #00a8b5;
}

.floating-input-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
}

.floating-input-wrapper input {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-primary, #12151c);
  border: 1px solid var(--border-color, #2a2e3a);
  border-radius: 25px;
  color: var(--text-primary, #e8eaed);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.floating-input-wrapper input:focus {
  border-color: #00a8b5;
}

.floating-input-wrapper input::placeholder {
  color: var(--text-secondary, #9aa0a6);
}

.floating-input-wrapper button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #00a8b5 0%, #008b8b 100%);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.floating-input-wrapper button:hover {
  transform: scale(1.05);
}

.floating-input-wrapper .voice-btn {
  background: var(--bg-primary, #12151c);
  border: 1px solid var(--border-color, #2a2e3a);
}

.floating-input-wrapper .voice-btn:hover {
  border-color: #00a8b5;
  color: #00a8b5;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: var(--bg-card, #1a1d23);
  border-radius: 14px;
  border-top-left-radius: 4px;
  width: fit-content;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: #00a8b5;
  border-radius: 50%;
  animation: typing-bounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Responsive Floating Chat */
@media (max-width: 480px) {
  .floating-chat-panel {
    width: calc(100vw - 32px);
    height: 60vh;
    bottom: 80px;
    right: 16px;
    left: 16px;
  }
  
  .chat-toggle-btn {
    bottom: 16px;
    right: 16px;
    padding: 12px 20px;
    font-size: 14px;
  }
}

/* Scrollbar for floating chat */
.floating-chat-messages::-webkit-scrollbar {
  width: 6px;
}

.floating-chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.floating-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 168, 181, 0.3);
  border-radius: 3px;
}

.floating-chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 168, 181, 0.5);
}

/* ========================================
   Floating Draggable Avatar & Popup
   ======================================== */

/* Floating Avatar */
.floating-avatar {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 65px;
  height: 65px;
  border-radius: 50%;
  border: 2px solid #00f0ff;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.5);
  background: #0a1423;
  cursor: grab;
  z-index: 10000;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  user-select: none;
  touch-action: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.floating-avatar:active,
.floating-avatar.dragging {
  cursor: grabbing;
  transform: scale(1.1);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.8);
}

.floating-avatar .avatar-initials {
  font-size: 24px;
  font-weight: 700;
  color: #00f0ff;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
  pointer-events: none;
}

/* Floating Popup */
.floating-popup {
  position: fixed;
  bottom: 110px;
  right: 30px;
  width: 350px;
  height: 500px;
  background: rgba(10, 20, 35, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid #00f0ff;
  border-radius: 15px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.floating-popup.hidden {
  display: none;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.95) translateY(10px);
}

/* Popup Header */
.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: rgba(0, 240, 255, 0.1);
  border-bottom: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 15px 15px 0 0;
  flex-shrink: 0;
}

.popup-header span:first-child {
  font-weight: 600;
  color: #00f0ff;
  font-size: 16px;
}

.popup-header span:last-child {
  color: #8b949e;
  font-size: 18px;
  padding: 5px;
  border-radius: 50%;
  transition: all 0.2s;
}

.popup-header span:last-child:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Popup Messages */
.popup-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.popup-message {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  animation: popup-msg-in 0.3s ease;
}

@keyframes popup-msg-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.popup-message.user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(0, 150, 200, 0.15));
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.popup-message.casea {
  align-self: flex-start;
  background: rgba(30, 40, 60, 0.8);
  border: 1px solid rgba(0, 240, 255, 0.15);
  color: #c9d1d9;
  border-bottom-left-radius: 4px;
}

.popup-message .msg-time {
  display: block;
  font-size: 11px;
  color: #6e7681;
  margin-top: 6px;
}

/* Popup Input Area */
.popup-input-area {
  display: flex;
  gap: 10px;
  padding: 15px 20px;
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: 0 0 15px 15px;
  flex-shrink: 0;
}

.popup-input-area input {
  flex: 1;
  padding: 12px 16px;
  background: rgba(20, 30, 50, 0.8);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 25px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
}

.popup-input-area input:focus {
  border-color: #00f0ff;
  background: rgba(20, 30, 50, 1);
}

.popup-input-area input::placeholder {
  color: #6e7681;
}

.popup-input-area button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(0, 150, 200, 0.15));
  color: #00f0ff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  border: 1px solid rgba(0, 240, 255, 0.3);
  flex-shrink: 0;
}

.popup-input-area button:hover {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.3), rgba(0, 150, 200, 0.25));
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
}

/* Scrollbar for popup messages */
.popup-messages::-webkit-scrollbar {
  width: 6px;
}

.popup-messages::-webkit-scrollbar-track {
  background: transparent;
}

.popup-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.2);
  border-radius: 3px;
}

.popup-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 240, 255, 0.4);
}

/* Responsive */
@media (max-width: 480px) {
  .floating-avatar {
    width: 55px;
    height: 55px;
    bottom: 20px;
    right: 20px;
  }
  
  .floating-avatar .avatar-initials {
    font-size: 20px;
  }
  
  .floating-popup {
    width: calc(100vw - 40px);
    height: 60vh;
    bottom: 90px;
    right: 20px;
    left: 20px;
  }
}

/* ========================================
   Tricky Casea Avatar (Hiyleli)
   ======================================== */

.floating-avatar-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 10000;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.floating-avatar-container.dragging {
  cursor: grabbing;
}

.tricky-black-background {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: black;
  border: 2px solid #00f0ff;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.floating-avatar-container:hover .tricky-black-background {
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.6);
}

.floating-avatar-container.dragging .tricky-black-background {
  transform: scale(1.1);
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.8);
}

.original-casea-image {
  max-width: 90%;
  max-height: 90%;
  transform: scale(0.9);
  pointer-events: none;
  object-fit: contain;
}

/* Responsive */
@media (max-width: 480px) {
  .floating-avatar-container {
    bottom: 20px;
    right: 20px;
  }
  
  .tricky-black-background {
    width: 60px;
    height: 60px;
  }
}

/* ========================================
   Live Animated Casea Avatar (Draggable)
   ======================================== */

/* ========================================
   OPTIMIZED LIVE IFRAME AVATAR - SCALE & ACCELERATE
   ======================================== */

/* Wrapper - the visible 80x80 circle */
.live-avatar-wrapper { 
  position: fixed; 
  bottom: 30px; 
  right: 30px; 
  width: 80px; 
  height: 80px; 
  border-radius: 50%; 
  background: #000; 
  border: 2px solid #00f0ff; 
  box-shadow: 0 0 15px rgba(0,240,255,0.6); 
  z-index: 10000; 
  overflow: hidden; 
  cursor: grab; 
  user-select: none;
  touch-action: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.live-avatar-wrapper:active,
.live-avatar-wrapper.dragging {
  cursor: grabbing;
  transform: scale(1.1);
  box-shadow: 0 0 35px rgba(0, 240, 255, 0.9);
}

/* Oversize iframe - rendered at 800x800 then scaled down 10x */
.live-avatar-iframe { 
  width: 800px; 
  height: 800px; 
  border: none; 
  transform: scale(0.1); 
  transform-origin: top left; 
  pointer-events: none; 
  will-change: transform; /* Hardware Acceleration */
}

/* Legacy frame class (for backwards compatibility) */
.live-casea-frame {
  width: 800px; 
  height: 800px; 
  border: none; 
  transform: scale(0.1); 
  transform-origin: top left; 
  pointer-events: none; 
  will-change: transform;
}

/* Drag shield to capture mouse/touch events */
.drag-shield { 
  position: absolute; 
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%; 
  z-index: 10; 
  background: transparent; 
  cursor: grab;
}

.live-avatar-wrapper.dragging .drag-shield {
  cursor: grabbing;
}

/* Responsive */
@media (max-width: 480px) {
  .live-avatar-wrapper {
    width: 65px;
    height: 65px;
    bottom: 20px;
    right: 20px;
  }
}

/* ========================================
   VIDEO AVATAR - Performance Optimized
   ======================================== */

/* Video avatar with transparent background effect */
.video-avatar {
    width: 100%; height: 100%;
    object-fit: cover; 
    transform: scale(1.35); /* Zooms in the video slightly so Casea fills the circle nicely */
    pointer-events: none;
    mix-blend-mode: screen; /* Now it only blends with #050d1a, not the map! */
}

/* Lightweight floater for video avatar - transparent background */
.lightweight-floater {
    position: fixed; bottom: 30px; right: 30px; width: 65px; height: 65px;
    background-color: #050d1a; /* Crucial: Solid dark background to blend against */
    isolation: isolate; /* CRITICAL: Stops the blend mode from bleeding into the map! */
    border: 2px solid #00f0ff; border-radius: 50%;
    z-index: 10000; cursor: grab; display: flex; justify-content: center; align-items: center;
    overflow: hidden; box-shadow: 0 0 15px rgba(0,240,255,0.4);
}

/* Update casea-perfect-mini for video avatars */
.casea-perfect-mini .video-avatar {
  width: 100%;
  height: 100%;
  transform: none;
  position: static;
}

/* ========================================
   AI THINKING BOX (Chain of Thought Process)
   ======================================== */
.ai-thinking-box { 
    margin-bottom: 10px; 
    font-size: 0.85rem; 
    color: #8892b0; 
    background: rgba(10, 20, 35, 0.5); 
    border-left: 2px solid #00f0ff; 
    border-radius: 4px; 
    padding: 5px 10px; 
}

.ai-thinking-box summary { 
    cursor: pointer; 
    font-weight: bold; 
    color: #00f0ff; 
    opacity: 0.8; 
}

.ai-thinking-box details[open] summary { 
    margin-bottom: 5px; 
    opacity: 1; 
}

.thinking-content { 
    font-style: italic; 
    opacity: 0.7; 
    white-space: pre-wrap; 
}

/* Gündəlik hesabat kartları: frontend/css/daily-analyses.css (#daily-analyses) */

/* ================================
   Ecological Command Center Panel
   (Right-side layer switcher)
   ================================ */
.map-container {
  position: relative;
}

.command-center-panel {
  position: absolute;
  top: 60px;
  bottom: 180px;
  right: 15px;
  left: auto;
  width: 260px;
  z-index: 2000;
  padding: 14px 14px 12px 14px;
  border-radius: 16px;
  background: rgba(8, 12, 24, 0.62);
  border: 1px solid rgba(0, 240, 255, 0.18);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(0, 240, 255, 0.10);
  pointer-events: auto;
  height: auto !important;
  max-height: none !important;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Standalone Location Widget (Bottom-Right) */
.location-widget {
  position: absolute;
  bottom: 15px;
  right: 15px;
  z-index: 2000;
  width: auto;
  min-width: 250px;
  height: 150px;
  max-height: 150px;
  overflow-y: auto;
  padding: 12px 12px 10px 12px;
  border-radius: 16px;
  background: rgba(8, 12, 24, 0.62);
  border: 1px solid rgba(0, 240, 255, 0.18);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(0, 240, 255, 0.10);
  pointer-events: auto;
}

.location-widget .lw-title {
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(0, 240, 255, 0.95);
  margin-bottom: 8px;
}

.location-widget .lw-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.location-widget .lw-row:first-of-type {
  border-top: none;
}

.location-widget .lw-k {
  color: rgba(160, 160, 176, 0.95);
  font-size: 0.9rem;
}

.location-widget .lw-v {
  color: rgba(229, 231, 235, 0.95);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.command-center-panel .cc-timemachine {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.command-center-panel .cc-tm-label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(160, 160, 176, 0.95);
}

.command-center-panel .cc-tm-select {
  width: 100%;
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 240, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(229, 231, 235, 0.95);
  outline: none;
  cursor: pointer;
  transition: border-color 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}

.command-center-panel .cc-tm-select:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 240, 255, 0.30);
  box-shadow: 0 0 22px rgba(0, 240, 255, 0.12);
}

.command-center-panel .cc-tm-select:focus {
  border-color: rgba(0, 240, 255, 0.36);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.10);
}

.command-center-panel .cc-compare {
  width: 100%;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid rgba(0, 240, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(229, 231, 235, 0.95);
  cursor: pointer;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease, background 220ms ease;
}

.command-center-panel .cc-compare:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 240, 255, 0.30);
  box-shadow: 0 0 22px rgba(0, 240, 255, 0.12);
}

.command-center-panel .cc-compare.active {
  border-color: rgba(0, 240, 255, 0.40);
  background: rgba(0, 240, 255, 0.08);
  box-shadow:
    0 12px 26px rgba(0, 0, 0, 0.42),
    0 0 30px rgba(0, 240, 255, 0.18);
}

/* Scrollbar styling (WebKit + Firefox) */
.command-center-panel::-webkit-scrollbar {
  width: 10px;
}
.command-center-panel::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.20);
  border-radius: 10px;
}
.command-center-panel::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(0, 240, 255, 0.28), rgba(0, 206, 209, 0.18));
  border: 1px solid rgba(0, 240, 255, 0.18);
  border-radius: 10px;
}
.command-center-panel::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(0, 240, 255, 0.38), rgba(0, 206, 209, 0.24));
}
.command-center-panel {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 240, 255, 0.28) rgba(0, 0, 0, 0.20);
}

/* Map loading spinner for high-res GEE swaps */
.gee-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 10, 20, 0.22);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  pointer-events: none;
}

.gee-loading-overlay.hidden {
  display: none;
}

.gee-spinner {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: rgba(0, 240, 255, 0.85);
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.25);
  animation: geeSpin 800ms linear infinite;
}

@keyframes geeSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ================================
   Leaflet Side-by-Side: force top
   ================================ */
.leaflet-sbs {
  z-index: 9999 !important;
  pointer-events: none; /* Let clicks pass through the container... */
}

.leaflet-sbs-divider,
.leaflet-sbs-range {
  z-index: 10000 !important;
  pointer-events: auto !important; /* ...but explicitly catch drags on the slider/divider */
  cursor: ew-resize !important;
}

/* Safety net: never show Leaflet's default layer control */
.leaflet-control-layers {
  display: none !important;
}

/* Compare year badges */
.compare-badge {
  position: absolute;
  top: 14px;
  z-index: 4000;
  pointer-events: none;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(8, 12, 24, 0.62);
  border: 1px solid rgba(0, 240, 255, 0.18);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  color: rgba(229, 231, 235, 0.95);
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.40),
    0 0 0 1px rgba(0, 240, 255, 0.10);
}

.compare-badge-left {
  left: 14px;
  color: rgba(0, 240, 255, 0.95);
}

.compare-badge-right {
  right: 14px;
}

.command-center-panel .cc-title {
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(0, 240, 255, 0.95);
  margin-bottom: 10px;
}

.command-center-panel .cc-buttons {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.command-center-panel .cc-overlays {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding-top: 4px;
}

.command-center-panel .cc-ov-title {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(160, 160, 176, 0.95);
}

.command-center-panel .cc-switch {
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.command-center-panel .cc-switch input {
  display: none;
}

.command-center-panel .cc-slider {
  width: 38px;
  height: 22px;
  border-radius: 999px;
  position: relative;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: background 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.command-center-panel .cc-slider::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  transform: translateY(-50%);
  background: rgba(229, 231, 235, 0.9);
  transition: transform 200ms ease, background 200ms ease;
}

.command-center-panel .cc-switch input:checked + .cc-slider {
  background: rgba(0, 240, 255, 0.18);
  border-color: rgba(0, 240, 255, 0.28);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.12);
}

.command-center-panel .cc-switch input:checked + .cc-slider::after {
  transform: translate(16px, -50%);
  background: rgba(0, 240, 255, 0.95);
}

.command-center-panel .cc-switch-label {
  color: rgba(229, 231, 235, 0.92);
  font-size: 0.92rem;
}

.command-center-panel .cc-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(229, 231, 235, 0.92);
  border-radius: 12px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease, background 220ms ease;
  will-change: transform, box-shadow;
}

.command-center-panel .cc-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 240, 255, 0.28);
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.35),
    0 0 22px rgba(0, 240, 255, 0.14);
}

.command-center-panel .cc-btn.active {
  border-color: rgba(0, 240, 255, 0.40);
  background: rgba(0, 240, 255, 0.08);
  box-shadow:
    0 12px 26px rgba(0, 0, 0, 0.42),
    0 0 30px rgba(0, 240, 255, 0.18);
}

.command-center-panel .cc-fullscreen {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 206, 209, 0.24);
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.10), rgba(0, 206, 209, 0.06));
  color: rgba(229, 231, 235, 0.95);
  cursor: pointer;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.command-center-panel .cc-fullscreen:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 240, 255, 0.34);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.4),
    0 0 26px rgba(0, 240, 255, 0.16);
}

.command-center-panel .cc-fs-icon {
  font-size: 1.05rem;
  color: rgba(0, 240, 255, 0.95);
}

.daily-analysis-code {
  margin: 0;
  padding: 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(0, 206, 209, 0.18);
  color: #cbd5e1;
  overflow: auto;
  white-space: pre;
}

.daily-analysis-thinking {
  margin: 0;
  padding: 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(0, 240, 255, 0.25);
  color: #8bdcff;
  overflow: auto;
  white-space: pre-wrap;
}

/* ========================================
   Premium Floating Mini Chat
   ======================================== */
.casea-mini-chat,
.mini-chat-window {
  position: fixed;
  width: 360px;
  max-width: calc(100vw - 24px);
  height: 460px;
  max-height: calc(100vh - 24px);
  right: 110px;
  bottom: 110px;
  z-index: 2147483647 !important;
  background: rgba(20, 20, 25, 0.7) !important;
  backdrop-filter: blur(15px) !important;
  -webkit-backdrop-filter: blur(15px) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 16px !important;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.5) !important;
  overflow: hidden;
  display: none;
  grid-template-rows: auto 1fr auto;
}

/* In map-only fullscreen, keep mini chat in top overlay and clickable */
#map-container:fullscreen #casea-mini-chat,
#map-container:fullscreen .mini-chat-window {
  z-index: 2147483647 !important;
  pointer-events: auto;
}

/* Fullscreen-only mini chat toggle icon (avatar-style) */
#casea-mini-chat-fs-toggle {
  display: none;
  position: absolute;
  right: 22px;
  bottom: 22px;
  width: 64px;
  height: 64px;
  border: 2px solid #00f0ff;
  border-radius: 50%;
  background: #000;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.65);
  cursor: pointer;
  z-index: 2147483647;
  overflow: hidden;
  padding: 0;
}

#casea-mini-chat-fs-toggle .video-avatar {
  width: 100%;
  height: 100%;
}

#casea-mini-chat-fs-toggle:hover {
  box-shadow: 0 0 26px rgba(0, 240, 255, 0.9);
  transform: scale(1.04);
}

#map-container:fullscreen #casea-mini-chat-fs-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
}

.casea-mini-chat.hidden,
.mini-chat-window.hidden {
  display: none !important;
}

.casea-mini-chat.show,
.mini-chat-window.show {
  display: grid !important;
}

.casea-mini-chat-header,
.mini-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  color: #dff8ff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  cursor: grab;
  user-select: none;
}

#mini-chat-header-title {
  font-weight: 600;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 0 10px rgba(0, 255, 204, 0.4), 0 0 20px rgba(79, 172, 254, 0.2);
}

.casea-mini-chat-header button,
.mini-chat-header button {
  border: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #d5e7ff;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease;
}

.casea-mini-chat-header button:hover,
.mini-chat-header button:hover {
  transform: scale(1.06);
  background: rgba(255, 255, 255, 0.14);
}

.casea-mini-chat-messages {
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mini-msg {
  padding: 10px 12px;
  border-radius: 12px;
  max-width: 90%;
  line-height: 1.5;
  font-size: 0.9rem;
}

.mini-msg.assistant {
  background: transparent;
  border: none;
  color: #d9e3f7;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding-left: 0;
}

.mini-msg.user {
  align-self: flex-end;
  background: #2c2c2e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f5fbff;
  border-radius: 20px;
}

.mini-msg-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mini-msg-text {
  flex: 1;
  max-width: calc(100% - 30px);
}

.casea-mini-chat-input {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.casea-mini-chat-input input {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(6, 10, 20, 0.55);
  color: #e8f2ff;
  outline: none;
}

.casea-mini-chat-input button {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #00ced1, #007fff);
  color: white;
  cursor: pointer;
}

#casea-mini-chat-mic {
  width: 42px;
  padding: 10px 0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.mini-mic-btn {
  background: linear-gradient(135deg, rgba(30, 30, 36, 0.8), rgba(20, 20, 25, 0.9)) !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  border-radius: 50% !important;
  width: 36px !important;
  height: 36px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: rgba(255, 255, 255, 0.6) !important;
  transition: all 0.3s ease !important;
  cursor: pointer !important;
  box-shadow: inset 0 2px 5px rgba(255, 255, 255, 0.05), 0 5px 15px rgba(0, 0, 0, 0.4) !important;
}

.mini-mic-btn:hover {
  background: linear-gradient(135deg, rgba(40, 40, 48, 0.9), rgba(30, 30, 36, 1)) !important;
  box-shadow: 0 0 12px rgba(0, 255, 204, 0.6) !important;
  transform: translateY(-2px);
  color: #00ffcc !important;
}

#casea-mini-chat-mic.mic-active {
  color: #00ffcc;
  animation: micPulse 1.5s infinite;
}

@keyframes micPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(0, 255, 204, 0.18);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(0, 255, 204, 0);
  }
}

/* ========================================
   Video carousel — WebVTT subtitles (::cue)
   ======================================== */
video.casea-subtitled::cue {
  color: #ffffff;
  background-color: rgba(0, 0, 0, 0.82);
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 105%;
  font-weight: 600;
  line-height: 1.35;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
}

video.casea-subtitled::-webkit-media-text-track-display {
  overflow: visible !important;
}
