/**
 * ===== SCHEDULER.CSS =====
 * Стилі для планувальника подій
 */

/* ========================================= */
/* OVERLAY (ГОЛОВНИЙ КОНТЕЙНЕР)              */
/* ========================================= */
.scheduler-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95); /* window_transparency */
    backdrop-filter: blur(3px); /* background_blur */
    z-index: 10000; /* НАЙВИЩИЙ ПРІОРИТЕТ */
    
    display: none; /* Прихований за замовчуванням */
    align-items: center;
    justify-content: center;
    
    /* Анімація появи */
    opacity: 0;
    transition: opacity 0.5s ease;
}

.scheduler-overlay.active {
    display: flex;
    opacity: 1;
}

.scheduler-overlay.closing {
    opacity: 0;
}

/* ========================================= */
/* PROGRESS BAR                              */
/* ========================================= */
.scheduler-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 10px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transform-origin: left;
    transition: transform linear;
    z-index: 10001;
}

/* Анімація progress bar */
.scheduler-progress-bar.animating {
    transform: scaleX(0);
}

/* ========================================= */
/* ВЕЛИКИЙ ЗАГОЛОВОК ВГОРІ                   */
/* ========================================= */
.scheduler-title {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    
    color: #ffffff;
    font-size: 48px;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-align: center;
    
    text-shadow: 
        0 0 20px rgba(102, 126, 234, 0.8),
        0 0 40px rgba(102, 126, 234, 0.6),
        0 4px 8px rgba(0, 0, 0, 0.8);
    
    padding: 20px 40px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    border: 3px solid rgba(102, 126, 234, 0.6);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    
    max-width: 90%;
    
    z-index: 10002;
    
    animation: titlePulse 3s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% {
        transform: translateX(-50%) scale(1);
        text-shadow: 
            0 0 20px rgba(102, 126, 234, 0.8),
            0 0 40px rgba(102, 126, 234, 0.6),
            0 4px 8px rgba(0, 0, 0, 0.8);
    }
    50% {
        transform: translateX(-50%) scale(1.05);
        text-shadow: 
            0 0 30px rgba(102, 126, 234, 1),
            0 0 60px rgba(102, 126, 234, 0.8),
            0 6px 12px rgba(0, 0, 0, 0.9);
    }
}

/* ========================================= */
/* МЕДІА КОНТЕЙНЕР                           */
/* ========================================= */
.scheduler-content {
    width: 75%; /* window_size */
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10001;
}

/* CLICK BLOCKER (блокує всі кліки на медіа) */
.scheduler-click-blocker {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10003;
    background: transparent;
    cursor: not-allowed;
}

/* ЗОБРАЖЕННЯ */
.scheduler-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* ВІДЕО (iframe) */
.scheduler-content iframe {
    width: 100%;
    height: 80vh;
    min-height: 500px;
    border: none;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    aspect-ratio: 16/9;
}

/* АУДІО (прихований, тільки контрол) */
.scheduler-content audio {
    position: absolute;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 500px;
}

/* ========================================= */
/* ПОВІДОМЛЕННЯ (ЗАМОЧОК)                    */
/* ========================================= */
.scheduler-message {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    
    display: flex;
    align-items: center;
    gap: 12px;
    
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    border: 2px solid rgba(107, 127, 219, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    
    z-index: 10002;
}

.scheduler-lock-icon {
    width: 24px;
    height: 24px;
    fill: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    flex-shrink: 0;
}

.scheduler-message-text {
    color: white;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.3px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    line-height: 1.4;
}

.scheduler-message-text strong {
    color: #667eea;
    font-weight: 700;
}

.scheduler-message-text code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #a0aec0;
}

/* ========================================= */
/* ERROR OVERLAY                             */
/* ========================================= */
.scheduler-error {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10003;
}

.scheduler-error-content {
    text-align: center;
    padding: 40px;
    max-width: 600px;
}

.scheduler-error-content img {
    max-width: 300px;
    max-height: 300px;
    margin-bottom: 30px;
    border-radius: 8px;
}

.scheduler-error-text {
    color: #ff6b6b;
    font-size: 24px;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(255, 107, 107, 0.5);
    line-height: 1.5;
}

/* ========================================= */
/* АНІМАЦІЇ                                  */
/* ========================================= */

/* Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Fade Out */
@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Pulse (для повідомлення) */
@keyframes pulse {
    0%, 100% {
        transform: translateX(-50%) scale(1);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    }
    50% {
        transform: translateX(-50%) scale(1.03);
        box-shadow: 0 6px 30px rgba(102, 126, 234, 0.4);
    }
}

.scheduler-message {
    animation: pulse 2s ease-in-out infinite;
}

/* ========================================= */
/* RESPONSIVE                                */
/* ========================================= */

@media (max-width: 768px) {
    .scheduler-content {
        width: 90%;
    }
    
    .scheduler-content iframe {
        height: 60vh;
    }
    
    .scheduler-title {
        font-size: 32px;
        top: 40px;
        padding: 15px 30px;
    }
    
    .scheduler-message {
        bottom: 20px;
        padding: 15px 30px;
        font-size: 14px;
    }
    
    .scheduler-lock-icon {
        width: 24px;
        height: 24px;
    }
    
    .scheduler-error-text {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .scheduler-content {
        width: 95%;
    }
    
    .scheduler-title {
        font-size: 24px;
        top: 30px;
        padding: 12px 20px;
        letter-spacing: 1px;
    }
    
    .scheduler-message {
        padding: 12px 24px;
        border-radius: 30px;
    }
    
    .scheduler-message-text {
        font-size: 13px;
    }
}

/* ========================================= */
/* УТИЛІТИ                                   */
/* ========================================= */

/* Блокування кліків */
.scheduler-overlay.active {
    pointer-events: all;
    cursor: not-allowed;
}

/* Приховати скролл під час показу */
body.scheduler-active {
    overflow: hidden;
}

/* ========================================= */
/* DEBUG (видалити після тестування)         */
/* ========================================= */

.scheduler-debug {
    position: fixed;
    top: 50px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: #0f0;
    padding: 10px;
    border-radius: 5px;
    font-family: monospace;
    font-size: 12px;
    z-index: 10004;
    max-width: 300px;
}