/* ========================================
   YouTube 플레이어 윈도우 스타일시트
   ======================================== */

/* ========================================
   1. 기본 레이아웃 및 컨테이너
   ======================================== */

body { 
    margin: 0; 
    padding: 0; 
    background-color: #000; 
    font-family: Arial, sans-serif;
}

.video-player-container { 
    width: 100%; 
    height: 100vh; 
    display: flex; 
    flex-direction: column; 
}

.video-area { 
    height: 50vh !important;
    position: relative; 
    background-color: #000; 
}

.video-controls-container { 
    height: 50vh !important;
    background-color: #f8f9fa; 
    border-top: 1px solid #e9ecef; 
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ========================================
   2. YouTube 플레이어 영역
   ======================================== */

#youtubePlayerContainer {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: #000;
    overflow: hidden;
}

#youtubePlayerContainer iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    border: 0;
}

/* ========================================
   3. 비디오 정보 바 및 컨트롤
   ======================================== */

.video-info-bar { 
    flex-shrink: 0;
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    flex-wrap: wrap; 
    padding: 0px 0;
}

.info-left { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    padding: 4px 0;
}

.info-right { 
    display: flex; 
    align-items: center; 
    flex-wrap: wrap; 
    gap: 5px;
}

.video-title { 
    font-weight: 500; 
    font-size: 16px; 
    line-height: 1.5; 
    padding: 5px 0; 
    color: #333;
}

/* 도움말 버튼 호버 효과 */
#helpBtn:hover {
    background-color: #f48fb1 !important;
    border-color: #e91e63 !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(233, 30, 99, 0.3);
}

/* ========================================
   4. 진행바 및 시간 표시
   ======================================== */

.video-progress-info {
    flex-shrink: 0;
    margin: 10px 15px;
}

.video-progress { 
    position: relative;
    height: 20px; 
    background-color: #e9ecef; 
    border-radius: 10px; 
    margin-bottom: 8px; 
    cursor: pointer;
    overflow: hidden;
}

.video-progress-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #dee2e6;
}

.segment-range {
    position: absolute;
    top: 0;
    height: 100%;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
}

.progress-bar { 
    position: absolute; 
    top: 0;
    height: 100%; 
    background-color: #28a745; 
    border-radius: 10px;
    width: 0%;
    transition: width 0.1s ease;
}

.progress-bar.dragging {
    transition: none;
}

.progress-marker { 
    position: absolute; 
    top: 50%; 
    width: 16px; 
    height: 16px; 
    background-color: #155724; 
    border-radius: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    z-index: 5;
}

.main-progress-handle {
    position: absolute;
    top: 50%;
    width: 16px;
    height: 16px;
    background-color: #007bff;
    border: 2px solid #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    left: 0%;
    cursor: grab;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    z-index: 10;
}

.main-progress-handle:active {
    cursor: grabbing;
}

/* 시간 표시 스타일 */
.progress-time-info {
    font-size: 12px;
    color: #6c757d;
    text-align: center;
}

#currentTime, #modalCurrentTime {
    color: #dc3545 !important;
    font-weight: bold;
    font-size: 20px;
}

#totalTime, #modalTotalTime {
    font-size: 20px;
    font-weight: bold;
}

.segment-range-text {
    color: #28a745;
    font-weight: 500;
}

/* ========================================
   5. 모든 구간 표시
   ======================================== */

#allSegmentsDisplay .segment-block {
    position: absolute;
    top: 0;
    height: 100%;
    background-color: #9ccc65;
    border: 1px solid #7cb342;
    border-radius: 2px;
    z-index: 3;
    opacity: 0.7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #2e7d32;
    font-weight: bold;
    text-shadow: 0 1px 1px rgba(255,255,255,0.5);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding: 0 2px;
    min-width: 20px;
}

#allSegmentsDisplay .segment-block:hover {
    opacity: 0.9;
    background-color: #8bc34a;
    cursor: pointer;
}

#allSegmentsDisplay .segment-block.small {
    font-size: 0;
}

#allSegmentsDisplay .segment-block.small::after {
    content: '●';
    font-size: 8px;
    color: #2e7d32;
}

/* ========================================
   6. 시간 이동 및 재생 컨트롤 버튼
   ======================================== */

