/* ============================================================
   SOLM8.AI Dashboard - Colorful Mosaic Theme
   Matches the vibrant landing page voice interface
   ============================================================ */

:root {
  /* Core Colors */
  --bg-black: #000000;
  --text-black: #000000;
  --white: #ffffff;

  /* Mosaic Colors */
  --mosaic-colors: #FF6B9D, #FEC860, #5DE6FF, #C06CFF, #90FF6A, #FF9F40, #4ECDC4, #FF6B6B, #95E1D3, #F38181;

  /* Layout */
  --header-height: 64px;
  --border-radius: 32px;
  --button-radius: 50px;

  /* Glass Effects */
  --glass-blur: blur(20px);
  --glass-bg: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.2);
}

/* Extras & Unlocks Styles */
.settings-checkbox.unlocked {
  opacity: 1 !important;
  cursor: pointer !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

.settings-checkbox.unlocked:hover {
  background: rgba(255, 255, 255, 0.05) !important;
}

/* Locked checkboxes - prevent all interaction */
.settings-checkbox.locked {
  opacity: 0.6 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

.settings-checkbox.locked input[type="checkbox"] {
  pointer-events: none !important;
  cursor: not-allowed !important;
}

.locked-content.unlocked {
  opacity: 1 !important;
  pointer-events: auto !important;
}

.badge-lock.unlocked {
  display: none;
}

/* Global Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-black);
  color: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Dashboard Wrapper */
.dashboard-wrapper {
  min-height: 100vh;
  background: var(--bg-black);
  position: relative;
}

/* Starfield Background */
.starfield {
  position: fixed;
  inset: 0;
  background: var(--bg-black);
  z-index: 1;
}

/* Main Content */
.main-content {
  position: relative;
  z-index: 2;
  padding-top: calc(var(--header-height) + 2rem);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  padding: 2rem;
}

/* Voice Chat Container */
.voice-chat-container {
  width: 100%;
  max-width: 800px;
  aspect-ratio: 16 / 10;
  position: relative;
}

/* Mosaic Panel */
.mosaic-panel {
  position: relative;
  width: 100%;
  height: 100%;
  background: #1a1a1a;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Mosaic Canvas */
.mosaic-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Voice Content */
.voice-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  z-index: 2;
}

/* AI Logo Container */
.ai-logo-container {
  position: relative;
  width: 180px;
  height: 100px;
}

.ai-logo {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.3));
  animation: logoHeartbeat 1.9s ease-in-out infinite;
  transform-origin: center;
}

/* Logo Heartbeat Animation - matches landing page */
@keyframes logoHeartbeat {
  0% {
    transform: scale(1);
  }

  28% {
    transform: scale(1.08);
  }

  45% {
    transform: scale(0.96);
  }

  65% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

/* Additional pulse glow effect when active */
.ai-logo.active img {
  animation: logoHeartbeat 1.9s ease-in-out infinite, logoPulseGlow 4s ease-in-out infinite;
}

@keyframes logoPulseGlow {

  0%,
  100% {
    filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.3));
  }

  40% {
    filter: drop-shadow(0 0 20px rgba(144, 255, 106, 0.6));
  }

  60% {
    filter: drop-shadow(0 0 25px rgba(92, 231, 255, 0.5));
  }
}

/* Talk Button */
.btn-talk-primary {
  padding: 1.25rem 4rem;
  font-size: 1.125rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.05em;
  color: var(--text-black);
  background: var(--white);
  border: none;
  border-radius: var(--button-radius);
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: visible;
}

/* Button pulse ring */
.btn-talk-primary::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.4);
  animation: buttonPulseRing 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes buttonPulseRing {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }

  60% {
    transform: scale(1.15);
    opacity: 0;
  }

  100% {
    transform: scale(1.15);
    opacity: 0;
  }
}

.btn-talk-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.btn-talk-primary:active {
  transform: translateY(0);
}

.btn-talk-primary.active {
  background: #FF6B9D;
  color: white;
}

.btn-talk-primary.active::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: ripple 0.6s ease-out;
}

@keyframes ripple {
  to {
    width: 300%;
    height: 300%;
    opacity: 0;
  }
}

