:root { 
    --primary: #007AFF; 
    --bg: #000000; 
    --card-bg: #1C1C1E; 
    --text: #FFFFFF; 
    --text-secondary: #8E8E93; 
    --danger: #FF3B30; 
    --success: #34C759; 
    --accent: #FF9500; 
}

* { 
    box-sizing: border-box; 
    -webkit-tap-highlight-color: transparent; 
}

body { 
    margin: 0; 
    padding: 0; 
    background-color: var(--bg); 
    color: var(--text); 
    font-family: -apple-system, system-ui, sans-serif; 
    min-height: 100vh; 
    overflow-y: auto; 
    transition: filter 0.3s; 
}

/* 작업 중 잠금 오버레이 (블러 효과) */
#processing-overlay {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(0, 0, 0, 0.8); 
    backdrop-filter: blur(10px);
    z-index: 2000; 
    display: none; 
    flex-direction: column;
    align-items: center; 
    justify-content: center; 
    padding: 40px;
}

header { 
    padding: 15px; 
    text-align: center; 
    font-weight: 700; 
    border-bottom: 0.5px solid #333; 
    position: sticky; 
    top: 0; 
    background: var(--bg); 
    z-index: 100; 
}

.preview-container { 
    width: 100%; 
    max-width: 800px; 
    margin: 0 auto; 
    background: #000; 
    aspect-ratio: 16 / 9; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    position: relative; 
}

video { 
    width: 100%; 
    height: 100%; 
    object-fit: contain; 
}

.editor-zone { 
    width: 100%; 
    max-width: 800px; 
    margin: 0 auto; 
    padding: 20px; 
}

.filename-input-container { 
    margin-bottom: 15px; 
}

.filename-input-container input { 
    width: 100%; 
    background: #2c2c2e; 
    border: 1px solid #444; 
    color: white; 
    padding: 12px; 
    border-radius: 8px; 
    font-size: 14px; 
    outline: none; 
}

.timeline-label { 
    display: flex; 
    justify-content: space-between; 
    font-size: 13px; 
    color: var(--text-secondary); 
    margin-bottom: 8px; 
}

/* 💡 타임라인 트랙: 썸네일 매핑의 핵심 */
.track-container { 
    height: 60px; 
    background: #2c2c2e; 
    border-radius: 12px; 
    position: relative; 
    margin-bottom: 20px; 
    touch-action: none; 
    overflow: hidden; 
    background-size: 100% 100%; /* 너비에 맞게 강제 매핑 */
    background-repeat: no-repeat; 
    background-position: center; 
}

.selection-range { 
    position: absolute; 
    height: 100%; 
    background: rgba(0, 122, 255, 0.2); 
    border-left: 2px solid var(--primary); 
    border-right: 2px solid var(--primary); 
    z-index: 5; 
}

.handle { 
    position: absolute; 
    top: 50%; 
    width: 24px; 
    height: 70px; 
    background: #fff; 
    border-radius: 6px; 
    transform: translateY(-50%); 
    box-shadow: 0 2px 10px rgba(0,0,0,0.5); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    cursor: ew-resize; 
    z-index: 10; 
}

.handle::before { 
    content: ''; 
    width: 2px; 
    height: 20px; 
    background: #d1d1d6; 
}

/* 진행률 박스 */
.progress-box { 
    width: 100%; 
    max-width: 500px; 
    text-align: center; 
}

.progress-container { 
    width: 100%; 
    height: 12px; 
    background: #333; 
    border-radius: 6px; 
    margin: 20px 0; 
    overflow: hidden; 
    border: 1px solid #444; 
}

#progress-bar { 
    width: 0%; 
    height: 100%; 
    background: var(--success); 
    box-shadow: 0 0 15px var(--success); 
    transition: width 0.2s; 
}

/* 컨트롤 그룹 */
.btn-group { 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
    margin-top: 15px; 
}

.vol-control-row { 
    display: flex; 
    gap: 10px; 
    align-items: center; 
}

.vol-input-wrapper { 
    display: flex; 
    align-items: center; 
    background: #2c2c2e; 
    border-radius: 12px; 
    padding: 0 15px; /* 패딩을 조금 더 넉넉히 */
    flex: 1.5;       /* 💡 flex 비율을 높여서 더 넓은 공간을 차지하게 함 (기존 1) */
    border: 1px solid #444; 
    min-width: 140px; /* 💡 최소 너비를 지정해서 찌그러짐 방지 */
}

.vol-input-wrapper span { 
    font-size: 13px; 
    color: var(--text-secondary); 
    margin-right: 10px;
    white-space: nowrap; /* 💡 핵심: 텍스트가 절대 줄바꿈되지 않도록 설정 */
    flex-shrink: 0;      /* 💡 공간이 부족해도 글자가 찌그러지지 않게 함 */
}

