/**
 * 🎬 Стили для модального окна видео в детективном стиле
 */

/* Основное модальное окно */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-modal.active {
    display: flex;
    opacity: 1;
}

/* Фон модального окна */
.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    cursor: pointer;
}

/* Контейнер модального окна */
.modal-container {
    position: relative;
    margin: auto;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 2px solid var(--color-primary);
    border-radius: 12px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.8),
        0 0 30px rgba(139, 69, 19, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.video-modal.active .modal-container {
    transform: scale(1);
}

/* Заголовок модального окна */
.modal-header {
    position: relative;
    padding: 20px 25px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.detective-icon {
    font-size: 1.4rem;
    animation: detectivePulse 2s infinite;
}

.modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

/* Тело модального окна */
.modal-body {
    padding: 0;
    position: relative;
}

.video-container {
    position: relative;
    width: 100%;
    height: 400px;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#youtube-player {
    width: 100%;
    height: 100%;
}

/* Загрузка видео */
.video-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.detective-spinner {
    text-align: center;
    color: white;
}

.detective-spinner.error {
    color: #ff4444;
}

.spinner-badge {
    font-size: 3rem;
    margin-bottom: 10px;
    animation: detectiveRotate 2s linear infinite;
}

.spinner-text {
    font-size: 1rem;
    opacity: 0.8;
    animation: detectivePulse 1.5s infinite;
}

/* Футер с контролами */
.modal-footer {
    padding: 15px 25px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.video-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
}

.control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 8px 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 10px rgba(139, 69, 19, 0.5);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

#volume-slider {
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

#volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--color-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(139, 69, 19, 0.5);
}

#volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--color-primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 5px rgba(139, 69, 19, 0.5);
}

.video-info {
    margin-left: auto;
    font-size: 0.9rem;
    opacity: 0.8;
    font-family: 'Courier New', monospace;
}

/* Детективные огни */
.detective-light {
    position: absolute;
    border-radius: 50%;
    animation: detectiveFlicker 1s infinite alternate;
}

/* Анимации */
@keyframes detectivePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
}

@keyframes detectiveRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes detectiveFlicker {
    0% { opacity: 0.3; box-shadow: 0 0 5px currentColor; }
    50% { opacity: 1; box-shadow: 0 0 15px currentColor; }
    100% { opacity: 0.6; box-shadow: 0 0 8px currentColor; }
}

/* Блокировка скролла при открытом модальном окне */
body.modal-open {
    overflow: hidden;
}

/* Адаптивность */
@media (max-width: 768px) {
    .modal-container {
        width: 95%;
        margin: 20px auto;
    }
    
    .video-container {
        height: 250px;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-title {
        font-size: 1rem;
    }
    
    .modal-footer {
        padding: 10px 20px;
    }
    
    .video-controls {
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .volume-control {
        order: 2;
        flex-basis: 100%;
        margin-top: 10px;
    }
    
    #volume-slider {
        flex: 1;
        max-width: 150px;
    }
}

@media (max-width: 480px) {
    .modal-container {
        width: 98%;
        margin: 10px auto;
    }
    
    .video-container {
        height: 200px;
    }
    
    .modal-header {
        padding: 12px 15px;
    }
    
    .modal-close {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
}

/* Интеграция с детективной темой */
.detective-modal .modal-container {
    background: 
        radial-gradient(circle at 20% 20%, rgba(139, 69, 19, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 69, 19, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

.detective-modal .modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--color-primary) 20%, 
        var(--color-accent) 50%, 
        var(--color-primary) 80%, 
        transparent 100%);
    animation: detectiveScan 3s linear infinite;
}

@keyframes detectiveScan {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Эффекты при наведении */
.video-modal .control-btn:active {
    transform: scale(0.95);
}

.video-modal .modal-close:active {
    transform: rotate(90deg) scale(0.9);
}

/* Дополнительные детективные эффекты */
.detective-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 30% 40%, rgba(139, 69, 19, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 70% 60%, rgba(139, 69, 19, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}