/**
 * Infrina Video Player Styles
 */

.infrina-player {
    max-width: 100%;
    margin: 0 auto;
    background: #0f172a;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.player-screen {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
}

/* Watermark */
.player-watermark {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    opacity: 0.4;
    z-index: 5;
    pointer-events: none;
}

.infrina-player:fullscreen .player-watermark,
.infrina-player:-webkit-full-screen .player-watermark {
    width: 48px;
    height: 48px;
    top: 20px;
    right: 20px;
}

.slide-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide-svg {
    width: 100%;
    height: 100%;
}

/* Subtitles */
.subtitle-container {
    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;
    z-index: 10;
    pointer-events: none;
    text-align: center;
}

.subtitle-text {
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
    display: inline;
    max-width: 85%;
}

.subtitle-text:empty {
    display: none;
}

/* Fullscreen subtitle adjustments */
.infrina-player:fullscreen .subtitle-text,
.infrina-player:-webkit-full-screen .subtitle-text {
    font-size: 22px;
    padding: 10px 20px;
}

.infrina-player:fullscreen .subtitle-container,
.infrina-player:-webkit-full-screen .subtitle-container {
    bottom: 80px;
}

/* Fullscreen Mode */
.infrina-player:fullscreen,
.infrina-player:-webkit-full-screen {
    max-width: 100%;
    width: 100%;
    height: 100%;
    border-radius: 0;
}

.infrina-player:fullscreen .player-screen,
.infrina-player:-webkit-full-screen .player-screen {
    height: calc(100% - 56px);
    aspect-ratio: auto;
}

.infrina-player:fullscreen .player-controls,
.infrina-player:-webkit-full-screen .player-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

/* Play Overlay */
.play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    cursor: pointer;
    transition: background 0.2s;
}

.play-overlay:hover {
    background: rgba(0, 0, 0, 0.4);
}

.play-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s, filter 0.2s;
    filter: drop-shadow(0 4px 12px rgba(8, 145, 178, 0.4));
}

.play-btn:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 6px 20px rgba(8, 145, 178, 0.6));
}

.play-btn:focus {
    outline: 2px solid #0891b2;
    outline-offset: 4px;
    border-radius: 50%;
}

.play-btn svg circle {
    fill: rgba(8, 145, 178, 0.9);
}
.play-btn:hover svg circle {
    fill: rgba(8, 145, 178, 1);
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.9);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #334155;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Player Controls */
.player-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
}

.ctrl-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 10px;
    border-radius: 10px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ctrl-btn:hover {
    background: rgba(8, 145, 178, 0.15);
    color: #67e8f9;
}

.ctrl-btn:focus {
    outline: 2px solid #0891b2;
    outline-offset: 2px;
}

/* Volume Control */
.volume-control {
    position: relative;
    display: flex;
    align-items: center;
}

.volume-slider-container {
    width: 0;
    overflow: hidden;
    transition: width 0.2s ease;
    display: flex;
    align-items: center;
}

.volume-control:hover .volume-slider-container,
.volume-control:focus-within .volume-slider-container {
    width: 80px;
    margin-left: 4px;
}

.volume-slider {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #334155;
    border-radius: 2px;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.volume-slider::-moz-range-track {
    background: #334155;
    height: 4px;
    border-radius: 2px;
}

/* CC/Subtitle Control */
.cc-control {
    position: relative;
}

.cc-btn.active {
    color: #3b82f6;
}

.cc-menu {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 8px 0;
    min-width: 140px;
    display: none;
    margin-bottom: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.cc-menu.show {
    display: block;
}

.cc-menu-item {
    padding: 8px 16px;
    color: #94a3b8;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-size: 14px;
}

.cc-menu-item:hover {
    background: #334155;
    color: #fff;
}

.cc-menu-item.active {
    color: #3b82f6;
}

.cc-menu-item.active::before {
    content: '✓ ';
}

/* Progress Bar */
.progress-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-bar {
    flex: 1;
    height: 5px;
    background: #334155;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: height 0.15s;
}

.progress-bar:hover {
    height: 8px;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #0891b2, #0e7490, #22d3ee);
    border-radius: 4px;
    transition: width 0.1s;
    position: relative;
    z-index: 1;
}

.progress-bar:hover .progress-fill {
    background: linear-gradient(90deg, #22d3ee, #0e7490, #0891b2);
}

/* Slide Markers */
.slide-markers {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 2;
}

.slide-marker {
    position: absolute;
    top: 0;
    width: 2px;
    height: 100%;
    background: rgba(148, 163, 184, 0.4);
    transform: translateX(-50%);
}

.time-display {
    font-size: 12px;
    color: #94a3b8;
    font-family: 'SF Mono', Monaco, monospace;
    min-width: 80px;
    text-align: right;
}

/* Error State */
.player-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #ef4444;
    text-align: center;
    padding: 20px;
}

/* Responsive */
@media (max-width: 640px) {
    .infrina-player {
        border-radius: 0;
    }

    .player-controls {
        padding: 8px 12px;
        gap: 8px;
    }

    .time-display {
        display: none;
    }
}

/* Module Section Video Integration */
.module-video {
    margin: 24px 0;
}

.module-video-title {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.module-video-title svg {
    width: 16px;
    height: 16px;
}
