/**
 * MODE SWITCHER STYLES
 * Стили для кнопки переключения режимов и overlay анимации
 */

/* ============================================================================= */
/* MODE SWITCH BUTTON */
/* ============================================================================= */

.mode-switch-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    
    padding: 12px 24px;
    
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    
    color: #EAEAEA;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.02em;
    
    cursor: pointer;
    transition: all 0.3s ease;
    
    /* Prevent text selection */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    
    /* Mobile tap highlight */
    -webkit-tap-highlight-color: transparent;
}

.mode-switch-btn:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.mode-switch-btn:active {
    transform: translateY(0);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.04) 100%);
}

.mode-switch-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.mode-switch-text {
    display: inline-block;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .mode-switch-btn {
        top: 15px;
        right: 15px;
        padding: 10px 20px;
        font-size: 13px;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .mode-switch-btn {
        top: 10px;
        right: 10px;
        padding: 8px 16px;
        font-size: 12px;
    }
}

/* ============================================================================= */
/* ANIMATION OVERLAY */
/* ============================================================================= */

.animation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    
    background-color: #0D0E12;
    
    display: flex;
    justify-content: center;
    align-items: center;
    
    opacity: 0;
    pointer-events: none;
    
    transition: opacity 0.2s ease;
}

.animation-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.animation-frame {
    width: 100%;
    max-width: var(--player-max-width);
    aspect-ratio: var(--player-aspect-ratio);
    height: auto;
    object-fit: contain;
    
    /* Smooth frame transitions */
    transition: opacity 0.05s ease;
}

/* ============================================================================= */
/* LOADING STATE */
/* ============================================================================= */

.mode-switch-btn.loading {
    pointer-events: none;
}

.mode-switch-btn.loading .mode-switch-text::after {
    content: '...';
    animation: loadingDots 1.5s infinite;
}

@keyframes loadingDots {
    0%, 20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60%, 100% {
        content: '...';
    }
}

/* ============================================================================= */
/* FADE ANIMATIONS */
/* ============================================================================= */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* ============================================================================= */
/* ACCESSIBILITY */
/* ============================================================================= */

/* Focus styles for keyboard navigation */
.mode-switch-btn:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.mode-switch-btn:focus:not(:focus-visible) {
    outline: none;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .mode-switch-btn,
    .animation-overlay,
    .animation-frame {
        transition: none;
    }
    
    .mode-switch-btn.loading .mode-switch-text::after {
        animation: none;
    }
}

/* ============================================================================= */
/* DARK MODE SUPPORT (already dark, but for consistency) */
/* ============================================================================= */

@media (prefers-color-scheme: dark) {
    .mode-switch-btn {
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%);
        border-color: rgba(255, 255, 255, 0.25);
    }
    
    .mode-switch-btn:hover {
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.1) 100%);
        border-color: rgba(255, 255, 255, 0.35);
    }
}
