/* 공통 CSS - CalcHub 계산기용 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
}

/* 공통 헤더 - index.html과 동일 */
.header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    color: #2563eb;
    text-decoration: none;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: #2563eb;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-link {
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: #2563eb;
}

/* 계산기 컨테이너 */
.container {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 24px;
}

/* 계산기 카드 */
.calculator-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

/* 단순한 계산기 헤더 */
.calculator-header-simple {
    background: #f8fafc;
    color: #1e293b;
    padding: 24px 32px;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
}

.calculator-title-simple {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.calculator-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 32px;
    text-align: center;
}

.calculator-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.calculator-subtitle {
    font-size: 16px;
    opacity: 0.9;
}

.calculator-body {
    padding: 32px;
}

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

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-label {
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.input-field {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s ease;
    background: white;
}

.input-field:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-field:invalid {
    border-color: #ef4444;
}

/* 버튼 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

/* 결과 섹션 */
.result-section {
    margin-top: 32px;
    padding: 24px;
    background: #f8fafc;
    border-radius: 12px;
    border-left: 4px solid #2563eb;
}

.result-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.result-item {
    background: white;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.result-label {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 4px;
}

.result-value {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
}

.result-value.highlight {
    color: #2563eb;
    font-size: 24px;
}

/* 단순한 결과 섹션 */
.result-simple {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.result-item-simple {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
}

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

.result-label-simple {
    font-weight: 500;
    color: #64748b;
    font-size: 14px;
}

.result-value-simple {
    font-weight: 600;
    color: #1e293b;
    font-size: 16px;
}

.result-value-simple.highlight {
    color: #2563eb;
    font-size: 18px;
}

/* 알림 메시지 */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fed7aa;
}

.alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .header-content {
        padding: 0 16px;
    }
    
    .nav-links {
        display: none;
    }
    
    .container {
        margin: 20px auto;
        padding: 0 16px;
    }
    
    .calculator-header {
        padding: 24px 20px;
    }
    
    .calculator-title {
        font-size: 24px;
    }
    
    .calculator-body {
        padding: 24px 20px;
    }
    
    .input-grid {
        grid-template-columns: 1fr;
    }
    
    .result-grid {
        grid-template-columns: 1fr;
    }
}

/* 애니메이션 */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

/* 로딩 스피너 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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