/* Custom A-B Loop Player Styles - Modern Glass Redesign */

.ab-player-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 2rem auto;
    background: transparent;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: none;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: white;
    aspect-ratio: 16 / 9;
}

.ab-player-container video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

/* Controls Overlay - Floating Glass Bar */
.ab-player-container .controls-overlay {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    /* Floating Effect */
    background: rgba(15, 23, 42, 0.75);
    /* Dark Slate with transparency */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 12px 20px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transform: translateY(10px);
}

.ab-player-container.cloza-show-controls .controls-overlay {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Progress Bar */
.ab-player-container .progress-area {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    transition: height 0.1s;
    margin-bottom: 6px;
}

.ab-player-container .progress-area:hover {
    height: 8px;
}

.ab-player-container .progress-bar {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    overflow: hidden;
    overflow: visible;
}

.ab-player-container .progress-fill {
    height: 100%;
    background: #3b82f6;
    /* Brand Blue */
    width: 0%;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 10px;
    pointer-events: none;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

/* Time Tooltip */
.ab-player-container .time-tooltip {
    position: absolute;
    top: -35px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    transform: translateX(-50%);
    pointer-events: none;
    display: none;
    font-weight: 600;
}

.ab-player-container .progress-area:hover .time-tooltip {
    display: block;
}

/* Markers & Regions */
.ab-player-container .loop-marker {
    position: absolute;
    top: -4px;
    width: 2px;
    height: 16px;
    background: #FFD700;
    /* Gold */
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.8);
}

.ab-player-container .loop-region {
    position: absolute;
    top: 0;
    height: 100%;
    background: rgba(255, 215, 0, 0.25);
    /* Gold Tint */
    pointer-events: none;
}

.ab-player-container .hidden {
    display: none !important;
}

/* Main Controls Row */
.ab-player-container .controls-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ab-player-container .controls-left,
.ab-player-container .controls-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Buttons */
.ab-player-container .control-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
    transition: all 0.2s;
    border-radius: 8px;
}

.ab-player-container .control-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.ab-player-container .control-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

/* Loop Buttons */
.ab-player-container .loop-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 6px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ab-player-container .loop-btn {
    font-weight: 700;
    font-size: 13px;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.9);
}

.ab-player-container .loop-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.ab-player-container .loop-btn.active {
    background: #FFD700;
    /* Gold */
    color: #1a1a1a;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
}

.ab-player-container .loop-btn.disabled {
    opacity: 0.3;
    pointer-events: none;
}

.ab-player-container .loop-status {
    font-size: 11px;
    margin-left: 4px;
    color: #cbd5e1;
    /* Light Slate */
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 60px;
}

/* Volume Slider */
.ab-player-container .volume-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ab-player-container input[type="range"] {
    width: 70px;
    accent-color: #3b82f6;
    height: 4px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    -webkit-appearance: none;
}

/* Time Display */
.ab-player-container .time-display {
    font-size: 13px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: #cbd5e1;
    margin-left: 4px;
}

/* Spinner */
.ab-player-container .loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
    pointer-events: none;
    z-index: 20;
}

.ab-player-container.loading .loading-spinner {
    display: block;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Speed Selector */
.ab-player-container .speed-control-container {
    position: relative;
    display: flex;
    align-items: center;
}

.ab-player-container .speed-selector {
    background: rgba(0, 0, 0, 0.3);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 3px 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
}

.ab-player-container .speed-selector:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
}

.ab-player-container .speed-selector option {
    background: #1e293b;
    color: white;
}

/* Tutor LMS Spotlight Mode Override - Force Light Theme */
body.tutor-spotlight-mode,
.tutor-spotlight-mode,
.tutor-lesson-content-area,
.tutor-single-lesson-wrap,
.tutor-lesson-viewer {
    background-color: #f5f5f5 !important;
    background: #f5f5f5 !important;
}

/* Ensure text is readable on light background */
body.tutor-spotlight-mode,
.tutor-spotlight-mode,
.tutor-spotlight-mode h1,
.tutor-spotlight-mode h2,
.tutor-spotlight-mode h3,
.tutor-spotlight-mode p,
.tutor-spotlight-mode li,
.tutor-spotlight-mode span {
    color: #1a202c !important;
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .ab-player-container .controls-overlay {
        bottom: 10px;
        left: 10px;
        right: 10px;
        padding: 10px;
    }

    .ab-player-container .controls-main {
        flex-wrap: wrap;
        gap: 10px;
    }

    .ab-player-container .loop-controls {
        order: 3;
        width: 100%;
        margin-top: 5px;
        justify-content: space-between;
    }

    .ab-player-container .time-display {
        font-size: 11px;
    }
}