/* ====================================================
   Dark Mode Theme Transitions
   ==================================================== */

/* Smooth transition for theme changes */
.mud-layout,
.mud-appbar,
.mud-drawer,
.mud-main-content,
.mud-paper,
.mud-card {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Theme toggle button animation */
.theme-toggle-button {
    transition: transform 0.2s ease, color 0.2s ease;
}

.theme-toggle-button:hover {
    transform: scale(1.1);
}

.theme-toggle-button:active {
    transform: scale(0.95);
}

/* Icon rotation animation on theme change */
@keyframes rotate-icon {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.theme-toggle-button.animating {
    animation: rotate-icon 0.5s ease-in-out;
}

/* Dark mode specific overrides */
.mud-theme-dark {
    /* Custom scrollbar for dark mode */
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(0, 0, 0, 0.2);
}

.mud-theme-dark ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.mud-theme-dark ::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.mud-theme-dark ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 5px;
}

.mud-theme-dark ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Light mode specific overrides */
.mud-theme-light {
    scrollbar-color: rgba(0, 0, 0, 0.3) rgba(255, 255, 255, 0.2);
}

.mud-theme-light ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.mud-theme-light ::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

.mud-theme-light ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
}

.mud-theme-light ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.4);
}

/* Ensure proper contrast for text in both themes */
.mud-theme-dark .mud-typography {
    color: rgba(255, 255, 255, 0.87);
}

.mud-theme-light .mud-typography {
    color: rgba(0, 0, 0, 0.87);
}

/* Code blocks in dark mode */
.mud-theme-dark code,
.mud-theme-dark pre {
    background-color: rgba(255, 255, 255, 0.05);
    color: #f8f8f2;
}

.mud-theme-light code,
.mud-theme-light pre {
    background-color: rgba(0, 0, 0, 0.05);
    color: #24292e;
}

/* Focus states for accessibility */
.mud-theme-dark *:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.mud-theme-light *:focus-visible {
    outline: 2px solid rgba(0, 0, 0, 0.3);
    outline-offset: 2px;
}

/* Card shadows adjustment for dark mode */
.mud-theme-dark .mud-paper {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.mud-theme-dark .mud-paper.mud-elevation-2 {
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.6);
}

/* Improve readability of disabled items in dark mode */
.mud-theme-dark .mud-disabled {
    opacity: 0.5;
}

.mud-theme-light .mud-disabled {
    opacity: 0.38;
}
