/* PHAT-VIDEO.CSS - Styling cho trang phát video */
/* Sử dụng Tailwind CSS làm chính, chỉ giữ lại styles đặc biệt */

/* Video Player */
.video-player-wrapper {
    position: relative;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.video-player-wrapper iframe {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
}

@media (min-width: 768px) {
    .video-player-wrapper iframe {
        min-height: 500px;
    }
}

@media (min-width: 1024px) {
    .video-player-wrapper iframe {
        min-height: 600px;
    }
}

/* Loading State */
.video-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(59, 130, 246, 0.2);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.info-separator {
    color: #38bdf8;
    font-size: 0.9rem;
    line-height: 1;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Notification Toast */
.toast-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    background-color: #1e293b;
    border: 1px solid #3b82f6;
    color: #ffffff;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-notification.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(10px);
    }
}

/* Fullscreen Mode */
.video-player-wrapper:fullscreen {
    background: #000;
}

.video-player-wrapper:fullscreen #video-container {
    height: 100vh;
}

.video-player-wrapper.fullscreen-active {
    background: #000;
}

.video-player-wrapper.fullscreen-active #video-container,
.video-player-wrapper.fullscreen-active iframe {
    height: 100vh;
    max-height: 100vh;
}

/* Modal for Report */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInOverlay 0.2s ease-out;
}

@keyframes fadeInOverlay {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: #1e293b;
    border: 1px solid #334155;
    border-radius: 1rem;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    animation: scaleIn 0.2s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Visible */
button:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.5);
    outline-offset: 2px;
}

/* Empty State */
.empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
    color: #94a3b8;
}

.empty-state svg {
    margin: 0 auto 1rem;
    color: #475569;
}

.player-center-notice {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    background-color: rgba(30, 41, 59, 0.95);
    border: 1px solid #334155;
    color: #ffffff;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.5);
    animation: popIn 0.2s ease-out;
    pointer-events: none;
    text-align: center;
    max-width: 90%;
}

@keyframes popIn {
    from { transform: translate(-50%, -55%); opacity: 0; }
    to { transform: translate(-50%, -50%); opacity: 1; }
}

.player-center-notice.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

.toggle-switch {
    width: 44px;
    height: 24px;
    border-radius: 9999px;
    background-color: #334155;
    border: 1px solid #475569;
    position: relative;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}

.toggle-switch .toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background-color: #ffffff;
    border-radius: 9999px;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.toggle-switch.on {
    background-color: #3b82f6;
    border-color: #2563eb;
}

.toggle-switch.on .toggle-thumb {
    transform: translateX(20px);
}

/* Mobile optimizations */
@media (max-width: 640px) {
    .toast-notification {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: calc(100% - 2rem);
        max-width: 420px;
        bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
        text-align: center;
        animation: fadeInOverlay 0.2s ease-out;
    }
    .player-center-notice {
        padding: 0.5rem 0.75rem;
        font-size: 0.95rem;
    }
    #episode-list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.5rem;
    }
    #episode-list button {
        min-height: 40px;
        font-size: 0.95rem;
    }
}
