/* video.css - 영상 녹화 및 트리밍 편집기 스타일 */

/* 영상 녹화 UI */
.video-record-area {
    display: none;
    text-align: center;
    position: relative;
    min-height: 280px;
}

.video-record-area.show {
    display: block;
}

#cameraPreview {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 0;
    background: #000;
}

.record-controls {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.record-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 4px solid #c41e3a;
    background: white;
    cursor: pointer;
    position: relative;
    transition: all 0.3s;
}

.record-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background: #c41e3a;
    border-radius: 50%;
    transition: all 0.3s;
}

.record-btn.recording::after {
    width: 24px;
    height: 24px;
    border-radius: 4px;
}

.record-btn.recording {
    border-color: #ff4444;
    animation: pulse-record 1s infinite;
}

@keyframes pulse-record {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 15px rgba(255, 68, 68, 0); }
}

.record-timer {
    font-size: 1.5rem;
    font-weight: bold;
    color: #c41e3a;
}

.record-hint {
    font-size: 0.85rem;
    color: #666;
}

.gallery-upload-area {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #ddd;
}

.gallery-upload-btn {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #2d5a3f 0%, #1a472a 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.gallery-upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(45, 90, 63, 0.4);
}

.gallery-upload-btn:active {
    transform: translateY(0);
}

.camera-switch-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
    z-index: 10;
}

.camera-switch-btn:hover {
    background: white;
    transform: scale(1.1);
}

.camera-switch-btn:active {
    transform: scale(0.95);
}

/* 카메라 프리뷰 컨테이너 */
.camera-preview-container {
    position: relative;
    width: 100%;
    min-height: 250px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

/* 영상 초기 선택 화면 */
.video-initial-choice {
    padding: 30px 20px;
    text-align: center;
}

.video-initial-choice .upload-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.video-initial-choice h3 {
    margin-bottom: 10px;
    color: #333;
}

.video-initial-choice p {
    color: #666;
    margin-bottom: 20px;
}

/* 뒤로가기 버튼 */
.back-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
    z-index: 10;
}

.back-btn:hover {
    background: white;
    transform: scale(1.1);
}

/* 영상 트리밍 편집기 */
.video-trim-editor {
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
}

.trim-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #2a2a2a;
}

.trim-header h3 {
    color: white;
    font-size: 1rem;
    margin: 0;
}

.trim-back-btn,
.trim-done-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.trim-back-btn {
    background: #444;
    color: white;
}

.trim-done-btn {
    background: linear-gradient(135deg, #c41e3a 0%, #a01830 100%);
    color: white;
}

.trim-done-btn:hover {
    transform: scale(1.05);
}

.trim-preview-container {
    position: relative;
    background: #000;
}

#trimPreviewVideo {
    width: 100%;
    max-height: 250px;
    object-fit: contain;
}

.trim-time-display {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    z-index: 5;
}

/* 영상 로딩 오버레이 */
.trim-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    z-index: 10;
    color: white;
    font-size: 0.95rem;
}

.trim-loading-overlay.hidden {
    display: none;
}

.trim-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #c41e3a;
    border-radius: 50%;
    animation: trimSpinner 0.8s linear infinite;
}

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

/* 로딩 중일 때 컨트롤 비활성화 */
.trim-controls.loading {
    opacity: 0.5;
    pointer-events: none;
    font-size: 0.85rem;
}

/* 영상 처리 중 오버레이 */
.trim-processing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.trim-processing-overlay.hidden {
    display: none;
}

.processing-content {
    text-align: center;
    color: white;
    padding: 30px;
    max-width: 280px;
}

.processing-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.15);
    border-top-color: #c41e3a;
    border-radius: 50%;
    animation: processingSpinner 1s linear infinite;
    margin: 0 auto 20px;
}

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

.processing-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #ffffff;
}

.processing-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.processing-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #c41e3a, #ff6b6b);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

.processing-percent {
    font-size: 1.5rem;
    font-weight: 700;
    color: #c41e3a;
    margin-bottom: 10px;
}

