/* ========================================
   CINEMINI VIDEO PLAYER STYLES
   ======================================== */

.player-container {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 2000;
    display: flex;
    flex-direction: column;
}

.player-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
    background: linear-gradient(rgba(0, 0, 0, 0.8), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.player-container.show-controls .player-header {
    opacity: 1;
}

.player-header .back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    background: none;
    font-size: 16px;
    font-weight: 600;
}

.player-header .back-btn svg {
    width: 20px;
    height: 20px;
}

.player-header .header-actions {
    display: flex;
    gap: 12px;
}

.player-header .header-actions button {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

/* Video Element */
.video-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Center Controls */
.center-controls {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 40px;
    z-index: 8;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.player-container.show-controls .center-controls {
    opacity: 1;
}

.skip-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.skip-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.skip-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.play-pause-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.play-pause-btn svg {
    width: 28px;
    height: 28px;
    fill: white;
}

.play-pause-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

/* Lock Button */
.lock-btn {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    z-index: 8;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.player-container.show-controls .lock-btn {
    opacity: 1;
}

/* Bottom Controls */
.player-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.player-container.show-controls .player-bottom {
    opacity: 1;
}

/* Progress Bar */
.progress-container {
    position: relative;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
    margin-bottom: 10px;
}

.progress-container:hover {
    height: 6px;
}

.progress-bar {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 2px;
    position: relative;
    transition: width 0.1s linear;
}

.progress-bar::after {
    content: '';
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: var(--accent-primary);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.progress-container:hover .progress-bar::after {
    opacity: 1;
}

.buffer-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

/* Ad markers on progress bar */
.ad-marker {
    position: absolute;
    top: -2px;
    width: 4px;
    height: 8px;
    background: #ffeb3b;
    border-radius: 1px;
    z-index: 2;
}

/* Time & Controls Row */
.controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.time-display {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.bottom-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.bottom-actions button {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 11px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.bottom-actions button:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.bottom-actions button svg {
    width: 14px;
    height: 14px;
}

/* ========================================
   AD OVERLAY
   ======================================== */
.ad-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: none;
    flex-direction: column;
}

.ad-overlay.show {
    display: flex;
}

.ad-overlay video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.ad-header {
    position: absolute;
    top: 12px;
    left: 16px;
    right: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 25;
}

.ad-label {
    padding: 4px 12px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #ffeb3b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ad-timer {
    font-size: 14px;
    font-weight: 700;
    color: white;
}

.skip-ad-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.skip-ad-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.skip-ad-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ad-click-zone {
    position: absolute;
    bottom: 60px;
    right: 16px;
    padding: 8px 16px;
    background: var(--accent-gradient);
    border-radius: 8px;
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    z-index: 25;
    animation: pulse 2s infinite;
}

/* ========================================
   SETTINGS PANELS (Audio, Subtitles, Speed)
   ======================================== */
.settings-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    background: rgba(20, 20, 30, 0.95);
    backdrop-filter: blur(20px);
    z-index: 30;
    padding: 16px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.settings-panel.show {
    transform: translateX(0);
}

.settings-panel h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    color: white;
}

.settings-section {
    margin-bottom: 20px;
}

.settings-section h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-option {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-bottom: 4px;
}

.settings-option:hover {
    background: rgba(255, 255, 255, 0.08);
}

.settings-option.active {
    color: var(--accent-primary);
    font-weight: 600;
    background: rgba(255, 77, 77, 0.1);
}

/* Speed selector */
.speed-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.speed-option {
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.speed-option:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.speed-option.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* ========================================
   EPISODE SELECTOR IN PLAYER
   ======================================== */
.episodes-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 320px;
    background: rgba(20, 20, 30, 0.95);
    backdrop-filter: blur(20px);
    z-index: 30;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    padding: 16px;
}

.episodes-panel.show {
    transform: translateX(0);
}

.episodes-panel h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    color: white;
}

.ep-list-item {
    display: flex;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 6px;
}

.ep-list-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.ep-list-item.active {
    background: rgba(255, 77, 77, 0.15);
    border: 1px solid var(--accent-primary);
}

.ep-list-item .ep-thumb {
    width: 90px;
    height: 55px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
}

.ep-list-item .ep-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ep-list-item .ep-info {
    flex: 1;
}

.ep-list-item .ep-number {
    font-size: 11px;
    color: var(--accent-primary);
    font-weight: 600;
    margin-bottom: 2px;
}

.ep-list-item .ep-title {
    font-size: 13px;
    font-weight: 500;
    color: white;
    margin-bottom: 2px;
}

.ep-list-item .ep-duration {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

/* ========================================
   MOBILE PLAYER ADJUSTMENTS
   ======================================== */
@media (max-width: 768px) {

    .settings-panel,
    .episodes-panel {
        width: 100%;
    }

    .center-controls {
        gap: 30px;
    }

    .skip-btn {
        width: 40px;
        height: 40px;
    }

    .play-pause-btn {
        width: 50px;
        height: 50px;
    }

    .bottom-actions button {
        padding: 5px 8px;
        font-size: 10px;
    }
}

/* Landscape mode */
@media (orientation: landscape) and (max-height: 500px) {
    .player-header {
        padding: 8px 16px;
    }

    .player-bottom {
        padding: 8px 16px;
    }

    .center-controls {
        gap: 50px;
    }
}

/* Fullscreen */
.player-container:fullscreen,
.player-container:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
}