.time-control-buttons {
    margin-top: 8px;
    padding: 5px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.time-control-buttons .btn {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.time-control-buttons .btn i {
    margin-right: 2px;
}

#playPauseBtn {
    min-width: 40px;
    padding: 4px 12px;
}

/* ========================================
   7. 볼륨 조절
   ======================================== */

.volume-control-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-slider-container {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 120px;
}

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

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.volume-slider:hover::-webkit-slider-thumb {
    background: #0056b3;
    transform: scale(1.1);
    transition: all 0.2s ease;
}

.volume-slider:hover::-moz-range-thumb {
    background: #0056b3;
    transform: scale(1.1);
    transition: all 0.2s ease;
}

.volume-percentage {
    font-size: 11px;
    color: #666;
    min-width: 30px;
    text-align: center;
    font-weight: 500;
}

/* 음소거 버튼 스타일 */
#modalMuteToggleBtn.btn-warning,
#mainMuteToggleBtn.btn-warning {
    color: white !important;
}

#modalMuteToggleBtn.btn-warning:hover,
#mainMuteToggleBtn.btn-warning:hover {
    color: white !important;
}

/* ========================================
   8. 자막 언어 설정
   ======================================== */

.subtitle-language-container { 
    position: relative; 
    display: inline-block;
}

.subtitle-language-options { 
    position: absolute; 
    top: 100%; 
    left: 0; 
    background: white; 
    border: 1px solid #ddd; 
    border-radius: 4px; 
    padding: 5px; 
    z-index: 9999; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); 
    width: 120px;
}

.subtitle-language-option { 
    width: 100%; 
    text-align: left; 
    font-size: 0.8rem; 
    margin-bottom: 2px;
}

.subtitle-language-option:last-child { 
    margin-bottom: 0;
}

.subtitle-language-option:hover, 
.subtitle-language-option:focus { 
    background-color: #f8f9fa;
}

.lang-value { 
    display: inline-block; 
    min-width: 30px;
}

/* ========================================
   9. 재생 속도 설정
   ======================================== */

.playback-rate-container { 
    position: relative; 
    display: inline-block;
}

.playback-rate-options { 
    position: absolute; 
    top: 100%; 
    right: 0 !important;
    left: auto !important;
    background: white; 
    border: 1px solid #ddd; 
    border-radius: 4px; 
    padding: 5px; 
    z-index: 9999; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); 
    width: 220px; 
    display: flex; 
    flex-wrap: wrap; 
    gap: 5px;
}

.playback-rate-option { 
    flex: 1 0 45px; 
    text-align: center; 
    font-size: 0.8rem; 
    margin: 2px;
}

.playback-rate-option:hover, 
.playback-rate-option:focus { 
    background-color: #f8f9fa;
}

.rate-value { 
    display: inline-block; 
    min-width: 20px;
}

/* ========================================
   10. 구간 목록 (수정된 부분)
   ======================================== */

/* 구간 목록 전체 컨테이너 */
.segment-list { 
    flex: 1;
    margin-top: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* 구간 목록 헤더 - 고정 영역 */
.segment-list-header {
    flex-shrink: 0;
    background-color: #f8f9fa;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 10px;
}

/* 실제 구간들이 들어가는 스크롤 영역 */
#segmentItems {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 5px;
}

/* 스크롤바 스타일 개선 */
#segmentItems::-webkit-scrollbar {
    width: 6px;
}

#segmentItems::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#segmentItems::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

#segmentItems::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.segment-list-container {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 5px;
}

.segment-item { 
    cursor: pointer;
    transition: background-color 0.2s;
    margin-bottom: 8px;
}

.segment-item:hover { 
    background-color: #f0f0f0;
}

.segment-item.active { 
    background-color: #e8f4f8;
    border-color: #8bc4ea;
}

.segment-item.checked {
    background-color: #e3f2fd;
    border-color: #2196f3;
}

.segment-checkbox {
    margin-right: 8px;
    transform: scale(1.2);
}

#selectAllSegments {
    margin-left: 10px;
    margin-right: 8px;
    transform: scale(1.3);
}

.segment-description { 
    flex-grow: 1; 
    margin-right: 10px; 
    font-size: 14px; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis;
}

.segment-time { 
    color: #6c757d; 
    font-size: 12px; 
    margin-right: 10px;
}

.segment-play-btn { 
    white-space: nowrap; 
    padding: 2px 8px;
}

.no-segments {
    text-align: center; 
    padding: 20px; 
    color: #6c757d;
}

/* 구간 목록 정렬 개선 */
.segment-item .d-flex .d-flex {
    align-items: center;
}

