/*============= THEME TOGGLE BUTTON ===============*/

.theme-toggle-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}

.theme-toggle-btn {
    background: var(--bg-card);
    border: 2px solid var(--border-primary);
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
    font-size: 20px;
}

.theme-toggle-btn:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: var(--shadow-xl);
    border-color: var(--accent-primary);
}

.theme-toggle-btn:active {
    transform: scale(0.95);
}

.theme-toggle-btn i {
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: block;
    position: absolute;
}

.theme-toggle-btn .fa-sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.theme-toggle-btn .fa-moon {
    opacity: 0;
    transform: rotate(180deg) scale(0);
}

[data-theme="dark"] .theme-toggle-btn .fa-sun {
    opacity: 0;
    transform: rotate(-180deg) scale(0);
}

[data-theme="dark"] .theme-toggle-btn .fa-moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* Ripple Effect */
.theme-toggle-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--accent-primary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
    opacity: 0.2;
}

.theme-toggle-btn:hover::before {
    width: 100%;
    height: 100%;
}

/* Glow Effect */
.theme-toggle-btn::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    filter: blur(8px);
}

.theme-toggle-btn:hover::after {
    opacity: 0.4;
}

/* Tooltip */
.theme-toggle-btn[title]::before {
    content: attr(title);
    position: absolute;
    right: 70px;
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-primary);
}

.theme-toggle-btn:hover[title]::before {
    opacity: 1;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .theme-toggle-container {
        bottom: 20px;
        right: 20px;
    }
    
    .theme-toggle-btn {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }
    
    .theme-toggle-btn[title]::before {
        display: none;
    }
}

/* Animation on Load */
@keyframes themeToggleSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.theme-toggle-container {
    animation: themeToggleSlideIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Focus Styles for Accessibility */
.theme-toggle-btn:focus {
    outline: 3px solid var(--accent-primary);
    outline-offset: 4px;
}

.theme-toggle-btn:focus:not(:focus-visible) {
    outline: none;
}