* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', sans-serif;
    background: linear-gradient(
        135deg,
        #7b8df1 0%,  /* 밝은 블루 */
        #8a63c7 100% /* 연한 퍼플 */
    );
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* body와 같은 계열 + 대비만 강화 */
.header {
    background: linear-gradient(
        135deg,
        #5a6fe0 0%,   /* body보다 살짝 딥한 블루 */
        #6a3f9e 100%  /* 보라 채도 소폭 감소 */
    );
    color: white;
    padding: 30px;
    text-align: center;
}

.form-container {
    padding: 40px;
}


/* [변경] 마진 증가 (기존 25px -> 35px) */
.form-group { margin-bottom: 35px; }

.form-group label { display: block; margin-bottom: 12px; font-weight: 600; color: #333; font-size: 1em; }

/* [변경] 입력창 크기 및 폰트 확대 (위아래 패딩 증가) */
.form-group input:not([type=range]) {
    width: 100%;
    padding: 14px 18px;     /* 패딩 증가 */
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 17px;        /* 폰트 증가 */
    background: #f8f9fa;
    transition: 0.3s;
    height: 54px;           /* 높이 명시 */
}

/* Range Input 스타일 */
input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    height: 8px; /* 레일 두께 약간 증가 */
    background: #e1e5e9;
    border-radius: 5px;
    padding: 0;
    outline: none;
    border: none;
    margin: 15px 0; /* 슬라이더 위아래 여백 증가 */
}
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px; /* 썸 크기 증가 */
    height: 22px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
}

/* Range + Number 동기화 그룹 */
.input-sync-group { display: flex; flex-direction: column; gap: 8px; }

/* [변경] 좌표 입력칸 전용 스타일 (폰트 및 크기 확대) */
.input-sync-group input[type=number] {
    padding: 10px;
    font-size: 16px;
    text-align: center;
    height: 48px; /* 높이 증가 */
}

/* 프리뷰 영역 */
.preview-wrapper {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 35px; /* 마진 증가 */
    border: 1px solid #dee2e6;
}
.video-preview {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-image 0.5s ease;
    cursor: crosshair;
}

/* [변경] 선택 영역 색상 변경 (노랑 -> 파랑 계열) */
.selection-area {
    position: absolute;
    border: 2px solid #00d2ff;          /* 밝은 하늘색 (Cyan) */
    background: rgba(0, 210, 255, 0.2); /* 반투명 하늘색 */
    transition: 0.1s;
    pointer-events: none;
}
.selection-area:hover {
    border-color: #007bff;              /* 진한 파랑 (Blue) */
    background: rgba(0, 123, 255, 0.3);
}

/* 레이아웃 */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; } /* 갭 증가 */
.form-row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* 툴팁 & 아이콘 */
.label-with-tooltip { display: flex; align-items: center; gap: 8px; }
.info-icon {
    display: inline-flex; justify-content: center; align-items: center;
    width: 24px; height: 24px; border-radius: 50%;
    background-color: #e1e5e9; color: #555;
    font-family: inherit; font-size: 0.9em; font-weight: bold;
    cursor: help; position: relative; transition: 0.2s;
}
.info-icon:hover { background-color: #667eea; color: white; transform: scale(1.1); }
.tooltip-box {
    visibility: hidden; opacity: 0; width: 240px; background-color: #333; color: #fff;
    text-align: left; border-radius: 6px; padding: 12px; position: absolute; z-index: 100;
    bottom: 135%; left: 50%; transform: translateX(-50%);
    font-size: 0.85em; line-height: 1.5; font-weight: normal;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2); transition: opacity 0.3s;
}
.tooltip-box::after {
    content: ""; position: absolute; top: 100%; left: 50%; margin-left: -5px;
    border-width: 5px; border-style: solid; border-color: #333 transparent transparent transparent;
}
.info-icon:hover .tooltip-box { visibility: visible; opacity: 1; }

/* 버튼 및 상태창 */
.btn { width: 100%; padding: 18px; border: none; border-radius: 10px; font-weight: 600; font-size: 1.1em; cursor: pointer; transition: 0.3s; }
/* [수정] margin-top 제거하여 downloadBtn과 높이/위치 통일 */
.btn-run { background: linear-gradient(135deg, #007bff, #6610f2); color: white; }
.btn-download { background: linear-gradient(135deg, #fd7e14, #e83e8c); color: white; }
.button-group { display: flex; gap: 20px; margin-top: 30px; }

.status-area { margin-top: 40px; padding: 25px; border-radius: 10px; display: none; border-left: 5px solid #667eea; font-size: 1.05em; }
.loading-spinner { display: inline-block; width: 18px; height: 18px; border: 3px solid #f3f3f3; border-top: 3px solid #667eea; border-radius: 50%; animation: spin 1s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }