/* BMI 계산기 완전한 CSS - explanation 영역 포함 */

/* ===== 기본 카드 스타일 ===== */
.main-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.explanation-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-top: 1.5rem;
    border: 1px solid #f1f5f9;
}

/* ===== 헤더 스타일 ===== */
.header {
    text-align: center;
    margin-bottom: 2rem;
}

.header-icon-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.header-icon {
    font-size: 2rem;
}

.header-title {
    font-size: 1.875rem;
    font-weight: bold;
    color: #1f2937;
    margin: 0;
}

.header-subtitle {
    color: #6b7280;
    margin: 0;
    font-size: 1rem;
}

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

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.label-icon {
    font-size: 1rem;
}

.input-field {
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
}

.input-field:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.input-field::placeholder {
    color: #9ca3af;
}

/* ===== 계산 버튼 ===== */
.calculate-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px -3px rgba(0, 0, 0, 0.2);
}

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

.btn-icon {
    font-size: 1.25rem;
}

/* ===== 빠른 가이드 ===== */
.quick-guide {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-top: 2rem;
}

.guide-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.guide-ranges {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
}

.guide-item {
    background: white;
    border-radius: 0.5rem;
    padding: 0.75rem;
    text-align: center;
    border: 2px solid;
    transition: transform 0.2s;
}

.guide-item:hover {
    transform: scale(1.05);
}

.guide-item.underweight {
    border-color: #3b82f6;
    background: #eff6ff;
}

.guide-item.normal {
    border-color: #10b981;
    background: #f0fdf4;
}

.guide-item.overweight {
    border-color: #f59e0b;
    background: #fffbeb;
}

.guide-item.obese {
    border-color: #ef4444;
    background: #fef2f2;
}

.guide-range {
    display: block;
    font-weight: bold;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.guide-label {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* ===== BMI 결과 표시 ===== */
.bmi-result {
    background: linear-gradient(135deg, #eef2ff 0%, #f0f9ff 100%);
    border: 2px solid #e0e7ff;
    border-radius: 1rem;
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
}

.bmi-result.hidden {
    display: none;
}

.result-header h3 {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 1.5rem;
}

.result-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.bmi-value-display {
    text-align: center;
}

.bmi-number {
    font-size: 3rem;
    font-weight: bold;
    color: #4f46e5;
    line-height: 1;
}

.bmi-unit {
    font-size: 1rem;
    color: #6b7280;
    font-weight: 500;
}

.category-display {
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
}

.category-display.underweight {
    background: #dbeafe;
    color: #1e40af;
}

.category-display.normal {
    background: #d1fae5;
    color: #065f46;
}

.category-display.overweight {
    background: #fed7aa;
    color: #92400e;
}

.category-display.obese {
    background: #fecaca;
    color: #991b1b;
}

.category-icon {
    font-size: 1.5rem;
}

.result-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.detail-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-label {
    font-weight: 500;
    color: #6b7280;
}

.detail-value {
    font-weight: 600;
    color: #1f2937;
}

/* ===== 에러 메시지 ===== */
.error-message {
    background: #fef2f2;
    border: 2px solid #fecaca;
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: #991b1b;
    font-weight: 500;
}

.error-icon {
    font-size: 1.25rem;
}

/* ===== EXPLANATION 카드 스타일 ===== */

/* 기본 제목과 텍스트 */
.explanation-card h3 {
    font-size: 1.5rem !important;
    font-weight: bold !important;
    color: #1f2937 !important;
    margin-bottom: 1.5rem !important;
    border-bottom: 2px solid #e5e7eb !important;
    padding-bottom: 0.5rem !important;
}

.explanation-card h4 {
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    color: #1f2937 !important;
    margin: 2rem 0 1rem 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

.explanation-card h5 {
    font-size: 1.125rem !important;
    font-weight: 600 !important;
    color: #374151 !important;
    margin: 1.5rem 0 1rem 0 !important;
}

/* 소개 섹션 */
.explanation-intro p {
    color: #6b7280 !important;
    line-height: 1.6 !important;
    font-size: 1rem !important;
    margin-bottom: 1.5rem !important;
}

/* 공식 섹션 */
.formula-section {
    margin: 2rem 0 !important;
}

.formula-cards {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
    gap: 1rem !important;
    margin-top: 1rem !important;
}

.formula-card {
    background: #f8fafc !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 0.75rem !important;
    padding: 1.5rem !important;
    text-align: center !important;
}

.formula-title {
    font-weight: 600 !important;
    color: #4f46e5 !important;
    margin-bottom: 0.75rem !important;
}

.formula-content {
    background: #1f2937 !important;
    color: #f9fafb !important;
    padding: 0.75rem !important;
    border-radius: 0.5rem !important;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace !important;
    font-size: 0.875rem !important;
    margin: 0.75rem 0 !important;
}

.formula-content code {
    color: #f9fafb !important;
    background: none !important;
    padding: 0 !important;
}

.formula-example {
    font-size: 0.875rem !important;
    color: #6b7280 !important;
    font-style: italic !important;
}

/* BMI 범위 카드들 */
.bmi-ranges-section {
    margin: 2rem 0 !important;
}

.bmi-range-cards {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    gap: 1rem !important;
    margin: 1rem 0 !important;
}

.bmi-range-card {
    padding: 1.5rem !important;
    border-radius: 0.75rem !important;
    text-align: center !important;
    border: 2px solid !important;
    transition: transform 0.2s !important;
}

.bmi-range-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.15) !important;
}

.bmi-range-card.underweight {
    background: #eff6ff !important;
    border-color: #3b82f6 !important;
    color: #1e40af !important;
}

.bmi-range-card.normal {
    background: #f0fdf4 !important;
    border-color: #10b981 !important;
    color: #065f46 !important;
}

.bmi-range-card.overweight {
    background: #fffbeb !important;
    border-color: #f59e0b !important;
    color: #92400e !important;
}

.bmi-range-card.obese {
    background: #fef2f2 !important;
    border-color: #ef4444 !important;
    color: #991b1b !important;
}

.range-header {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    margin-bottom: 0.75rem !important;
}

.range-icon {
    font-size: 1.25rem !important;
}

.range-title {
    font-weight: 600 !important;
    font-size: 1rem !important;
}

.range-value {
    font-weight: bold !important;
    font-size: 1.125rem !important;
    margin-bottom: 0.5rem !important;
}

.range-desc {
    font-size: 0.875rem !important;
    opacity: 0.8 !important;
}

/* 비만 단계 */
.obesity-stages {
    background: #fef2f2 !important;
    border: 1px solid #fecaca !important;
    border-radius: 0.75rem !important;
    padding: 1.5rem !important;
    margin-top: 1rem !important;
}

.stage-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
}

.stage-item {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.5rem 1rem !important;
    background: white !important;
    border-radius: 0.5rem !important;
    border: 1px solid #f3f4f6 !important;
}

.stage-label {
    font-weight: 500 !important;
    color: #374151 !important;
}

.stage-range {
    font-weight: 600 !important;
    color: #dc2626 !important;
}

/* 아코디언 스타일 */
.meaning-accordion {
    margin-top: 1rem !important;
}

.meaning-item {
    border: 1px solid #e5e7eb !important;
    border-radius: 0.5rem !important;
    margin-bottom: 0.5rem !important;
    overflow: hidden !important;
}

.meaning-header {
    background: #f9fafb !important;
    padding: 1rem 1.5rem !important;
    cursor: pointer !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    transition: background-color 0.2s !important;
}

.meaning-header:hover {
    background: #f3f4f6 !important;
}

.meaning-header.active {
    background: #eef2ff !important;
}

.meaning-title {
    font-weight: 600 !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

.toggle-icon {
    font-weight: bold !important;
    color: #6b7280 !important;
    transition: transform 0.2s !important;
}

.meaning-content {
    padding: 1.5rem !important;
    display: none !important;
    background: white !important;
}

.meaning-content p {
    color: #374151 !important;
    line-height: 1.6 !important;
    margin-bottom: 1rem !important;
}

.health-risks, .health-benefits {
    margin: 0 !important;
    padding-left: 1.5rem !important;
}

.health-risks li, .health-benefits li {
    color: #6b7280 !important;
    line-height: 1.6 !important;
    margin-bottom: 0.5rem !important;
}

.health-benefits li {
    color: #059669 !important;
}

/* 한계점 섹션 */
.limitations-section {
    margin: 2rem 0 !important;
}

.limitation-cards {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
    gap: 1rem !important;
    margin-top: 1rem !important;
}

.limitation-card {
    background: #fffbeb !important;
    border: 1px solid #fde047 !important;
    border-radius: 0.75rem !important;
    padding: 1.5rem !important;
    text-align: center !important;
}

.limitation-icon {
    font-size: 2rem !important;
    margin-bottom: 0.75rem !important;
}

.limitation-title {
    font-weight: 600 !important;
    color: #92400e !important;
    margin-bottom: 0.75rem !important;
}

.limitation-desc {
    font-size: 0.875rem !important;
    color: #a16207 !important;
    line-height: 1.5 !important;
}

/* 참고 자료 섹션 */
.references-section {
    margin: 2rem 0 !important;
    padding-top: 1.5rem !important;
    border-top: 1px solid #e5e7eb !important;
}

.reference-links {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
    margin-top: 1rem !important;
}

.reference-link {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    padding: 1rem !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 0.5rem !important;
    text-decoration: none !important;
    color: #374151 !important;
    transition: all 0.2s !important;
}

.reference-link:hover {
    background: #eef2ff !important;
    border-color: #4f46e5 !important;
    transform: translateX(4px) !important;
}

.link-icon {
    font-size: 1.25rem !important;
}

.link-text {
    flex: 1 !important;
    font-weight: 500 !important;
}

.external-icon {
    color: #6b7280 !important;
    font-weight: bold !important;
}

/* ===== 반응형 디자인 ===== */
@media (max-width: 768px) {
    .input-row {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .result-main {
        flex-direction: column !important;
        gap: 1rem !important;
    }
    
    .bmi-number {
        font-size: 2.5rem !important;
    }
    
    .category-display {
        font-size: 1.125rem !important;
    }
    
    .guide-ranges {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .result-details {
        grid-template-columns: 1fr !important;
    }
    
    .explanation-card {
        padding: 1.5rem !important;
        margin-top: 1rem !important;
    }
    
    .formula-cards {
        grid-template-columns: 1fr !important;
    }
    
    .bmi-range-cards {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .limitation-cards {
        grid-template-columns: 1fr !important;
    }
    
    .stage-item {
        flex-direction: column !important;
        text-align: center !important;
        gap: 0.5rem !important;
    }
}

@media (max-width: 480px) {
    .guide-ranges {
        grid-template-columns: 1fr !important;
    }
    
    .calculate-btn {
        font-size: 1rem !important;
        padding: 0.875rem 1.25rem !important;
    }
    
    .bmi-result {
        padding: 1.5rem !important;
    }
    
    .bmi-range-cards {
        grid-template-columns: 1fr !important;
    }
    
    .meaning-header {
        padding: 0.75rem 1rem !important;
    }
    
    .meaning-content {
        padding: 1rem !important;
    }
}

/* ===== 애니메이션 ===== */
.explanation-card {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out 0.3s forwards;
}

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