/* Phone Mode Toggle - Top Left (mirrors voice-status on top right) */
.phone-mode-toggle {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.5rem 0.75rem;
  background: white;
  border-radius: 50px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.phone-mode-toggle.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.phone-mode-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #1a1a1a;
  user-select: none;
}

/* iOS-style pill toggle */
.pill-toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  cursor: pointer;
}

.pill-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.pill-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #e0e0e0;
  border-radius: 22px;
  transition: background 0.3s ease;
}

.pill-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.pill-toggle input:checked + .pill-slider {
  background: #4CAF50;
}

.pill-toggle input:checked + .pill-slider::before {
  transform: translateX(18px);
}

/* Update label color when active */
.phone-mode-toggle:has(input:checked) .phone-mode-label {
  color: #4CAF50;
}

/* Mobile adjustments */
@media (max-width: 480px) {
  .phone-mode-toggle {
    top: 0.5rem;
    left: 0.5rem;
    gap: 6px;
    padding: 0.35rem 0.5rem;
  }

  .phone-mode-label {
    font-size: 0.55rem;
  }

  .pill-toggle {
    width: 36px;
    height: 20px;
  }

  .pill-slider::before {
    height: 16px;
    width: 16px;
  }

  .pill-toggle input:checked + .pill-slider::before {
    transform: translateX(16px);
  }
}

@media (max-width: 360px) {
  .phone-mode-label {
    font-size: 0.5rem;
  }
}

/* Minimal Header */
.header-minimal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  gap: 1rem;
}

.header-logo {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.header-logo img {
  width: 30px;
  height: 30px;
  animation: logo-glow-pulse 2s ease-in-out infinite;
}

@keyframes logo-glow-pulse {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(144, 255, 106, 0.3)); }
  50% { filter: drop-shadow(0 0 10px rgba(144, 255, 106, 0.7)) drop-shadow(0 0 18px rgba(168, 85, 247, 0.4)); }
}

/* Pixelated SOLM8 text */
.pixel-text {
  display: flex;
  align-items: center;
  gap: 2px;
}

.pixel-letter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 1px;
  width: 15px;
  height: 18px;
}

.pixel-letter.wide {
  grid-template-columns: repeat(5, 1fr);
  width: 18px;
}

.pixel-letter .p {
  border-radius: 0.5px;
}

.pixel-letter .p.on {
  background: currentColor;
}

.pixel-letter .p.off {
  background: transparent;
}

/* Animated color cycle */
.pixel-text .pixel-letter {
  animation: pixel-color-cycle 3s ease-in-out infinite;
}

.pixel-text .pixel-letter:nth-child(1) { animation-delay: 0s; }
.pixel-text .pixel-letter:nth-child(2) { animation-delay: 0.15s; }
.pixel-text .pixel-letter:nth-child(3) { animation-delay: 0.3s; }
.pixel-text .pixel-letter:nth-child(4) { animation-delay: 0.45s; }
.pixel-text .pixel-letter:nth-child(5) { animation-delay: 0.6s; }

