:root {
  /* Light mode colors */
  --bg-color: #ffffff;
  --text-color: #333333;
  --navbar-bg: #1b1c77;
  --accent-color: #f9c800;
  --card-bg: #f8f9fa;
  --card-border: #dee2e6;
  --comment-bg: #f9f9f9;
  
  /* Dark mode base colors (common to all dark themes) */
  --dark-bg: #121212;
  --dark-text: #e0e0e0;
  /* --dark-card-bg: #1e1e1e; */
   --dark-card-bg: #1b1c77;
  --dark-card-border: #1b1c77;
  --dark-comment-bg: #2d2d2d;
  
  /* Theme-specific variables (will be overridden) */
  --theme-primary: #1b1c77;
  --theme-secondary: #bbdefb;
  --theme-accent: #283593;

    /* Transition properties */
  --transition-speed: 0.3s;
  --transition-easing: ease;
}

/* Apply transitions to all theme-able elements */
body,
.navbar,
.card,
.comment,
.section-one,
.section-two-color-a,
.stream-button,
.schedule-time,
.schedule-name,
.modal-content,
.toast,
.btn,
.form-control,
.accordion-button {
  transition: 
    background-color var(--transition-speed) var(--transition-easing),
    color var(--transition-speed) var(--transition-easing),
    border-color var(--transition-speed) var(--transition-easing),
    box-shadow var(--transition-speed) var(--transition-easing);
}

/* Specific transitions for elements that need it */
.video-js {
  transition: filter var(--transition-speed) var(--transition-easing);
}

[class*="dark-mode-"] .video-js {
  filter: brightness(0.85);
}

/* Smooth backdrop transition for modals */
.modal-backdrop {
  transition: opacity var(--transition-speed) var(--transition-easing);
}



 /* Dark mode themes */
