/* ========== AURA Clean & Modern Light/Dark Theme System ========== */

:root {
  /* Light Theme - Clean & Professional with Green Colors */
  --primary: #059669;           /* Deep green for buttons */
  --primary-rgb: 5, 150, 105;   /* RGB values for primary color */
  --primary-hover: #047857;     /* Darker green on hover */
  --primary-active: #065F46;    /* Active state */
  --accent: #22C55E;            /* Emerald for highlights */
  --accent-hover: #16A34A;      /* Darker emerald on hover */
  
  /* Gradient combinations */
  --gradient-primary: linear-gradient(135deg, #10B981 0%, #22C55E 100%);
  --gradient-secondary: linear-gradient(135deg, #059669 0%, #16A34A 100%);
  --gradient-background: linear-gradient(135deg, #FFFFFF 0%, #F9FAFB 50%, #F3F4F6 100%);
  
  /* Background colors - Pure white primary */
  --bg-primary: #FFFFFF;        /* Pure white background */
  --bg-secondary: #F9FAFB;      /* Subtle gray secondary */
  --bg-tertiary: #F3F4F6;       /* Slightly darker tertiary */
  --bg-overlay: rgba(255, 255, 255, 0.95);
  
  /* Text colors - High contrast for readability */
  --text-primary: #111827;      /* Near black for primary text */
  --text-secondary: #374151;    /* Dark gray for secondary text */
  --text-muted: #6B7280;        /* Medium gray for muted text */
  --text-inverse: #FFFFFF;      /* White text for dark backgrounds */
  
  /* Border and divider colors */
  --border: #E5E7EB;            /* Light gray borders */
  --border-hover: #D1D5DB;      /* Darker on hover */
  --border-focus: #059669;      /* Green focus state */
  
  /* Interactive element colors */
  --button-primary: #059669;
  --button-primary-hover: #047857;
  --button-secondary: #F9FAFB;
  --button-secondary-hover: #F3F4F6;
  --button-outline: transparent;
  --button-outline-border: #E5E7EB;
  --button-outline-hover: #059669;
  
  /* Slider and form control colors */
  --slider-track: #E5E7EB;
  --slider-thumb: #059669;
  --slider-thumb-hover: #047857;
  --input-background: #FFFFFF;
  --input-border: #E5E7EB;
  --input-focus: #059669;
  
  /* Shadow system */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-primary: 0 10px 40px rgba(5, 150, 105, 0.15);
  --shadow-secondary: 0 4px 20px rgba(34, 197, 94, 0.1);
  
  /* Status colors */
  --success: #10B981;
  --success-light: #D1FAE5;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --danger: #EF4444;
  --danger-light: #FEE2E2;
  
  --theme-name: "Light";
}

/* Dark Theme - Pure black with high contrast and warm accent */
[data-theme="dark"] {
  /* Dark Theme - Professional & High Contrast */
  --primary: #34D399;           /* Brighter green for better visibility */
  --primary-rgb: 52, 211, 153;  /* RGB values for primary color */
  --primary-hover: #10B981;     /* Darker green on hover */
  --primary-active: #059669;    /* Active state */
  --accent: #4ADE80;            /* Bright emerald for highlights */
  --accent-hover: #22C55E;      /* Darker emerald on hover */
  
  /* Gradient combinations */
  --gradient-primary: linear-gradient(135deg, #34D399 0%, #4ADE80 100%);
  --gradient-secondary: linear-gradient(135deg, #10B981 0%, #22C55E 100%);
  --gradient-background: linear-gradient(135deg, #000000 0%, #111827 50%, #1F2937 100%);
  
  /* Background colors - Pure black primary */
  --bg-primary: #000000;        /* Pure black background */
  --bg-secondary: #111827;      /* Very dark gray secondary */
  --bg-tertiary: #1F2937;       /* Dark gray tertiary */
  --bg-overlay: rgba(0, 0, 0, 0.95);
  
  /* Text colors - High contrast for readability */
  --text-primary: #FFFFFF;      /* Pure white for primary text */
  --text-secondary: #F3F4F6;    /* Light gray for secondary text */
  --text-muted: #9CA3AF;        /* Medium gray for muted text */
  --text-inverse: #000000;      /* Black text for light backgrounds */
  
  /* Border and divider colors */
  --border: #374151;            /* Dark gray borders */
  --border-hover: #4B5563;      /* Lighter on hover */
  --border-focus: #34D399;      /* Green focus state */
  
  /* Interactive element colors */
  --button-primary: #34D399;
  --button-primary-hover: #10B981;
  --button-secondary: #111827;
  --button-secondary-hover: #1F2937;
  --button-outline: transparent;
  --button-outline-border: #374151;
  --button-outline-hover: #34D399;
  
  /* Slider and form control colors */
  --slider-track: #374151;
  --slider-thumb: #34D399;
  --slider-thumb-hover: #10B981;
  --input-background: #111827;
  --input-border: #374151;
  --input-focus: #34D399;
  
  /* Shadow system - More pronounced for dark theme */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.8);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.7), 0 10px 10px -5px rgba(0, 0, 0, 0.5);
  --shadow-primary: 0 10px 40px rgba(52, 211, 153, 0.3);
  --shadow-secondary: 0 4px 20px rgba(74, 222, 128, 0.2);
  
  /* Status colors */
  --success: #34D399;
  --success-light: rgba(52, 211, 153, 0.1);
  --warning: #F59E0B;
  --warning-light: rgba(245, 158, 11, 0.1);
  --danger: #EF4444;
  --danger-light: rgba(239, 68, 68, 0.1);
  
  --theme-name: "Dark";
}

/* ========== Interactive Elements & Button Styles ========== */

/* Primary buttons with consistent styling */
button {
  background: var(--button-primary);
  color: var(--text-inverse);
  border: none;
  transition: all 0.3s ease;
}

button:hover:not(:disabled) {
  background: var(--button-primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

button:active:not(:disabled) {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Secondary buttons */
.btn-secondary {
  background: var(--button-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--button-secondary-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

/* Outline buttons */
.btn-outline {
  background: var(--button-outline);
  color: var(--text-primary);
  border: 2px solid var(--button-outline-border);
}

.btn-outline:hover:not(:disabled) {
  background: var(--button-outline-hover);
  color: var(--text-inverse);
  border-color: var(--button-outline-hover);
}

/* Modern Theme Toggle Button */
.theme-toggle {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  padding: 0.75rem 1.25rem;
  border-radius: 25px;
  min-width: 100px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 500;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.theme-toggle::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.theme-toggle:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.theme-toggle:hover::before {
  opacity: 0.1;
}

.theme-toggle:active {
  transform: translateY(0);
}

/* ========== Form Elements ========== */

/* Input fields */
input[type="text"],
input[type="email"],
input[type="password"],
textarea {
  background: var(--input-background);
  border: 1px solid var(--input-border);
  color: var(--text-primary);
  padding: 0.75rem;
  border-radius: 8px;
  transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* File input */
input[type="file"] {
  background: var(--bg-secondary);
  border: 2px dashed var(--border);
  color: var(--text-primary);
  padding: 1rem;
  border-radius: 12px;
  transition: all 0.3s ease;
}

input[type="file"]:hover {
  border-color: var(--border-hover);
  background: var(--bg-tertiary);
}

/* Range sliders */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-track {
  background: var(--slider-track);
  height: 6px;
  border-radius: 3px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  background: var(--slider-thumb);
  height: 20px;
  width: 20px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  background: var(--slider-thumb-hover);
  transform: scale(1.1);
}

/* Checkbox styling */
input[type="checkbox"] {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* ========== Navigation & Layout ========== */

/* Navigation bar */
.navbar {
  background: var(--bg-overlay);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

.navbar a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.navbar a:hover {
  color: var(--primary);
}

.navbar a.active {
  color: var(--primary);
  font-weight: 600;
  position: relative;
}

.navbar a.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
}

/* Card elements */
.card, .processing-section, .result-section {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.card h1, .card h2, .card h3, .card h4, .card h5, .card h6,
.processing-section h1, .processing-section h2, .processing-section h3,
.result-section h1, .result-section h2, .result-section h3 {
  color: var(--text-primary);
}

.card p, .card span, .card div,
.processing-section p, .processing-section span, .processing-section div,
.result-section p, .result-section span, .result-section div {
  color: var(--text-secondary);
}

/* Status indicators */
.status-text {
  color: var(--text-primary);
}

.status-indicator {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

/* Processing elements */
.processing-message {
  color: var(--text-primary);
}

.transcript-text {
  color: var(--text-primary);
}

.chunk-number {
  color: var(--accent);
}

/* Error and success messages */
.error-message {
  color: var(--danger);
  background: var(--danger-light);
  border: 1px solid var(--danger);
}

.success-message {
  color: var(--success);
  background: var(--success-light);
  border: 1px solid var(--success);
}

.warning-message {
  color: var(--warning);
  background: var(--warning-light);
  border: 1px solid var(--warning);
}

/* ========== Animated Background Effects ========== */

/* Dynamic gradient animations */
@keyframes gradientShift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* Floating particles animation for certain themes */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

/* Theme-specific background animations */
[data-theme="cyberpunk"] .hero-section,
[data-theme="cyberpunk"] .hero-section-viewer {
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

[data-theme="retro"] .hero-section,
[data-theme="retro"] .hero-section-viewer {
  background-size: 400% 400%;
  animation: gradientShift 20s ease infinite;
}

/* ========== Theme Selector Styles ========== */

.theme-selector {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-secondary);
  transition: all 0.3s ease;
}

.theme-selector:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-primary);
}

.theme-selector-title {
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 0.75rem;
  text-align: center;
  font-size: 0.9rem;
}

.theme-options {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  justify-content: center;
}

.theme-option {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 2px solid var(--border);
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  overflow: hidden;
}

.theme-option:hover {
  transform: scale(1.1);
  border-color: var(--primary);
}

.theme-option.active {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent);
}

.theme-option.active::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-weight: bold;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

/* Individual theme option colors */
.theme-option.light { background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%); border: 2px solid #e5e7eb; }
.theme-option.dark { background: linear-gradient(135deg, #0f172a 0%, #334155 100%); }

.current-theme {
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-align: center;
  font-weight: 500;
}

/* Mobile responsive theme selector */
@media (max-width: 768px) {
  .theme-selector {
    top: auto;
    bottom: 20px;
    right: 20px;
    left: 20px;
    padding: 0.75rem;
  }
  
  .theme-options {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .theme-option {
    width: 35px;
    height: 35px;
  }
}

/* ========== Footer Styling ========== */

.app-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 4rem;
  backdrop-filter: blur(20px);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  padding: 0 1rem;
}

.footer-content p {
  color: var(--text-secondary-contrast) !important;
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.025em;
}

@media (max-width: 768px) {
  .app-footer {
    margin-top: 2rem;
    padding: 1.5rem 0;
  }
  
  .footer-content p {
    font-size: 0.9rem;
  }
  
  /* Enhanced mobile form controls */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="file"],
  select,
  textarea {
    min-height: 48px !important;
    padding: 0.875rem !important;
    font-size: 1rem !important;
    border-radius: 8px !important;
  }
  
  /* Larger touch targets for checkboxes */
  input[type="checkbox"] {
    width: 20px !important;
    height: 20px !important;
    margin-right: 0.75rem !important;
  }
  
  /* Better mobile textarea */
  textarea {
    min-height: 120px !important;
    resize: vertical !important;
  }
  
  /* Enhanced mobile typography */
  h1 {
    font-size: 2.25rem !important;
    line-height: 1.2 !important;
    margin-bottom: 1rem !important;
  }
  
  h2 {
    font-size: 1.875rem !important;
    line-height: 1.3 !important;
    margin-bottom: 0.875rem !important;
  }
  
  h3 {
    font-size: 1.5rem !important;
    line-height: 1.4 !important;
    margin-bottom: 0.75rem !important;
  }
  
  h4 {
    font-size: 1.25rem !important;
    line-height: 1.4 !important;
    margin-bottom: 0.5rem !important;
  }
  
  p {
    font-size: 1rem !important;
    line-height: 1.6 !important;
    margin-bottom: 1rem !important;
  }
  
  /* Enhanced mobile spacing */
  .container {
    padding: 1rem !important;
  }
  
  .processing-section,
  .main-sections,
  .content-section {
    padding: 1.5rem 1rem !important;
    margin-bottom: 1rem !important;
  }
}

/* Additional mobile optimizations for smaller screens */
@media (max-width: 480px) {
  /* Even more compact typography for small screens */
  h1 {
    font-size: 2rem !important;
  }
  
  h2 {
    font-size: 1.625rem !important;
  }
  
  h3 {
    font-size: 1.375rem !important;
  }
  
  /* Tighter spacing for small screens */
  .container {
    padding: 0.75rem !important;
  }
  
  /* Stack elements vertically on small screens */
  .voice-controls,
  .enhanced-controls,
  .processing-controls {
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  
  /* Full-width buttons on small screens */
  button, .btn-primary, .btn-secondary, .btn-outline {
    width: 100% !important;
  }
  
  /* Better modal scaling */
  .feedback-modal-content {
    margin: 1rem !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
  }
}