@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;700&display=swap');

/* public/style.css */
:root {
    --primary-color: #64B5F6;   /* 메인 하늘색 (예: 밝은 파랑) */
    --secondary-color: #BBDEFB; /* 보조 하늘색 (예: 더 연한 파랑) */
    --background-color: #F8F8F8; /* 배경색 */
    --text-color: #333333;
    --card-bg: #FFFFFF;
    --border-color: #EEEEEE;
    --shadow-light: rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

.container {
    max-width: 600px;
    width: 100%;
    padding: 20px;
    text-align: center;
}

header {
    margin-bottom: 40px;
}

.title {
    font-size: 2.5em;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.3;
}

.subtitle {
    font-size: 1.1em;
    color: #666;
    font-weight: 300;
}

.card {
    background-color: var(--card-bg);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px var(--shadow-light);
    border: 1px solid var(--border-color);
    text-align: left;
}

/* =========================================== */
/* ✨ 단계별 흐름을 위한 CSS (스크롤 문제 해결 핵심) */
/* =========================================== */

/* 모든 단계 요소에 애니메이션 적용 */
.step {
    overflow: hidden; /* 요소가 펼쳐질 때 내용이 넘치는 것을 방지 */
    transition: max-height 0.7s ease-in-out, opacity 0.5s ease;
    padding: 0 0 25px 0; /* padding-bottom을 transition 범위 밖으로 빼서 튀는 현상 방지 */
}

/* 숨겨진 단계 스타일 (스크롤 가능하도록 display:block 유지) */
.step.hidden {
    max-height: 0;
    opacity: 0;
    padding-bottom: 0; /* 숨겨진 상태에서는 패딩도 제거 */
    pointer-events: none; /* 클릭 이벤트 막기 */
}

/* =========================================== */


.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-color);
    font-size: 0.95em;
}

input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    color: var(--text-color);
    background-color: #fdfdfd;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(100, 181, 246, 0.3);
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.radio-group label {
    flex: 1 1 auto;
    display: inline-block;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 400;
    margin-bottom: 0;
}

.radio-group input[type="radio"] {
    display: none;
}

.radio-group label:has(input[type="radio"]:checked) {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    font-weight: 700;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(100, 181, 246, 0.4);
}

/* 관심사 체크박스 스타일 */
#interests-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.interest-option {
    flex: 1 1 calc(33.333% - 10px);
    display: flex;
    align-items: center;
}

.interest-option input[type="checkbox"] {
    display: none;
}

.interest-option label {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 400;
    margin-bottom: 0;
}

.interest-option input[type="checkbox"]:checked + label {
    background-color: var(--secondary-color);
    color: var(--text-color);
    border-color: var(--primary-color);
    font-weight: 700;
}

/* 기타 입력 필드 스타일 */
#other-interest-group {
    /* 이 부분은 script.js의 DOMContentLoaded 이벤트에서 제어됩니다. */
    display: none; 
    width: 100%;
    margin-top: 10px;
}

#other-interest-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    color: var(--text-color);
    background-color: #fdfdfd;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#other-interest-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(100, 181, 246, 0.3);
}


button {
    width: 100%;
    padding: 15px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(100, 181, 246, 0.3);
}

button.loading {
    background-color: #e65a77;
    cursor: not-allowed;
    opacity: 0.8;
}

.result-section h2 {
    color: var(--primary-color);
    font-size: 1.8em;
    margin-bottom: 20px;
    text-align: center;
}

.gift-card {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px var(--shadow-light);
}

.gift-card h3 {
    margin: 0 0 10px 0;
    color: var(--primary-color);
    font-size: 1.2em;
}

.gift-card p {
    margin: 5px 0;
    font-size: 0.95em;
    line-height: 1.7;
}

.gift-card strong {
    font-weight: 700;
    color: #555;
}

.retry-button {
    background-color: #6c757d;
    margin-top: 20px;
}

#loadingSpinner {
    display: block;
    text-align: center;
    color: var(--primary-color);
    font-size: 2.5em;
    margin: 20px auto;
}

/* =========================================== */
/* 광고 영역 스타일 */
/* =========================================== */
#adfit-container {
    margin: 40px auto 20px auto;
    max-width: 100%;
    text-align: center;
    min-height: 100px; /* 광고 로드 전 레이아웃 튀는 것 방지 */
}

footer {
    margin-top: 10px;
    font-size: 0.85em;
    color: #999;
}


.search-button {
    display: inline-block;
    padding: 10px 15px;
    color: white;
    text-decoration: none;
    font-weight: 700;
    border-radius: 8px;
    font-size: 0.9em;
    text-align: center;
    transition: all 0.2s ease;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.search-button {
    flex: 1;
}

.search-button.naver {
    background-color: #03C75A;
}
.search-button.naver:hover {
    background-color: #02b350;
    transform: translateY(-1px);
}

.search-button.coupang {
    background-color: #346aff;
}
.search-button.coupang:hover {
    background-color: #2955d1;
    transform: translateY(-1px);
}