* {
    box-sizing: border-box;
}

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

header {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header h1 {
    margin: 0;
    color: #333;
    font-size: 2.2em;
}

.subtitle {
    color: #666;
    margin-top: 10px;
    font-size: 1.1em;
}

main {
    max-width: 900px;
    margin: 30px auto;
    padding: 0 20px;
}

/* 입력 섹션 */
#input-section {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

#input-section h2 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    flex: 100%;
}

.form-group label {
    font-weight: 600;
    color: #444;
    margin-bottom: 8px;
}

.form-group input,
.form-group select {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

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

#analyze-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

#analyze-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

/* 결과 섹션 */
#result-section {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.hidden {
    display: none !important;
}

/* 경고 박스 */
#warning-box {
    background: linear-gradient(135deg, #fff5f5 0%, #fff0f0 100%);
    border: 2px solid #e74c3c;
    border-radius: 15px;
    padding: 25px;
}

#warning-box h3 {
    color: #c0392b;
    margin: 0 0 15px 0;
}

.warning-item {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

.warning-item:last-child {
    margin-bottom: 0;
}

.warning-item.danger {
    border-left: 4px solid #e74c3c;
}

.warning-item.warning {
    border-left: 4px solid #f39c12;
}

.warning-item h4 {
    margin: 0 0 10px 0;
    color: #c0392b;
}

.warning-item.warning h4 {
    color: #d68910;
}

.warning-item p {
    margin: 0 0 10px 0;
    color: #555;
}

.warning-item ul {
    margin: 0;
    padding-left: 20px;
    color: #666;
}

.warning-item li {
    margin: 5px 0;
}

/* 통계 박스 */
#stats-box {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

#stats-box h3 {
    margin: 0 0 20px 0;
    color: #333;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.stat-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.85em;
    color: #666;
    margin-bottom: 8px;
}

.stat-value {
    display: block;
    font-size: 2em;
    font-weight: 700;
    color: #333;
}

.stat-value.danger {
    color: #e74c3c;
}

.stat-value.warning {
    color: #f39c12;
}

.stat-value.safe {
    color: #27ae60;
}

.stat-desc {
    display: block;
    font-size: 0.85em;
    color: #888;
    margin-top: 5px;
}

/* 건강한 권장안 */
#healthy-recommendation {
    background: linear-gradient(135deg, #e8f8f5 0%, #d5f5e3 100%);
    border: 2px solid #27ae60;
    border-radius: 15px;
    padding: 25px;
}

#healthy-recommendation h3 {
    color: #1e8449;
    margin: 0 0 15px 0;
}

.healthy-intro {
    color: #555;
    margin-bottom: 20px;
}

.healthy-options {
    display: flex;
    gap: 20px;
}

.healthy-option {
    flex: 1;
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 2px solid transparent;
}

.healthy-option.recommended {
    border-color: #27ae60;
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.2);
}

.healthy-option h4 {
    margin: 0 0 15px 0;
    color: #333;
}

.healthy-option ul {
    padding-left: 20px;
    margin: 0 0 15px 0;
}

.healthy-option li {
    margin: 8px 0;
    color: #555;
}

.option-benefit {
    font-size: 0.9em;
    color: #27ae60;
    margin: 0;
    line-height: 1.8;
}

/* 식단 박스 */
#diet-plan-box {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

#diet-plan-box h3 {
    margin: 0 0 20px 0;
    color: #333;
}

.diet-intro {
    text-align: center;
    font-size: 1.1em;
    color: #555;
    margin-bottom: 25px;
}

.meal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.meal-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
}

.meal-card h4 {
    margin: 0 0 15px 0;
    color: #333;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.meal-option {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    background: white;
    transition: transform 0.2s, background 0.2s, border 0.2s;
    cursor: pointer;
    border: 2px solid transparent;
}

.meal-option:last-child {
    margin-bottom: 0;
}

.meal-option.featured {
    background: linear-gradient(135deg, #667eea20 0%, #764ba220 100%);
    border: 2px solid #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.meal-option:hover {
    transform: translateX(5px);
}

.meal-name {
    margin: 0 0 5px 0;
    font-weight: 600;
    color: #333;
}

.meal-macros {
    margin: 0;
    font-size: 0.85em;
    color: #888;
}

.diet-tips {
    margin-top: 25px;
    background: #fff3cd;
    border-radius: 12px;
    padding: 20px;
}

.diet-tips h4 {
    margin: 0 0 15px 0;
    color: #856404;
}

.diet-tips ul {
    margin: 0;
    padding-left: 20px;
}

.diet-tips li {
    margin: 8px 0;
    color: #666;
}

/* 운동 박스 */
#exercise-box {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

#exercise-box h3 {
    margin: 0 0 20px 0;
    color: #333;
}

.exercise-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.exercise-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
}

.exercise-item.full-width {
    grid-column: span 2;
}

.exercise-item h4 {
    margin: 0 0 10px 0;
    color: #333;
}

.exercise-item p {
    margin: 0;
    color: #555;
}

/* 리셋 버튼 */
#reset-btn {
    width: 100%;
    padding: 16px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

#reset-btn:hover {
    background: #5a6268;
}

/* 푸터 */
footer {
    background: rgba(0, 0, 0, 0.3);
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
}

footer p {
    margin: 5px 0;
}

/* 반응형 */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 15px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

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

    .exercise-item.full-width {
        grid-column: span 1;
    }

    .healthy-options {
        flex-direction: column;
    }

    header h1 {
        font-size: 1.8em;
    }

    #input-section {
        padding: 25px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
