/* 기본 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 헤더 */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}

.logo-link:hover {
    opacity: 0.8;
    text-decoration: none;
}

.logo-link:visited {
    color: inherit;
}

.logo i {
    margin-right: 0.5rem;
    font-size: 1.8rem;
}

.language-selector select {
    padding: 0.5rem 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 25px;
    background: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.language-selector select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 메인 컨테이너 */
.main-container {
    padding: 2rem 0;
    min-height: calc(100vh - 140px);
}

/* 서비스 탭 */
.service-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.tab-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.tab-btn i {
    font-size: 1.2rem;
}

/* 탭 콘텐츠 */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 서비스 카드 */
.service-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.service-card h2 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
    font-weight: 600;
}

.service-card p {
    color: #666;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* 입력 섹션 */
.input-section {
    margin-bottom: 2rem;
}

.url-input-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.url-input-group input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid #e1e5e9;
    border-radius: 50px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.url-input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.url-input-group input:disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
    border-color: #ddd;
}

/* 버튼 스타일 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-download {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    min-width: 120px;
    justify-content: center;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

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

.btn:disabled,
.btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    pointer-events: none;
}

.btn.disabled:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* 업로드 버튼 스타일 */
#uploadBtn {
    margin-top: 10px;
    margin-left: auto;
    margin-right: 0;
    display: block !important;
    width: fit-content;
}

/* 비디오 정보 */
.video-info {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.video-preview {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: flex-start;
}

.video-preview img {
    width: 200px;
    height: 112px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.video-details h3 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    line-height: 1.4;
}

.video-details p {
    color: #666;
    font-size: 0.9rem;
}

/* 자막 섹션 */
.subtitle-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e1e5e9;
}

.subtitle-section h4 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.subtitle-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.subtitle-controls select {
    flex: 1;
    max-width: 300px;
    padding: 0.8rem 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 25px;
    font-size: 0.9rem;
    background: white;
}

/* 다운로드 섹션 */
.download-section h4 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.download-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* 파일 업로드 */
.upload-section {
    margin-bottom: 2rem;
}

.file-drop-zone {
    border: 3px dashed #ccc;
    border-radius: 15px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.file-drop-zone:hover,
.file-drop-zone.dragover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.drop-zone-content i {
    font-size: 3rem;
    color: #ccc;
    margin-bottom: 1rem;
    display: block;
}

.file-drop-zone:hover .drop-zone-content i,
.file-drop-zone.dragover .drop-zone-content i {
    color: #667eea;
}

.drop-zone-content p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.file-info {
    font-size: 0.9rem !important;
    color: #999 !important;
}

/* 진행 상황 */
.progress-section {
    margin-top: 2rem;
}

.progress-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.progress-card h3 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e1e5e9;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

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

.progress-card p {
    color: #666;
    font-size: 1rem;
    font-weight: 500;
}

/* 결과 섹션 */
.result-section {
    margin-top: 2rem;
}

.result-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.result-card h3 {
    color: #28a745;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.result-card p {
    color: #666;
    margin-bottom: 1.5rem;
}

.download-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.download-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 200px;
    justify-content: center;
}

.download-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
    color: white;
    text-decoration: none;
}

/* 푸터 */
.footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1.5rem 0;
    text-align: center;
    color: #666;
    margin-top: auto;
}

/* 모달 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    padding: 1rem;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #333;
}

.modal-body {
    padding: 2rem;
    text-align: center;
}

.modal-body i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.modal-body i.fa-check-circle {
    color: #28a745;
}

.modal-body i.fa-exclamation-triangle {
    color: #ffc107;
}

.modal-body i.fa-times-circle {
    color: #dc3545;
}

.modal-body i.fa-info-circle {
    color: #17a2b8;
}

.modal-body p {
    font-size: 1.1rem;
    color: #333;
    line-height: 1.5;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .service-tabs {
        flex-direction: column;
        align-items: center;
    }
    
    .tab-btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .service-card {
        padding: 1.5rem;
    }
    
    .url-input-group {
        flex-direction: column;
    }
    
    .video-preview {
        flex-direction: column;
        text-align: center;
    }
    
    .video-preview img {
        width: 100%;
        max-width: 300px;
        height: auto;
    }
    
    .subtitle-controls {
        flex-direction: column;
    }
    
    .subtitle-controls select {
        max-width: none;
    }
    
    .download-buttons {
        justify-content: center;
    }
    
    .file-drop-zone {
        padding: 2rem 1rem;
    }
    
    .drop-zone-content i {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .service-card h2 {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .download-buttons {
        flex-direction: column;
    }
    
    .btn-download {
        width: 100%;
    }
}

/* 로딩 애니메이션 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* 성공/오류 메시지 */
.message {
    padding: 1rem;
    border-radius: 10px;
    margin: 1rem 0;
    text-align: center;
}

.message.success {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.message.error {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.2);
}

.message.warning {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.2);
}

/* 파일 선택됨 상태 */
.file-selected {
    border-color: #28a745 !important;
    background: rgba(40, 167, 69, 0.05) !important;
}

.file-selected .drop-zone-content i {
    color: #28a745 !important;
}