.segment-item .badge {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

.segment-item .card-body .d-flex > div:first-child {
    align-items: center;
}

.segment-item .card-body .d-flex > div:first-child > div {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.segment-item .card-body .d-flex > div:first-child > div > span,
.segment-item .card-body .d-flex > div:first-child > div > .badge {
    display: inline-flex;
    align-items: center;
}

/* ========================================
   11. 구간연속 재생
   ======================================== */

#sequentialPlayBtn {
    background: linear-gradient(45deg, #4caf50, #8bc34a);
    border: none;
    color: white;
    font-weight: bold;
}

#sequentialPlayBtn:hover {
    background: linear-gradient(45deg, #45a049, #7cb342);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

#sequentialPlayBtn:disabled {
    background: #ccc;
    color: #666;
    transform: none;
    box-shadow: none;
}

#sequentialPlayBtn.btn-warning {
    background: linear-gradient(45deg, #ff9800, #f57c00);
}

#sequentialPlayBtn.btn-warning:hover {
    background: linear-gradient(45deg, #e68900, #e65100);
}

.sequential-playing {
    animation: pulse 1.5s infinite;
    border-color: #ff9800 !important;
    background-color: #fff3e0 !important;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* ========================================
   12. 반복횟수 설정
   ======================================== */

.repeat-count-container {
    position: relative;
    display: inline-block;
    margin-left: 8px;
}

.repeat-count-btn {
    font-size: 11px;
    padding: 2px 6px;
    min-width: 40px;
    border-radius: 12px;
}

.repeat-count-btn.has-repeat {
    background-color: #ff6b6b;
    border-color: #ff5252;
    color: white;
}

.repeat-count-btn.has-repeat:hover {
    background-color: #ff5252;
    border-color: #f44336;
    color: white;
}

.repeat-count-dropdown {
    position: absolute;
    top: 100%;
    right: -50px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 240px;
    white-space: nowrap;
    display: none;
}

.repeat-count-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 62px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid white;
}

.repeat-count-header {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
    text-align: center;
}

.repeat-count-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    margin-top: 5px;
}

.repeat-count-option {
    padding: 4px 8px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    background: white;
    transition: all 0.2s;
    white-space: nowrap;
}

.repeat-count-option:hover {
    background: #f0f0f0;
    border-color: #007bff;
}

.repeat-count-option.selected {
    background: #007bff;
    color: white;
    border-color: #0056b3;
}

.repeat-count-reset {
    margin-top: 8px;
    padding: 4px 12px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    width: 100%;
}

.repeat-count-reset:hover {
    background: #5a6268;
}

/* ========================================
   13. 구간 상세 설명 레이어
   ======================================== */

.segment-detail-btn {
    font-size: 12px;
    padding: 2px 6px;
    margin-left: 8px;
}

.segment-detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: none;
}

.segment-detail-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    max-width: 700px;
    max-height: 70%;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    width: 90%;
}

.segment-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.segment-detail-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.segment-detail-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.segment-detail-close:hover {
    color: #333;
}

.segment-detail-content {
    white-space: pre-wrap;
    line-height: 1.6;
    color: #555;
}

/* ========================================
   14. 모달 (구간 편집)
   ======================================== */

.modal-video-preview {
    background: #000; 
    border-radius: 8px; 
    overflow: hidden;
    margin-bottom: 15px;
}

#modalVideoContainer {
    width: 100%; 
    height: 200px; 
    position: relative;
}

#modalVideoContainer iframe {
    width: 100% !important;
    height: 100% !important;
}

.modal-progress-container {
    margin-bottom: 15px;
}

.modal-progress-info {
    margin-bottom: 8px;
    font-size: 14px;
    color: #333;
}

.modal-video-progress {
    position: relative; 
    height: 20px; 
    background-color: #e9ecef; 
    border-radius: 10px; 
    cursor: pointer;
}

.modal-progress-fill {
    height: 100%; 
    background-color: #007bff; 
    border-radius: 10px; 
    width: 0%; 
    transition: width 0.1s ease;
}

.modal-progress-fill.dragging {
    transition: none;
}

.modal-progress-handle {
    position: absolute; 
    top: 50%; 
    width: 16px; 
    height: 16px; 
    background-color: #007bff; 
    border: 2px solid #fff; 
    border-radius: 50%; 
    transform: translate(-50%, -50%); 
    left: 0%; 
    cursor: grab; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.modal-progress-handle:active {
    cursor: grabbing;
}

.modal-controls {
    text-align: center;
    margin-bottom: 20px;
}

.modal-controls .btn {
    margin: 0 5px;
    font-size: 13px;
    padding: 6px 10px;
}

.modal-controls #modalPlayPauseBtn {
    font-size: 14px;
    padding: 8px 12px;
    min-width: 50px;
}

