/* CodeAndFork - Theme CSS */
/* ======================================================== */

/* Theme Transition */
* {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
/* Theme Icons Colors */
.fa-moon {
  color: #ffffff; /* White moon */
}

.fa-sun {
  color: #facc15; /* Yellow sun */
}
/* Dark Theme Specific Styles */
[data-theme="dark"] {
  /* Code Editor Dark Theme */
  .code-window {
    background: #1a1b26;
  }
  
  .code-content {
    color: #a9b1d6;
  }
  
  .code-content .keyword {
    color: #bb9af7;
  }
  
  .code-content .function {
    color: #7aa2f7;
  }
  
  .code-content .string {
    color: #9ece6a;
  }
  
  .code-content .comment {
    color: #565f89;
  }
  
  /* Scrollbar */
  ::-webkit-scrollbar {
    width: 10px;
  }
  
  ::-webkit-scrollbar-track {
    background: var(--bg-secondary);
  }
  
  ::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 5px;
  }
  
  ::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
  }
}

/* Light Theme Specific Styles */
[data-theme="light"] {
  /* Code Editor Light Theme */
  .code-window {
    background: #f8fafc;
  }
  
  .code-content {
    color: #334155;
  }
  
  .code-content .keyword {
    color: #7c3aed;
  }
  
  .code-content .function {
    color: #2563eb;
  }
  
  .code-content .string {
    color: #059669;
  }
  
  .code-content .comment {
    color: #94a3b8;
  }
  
  /* Selection */
  ::selection {
    background: rgba(99, 102, 241, 0.2);
    color: var(--text-primary);
  }
  
  /* Scrollbar */
  ::-webkit-scrollbar {
    width: 10px;
  }
  
  ::-webkit-scrollbar-track {
    background: var(--bg-secondary);
  }
  
  ::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
  }
  
  ::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
  }
}

/* Theme Switcher Animation */
.theme-switcher {
  position: relative;
  overflow: hidden;
}

.theme-switcher::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.theme-switcher:hover::before {
  opacity: 0.1;
}

/* Loading Animation for Theme Switch */
.theme-transitioning {
  overflow: hidden;
}

.theme-transitioning::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-primary);
  z-index: 9999;
  opacity: 0;
  animation: themeSwitch 0.6s ease;
}

@keyframes themeSwitch {
  0% {
    opacity: 0;
    transform: scale(0);
  }
  50% {
    opacity: 0.3;
  }
  100% {
    opacity: 0;
    transform: scale(2);
  }
}

/* System Preference Detection */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary-color: #818cf8;
    --primary-dark: #6366f1;
    --secondary-color: #34d399;
    --accent-color: #fbbf24;
    
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    --border-color: #334155;
    --card-bg: #1e293b;
    --card-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    --card-shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.3);
    
    --header-bg: rgba(15, 23, 42, 0.95);
    --footer-bg: #020617;
  }
}

