/**
 * Theme Switcher Styles
 */

.theme-switcher {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.theme-switcher:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.theme-switcher i {
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

/* Dark mode icon */
html[data-bs-theme="dark"] .theme-switcher .dark-icon {
    display: none;
}

html[data-bs-theme="dark"] .theme-switcher .light-icon {
    display: inline-block;
    color: #FFD700; /* Gold color for sun icon in dark mode */
}

/* Light mode icon */
html[data-bs-theme="light"] .theme-switcher .light-icon {
    display: none;
}

html[data-bs-theme="light"] .theme-switcher .dark-icon {
    display: inline-block;
    color: #6c757d; /* Dark gray for moon icon in light mode */
}

/* Theme toggle animation */
.theme-toggle-animation {
    animation: rotate 0.5s ease;
}

@keyframes rotate {
    0% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(1.2);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}

/* Theme-specific adjustments */
html[data-bs-theme="light"] {
    --custom-text-color: #212529;
    --custom-bg-color: #f8f9fa;
    --custom-card-border: rgba(0, 0, 0, 0.125);
    --custom-link-color: #0d6efd;
    --custom-section-bg: #ffffff;
    color: #212529 !important;
}

html[data-bs-theme="dark"] {
    --custom-text-color: #f8f9fa;
    --custom-bg-color: #212529;
    --custom-card-border: rgba(255, 255, 255, 0.125);
    --custom-link-color: #6ea8fe;
    --custom-section-bg: #2b3035;
    color: #f8f9fa !important;
}

/* Smooth transition between themes */
body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

.card, .navbar, .list-group-item, .btn {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Custom color adjustments for code blocks based on theme */
html[data-bs-theme="light"] .code-block-header {
    background-color: #f1f1f1;
    color: #212529;
    border-bottom: 1px solid #e9e9e9;
}

html[data-bs-theme="light"] .code-lang-label {
    background-color: #e9e9e9;
    color: #212529;
}

html[data-bs-theme="light"] .code-copy-btn {
    color: #6c757d;
}

html[data-bs-theme="light"] .highlight pre {
    color: #212529;
}

/* Add responsiveness for the theme switcher */
@media (max-width: 576px) {
    .theme-switcher-text {
        display: none;
    }
    
    .theme-switcher {
        padding: 0.25rem;
    }
}