/* ========================================
   15. 구간 편집 폼
   ======================================== */

.segment-form-group {
    padding: 15px 15px 8px 15px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 15px;
    background-color: #fff;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.segment-form-group.new-segment {
    background-color: #e0f7fa !important;
    border: 2px dashed #4dd0e1 !important;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.segment-form-group.new-segment .segment-title {
    color: #00695c;
    font-weight: bold;
}

.new-segment-help {
    display: none;
}

.segment-form-group.new-segment .new-segment-help {
    display: block !important;
}

.segment-title {
    color: #333;
    margin-bottom: 15px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.segment-form-group .input-group {
    margin-bottom: 10px;
}

.segment-form-group .input-group-text {
    font-size: 0.9rem;
    min-width: 50px;
    justify-content: center;
}

/* ========================================
   16. 구간목록 모달
   ======================================== */

.modal-segment-list {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

#segmentListModalBtn:hover {
    background-color: #17a2b8 !important;
    border-color: #138496 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(23, 162, 184, 0.3);
}

/* ========================================
   17. 스크롤바 스타일링
   ======================================== */

.segment-list::-webkit-scrollbar,
.segment-list-container::-webkit-scrollbar,
.modal-segment-list::-webkit-scrollbar {
    width: 8px;
}

.segment-list::-webkit-scrollbar-track,
.segment-list-container::-webkit-scrollbar-track,
.modal-segment-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.segment-list::-webkit-scrollbar-thumb,
.segment-list-container::-webkit-scrollbar-thumb,
.modal-segment-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.segment-list::-webkit-scrollbar-thumb:hover,
.segment-list-container::-webkit-scrollbar-thumb:hover,
.modal-segment-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ========================================
   18. 모바일 반응형 (768px 이하)
   ======================================== */

@media (max-width: 768px) {
    .video-area {
        height: 50vh !important;
    }
    
    .video-controls-container {
        height: 50vh !important;
    }
    
    .video-info-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .info-left {
        width: 100%;
        justify-content: flex-start;
        margin-bottom: 4px;
        padding: 0;
    }
    
    .video-title { 
        max-width: 100%;
    }
    
    .info-right { 
        width: 100%;
        justify-content: flex-end;
        margin-top: 0;
    }
    
    .info-right .btn {
        margin-right: 3px !important;
        margin-left: 0 !important;
    }
    
    .info-right .btn:last-child {
        margin-right: 0 !important;
    }
    
    .info-right .subtitle-language-container,
    .info-right .playback-rate-container {
        margin-right: 3px !important;
    }
    
    .time-control-buttons .btn {
        font-size: 10px;
        padding: 3px 6px;
    }
    
    .segment-form-group .input-group-text {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
    
    .segment-form-group .form-control {
        font-size: 0.85rem;
        padding: 0.25rem 0.5rem;
    }
    
    .segment-list-container {
        max-height: 200px;
    }
    
    .modal-controls .btn {
        font-size: 11px;
        padding: 5px 8px;
        margin: 0 3px;
    }
    
    .modal-controls #modalPlayPauseBtn {
        font-size: 13px;
        padding: 6px 10px;
        min-width: 45px;
    }
    
    .modal-segment-list {
        max-height: 350px;
    }
    
    .volume-slider-container {
        min-width: 100px;
    }
    
    .volume-slider {
        width: 60px;
    }
    
    .volume-percentage {
        font-size: 10px;
        min-width: 25px;
    }
    
    .playback-rate-options {
        right: -5px !important;
    }
    
    .repeat-count-dropdown {
        right: -30px;
        min-width: 240px;
    }
    
    .repeat-count-dropdown::before {
        right: 42px;
    }
    
    .repeat-count-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .segment-detail-modal {
        max-width: 80%;
        max-height: 80%;
        padding: 15px;
        margin: 10px;
        width: calc(100vw - 20px);
        min-width: 280px;
    }
    
    .segment-detail-header {
        margin-bottom: 10px;
        padding-bottom: 8px;
    }
    
    .segment-detail-title {
        font-size: 15px;
    }
    
    .segment-detail-content {
        font-size: 14px;
        line-height: 1.5;
    }
}

/* ========================================
   19. 모바일 반응형 (480px 이하)
   ======================================== */

@media (max-width: 480px) {
    .video-area {
        height: 40vh !important;
    }
    
    .video-controls-container {
        height: 60vh !important;
    }
    
    .info-right .btn {
        margin-right: 2px !important;
        margin-left: 0 !important;
    }
    
    .info-right .btn:last-child {
        margin-right: 0 !important;
    }
    
    .info-right .subtitle-language-container,
    .info-right .playback-rate-container {
        margin-right: 2px !important;
    }
    
    .modal-controls .btn {
        font-size: 10px;
        padding: 4px 6px;
        margin: 0 2px;
    }
    
    .modal-controls #modalPlayPauseBtn {
        font-size: 12px;
        padding: 5px 8px;
        min-width: 40px;
    }
    
    .modal-segment-list {
        max-height: 300px;
    }
    
    .volume-slider-container {
        min-width: 80px;
    }
    
    .volume-slider {
        width: 50px;
    }
    
    .segment-detail-modal {
        max-width: 80%;
        max-height: 85%;
        padding: 12px;
        margin: 5px;
        width: calc(100vw - 10px);
        border-radius: 6px;
    }
    
    .segment-detail-title {
        font-size: 15px;
    }
    
    .segment-detail-content {
        font-size: 14px;
    }
    
    .segment-detail-close {
        width: 28px;
        height: 28px;
        font-size: 18px;
    }
}

