/* 기본 스타일 리셋 */
* {
    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;
    padding: 20px;
}

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

/* 헤더 스타일 */
header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    text-align: center;
    padding: 30px 20px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 300;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 메인 콘텐츠 */
main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 40px;
}

/* 입력 섹션 */
.input-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.input-section h2,
.input-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.input-section h2 {
    font-size: 1.5rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.input-section h3 {
    font-size: 1.2rem;
    margin-top: 25px;
    color: #34495e;
}

/* 폼 그룹 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* 해상도 그룹 */
.resolution-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* 초점거리 그룹 */
.focal-length-group {
    display: flex;
    flex-direction: column;
    gap: 0px;
    margin-top: 40px;
}

/* 계산 버튼 */
#calculate-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: 20px;
}

#calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

#calculate-btn:active {
    transform: translateY(0);
}

/* 결과 섹션 */
.result-section {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.result-section h2 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1.5rem;
    border-bottom: 2px solid #27ae60;
    padding-bottom: 10px;
}

/* 결과 아이템 */
.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.result-item:last-child {
    border-bottom: none;
}

.result-label {
    font-weight: 500;
    color: #555;
}

.result-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #27ae60;
    background: #f8f9fa;
    padding: 8px 15px;
    border-radius: 5px;
    min-width: 100px;
    text-align: center;
}

/* 계산 과정 섹션 */
.details-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #ecf0f1;
}

.details-section h3 {
    color: #34495e;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

#calculation-steps {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.8;
    color: #555;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    main {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .resolution-group {
        grid-template-columns: 1fr;
    }
    
    .input-section,
    .result-section {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    header {
        padding: 20px 15px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    main {
        padding: 15px;
    }
    
    .input-section,
    .result-section {
        padding: 15px;
    }
}

/* 애니메이션 */
.result-section {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 입력 검증 스타일 */
.form-group input.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.error-message {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-top: 5px;
    display: none;
}

.error-message.show {
    display: block;
}

/* Footer 및 언어 선택 스타일 */
footer {
    background: #f8f9fa;
    padding: 20px 40px;
    border-top: 1px solid #e9ecef;
    text-align: center;
}

#language-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.language-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.language-btn {
    padding: 8px 16px;
    border: 2px solid #3498db;
    background: white;
    color: #3498db;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.language-btn:hover {
    background: #3498db;
    color: white;
    transform: translateY(-1px);
}

.language-btn.active {
    background: #3498db;
    color: white;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.language-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/* 반응형 디자인 - 언어 버튼 */
@media (max-width: 768px) {
    footer {
        padding: 15px 20px;
    }
    
    .language-buttons {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .language-btn {
        width: 120px;
    }
}