.vol-input-wrapper input { 
    background: transparent; 
    border: none; 
    color: white; 
    padding: 12px 0; 
    width: 100%; 
    outline: none; 
    font-weight: bold;
    text-align: right; /* 숫자 입력을 우측으로 정렬하면 더 깔끔합니다 */
}

button { 
    border: none; 
    font-size: 15px; 
    font-weight: 600; 
    padding: 14px; 
    border-radius: 14px; 
    cursor: pointer; 
    transition: 0.2s; 
}

.btn-secondary { background: #2c2c2e; color: #fff; flex: 1; }
.btn-primary { background: var(--primary); color: #fff; flex: 2; }

/* 클립 리스트 섹션 */
.clip-section { 
    width: 100%; 
    max-width: 800px; 
    margin: 20px auto; 
    padding: 20px; 
    background: var(--card-bg); 
    border-radius: 24px 24px 0 0; 
}

.clip-item { 
    background: #2c2c2e; 
    border-radius: 16px; 
    padding: 15px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 12px; 
    border-left: 5px solid var(--primary); 
}

.clip-item.modified { 
    border-left-color: var(--accent); 
}

/* 리스트 내 입력창 */
.inline-input { 
    background: #111; 
    border: 1px solid #444; 
    color: var(--text); 
    width: 70px; 
    padding: 6px; 
    border-radius: 6px; 
    font-weight: bold; 
    text-align: center; 
    margin-top: 4px; 
    font-size: 13px; 
}

.inline-input:focus { 
    border-color: var(--primary); 
    outline: none; 
}

.vol-label { color: var(--accent); }

.clip-tag { 
    font-size: 10px; 
    font-weight: 800; 
    padding: 2px 6px; 
    border-radius: 4px; 
    width: fit-content; 
    margin-bottom: 8px; 
}

.tag-normal { background: rgba(0, 122, 255, 0.2); color: var(--primary); }
.tag-vol { background: rgba(255, 149, 0, 0.2); color: var(--accent); }

.export-footer { 
    padding: 20px; 
    padding-bottom: 40px; 
    max-width: 800px; 
    margin: 0 auto; 
}

.btn-export { 
    width: 100%; 
    background: var(--success); 
    color: white; 
    font-size: 16px; 
    height: 60px; 
}

.btn-delete { 
    background: rgba(255, 59, 48, 0.15); 
    color: var(--danger); 
    padding: 8px 12px; 
    border-radius: 10px; 
    font-size: 13px; 
}

.clip-controls { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 10px; 
    margin-top: 8px; 
}

.input-unit { 
    display: flex; 
    flex-direction: column; 
}

.input-unit label { 
    font-size: 10px; 
    color: var(--text-secondary); 
    margin-left: 2px; 
}

/* 모든 드래그 가능한 요소에 선택 방지 적용 */
.track-container, .handle, .selection-range {
    -webkit-user-select: none;  /* Safari */
    -ms-user-select: none;      /* IE 10+ */
    user-select: none;          /* 표준 속성: 텍스트/이미지 선택 방지 */
    
    /* 추가: 이미지를 드래그해서 밖으로 빼려는 동작 방지 */
    -webkit-user-drag: none;
}

/* 추가 팁: 전체 앱에서 텍스트 선택이 필요 없다면 body에 걸어도 됩니다 */
body {
    -webkit-user-select: none;
    user-select: none;
}

/* 입력창처럼 텍스트를 쳐야 하는 곳은 다시 허용해줘야 합니다 */
input, textarea {
    -webkit-user-select: text;
    user-select: text;
}

/* 업로드 존 스타일 */
.upload-zone {
    background: #fdfdfd;
    border: 3px dashed #3498db;
    border-radius: 15px;
    margin: 20px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.upload-zone:hover {
    background: #f0f7ff;
    border-color: #2980b9;
    transform: translateY(-2px);
}

.upload-icon {
    font-size: 50px;
    margin-bottom: 10px;
}

.btn-main-upload {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 15px;
}

/* 영상이 로드되면 업로드 존을 숨기는 처리 (js에서 제어 가능) */
.upload-zone.hidden {
    display: none;
}


/* 초기 상태: 편집 관련 UI 숨기기 */
.hidden-initially {
    display: none !important;
}

/* 업로드 존은 항상 보여야 하므로 제외 */
#upload-zone {
    display: block;
}

/* 업로드 존이 숨겨질 때(파일 로드 후) 사용할 클래스 */
#upload-zone.hidden {
    display: none !important;
}