/* ========================================
   20. PC 큰 화면 (1200px 이상)
   ======================================== */

@media (min-width: 1200px) {
    .segment-detail-modal {
        max-width: 800px;
        width: 60%;
    }
}

/* ========================================
   21. 모달 배속 설정 (추가)
   ======================================== */

/* 모달 배속 버튼 높이 조정 */
#modalPlaybackRateBtn {
    height: 38px;
}

/* 모달 배속 초기화 버튼 스타일 */
.modal-playback-rate-reset {
    width: 100% !important;
    border-top: 1px solid #ddd !important;
    border-radius: 0 0 4px 4px !important;
    margin-top: 2px;
}

/* ========================================
   22. 전체화면 및 반복 컨트롤 (Bootstrap 덮어쓰기)
   ======================================== */

/* Bootstrap 덮어쓰기 - 강제 적용 */
.progress-time-info {
    font-size: 12px !important;
    color: #6c757d !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    width: 100% !important;
}

.time-info-left {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex: 1 !important;
    min-width: 0 !important;
}

.fullscreen-repeat-controls {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
}

/* 전체 반복 설정 */
.full-repeat-container {
    position: relative;
    display: inline-block;
}

#fullRepeatBtn {
    min-width: 80px;
    font-size: 14px; /* 기존 14px 유지 */
    padding: 4px 8px; /* 기존 패딩 유지 */
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.repeat-text {
    font-size: 14px; /* 아이콘과 동일한 크기 */
    font-weight: 500;
}

/* 전체화면 버튼들 */
#portraitFullscreenBtn, #landscapeFullscreenBtn {
    min-width: 44px;
    font-size: 14px;
    padding: 4px 8px;
    transition: all 0.2s ease;
}

.full-repeat-options {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 180px;
    white-space: nowrap;
    margin-top: 5px;
}

/* d-none 클래스가 적용될 때만 숨김 */
.full-repeat-options.d-none {
    display: none !important;
}

.full-repeat-options::after {
    content: '';
    position: absolute;
    top: -6px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid white;
}

.full-repeat-header {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    text-align: center;
    font-weight: bold;
}

.full-repeat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 8px;
}

.full-repeat-option {
    padding: 6px 8px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    background: white;
    transition: all 0.2s;
}

.full-repeat-option:hover {
    background: #f0f0f0;
    border-color: #007bff;
}

.full-repeat-option.selected {
    background: #007bff;
    color: white;
    border-color: #0056b3;
}

.full-repeat-reset {
    width: 100%;
    padding: 6px 12px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
}

.full-repeat-reset:hover {
    background: #5a6268;
}

#portraitFullscreenBtn:hover {
    background-color: #007bff;
    border-color: #0056b3;
    color: white;
    transform: translateY(-1px);
}

#landscapeFullscreenBtn:hover {
    background-color: #28a745;
    border-color: #1e7e34;
    color: white;
    transform: translateY(-1px);
}

/* 반복 활성 상태 */
#fullRepeatBtn.active {
    background-color: #dc3545;
    border-color: #c82333;
    color: white;
}

#fullRepeatBtn.active:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

/* 레이어 우선순위 정리 */
.full-repeat-options {
    z-index: 9995 !important; /* 다른 드롭다운보다 높게 */
}

.repeat-count-dropdown {
    z-index: 9994 !important;
}

.subtitle-language-options {
    z-index: 9990 !important;
}

.playback-rate-options {
    z-index: 9991 !important;
}