/* Theme Transition Styles */
.theme-transition * {
    transition: background-color 0.3s ease, 
                color 0.3s ease, 
                border-color 0.3s ease, 
                box-shadow 0.3s ease,
                fill 0.3s ease !important;
}

/* Enhanced Theme Toggle Button */
.deep-theme-toggle {
    position: fixed;
    top: 35%;
    right: 5px;
    z-index: 1050;
    background: var(--card-bg, #ffffff);
    color: var(--text-primary, #000000);
    border-radius: 5px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* box-shadow: 0 4px 12px var(--shadow-light, rgba(0, 0, 0, 0.1)); */
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    user-select: none;
    outline: none;
}

.deep-theme-toggle:hover {
    background: var(--bg-secondary, #f4f7fc);
    /* box-shadow: 0 6px 20px var(--shadow-hover, rgba(0, 0, 0, 0.3)); */
    /* transform: translateY(-2px) scale(1.05); */
}

.deep-theme-toggle:active {
    transform: translateY(0) scale(0.95);
}

.deep-theme-toggle:focus {
    outline: 2px solid #0078bd;
    outline-offset: 2px;
}

.deep-theme-toggle i {
    color: var(--text-primary, #000000);
    transition: transform 0.3s ease;
}

.deep-theme-toggle:hover i {
    transform: scale(1.1);
}

/* Responsive adjustments for theme toggle */
@media (max-width: 768px) {
    .deep-theme-toggle {
        right: 15px;
        top: 35%;
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .deep-theme-toggle {
        right: 10px;
        top: 30%;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* Smooth theme transition for all elements */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f4f7fc;
    --bg-ash: #e0dfdf;
    --bg-ash-new: #f6f6f6;
    --bg-ash-dark: #2d3e50;
    --text-primary: #000000;
    --text-secondary: #565656;
    --text-muted: #666666;
    --border-color: #b3b3b3;
    --card-bg: #ffffff;
    --navbar-bg: rgba(255, 255, 255, 0.65);
    --navbar-text: #ffffff;
    --footer-bg: #1a1072;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-hover: rgba(0, 0, 0, 0.3);
    --input-bg: transparent;
}

[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-ash: #3a3a3a;
    --bg-ash-new: #2a2a2a;
    --bg-ash-dark: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --text-muted: #b0b0b0;
    --border-color: #555555;
    --card-bg: #2d2d2d;
    --navbar-bg: rgba(26, 26, 26, 0.95);
    --navbar-text: #ffffff;
    --footer-bg: #0d0d0d;
    --shadow-light: rgba(255, 255, 255, 0.1);
    --shadow-hover: rgba(255, 255, 255, 0.2);
    --input-bg: #3a3a3a;
}

/* Animation for theme toggle icon */
@keyframes iconRotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(180deg);
    }
}

.theme-switching .deep-theme-toggle i {
    animation: iconRotate 0.3s ease-in-out;
}

/* Loading animation for theme change */
@keyframes themeChange {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.theme-transition body {
    animation: themeChange 0.3s ease-in-out;
}