.dark-mode {
  --theme-primary: linear-gradient(135deg, #404040 0%, #303030 50%, #181818 100%);;
  --theme-secondary: #bbdefb;
  --theme-accent: #283593;
}


/* Dark mode themes */
.dark-mode-classic {
  --theme-primary: #1a237e;
/* --theme-primary: linear-gradient(135deg, #404040 0%, #303030 50%, #181818 100%); */
  --theme-secondary: #bbdefb;
  --theme-accent: #283593;
}

.dark-mode-purple {
  --theme-primary: #311b92;
  --theme-secondary: #d1c4e9;
  --theme-accent: #4527a0;
}

.dark-mode-charcoal {
  --theme-primary: #263238;
  --theme-secondary: #cfd8dc;
  --theme-accent: #37474f;
}

.dark-mode-teal {
  --theme-primary: #006064;
  --theme-secondary: #b2ebf2;
  --theme-accent: #00838f;
}

.dark-mode-amber {
  --theme-primary: #ff6f00;
  --theme-secondary: #ffe082;
  --theme-accent: #ff8f00;
}



/* Base dark mode styles (applies to all dark themes) */
[class*="dark-mode-"] {
  background-color: var(--dark-bg);
  color: var(--dark-text);
}

[class*="dark-mode-"] .navbar {
  background-color: var(--theme-primary) !important;
}

/* [class*="dark-mode-"] .card {
  background-color: var(--dark-card-bg);
  border-color: var(--dark-card-border);
} */

[class*="dark-mode-"] .card {
    background-color: var(--theme-primary) !important;
    border-color: var(--theme-primary) !important;
}
[class*="dark-mode-"] .card-footer {
    background-color: var(--theme-primary) !important;
    border-color: var(--theme-primary) !important;
}


[class*="dark-mode-"] .section-one {
  background-color: var(--theme-primary) !important;
}

[class*="dark-mode-"] .section-two-color-a {
  color: var(--theme-secondary) !important;
}

[class*="dark-mode-"] .stream-button {
  /* background-color: var(--theme-accent); */
   background-color: var(--theme-secondary);
  color: #ffffff;
}

[class*="dark-mode-"] .comment {
  background-color: var(--dark-comment-bg);
  color: var(--dark-text);
}

[class*="dark-mode-"] .schedule-time {
  color: #ffffff !important;
}

[class*="dark-mode-"] .schedule-name {
  color: var(--dark-text) !important;
}

/* Toggle switch styles */
.form-check-input:checked {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
}

.form-check-label {
  color: inherit;
  margin-right: 5px;
}


/* Theme Selector Styles */
#themeSelector {
    width: 140px !important;
    border-radius: 20px !important;
    background: var(--theme-primary, #1b1c77) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    padding: 6px 12px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    transition: all 0.3s ease !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    background-image: 
        linear-gradient(45deg, transparent 50%, #f9c800 50%),
        linear-gradient(135deg, #f9c800 50%, transparent 50%) !important;
    background-position:
        calc(100% - 15px) 50%,
        calc(100% - 10px) 50% !important;
    background-size:
        5px 5px,
        5px 5px !important;
    background-repeat: no-repeat !important;
}

#themeSelector:hover {
    background-color: var(--theme-accent, #283593) !important;
    border-color: #f9c800 !important;
}

#themeSelector:focus {
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(249, 200, 0, 0.3) !important;
}

/* Dark mode specific styles */
[class*="dark-mode-"] #themeSelector {
    background-color: var(--theme-accent, #283593) !important;
    color: var(--theme-secondary, #bbdefb) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[class*="dark-mode-"] #themeSelector:hover {
    background-color: var(--theme-primary, #1a237e) !important;
}

/* Custom dropdown arrow for all browsers */
#themeSelector option {
    background: var(--dark-card-bg, #1e1e1e);
    color: var(--dark-text, #e0e0e0);
    padding: 8px 12px;
}


/* Remove default dropdown arrow in IE */
#themeSelector::-ms-expand {
    display: none;
}

/* Positioning for the theme selector */
.theme-selector-container {
    position: relative;
    display: inline-block;
    margin-left: 10px;
}

/* Custom dropdown arrow container */
.theme-selector-container::after {
    content: "▼";
    color: #f9c800;
    font-size: 10px;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* Theme Toggle Button */
.theme-toggle-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.btn-theme-toggle {
  background: var(--theme-primary, #1b1c77);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 8px 16px;
  color: white;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-theme-toggle:hover {
  background: var(--theme-accent, #283593);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

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

/* Theme Icons */
.theme-icon {
  display: inline-block;
  transition: all 0.3s ease;
  width: 18px;
  height: 18px;
}

.sun-icon {
  color: #f9c800;
}

.moon-icon {
  color: #bbdefb;
}

/* Text and icon visibility */
.btn-theme-toggle .theme-text {
  transition: all 0.3s ease;
}

/* Dark mode specific styles */
[class*="dark-mode-"] .btn-theme-toggle {
  background: var(--theme-accent, #283593);
  border-color: rgba(255, 255, 255, 0.2);
}

[class*="dark-mode-"] .btn-theme-toggle:hover {
  background: var(--theme-primary, #1a237e);
}

/* Icon animation */
.btn-theme-toggle .sun-icon {
  position: absolute;
  opacity: 0;
  transform: rotate(0deg);
}

.btn-theme-toggle .moon-icon {
  opacity: 1;
  transform: rotate(0deg);
}

[class*="dark-mode-"] .btn-theme-toggle .sun-icon {
  opacity: 1;
  transform: rotate(180deg);
}

[class*="dark-mode-"] .btn-theme-toggle .moon-icon {
  opacity: 0;
  transform: rotate(-180deg);
}

[class*="dark-mode-"] .btn-theme-toggle .theme-text {
  content: "Light Mode";
}

/* Theme selector styling */
.theme-selector {
  width: 140px;
  border-radius: 20px;
  background: var(--theme-primary, #1b1c77);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  appearance: none;
}

.theme-selector:hover {
  background: var(--theme-accent, #283593);
}

.theme-selector:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(249, 200, 0, 0.3);
}



/* Animation for theme selector appearance */
@keyframes slideIn {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

#themeSelector:not(.d-none) {
    animation: slideIn 0.3s ease-out;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #themeSelector {
        width: 120px !important;
        font-size: 12px !important;
    }
    
    .theme-selector-container::after {
        right: 8px;
    }
}

/* Special styling for the currently selected theme */
#themeSelector option:checked {
    background: linear-gradient(to right, var(--theme-primary), var(--theme-accent));
    color: white;
    font-weight: bold;
}