@keyframes pixel-color-cycle {
  0%, 100% { color: #90FF6A; }
  25% { color: #a855f7; }
  50% { color: #ec4899; }
  75% { color: #3b82f6; }
}

/* Header Navigation */
.header-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  justify-content: center;
  flex: 1;
}

.header-nav a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
}

.header-nav a:hover,
.header-nav a.active {
  color: var(--white);
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

@media (max-width: 1100px) {
  .header-minimal {
    padding: 0 14px;
    gap: 0.6rem;
  }

  .header-logo span {
    display: none;
  }
}

@media (max-width: 900px) {
  .header-nav {
    gap: 0.9rem;
  }

  .header-nav a {
    font-size: 0.8rem;
  }

  .header-user {
    gap: 0.5rem;
  }

  .btn-logout {
    padding: 0.4rem 0.65rem;
    font-size: 0.8rem;
  }
}

/* User Menu */
.header-user {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
}

@media (max-width: 720px) {
  .header-minimal {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-auto-rows: auto;
    align-items: center;
    row-gap: 0.45rem;
    column-gap: 0.75rem;
    padding: 12px 16px;
    height: auto;
    background: rgba(0, 0, 0, 0.95);
  }

  .header-logo {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0;
  }

  .header-logo img {
    width: 24px;
    height: 24px;
  }

  .pixel-text {
    gap: 1px;
  }

  .pixel-letter {
    width: 12px;
    height: 15px;
  }

  .pixel-letter.wide {
    width: 15px;
  }

  .header-user {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    justify-self: flex-end;
    margin-left: 0;
    gap: 0.5rem;
    padding-top: 0;
    border-top: none;
  }

  .header-nav {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 0.35rem;
    margin-top: 0.1rem;
    /* Fallback scroll for very small screens */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .header-nav::-webkit-scrollbar {
    display: none;
  }

  .header-nav a {
    font-size: 0.7rem;
    padding: 0.45rem 0.5rem;
    background: rgba(255, 255, 255, 0.08);
    flex: 0 0 auto;
    text-align: center;
    white-space: nowrap;
  }

  .btn-logout {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
  }

  body .main-content {
    padding-top: 140px;
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.btn-logout {
  padding: 0.5rem 1rem;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.4);
}

/* Voice Status - Top right badge (moved from center to avoid logo overlap) */
.voice-status {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  left: auto;
  transform: none;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.5);
  padding: 0.4rem 0.75rem;
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

.voice-status.active {
  color: #90FF6A;
}

/* Voice Timer - Closer to bottom edge */
.voice-timer {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
  font-family: 'SF Mono', 'Monaco', monospace;
}

/* ================================================================================
   VOICE AUDIO CONTROLS - Option A: Labeled Buttons with White/Baby Blue Theme
   ================================================================================ */

/* Subtle pulse animation for active state */
@keyframes softPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(135, 206, 250, 0.4); }
  50% { box-shadow: 0 0 12px 2px rgba(135, 206, 250, 0.25); }
}

/* Container - white/light background */
.voice-audio-controls {
  display: flex;
  flex-direction: row;
  gap: 1.25rem;
  align-items: flex-start;
  justify-content: center;
  margin-top: 1.25rem;
  padding: 1rem 1.5rem 0.75rem 1.5rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 20px;
  border: 1px solid rgba(135, 206, 250, 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Control group - button + label stacked */
.control-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

/* Control label under button */
.control-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  font-weight: 600;
  white-space: nowrap;
}

/* Volume Control Row */
.volume-control-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  min-width: 100px;
  margin-top: 0.75rem; /* Push down to center with button icons */
}

/* Volume Slider */
.volume-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(135, 206, 250, 0.3);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

/* Slider track for Firefox */
.volume-slider::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: rgba(135, 206, 250, 0.3);
}

/* Slider thumb - WebKit (Chrome, Safari, Edge) */
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #87CEEB, #60A5FA);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(96, 165, 250, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: 2px solid #fff;
}

.volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 3px 12px rgba(96, 165, 250, 0.5);
}

.volume-slider::-webkit-slider-thumb:active {
  transform: scale(1.1);
}

/* Slider thumb - Firefox */
.volume-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #87CEEB, #60A5FA);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(96, 165, 250, 0.4);
}

.volume-slider::-moz-range-thumb:hover {
  transform: scale(1.15);
}

/* Volume Value Display */
.volume-value {
  font-size: 0.7rem;
  color: #64748b;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-family: 'SF Mono', 'Monaco', monospace;
}

/* Audio Control Buttons - Baby blue theme */
.btn-audio-control {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(135, 206, 250, 0.5);
  background: linear-gradient(135deg, #87CEEB, #60A5FA);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 1.4rem;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 3px 10px rgba(96, 165, 250, 0.3);
  animation: softPulse 2.5s ease-in-out infinite;
}

/* Hide the old label style */
.btn-audio-control .btn-label {
  display: none;
}

.btn-audio-control:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 15px rgba(96, 165, 250, 0.5);
}

.btn-audio-control:active {
  transform: scale(0.95);
}

/* Muted state - red theme */
.btn-audio-control.muted {
  background: linear-gradient(135deg, #f87171, #EF4444);
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 3px 10px rgba(239, 68, 68, 0.3);
  animation: none;
}

.btn-audio-control.muted:hover {
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.5);
}

/* Focus state for accessibility */
.btn-audio-control:focus {
  outline: none;
}

.btn-audio-control:focus-visible {
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.5);
}

