/* Prevent direct interaction with YouTube iframe */
.fca-custom-video-player .fca-video-container iframe {
    pointer-events: none !important;
}

/* Custom Video Player Controls */
.fca-custom-video-player .fca-video-controls-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: auto;
}

.fca-custom-video-player:hover .fca-video-controls-overlay,
.fca-custom-video-player:focus-within .fca-video-controls-overlay,
.fca-custom-video-player .fca-video-controls-overlay.fca-video-controls-visible {
    opacity: 1;
}

.fca-video-controls {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.5) 70%, transparent 100%);
    padding: 50px 20px 16px;
}

/* SVG Icons */
.fca-video-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    vertical-align: middle;
}

/* Progress Area */
.fca-video-progress-area {
    position: relative;
    margin-bottom: 14px;
    cursor: pointer;
}

.fca-video-chapter-markers {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
}

.fca-video-chapter-marker {
    position: absolute;
    top: -2px;
    width: 3px;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fca-video-chapter-marker:hover {
    background-color: rgba(255, 255, 255, 0.9);
    height: 14px;
}

.fca-video-progress-bar {
    position: relative;
    height: 5px;
    background-color: rgba(255, 255, 255, 0.25);
    border-radius: 3px;
    overflow: visible;
    transition: height 0.2s ease;
}

.fca-video-progress-bar:hover {
    height: 7px;
}

.fca-video-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: var(--fcom-primary-button, #1877F2);
    border-radius: 3px;
    transition: width 0.1s linear;
}

.fca-video-progress-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 15px;
    height: 15px;
    background-color: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.fca-video-progress-bar:hover .fca-video-progress-handle {
    opacity: 1;
}

/* Controls Bar */
.fca-video-controls-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}

.fca-video-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 0;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 6px;
    min-width: 36px;
    height: 36px;
}

.fca-video-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

.fca-video-btn:active {
    transform: scale(0.95);
}