.processing-time {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.trim-controls {
    padding: 20px;
}

.trim-slider-container {
    margin-bottom: 15px;
}

.trim-track {
    position: relative;
    height: 60px;
    background: #222;
    border-radius: 8px;
    overflow: hidden;
    touch-action: none;
    user-select: none;
}

/* 썸네일 및 오버레이 - 제거됨 (사용자 요청) */
.trim-thumbnails,
.trim-thumbnail,
.trim-overlay-left,
.trim-overlay-right {
    display: none;
}

.trim-selected {
    position: absolute;
    top: 0;
    height: 100%;
    min-width: 80px;
    border: 3px solid #c41e3a;
    border-radius: 4px;
    box-sizing: border-box;
    z-index: 3;
    pointer-events: auto;
    cursor: grab;
    box-shadow: 0 0 10px rgba(196, 30, 58, 0.5);
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
    touch-action: none;
}

.trim-selected:hover {
    box-shadow: 0 0 15px rgba(196, 30, 58, 0.7);
    border-color: #e52848;
}

.trim-selected.dragging {
    cursor: grabbing;
    box-shadow: 0 0 20px rgba(196, 30, 58, 1);
    border-color: #ff3355;
}

/* 드래그 힌트 아이콘 */
.trim-selected::after {
    content: '⋮⋮';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    letter-spacing: 2px;
    pointer-events: none;
}

.trim-handle {
    position: absolute;
    top: 0;
    width: 20px;
    height: 100%;
    background: linear-gradient(135deg, #c41e3a 0%, #a01830 100%);
    cursor: ew-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    touch-action: none;
}

.trim-handle:hover {
    transform: scaleX(1.1);
    box-shadow: 0 0 15px rgba(196, 30, 58, 0.8);
}

.trim-handle.dragging {
    transform: scaleX(1.2);
    box-shadow: 0 0 20px rgba(196, 30, 58, 1);
}

.trim-handle::before {
    display: none;
}

.trim-handle::after {
    display: none;
}

.trim-handle.start {
    left: 0;
    border-radius: 6px 0 0 6px;
}

.trim-handle.end {
    right: 0;
    border-radius: 0 6px 6px 0;
}

.trim-playhead {
    position: absolute;
    top: -5px;
    width: 3px;
    height: calc(100% + 10px);
    background: white;
    pointer-events: none;
    z-index: 5;
    border-radius: 2px;
    box-shadow: 0 0 5px rgba(255,255,255,0.8);
    transition: left 0.05s linear;
}

.trim-playhead::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid white;
}

/* 전체 타임라인 시간 표시 (0:00 ~ 전체길이) */
.trim-timeline-times {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    color: #888;
    font-size: 0.75rem;
}

/* 선택 구간 정보 */
.trim-selection-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding: 12px 16px;
    background: rgba(196, 30, 58, 0.15);
    border: 1px solid rgba(196, 30, 58, 0.3);
    border-radius: 10px;
}

.trim-selection-range {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.trim-selection-label {
    font-size: 0.7rem;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trim-selection-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.trim-selection-duration {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.trim-selection-duration #trimLength {
    font-size: 1.4rem;
    font-weight: 700;
    color: #c41e3a;
}

.trim-max-info {
    font-size: 0.8rem;
    color: #888;
}

.trim-warning-container {
    min-height: 20px;
    margin-top: 8px;
    text-align: center;
}

.trim-size-warning {
    font-size: 0.85rem;
    color: #ff6b6b;
}

.trim-size-warning.error {
    color: #ff4444;
    font-weight: 600;
}

/* 기존 trim-times 제거, trim-info 스타일 수정 */
.trim-info {
    display: none;
}

.trim-times {
    display: none;
    align-items: center;
    margin-bottom: 15px;
}

.trim-length {
    color: #4CAF50;
    font-weight: 600;
}

.trim-play-controls {
    text-align: center;
}

.trim-play-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #2d5a3f 0%, #1a472a 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.trim-play-btn:hover {
    transform: scale(1.05);
}