/* Mobile responsive */
@media (max-width: 480px) {
  .voice-audio-controls {
    gap: 1rem;
    padding: 0.875rem 1rem 0.625rem 1rem;
    border-radius: 16px;
    margin-bottom: 2rem; /* Add clearance for timer */
  }

  .control-group {
    gap: 0.3rem;
  }

  .control-label {
    font-size: 0.6rem;
  }

  .volume-control-container {
    min-width: 80px;
  }

  .volume-slider {
    height: 8px;
  }

  .volume-slider::-webkit-slider-thumb {
    width: 24px;
    height: 24px;
  }

  .volume-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
  }

  .btn-audio-control {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    font-size: 1.25rem;
  }

  .volume-value {
    font-size: 0.65rem;
  }

  /* Voice status - smaller badge on mobile */
  .voice-status {
    top: 0.5rem;
    right: 0.5rem;
    font-size: 0.65rem;
    padding: 0.3rem 0.6rem;
  }

  /* Voice timer - closer to bottom on mobile */
  .voice-timer {
    bottom: 0.75rem;
    font-size: 1.25rem;
  }
}

/* Very small screens */
@media (max-width: 360px) {
  .voice-audio-controls {
    gap: 0.75rem;
    padding: 0.75rem 0.75rem 0.5rem 0.75rem;
    margin-bottom: 2.5rem; /* Extra clearance for timer on tiny screens */
  }

  .volume-control-container {
    min-width: 70px;
  }

  .btn-audio-control {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    font-size: 1.1rem;
  }

  .control-label {
    font-size: 0.55rem;
  }

  /* Voice status - even smaller on tiny screens */
  .voice-status {
    font-size: 0.6rem;
    padding: 0.25rem 0.5rem;
  }

  /* Voice timer - tighter on tiny screens */
  .voice-timer {
    bottom: 0.5rem;
    font-size: 1.1rem;
  }
}

/* Free Minutes Info (always visible for free users, updated during calls) */
.free-minutes-info {
  position: absolute;
  bottom: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--font-sans, 'Inter', sans-serif);
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.free-minutes-info.warning {
  color: #FFB800;
  border-color: rgba(255, 184, 0, 0.3);
  background: rgba(255, 184, 0, 0.15);
}

.free-minutes-info.critical {
  color: #FF6B6B;
  border-color: rgba(255, 107, 107, 0.4);
  background: rgba(255, 107, 107, 0.2);
  animation: pulse-critical 1s ease-in-out infinite;
}

@keyframes pulse-critical {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Loading Screen */
.loading-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-black);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-mosaic {
  width: 200px;
  height: 200px;
  border-radius: 24px;
  overflow: hidden;
  position: relative;
}

/* Modal Overlays */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}

/* Upgrade Offer Card (in limit modal) */
.upgrade-offer-card {
  background: linear-gradient(135deg, rgba(144, 255, 106, 0.1) 0%, rgba(144, 255, 106, 0.02) 100%);
  border: 1px solid rgba(144, 255, 106, 0.3);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 0.5rem;
}

.upgrade-offer-badge {
  display: inline-block;
  background: #90FF6A;
  color: #000;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
}

.upgrade-offer-pricing {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.upgrade-offer-plan {
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
}

.upgrade-offer-price {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.8);
}

.upgrade-offer-price strong {
  color: #90FF6A;
  font-size: 1.1rem;
}

.upgrade-offer-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
  display: grid;
  gap: 0.5rem;
}

.upgrade-offer-features li {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  padding-left: 1.25rem;
  position: relative;
}

.upgrade-offer-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #90FF6A;
  font-weight: 600;
}

.upgrade-offer-btn {
  width: 100%;
  background: #90FF6A !important;
  color: #000 !important;
  font-weight: 700;
  padding: 0.875rem 1.5rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.upgrade-offer-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(144, 255, 106, 0.3);
}

/* Settings Form */
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.settings-form label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.settings-form input,
.settings-form select {
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: white;
  font-size: 1rem;
}

