/* ===== FUEDEVS DOCUMENTATION - THEMES ===== */

/* ===== LIGHT THEME (DEFAULT) ===== */
.light-theme {
  /* Background Colors */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F9FAFB;
  --bg-tertiary: #F3F4F6;
  --bg-overlay: rgba(0, 0, 0, 0.5);

  /* Text Colors */
  --text-primary: #111827;
  --text-secondary: #4B5563;
  --text-tertiary: #6B7280;
  --text-inverse: #FFFFFF;

  /* Border Colors */
  --border-color: #E5E7EB;
  --border-light: #F3F4F6;
  --border-dark: #D1D5DB;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 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-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* ===== DARK THEME ===== */
.dark-theme {
  /* Background Colors */
  --bg-primary: #111827;
  --bg-secondary: #1F2937;
  --bg-tertiary: #374151;
  --bg-overlay: rgba(0, 0, 0, 0.8);

  /* Text Colors */
  --text-primary: #F9FAFB;
  --text-secondary: #D1D5DB;
  --text-tertiary: #9CA3AF;
  --text-inverse: #111827;

  /* Border Colors */
  --border-color: #374151;
  --border-light: #1F2937;
  --border-dark: #4B5563;

  /* Shadows - Enhanced for dark theme */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.6);

  /* Adjust semantic colors for dark theme */
  --success-light: #064E3B;
  --warning-light: #78350F;
  --error-light: #7F1D1D;
  --info-light: #1E3A8A;

  /* Primary color adjustments */
  --primary-50: #312E81;
  --primary-100: #4C1D95;
}

/* ===== THEME TRANSITION ===== */
* {
  transition: background-color var(--transition-fast), 
              color var(--transition-fast), 
              border-color var(--transition-fast),
              box-shadow var(--transition-fast);
}

/* Disable transitions during theme change to prevent flashing */
.theme-transitioning * {
  transition: none !important;
}

/* ===== THEME-SPECIFIC COMPONENT ADJUSTMENTS ===== */

/* Header adjustments for dark theme */
.dark-theme .header {
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Sidebar adjustments for dark theme */
.dark-theme .sidebar {
  background: var(--bg-primary);
  border-right-color: var(--border-color);
}

/* Search input adjustments for dark theme */
.dark-theme .search-input {
  background: var(--bg-tertiary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.dark-theme .search-input::placeholder {
  color: var(--text-tertiary);
}

/* Button adjustments for dark theme */
.dark-theme .btn-outline {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.dark-theme .btn-outline:hover {
  background: var(--primary-color);
  color: var(--white);
}

/* Code block adjustments */
.dark-theme pre {
  background-color: #0D1117;
  border: 1px solid var(--border-color);
}

.dark-theme code {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

/* Table adjustments for dark theme */
.dark-theme th {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.dark-theme td {
  border-bottom-color: var(--border-color);
}

/* Highlight card adjustments for dark theme */
.dark-theme .highlight-card {
  background: var(--bg-secondary);
  border-color: var(--border-color);
}

.dark-theme .highlight-card:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-lg);
}

/* Floating elements adjustments for dark theme */
.dark-theme .floating-element {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  box-shadow: var(--shadow-lg);
}

/* Search modal adjustments for dark theme */
.dark-theme .search-modal-content {
  background: var(--bg-primary);
  border-color: var(--border-color);
}

/* Language dropdown adjustments for dark theme */
.dark-theme .language-dropdown {
  background: var(--bg-primary);
  border-color: var(--border-color);
}

.dark-theme .language-option.active {
  background: var(--primary-900);
  color: var(--primary-200);
}

/* ===== HIGH CONTRAST THEME ===== */
.high-contrast-theme {
  /* High contrast colors for accessibility */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F0F0F0;
  --bg-tertiary: #E0E0E0;
  
  --text-primary: #000000;
  --text-secondary: #000000;
  --text-tertiary: #333333;
  
  --primary-color: #0000FF;
  --primary-dark: #000080;
  --primary-light: #4040FF;
  
  --border-color: #000000;
  --border-light: #666666;
  --border-dark: #000000;
  
  /* Enhanced shadows for better visibility */
  --shadow-sm: 0 2px 4px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 12px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 15px 25px -5px rgba(0, 0, 0, 0.3);
}

.high-contrast-theme.dark {
  --bg-primary: #000000;
  --bg-secondary: #1A1A1A;
  --bg-tertiary: #333333;
  
  --text-primary: #FFFFFF;
  --text-secondary: #FFFFFF;
  --text-tertiary: #CCCCCC;
  
  --primary-color: #00FFFF;
  --primary-dark: #00CCCC;
  --primary-light: #66FFFF;
  
  --border-color: #FFFFFF;
  --border-light: #999999;
  --border-dark: #FFFFFF;
}

/* ===== REDUCED MOTION THEME ===== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .floating-element {
    animation: none !important;
  }
  
  .loading-spinner {
    animation: none !important;
  }
  
  .scroll-reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  * {
    background: white !important;
    color: black !important;
    box-shadow: none !important;
  }
  
  .header,
  .sidebar,
  .back-to-top,
  .search-modal,
  .mobile-menu-overlay,
  .floating-elements {
    display: none !important;
  }
  
  .main-content {
    margin-left: 0 !important;
    max-width: 100% !important;
    padding: 0 !important;
  }
  
  .content-section {
    page-break-inside: avoid;
    margin-bottom: 2rem !important;
  }
  
  .hero-section {
    page-break-after: always;
  }
  
  a {
    text-decoration: underline !important;
  }
  
  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
}

/* ===== THEME PREFERENCE DETECTION ===== */
@media (prefers-color-scheme: dark) {
  :root:not(.light-theme):not(.dark-theme) {
    /* Auto dark theme when no explicit theme is set */
    --bg-primary: #111827;
    --bg-secondary: #1F2937;
    --bg-tertiary: #374151;
    --bg-overlay: rgba(0, 0, 0, 0.8);

    --text-primary: #F9FAFB;
    --text-secondary: #D1D5DB;
    --text-tertiary: #9CA3AF;
    --text-inverse: #111827;

    --border-color: #374151;
    --border-light: #1F2937;
    --border-dark: #4B5563;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  }
}

/* ===== THEME TOGGLE ICON CHANGES ===== */
.light-theme .theme-toggle .fa-moon {
  display: inline;
}

.light-theme .theme-toggle .fa-sun {
  display: none;
}

.dark-theme .theme-toggle .fa-moon {
  display: none;
}

.dark-theme .theme-toggle .fa-sun {
  display: inline;
}

/* ===== CUSTOM SCROLLBAR FOR THEMES ===== */
.dark-theme ::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
}

.dark-theme ::-webkit-scrollbar-thumb {
  background: var(--text-tertiary);
}

.dark-theme ::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* ===== THEME-SPECIFIC FOCUS STYLES ===== */
.dark-theme :focus {
  outline-color: var(--primary-light);
}

.high-contrast-theme :focus {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

/* ===== THEME LOADING STATE ===== */
.theme-loading {
  transition: none !important;
}

.theme-loading * {
  transition: none !important;
}
