/* ===== 기본 설정 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #FFF8F0;
    --main-color: #FF7F50;
    --main-color-hover: #FF6A3D;
    --text-dark: #333333;
    --text-gray: #666666;
    --text-light: #999999;
    --card-bg: #FFFFFF;
    --shadow: 0 4px 20px rgba(255, 127, 80, 0.1);
    --shadow-hover: 0 6px 30px rgba(255, 127, 80, 0.15);
    --border-radius: 24px;
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Malgun Gothic', '맑은 고딕', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== 화면 전환 ===== */
.screen {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition);
    flex: 1;
}

.screen.active {
    display: block;
    animation: fadeInUp 0.5s ease forwards;
}

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

/* ===== 컨테이너 ===== */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== 헤더 ===== */
.header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--main-color);
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(255, 127, 80, 0.2);
}

.subtitle {
    font-size: 1rem;
    color: var(--text-gray);
}

/* ===== 카드 ===== */
.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 40px 30px;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

/* ===== 폼 스타일 ===== */
.form-group {
    margin-bottom: 30px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-dark);
    font-size: 1rem;
}

.form-group input[type="text"],
.form-group input[type="date"] {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #F0E6DC;
    border-radius: 16px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background-color: #FDFBF8;
}

.form-group input[type="text"]:focus,
.form-group input[type="date"]:focus {
    outline: none;
    border-color: var(--main-color);
    background-color: var(--card-bg);
}

/* ===== 라디오 버튼 ===== */
.radio-group {
    display: flex;
    gap: 15px;
}

.radio-label {
    flex: 1;
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px 20px;
    border: 2px solid #F0E6DC;
    border-radius: 16px;
    cursor: pointer;
    transition: var(--transition);
    background-color: #FDFBF8;
    font-weight: 500;
}

.radio-icon {
    font-size: 1.3rem;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    background-color: var(--main-color);
    color: white;
    border-color: var(--main-color);
    transform: scale(1.05);
}

.radio-custom:hover {
    border-color: var(--main-color);
}

/* ===== 버튼 ===== */
.btn {
    width: 100%;
    padding: 18px 30px;
    border: none;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--main-color) 0%, #FF9470 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 127, 80, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 127, 80, 0.4);
}

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

.btn-secondary {
    background: white;
    color: var(--main-color);
    border: 2px solid var(--main-color);
}

.btn-secondary:hover {
    background: var(--main-color);
    color: white;
}

.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.action-buttons .btn {
    flex: 1;
}

/* ===== 결과 화면 ===== */
.result-card {
    animation: fadeInUp 0.6s ease;
}

.result-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 2px solid #F5F5F5;
}

.user-name {
    font-size: 1.8rem;
    color: var(--main-color);
    margin-bottom: 8px;
}

.user-info {
    color: var(--text-gray);
    font-size: 0.95rem;
}

/* ===== 키워드 ===== */
.keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    justify-content: center;
}

.keyword-tag {
    display: inline-block;
    padding: 8px 18px;
    background: linear-gradient(135deg, #FFE5D9 0%, #FFD4C1 100%);
    color: var(--main-color);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(255, 127, 80, 0.1);
    animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== 운세 메시지 ===== */
.fortune-message {
    background: linear-gradient(135deg, #FFF5F0 0%, #FFEBE0 100%);
    padding: 25px;
    border-radius: 20px;
    margin-bottom: 25px;
}

.fortune-message h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.message-text {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-dark);
}

/* ===== 식사 추천 ===== */
.meal-recommendations {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.meal-card {
    background: linear-gradient(135deg, #FFFAF7 0%, #FFF5F0 100%);
    padding: 20px;
    border-radius: 20px;
    border: 2px solid #FFE5D9;
    transition: var(--transition);
}

.meal-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(255, 127, 80, 0.15);
}

.meal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

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

.meal-header h4 {
    font-size: 1rem;
    color: var(--text-dark);
}

.meal-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--main-color);
    margin-bottom: 8px;
}

.meal-reason {
    font-size: 0.9rem;
    color: var(--text-gray);
    line-height: 1.6;
}

/* ===== 팁 섹션 ===== */
.tip-section {
    background: linear-gradient(135deg, #FFF9E6 0%, #FFF4D6 100%);
    padding: 20px;
    border-radius: 20px;
    border-left: 4px solid #FFD700;
}

.tip-section h4 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.tip-text {
    font-size: 0.95rem;
    color: var(--text-dark);
    line-height: 1.7;
}

/* ===== 푸터 ===== */
.footer {
    text-align: center;
    margin-top: auto;
    padding-top: 40px;
}

.footer p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ===== 토스트 알림 ===== */
.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-dark);
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    font-weight: 500;
    transition: var(--transition);
    z-index: 1000;
}

.toast.show {
    bottom: 30px;
    animation: toastSlide 3s ease;
}

@keyframes toastSlide {
    0%, 100% {
        bottom: -100px;
    }
    10%, 90% {
        bottom: 30px;
    }
}

/* ===== 반응형 디자인 ===== */
@media (max-width: 768px) {
    .container {
        padding: 30px 15px;
    }

    .logo {
        font-size: 2rem;
    }

    .card {
        padding: 30px 20px;
    }

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

    .action-buttons {
        flex-direction: column;
    }

    .radio-group {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .user-name {
        font-size: 1.5rem;
    }

    .btn {
        font-size: 1rem;
        padding: 16px 25px;
    }
}

/* ===== 애니메이션 지연 ===== */
.keyword-tag:nth-child(1) { animation-delay: 0.1s; }
.keyword-tag:nth-child(2) { animation-delay: 0.2s; }
.keyword-tag:nth-child(3) { animation-delay: 0.3s; }

.meal-card:nth-child(1) { animation-delay: 0.2s; }
.meal-card:nth-child(2) { animation-delay: 0.3s; }