.settings-form button {
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-save {
  background: #90FF6A;
  color: black;
  border: none;
}

.btn-cancel {
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.2s ease;
}

.btn-cancel:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.modal-footer {
  margin-top: 1.25rem;
  display: flex;
  justify-content: center;
}

.modal-footer--stack {
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.btn-cancel--full {
  width: 100%;
}

.btn-save--full {
  width: 100%;
}

.global-status {
  position: relative;
  margin: 0 auto;
  margin-top: 70px;
  background: rgba(5, 7, 16, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 0.6rem 1.4rem;
  color: #fff;
  font-size: 0.85rem;
  max-width: 420px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.global-status.show {
  opacity: 1;
  transform: translateY(0);
}

.global-status[data-type="error"] {
  border-color: rgba(239, 68, 68, 0.4);
  color: #ffb4b4;
}

.global-status[data-type="success"] {
  border-color: rgba(16, 185, 129, 0.4);
  color: #93ffd2;
}

.global-status[data-type="info"] {
  border-color: rgba(79, 159, 255, 0.4);
  color: #b3d4ff;
}

.demo-limit-banner {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 158, 203, 0.35);
  border-radius: 22px;
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
}

.demo-limit-banner[hidden] {
  display: none !important;
}

.demo-limit-content {
  display: flex;
  gap: 1rem;
  margin-left: auto;
  align-items: center;
}

.demo-limit-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: rgba(255, 77, 158, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.demo-limit-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.demo-limit-copy {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.92rem;
}

.demo-limit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.demo-limit-actions .btn-upgrade {
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1.4rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, #ff7acb, #ff9d6c);
  color: #0b0610;
  box-shadow: 0 12px 24px rgba(255, 122, 203, 0.35);
}

.demo-limit-actions .btn-outline {
  border-radius: 999px;
  padding: 0.75rem 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.85);
  background: transparent;
}

.btn-talk-primary.limit-locked,
.btn-talk-primary.limit-locked:hover {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-locked {
  opacity: 0.6 !important;
  cursor: not-allowed !important;
  background: rgba(255, 255, 255, 0.1) !important;
  color: rgba(255, 255, 255, 0.5) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: none !important;
}

.form-status {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
  min-height: 1rem;
}

.form-status[data-type="success"] {
  color: #89ffd9;
}

.form-status[data-type="error"] {
  color: #ffb2b2;
}

.form-status[data-type="warning"] {
  color: #ffd18a;
}

.account-avatar-card {
  display: flex;
  align-items: center;
  justify-content: center;
}


.avatar-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  align-items: center;
  justify-content: center;
  position: relative;
}

.avatar-block {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
  width: auto;
}

.avatar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.avatar-actions--stack {
  flex-direction: column;
  align-items: stretch;
}

.avatar-actions--stack .btn-outline {
  width: 200px;
}

.avatar-divider {
  display: none;
}

.account-avatar-preview {
  width: 116px;
  height: 116px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.account-avatar-preview--user,
.account-avatar-preview--soulmate {
  margin: 0 auto;
  display: block;
}

.account-avatar-preview--user {
  transform: translateX(0);
}

.account-avatar-preview--soulmate {
  margin-top: -2.4rem;
  transform: translateX(0);
}

@media (min-width: 768px) {
  .avatar-stack {
    flex-direction: column;
    gap: 0.85rem;
  }

  .account-avatar-preview--soulmate {
    margin-top: -2rem;
  }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.2s ease;
  z-index: 10;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  transform: rotate(90deg);
}

.voice-preview-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.voice-preview-btn {
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.75rem;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.voice-preview-btn:hover:not(.disabled) {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.45);
}

.voice-preview-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .voice-chat-container {
    max-width: 100%;
    aspect-ratio: 1;
  }

  .btn-talk-primary {
    padding: 1rem 3rem;
    font-size: 1rem;
  }

  .ai-logo-container {
    width: 120px;
    height: 80px;
  }

  .header-nav {
    gap: 1rem;
    margin-left: auto;
  }

  .header-nav a {
    font-size: 0.8rem;
  }

  /* Free minutes info - mobile */
  .free-minutes-info {
    font-size: 0.7rem;
    bottom: 0.25rem;
  }

  /* Modal responsive */
  .modal-content {
    padding: 1.5rem;
    margin: 1rem;
    max-height: 85vh;
  }

  /* Upgrade offer card - mobile */
  .upgrade-offer-card {
    padding: 1.25rem;
  }

  .upgrade-offer-badge {
    font-size: 0.65rem;
    padding: 0.2rem 0.6rem;
  }

  .upgrade-offer-plan {
    font-size: 1.1rem;
  }

  .upgrade-offer-price {
    font-size: 0.9rem;
  }

  .upgrade-offer-features {
    gap: 0.4rem;
  }

  .upgrade-offer-features li {
    font-size: 0.8rem;
  }

  .upgrade-offer-btn {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  /* Post-call modal - mobile */
  .post-call-modal {
    max-width: 90% !important;
    padding: 1.5rem !important;
  }

  .post-call-modal h3 {
    font-size: 1.1rem !important;
  }

  .post-call-modal .btn-save,
  .post-call-modal .btn-cancel {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  /* Limit modal - mobile */
  .limit-modal {
    max-width: 95% !important;
  }

  /* Stack plan cards on mobile */
  .limit-modal .modal-footer [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }
}

/* Extra small screens */
@media (max-width: 380px) {
  .upgrade-offer-card {
    padding: 1rem;
  }

  .upgrade-offer-plan {
    font-size: 1rem;
  }

  .upgrade-offer-features li {
    font-size: 0.75rem;
    padding-left: 1rem;
  }

  .upgrade-offer-btn {
    padding: 0.65rem 0.75rem;
    font-size: 0.85rem;
  }

  .post-call-modal {
    padding: 1.25rem !important;
  }

  .free-minutes-info {
    font-size: 0.65rem;
  }
}

/* Quick Stats (Hidden by default) */
.quick-stats {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  display: none;
  gap: 1rem;
  margin-left: auto;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Notification */
.notification {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 1rem 1.5rem;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: white;
  font-size: 0.875rem;
  opacity: 0;
  transform: translateY(1rem);
  transition: all 0.3s ease;
  z-index: 300;
}

.notification.show {
  opacity: 1;
  transform: translateY(0);
}

.notification.success {
  border-color: #90FF6A;
}

.notification.error {
  border-color: #FF6B6B;
}

/* Hide elements from dark theme */
.sidebar-glass,
.stats-grid,
.dashboard-grid,
.card-glass,
.section-header,
.avatar-ring {
  display: none !important;
}

@media (max-width: 600px) {
  .modal-content {
    padding: 1.5rem;
    width: 95%;
  }

  .modal-close {
    top: 12px;
    right: 12px;
  }
}

/* ============================================================
   Enhanced Mobile Responsiveness
   ============================================================ */

/* Very small phones (320px - 380px) */
@media (max-width: 380px) {
  .voice-chat-container {
    max-width: 100%;
    aspect-ratio: 1;
  }

  .btn-talk-primary {
    padding: 0.875rem 2rem;
    font-size: 0.9rem;
  }

  .ai-logo-container {
    width: 100px;
    height: 70px;
  }

  .ai-logo img {
    max-width: 60px;
  }

  /* Voice status - smaller badge, already positioned top-right */
  .voice-status {
    top: 0.4rem;
    right: 0.4rem;
    font-size: 0.6rem;
    padding: 0.25rem 0.5rem;
  }

  /* Voice timer - smaller on very small phones */
  .voice-timer {
    bottom: 0.5rem;
    font-size: 1.1rem;
  }

  .header-nav {
    gap: 0.5rem;
  }

  .header-nav a {
    font-size: 0.7rem;
    padding: 0.4rem 0.6rem;
  }

  /* Demo limit overlay */
  .demo-limit-overlay {
    padding: 1.25rem;
  }

  .demo-limit-icon {
    font-size: 2.5rem;
  }

  .demo-limit-title {
    font-size: 1.1rem;
  }

  .demo-limit-text {
    font-size: 0.85rem;
  }

  .demo-limit-actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  .demo-limit-actions button {
    width: 100%;
    font-size: 0.85rem;
    padding: 0.75rem;
  }
}

/* Standard mobile adjustments */
@media (max-width: 480px) {
  .main-content {
    padding: 1.5rem 1rem;
  }

  .voice-content {
    gap: 0.75rem;
  }

  /* Quick actions at bottom */
  .quick-actions {
    padding: 0.5rem;
    gap: 0.25rem;
  }

  .quick-action-btn {
    padding: 0.5rem;
    font-size: 0.7rem;
  }

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