/* Time Display */
.fca-video-time {
    font-size: 14px;
    font-weight: 500;
    user-select: none;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.fca-video-time-separator {
    opacity: 0.7;
    margin: 0 2px;
}

/* Volume Control */
.fca-video-volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.fca-video-volume-slider {
    width: 70px;
    height: 5px;
    background: rgba(255, 255, 255, 0.25);
    outline: none;
    border-radius: 3px;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.fca-video-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #fff;
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.fca-video-volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.fca-video-volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #fff;
    cursor: pointer;
    border-radius: 50%;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.fca-video-volume-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
}

/* Chapters Menu (inside player) */
.fca-video-chapters-menu {
    position: absolute;
    bottom: 100%;
    right: 10px;
    margin-bottom: 10px;
    background-color: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    min-width: 280px;
    max-width: 380px;
    max-height: 340px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.fca-video-chapters-list {
    padding: 8px;
}

.fca-video-chapter-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fca-video-chapter-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.fca-video-chapter-item.fca-video-chapter-active {
    background-color: var(--fcom-primary-button, #1877F2);
}

.fca-video-chapter-time {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    min-width: 45px;
}

.fca-video-chapter-title {
    font-size: 14px;
    color: #fff;
    flex: 1;
    line-height: 1.4;
}

/* External Chapters */
.fca-video-external-chapters {
    background-color: var(--fcom-card-bg, #fff);
    border: 1px solid var(--fcom-primary-border, #e5e7eb);
    border-radius: 12px;
    overflow: hidden;
}

.fca-chapters-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--fcom-primary-text, #19283a);
    padding: 16px 20px;
    border-bottom: 1px solid var(--fcom-primary-border, #e5e7eb);
    background-color: var(--fcom-active-bg, #f7f8fa);
}

.fca-chapters-list {
    padding: 8px;
}

.fca-chapter-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.fca-chapter-item:hover {
    background-color: var(--fcom-active-bg, #f0f3f5);
}

.fca-chapter-item.fca-chapter-active {
    background-color: var(--fcom-primary-button, #1877F2);
}

.fca-chapter-item.fca-chapter-active .fca-chapter-title,
.fca-chapter-item.fca-chapter-active .fca-chapter-time,
.fca-chapter-item.fca-chapter-active .fca-chapter-number {
    color: #fff;
}

.fca-chapter-number {
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--fcom-active-bg, #f0f3f5);
    color: var(--fcom-primary-text, #19283a);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
}

.fca-chapter-item.fca-chapter-active .fca-chapter-number {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.fca-chapter-info {
    flex: 1;
    min-width: 0;
}

.fca-chapter-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--fcom-primary-text, #19283a);
    line-height: 1.4;
    margin-bottom: 4px;
}

.fca-chapter-time {
    font-size: 12px;
    font-weight: 500;
    color: var(--fcom-secondary-text, #6b7280);
}

/* Below Chapters */
.fca-chapters-below {
    margin-top: 20px;
}

/* Side Chapters */
.fca-video-with-side-chapters {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.fca-video-with-side-chapters .fca-custom-video-player {
    flex: 1;
    min-width: 0;
}

.fca-video-with-side-chapters .fca-chapters-side {
    flex: 0 0 320px;
    max-width: 380px;
}

/* Responsive */
@media (max-width: 968px) {
    .fca-video-with-side-chapters {
        flex-direction: column;
    }
    
    .fca-video-with-side-chapters .fca-chapters-side {
        flex: 1;
        max-width: 100%;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .fca-video-controls {
        padding: 40px 16px 12px;
    }
    
    .fca-video-btn {
        padding: 6px;
        min-width: 32px;
        height: 32px;
    }
    
    .fca-video-icon {
        width: 18px;
        height: 18px;
    }
    
    .fca-video-time {
        font-size: 13px;
    }
    
    .fca-video-volume-slider {
        width: 50px;
    }
    
    .fca-video-chapters-menu {
        right: auto;
        left: 10px;
        max-width: calc(100% - 20px);
    }
}

@media (max-width: 480px) {
    .fca-video-volume-slider {
        display: none;
    }
    
    .fca-video-controls-bar {
        gap: 6px;
    }
    
    .fca-video-btn {
        padding: 5px;
        min-width: 28px;
        height: 28px;
    }
    
    .fca-video-icon {
        width: 16px;
        height: 16px;
    }
}

/* Fullscreen adjustments */
.fca-custom-video-player:fullscreen .fca-video-controls,
.fca-custom-video-player:-webkit-full-screen .fca-video-controls,
.fca-custom-video-player:-moz-full-screen .fca-video-controls {
    padding: 70px 28px 24px;
}

.fca-custom-video-player:fullscreen .fca-video-btn,
.fca-custom-video-player:-webkit-full-screen .fca-video-btn,
.fca-custom-video-player:-moz-full-screen .fca-video-btn {
    min-width: 44px;
    height: 44px;
    padding: 10px;
}

.fca-custom-video-player:fullscreen .fca-video-icon,
.fca-custom-video-player:-webkit-full-screen .fca-video-icon,
.fca-custom-video-player:-moz-full-screen .fca-video-icon {
    width: 24px;
    height: 24px;
}

/* Smooth scrolling for chapters menu */
.fca-video-chapters-menu,
.fca-chapters-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.fca-video-chapters-menu::-webkit-scrollbar,
.fca-chapters-list::-webkit-scrollbar {
    width: 8px;
}

.fca-video-chapters-menu::-webkit-scrollbar-track,
.fca-chapters-list::-webkit-scrollbar-track {
    background: transparent;
}

.fca-video-chapters-menu::-webkit-scrollbar-thumb,
.fca-chapters-list::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.fca-video-chapters-menu::-webkit-scrollbar-thumb:hover,
.fca-chapters-list::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

/* Timeline View */
.fca-video-timeline-container {
    margin-top: 24px;
    background-color: var(--fcom-card-bg, #fff);
    border: 1px solid var(--fcom-primary-border, #e5e7eb);
    border-radius: 12px;
    overflow: hidden;
}

.fca-timeline-chapters-list {
    padding: 12px 20px 20px;
    display: flex;
    flex-direction: row;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    min-width: 100%;
}

.fca-timeline-list-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: var(--fcom-active-bg, #f0f3f5);
    border: 2px solid transparent;
    min-width: 0;
    flex: 1 1 0;
    max-width: 200px;
}

.fca-timeline-list-item:hover {
    background-color: var(--fcom-primary-button, #1877F2);
    border-color: var(--fcom-primary-button, #1877F2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.2);
}

.fca-timeline-list-item:hover .fca-timeline-list-number,
.fca-timeline-list-item:hover .fca-timeline-list-title,
.fca-timeline-list-item:hover .fca-timeline-list-time {
    color: #fff;
}

.fca-timeline-list-item-active {
    background-color: var(--fcom-primary-button, #1877F2);
    border-color: var(--fcom-primary-button, #1877F2);
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.3);
}

.fca-timeline-list-item-active .fca-timeline-list-number,
.fca-timeline-list-item-active .fca-timeline-list-title,
.fca-timeline-list-item-active .fca-timeline-list-time {
    color: #fff;
}

.fca-timeline-list-number {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--fcom-primary-text, #19283a);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.2s ease;
}

.fca-timeline-list-item-active .fca-timeline-list-number {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.fca-timeline-list-info {
    flex: 1;
    min-width: 0;
    width: 100%;
    text-align: center;
}

.fca-timeline-list-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--fcom-primary-text, #19283a);
    line-height: 1.3;
    margin-bottom: 4px;
    transition: color 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-align: center;
}

.fca-timeline-list-time {
    font-size: 11px;
    font-weight: 500;
    color: var(--fcom-secondary-text, #6b7280);
    transition: color 0.2s ease;
    white-space: nowrap;
}

/* Responsive Timeline */
@media (max-width: 768px) {
    .fca-timeline-chapters-list {
        flex-direction: row;
        overflow-x: auto;
        gap: 8px;
        padding: 12px 16px 16px;
    }
    
    .fca-timeline-list-item {
        flex: 0 0 auto;
        min-width: 120px;
    }
}
