/* 기본 리셋 및 전역 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    margin: 0;
    padding: 0;
}

/* 컨테이너 스타일 통합 */
.container, .hero {
    max-width: 1400px;
}
.container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    width: 90%;
    margin: 100px auto 40px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 제목 스타일 통합 */
h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    margin-bottom: 0.5rem;
}

h2 {
    color: #333;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.catchphrase {
    text-align: center;
    font-size: 1.1rem;
    color: #666;
    opacity: 0.8;
    margin-bottom: 3rem;
}

/* 상단 네비게이션 바 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.navbar .navbar-wrapper {
    width: 100%;
    max-width: 1400px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    margin: 0 auto;
}

.logo {
    padding-left: 20px;
    font-weight: 700;
    font-size: 1.5rem;
    text-decoration: none;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-links li {
    margin-left: 20px;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    padding: 5px 10px;
    transition: all 0.3s ease;
}

.nav-links a:hover {
    color: #667eea;
}

/* 드롭 영역 / 업로드 영역 통합 스타일 */
.drop-area,
.upload-area {
    position: relative;
    border: 3px dashed #ddd;
    border-radius: 16px;
    padding: 3rem 2rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    cursor: pointer;
    background: linear-gradient(45deg, #f8f9ff, #f0f2ff);
    text-align: center;
}

.drop-area:hover,
.upload-area:hover {
    border-color: #667eea;
    background: linear-gradient(45deg, #f0f2ff, #e8ebff);
    transform: translateY(-2px);
}

.drop-area.highlight,
.drop-area.dragover,
.upload-area.dragover {
    border-color: #667eea;
    background: linear-gradient(45deg, #e8ebff, #dde2ff);
    transform: scale(1.02);
}

.drop-area p,
.upload-text {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 0.5rem;
}

.upload-hint {
    color: #888;
    font-size: 0.95rem;
}

/* 상태 바 */
.status-bar {
    margin-bottom: 2rem;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.status-loading {
    background: linear-gradient(45deg, #fff3cd, #ffeaa7);
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-success {
    background: linear-gradient(45deg, #d4edda, #a8e6a3);
    color: #155724;
    border: 1px solid #a8e6a3;
}

.status-error,
.error {
    background: linear-gradient(45deg, #f8d7da, #f5b7b1);
    color: #721c24;
    border: 1px solid #f5b7b1;
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    margin: 10px 0;
}

.status-hidden {
    display: none;
}

/* 미리보기 섹션 */
.preview-section,
.output-section {
    margin-bottom: 30px;
}

.preview-container {
    margin-top: 20px;
    text-align: center;
}

video {
    max-width: 100%;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

/* 컨트롤 그룹 */
.controls {
    margin: 20px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.control-group {
    flex: 1;
    min-width: 200px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

input[type="range"],
select,
input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
    background: white;
    transition: all 0.3s ease;
}

input[type="range"]:focus,
select:focus,
input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 버튼 스타일 통합 */
button,
.btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

button,
.btn-primary,
#convert-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

button:hover,
.btn-primary:hover,
#convert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.4);
}

.download-btn {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    box-shadow: 0 8px 20px rgba(46, 204, 113, 0.3);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(46, 204, 113, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    color: #495057;
    border: 1px solid #dee2e6;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #e9ecef, #dee2e6);
    transform: translateY(-1px);
}

button:disabled,
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* 로딩 스타일 */
.loading {
    text-align: center;
    margin: 20px 0;
}

.spinner {
    border: 3px solid rgba(102, 126, 234, 0.2);
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-dots {
    display: inline-block;
    width: 20px;
    text-align: left;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* 결과 섹션 */
.result {
    text-align: center;
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.result img {
    max-width: 100%;
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

#result-compare {
    display: flex;
    gap: 20px;
}

/* 캔버스 컨테이너 */
.canvas-container {
    position: relative;
    display: inline-block;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    background: #fff;
    margin-bottom: 2rem;
}

#canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.canvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #666;
    opacity: 0;
    transition: all 0.3s ease;
}

.canvas-overlay.show {
    opacity: 1;
}

/* Hero 섹션 */
.hero {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 4rem 3rem;
    margin: 40px auto;
    width: 90%;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-content h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #1f2937;
    text-align: center;
}

.hero-content p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: #4b5563;
    text-align: center;
}

.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.feature {
    background: linear-gradient(45deg, #f8f9ff, #f0f2ff);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.feature:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem;
    color: #667eea;
}

.feature h3 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
    color: #333;
}

.feature p {
    color: #6b7280;
}

/* Three-way 컨테이너 */
.three-way-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    width: 100%;
    margin-top: 20px;
}

.three-way-container > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(45deg, #f8f9ff, #f0f2ff);
    border: 1px solid rgba(102, 126, 234, 0.1);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
}

.three-way-container > div:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.three-way-container h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-weight: 600;
}

.three-way-container video,
.three-way-container img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}


/* 언어 선택기 */
.language-selector {
    position: relative;
    margin-left: 20px;
}

.language-selector-btn {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #e0e0e0;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #333;
    transition: all 0.3s ease;
}

.language-selector-btn:hover {
    background: linear-gradient(45deg, #f8f9ff, #f0f2ff);
    border-color: #667eea;
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    width: 140px;
    z-index: 1001;
    display: none;
    overflow: hidden;
}

.language-dropdown.active {
    display: block;
}

.language-option {
    padding: 12px 15px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
    color: #333;
}

.language-option:hover {
    background: linear-gradient(45deg, #f8f9ff, #f0f2ff);
}

.language-flag {
    width: 20px;
    height: 15px;
    margin-right: 8px;
    object-fit: cover;
}

/* 파일 입력 */
.file-input,
input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* 유틸리티 클래스 */
.mt-common {
    margin-top: 20px;
}

.mb-common {
    margin-bottom: 20px;
}

/* 반응형 */
@media (max-width: 768px) {
    .container,
    .hero {
        padding: 2rem;
        margin: 80px 20px 20px;
        width: calc(100% - 40px);
    }

    h1 {
        font-size: 2rem;
    }

    .catchphrase {
        font-size: 1rem;
    }

    .nav-links {
        position: fixed;
        top: 60px;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        flex-direction: column;
        align-items: center;
        padding: 20px 0;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-links li {
        margin: 15px 0;
    }

    .hamburger {
        display: block;
        margin-right: 20px;
    }

    .features {
        grid-template-columns: 1fr;
    }

    .controls {
        flex-direction: column;
    }

    .control-group {
        width: 100%;
    }

    #result-compare {
        flex-direction: column;
    }

    .three-way-container {
        grid-template-columns: 1fr;
    }

    .upload-area,
    .drop-area {
        padding: 2rem 1rem;
    }

    .btn {
        width: 100%;
        max-width: 300px;
    }
}

/* Footer Styles */
#footer {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e0e6ed;
    padding: 3rem 0 1rem 0;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

#footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
    transparent 0%,
    rgba(64, 224, 208, 0.5) 25%,
    rgba(138, 43, 226, 0.5) 50%,
    rgba(64, 224, 208, 0.5) 75%,
    transparent 100%);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: #40e0d0;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-section h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: linear-gradient(90deg, #40e0d0, #8a2be2);
    border-radius: 1px;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer-section li {
    display: flex;
    align-items: center;
}

.bt-symbol {
    color: rgba(224, 230, 237, 0.4);
    font-weight: 300;
    font-size: 0.9rem;
}

.footer-link {
    color: #b8c6db;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.25rem 0;
}

.footer-link:hover {
    color: #40e0d0;
    text-shadow: 0 0 8px rgba(64, 224, 208, 0.4);
}

.footer-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, #40e0d0, #8a2be2);
    transition: width 0.3s ease;
}

.footer-link:hover::after {
    width: 100%;
}

.contact-info {
    color: #b8c6db;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

.contact-info a {
    color: #40e0d0;
    text-decoration: none;
    transition: all 0.3s ease;
}

.contact-info a:hover {
    color: #8a2be2;
    text-shadow: 0 0 8px rgba(138, 43, 226, 0.4);
}

.copyright {
    text-align: center;
    padding: 1.5rem 0 1rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(224, 230, 237, 0.7);
    font-size: 0.9rem;
    font-weight: 300;
    background: rgba(0, 0, 0, 0.2);
    position: relative;
}

.copyright::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 1px;
    background: linear-gradient(90deg,
    transparent 0%,
    rgba(64, 224, 208, 0.3) 50%,
    transparent 100%);
}

/* Responsive Design */
@media (max-width: 768px) {
    #footer {
        padding: 2rem 0 1rem 0;
    }

    .footer-container {
        padding: 0 1rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }

    .footer-section ul {
        justify-content: center;
        flex-wrap: wrap;
    }

    .footer-section h4::after {
        left: 50%;
        transform: translateX(-50%);
    }
}

@media (max-width: 480px) {
    .footer-section ul {
        flex-direction: column;
        gap: 0.5rem;
    }

    .bt-symbol {
        display: none;
    }
}