/* ===================================
   오늘의 사주 - 화이트 + 골드 + 네이비 테마
   =================================== */

:root {
    /* 메인 컬러 */
    --white: #ffffff;
    --off-white: #fafafa;
    --light-gray: #f5f5f5;
    --gray: #e0e0e0;
    --dark-gray: #666666;
    --text-color: #333333;

    /* 포인트 컬러 */
    --gold: #D4AF37;
    --gold-light: #F4E5B2;
    --gold-dark: #B8960C;
    --navy: #1a237e;
    --navy-light: #3949ab;
    --navy-dark: #0d1642;

    /* 오행 색상 */
    --wood: #2E7D32;
    --fire: #C62828;
    --earth: #F9A825;
    --metal: #757575;
    --water: #1565C0;

    /* 기타 */
    --shadow: rgba(0, 0, 0, 0.08);
    --shadow-strong: rgba(0, 0, 0, 0.15);
    --radius: 16px;
    --radius-sm: 10px;

    --font-family: 'Noto Serif KR', serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--off-white);
    color: var(--text-color);
    line-height: 1.7;
    min-height: 100vh;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 16px;
    padding-bottom: 80px; /* 하단 광고 공간 */
}

/* ===================================
   메인 페이지 (index.html)
   =================================== */

.main-header {
    text-align: center;
    padding: 40px 20px 30px;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    margin: 0 -16px 24px;
    border-radius: 0 0 30px 30px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.logo-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.main-header h1 {
    color: var(--gold);
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -1px;
}

.tagline {
    color: rgba(255,255,255,0.85);
    font-size: 0.95rem;
}

/* 메뉴 그리드 */
.menu-section {
    margin-bottom: 24px;
}

.menu-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.menu-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--white);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-color);
    box-shadow: 0 2px 12px var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--gray);
}

.menu-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--shadow-strong);
    border-color: var(--gold);
}

.menu-card.featured {
    background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 100%);
    color: var(--white);
    border: none;
}

.menu-card.featured h2 {
    color: var(--gold);
}

.menu-card.featured p {
    color: rgba(255,255,255,0.8);
}

.card-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.card-content h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.card-content p {
    font-size: 0.85rem;
    color: var(--dark-gray);
}

.card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--gold);
    color: var(--navy-dark);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
}

.card-badge.new {
    background: var(--fire);
    color: white;
}

/* 정보 섹션 */
.info-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.info-card {
    background: var(--white);
    padding: 16px;
    border-radius: var(--radius-sm);
    text-align: center;
    border: 1px solid var(--gray);
}

.info-card h3 {
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.info-card p {
    font-size: 0.75rem;
    color: var(--dark-gray);
}

/* 알림 배너 */
.notification-banner {
    background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 100%);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 16px;
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.banner-text {
    flex: 1;
}

.banner-text strong {
    color: var(--gold);
    font-size: 0.95rem;
    display: block;
    margin-bottom: 2px;
}

.banner-text p {
    color: rgba(255,255,255,0.8);
    font-size: 0.8rem;
    margin: 0;
}

.banner-btn {
    background: var(--gold);
    color: var(--navy-dark);
    border: none;
    padding: 10px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s;
}

.banner-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
}

/* 푸터 */
.main-footer {
    text-align: center;
    padding: 24px 16px;
    color: var(--dark-gray);
    font-size: 0.8rem;
}

.disclaimer {
    margin-top: 4px;
    font-size: 0.7rem;
    opacity: 0.7;
}

/* ===================================
   입력 페이지 (input.html)
   =================================== */

.sub-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--gray);
}

.sub-header h1 {
    font-size: 1.2rem;
    color: var(--navy);
}

.back-btn {
    color: var(--navy);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
}

.input-section {
    margin-bottom: 24px;
}

.input-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 4px 20px var(--shadow);
    border: 1px solid var(--gray);
}

.input-header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--gold-light);
}

.input-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 12px;
}

.input-header h2 {
    font-size: 1.4rem;
    color: var(--navy);
    margin-bottom: 8px;
}

.input-header p {
    color: var(--dark-gray);
    font-size: 0.9rem;
}

/* 폼 스타일 */
.saju-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

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

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--navy);
    margin-bottom: 6px;
}

.form-group select {
    padding: 14px 12px;
    font-size: 1rem;
    font-family: var(--font-family);
    border: 2px solid var(--gray);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--text-color);
    cursor: pointer;
    transition: border-color 0.3s;
}

.form-group select:focus {
    outline: none;
    border-color: var(--gold);
}

/* 성별/음양력 버튼 */
.gender-group,
.calendar-group {
    margin-top: 8px;
}

.gender-buttons,
.calendar-buttons {
    display: flex;
    gap: 12px;
}

.gender-buttons input,
.calendar-buttons input {
    display: none;
}

.gender-btn,
.calendar-btn {
    flex: 1;
    padding: 14px;
    text-align: center;
    border: 2px solid var(--gray);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s;
}

.gender-buttons input:checked + .gender-btn,
.calendar-buttons input:checked + .calendar-btn {
    background: var(--navy);
    color: var(--white);
    border-color: var(--navy);
}

/* 제출 버튼 */
.submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 18px;
    margin-top: 12px;
    font-size: 1.15rem;
    font-weight: 700;
    font-family: var(--font-family);
    color: var(--navy-dark);
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
}

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

/* 팁 섹션 */
.tip-section {
    margin-bottom: 24px;
}

.tip-card {
    background: var(--gold-light);
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--gold);
}

.tip-card h3 {
    font-size: 0.95rem;
    color: var(--navy);
    margin-bottom: 6px;
}

.tip-card p {
    font-size: 0.85rem;
    color: var(--text-color);
}

/* ===================================
   로딩 페이지 (loading.html)
   =================================== */

.loading-page {
    background: linear-gradient(180deg, var(--navy-dark) 0%, var(--navy) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-page .container {
    padding-bottom: 0;
}

.loading-content {
    text-align: center;
    color: var(--white);
    padding: 40px 20px;
}

/* 음양 회전 애니메이션 */
.loading-animation {
    margin-bottom: 32px;
}

.yin-yang {
    width: 100px;
    height: 100px;
    margin: 0 auto;
    background: linear-gradient(to right, var(--white) 50%, var(--navy-dark) 50%);
    border-radius: 50%;
    position: relative;
    animation: rotate 2s linear infinite;
}

.yin-yang::before,
.yin-yang::after {
    content: '';
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.yin-yang::before {
    background: var(--white);
    top: 0;
    left: 25px;
}

.yin-yang::after {
    background: var(--navy-dark);
    bottom: 0;
    left: 25px;
}

.yin-yang-inner {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    top: 17px;
    left: 42px;
    background: var(--navy-dark);
    z-index: 1;
}

.yin-yang-inner::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--white);
    top: 50px;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.loading-text h1 {
    font-size: 1.4rem;
    color: var(--gold);
    margin-bottom: 8px;
}

.loading-status {
    font-size: 0.95rem;
    opacity: 0.8;
}

.loading-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 32px 0;
    text-align: left;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
}

.step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    opacity: 0.4;
    transition: all 0.3s;
}

.step.active {
    opacity: 1;
    background: rgba(212, 175, 55, 0.2);
    border: 1px solid var(--gold);
}

.step-icon {
    font-size: 1.2rem;
}

.step-text {
    font-size: 0.9rem;
}

.loading-tip {
    margin-top: 24px;
    padding: 16px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
}

.loading-tip p {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* ===================================
   결과 페이지 (result.html)
   =================================== */

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--gray);
}

.result-header h1 {
    font-size: 1.2rem;
    color: var(--navy);
}

.result-header .share-btn {
    background: var(--gold);
    color: var(--navy-dark);
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

/* 결과 카드 공통 */
.result-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 2px 12px var(--shadow);
    border: 1px solid var(--gray);
}

.card-header {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gold-light);
}

.card-header h2 {
    font-size: 1.15rem;
    color: var(--navy);
}

/* 사주 테이블 */
.saju-table {
    margin-bottom: 20px;
}

.saju-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.saju-cell {
    text-align: center;
    padding: 8px;
}

.header-row .saju-cell {
    font-size: 0.8rem;
    color: var(--dark-gray);
    font-weight: 500;
}

.cheongan-row .saju-cell,
.jiji-row .saju-cell {
    font-size: 1.8rem;
    font-weight: 700;
    padding: 12px 8px;
    border-radius: var(--radius-sm);
    background: var(--light-gray);
    border: 2px solid var(--gray);
}

/* 오행 색상 */
.element-wood { color: var(--wood); border-color: var(--wood); background: rgba(46, 125, 50, 0.1); }
.element-fire { color: var(--fire); border-color: var(--fire); background: rgba(198, 40, 40, 0.1); }
.element-earth { color: var(--earth); border-color: var(--earth); background: rgba(249, 168, 37, 0.1); }
.element-metal { color: var(--metal); border-color: var(--metal); background: rgba(117, 117, 117, 0.1); }
.element-water { color: var(--water); border-color: var(--water); background: rgba(21, 101, 192, 0.1); }

.ilgan-summary {
    background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 100%);
    color: var(--white);
    padding: 20px;
    border-radius: var(--radius-sm);
    text-align: center;
}

.ilgan-summary h3 {
    color: var(--gold);
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.ilgan-summary p {
    font-size: 0.95rem;
    line-height: 1.7;
}

/* 오행 에너지 차트 */
.energy-chart {
    margin-bottom: 20px;
}

.energy-bar {
    margin-bottom: 12px;
}

.energy-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.energy-label .name {
    font-weight: 500;
}

.energy-label .percent {
    color: var(--dark-gray);
}

.energy-track {
    height: 28px;
    background: var(--light-gray);
    border-radius: 14px;
    overflow: hidden;
}

.energy-fill {
    height: 100%;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    font-size: 0.75rem;
    color: white;
    font-weight: 600;
    transition: width 1s ease-out;
}

.energy-fill.wood { background: linear-gradient(90deg, #66BB6A, var(--wood)); }
.energy-fill.fire { background: linear-gradient(90deg, #EF5350, var(--fire)); }
.energy-fill.earth { background: linear-gradient(90deg, #FFCA28, var(--earth)); }
.energy-fill.metal { background: linear-gradient(90deg, #9E9E9E, var(--metal)); }
.energy-fill.water { background: linear-gradient(90deg, #42A5F5, var(--water)); }

.energy-summary {
    background: var(--gold-light);
    padding: 16px;
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 0.95rem;
    border-left: 4px solid var(--gold);
}

/* 운세 내용 */
.fortune-content {
    line-height: 1.9;
}

.fortune-content p {
    margin-bottom: 16px;
    text-align: justify;
}

.fortune-content h3 {
    color: var(--navy);
    font-size: 1.05rem;
    margin: 24px 0 12px;
    padding-left: 12px;
    border-left: 3px solid var(--gold);
}

/* 아코디언 */
.detail-accordion {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.accordion-item {
    border: 1px solid var(--gray);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.accordion-header {
    width: 100%;
    padding: 16px;
    background: var(--light-gray);
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-family);
    color: var(--text-color);
    transition: background 0.3s;
}

.accordion-header:hover {
    background: var(--gray);
}

.accordion-icon {
    transition: transform 0.3s;
    font-size: 0.8rem;
}

.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    background: var(--white);
}

.accordion-item.active .accordion-body {
    max-height: 600px;
}

.accordion-content {
    padding: 20px;
    line-height: 1.8;
}

/* 행운 가이드 */
.luck-items {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.luck-item {
    text-align: center;
    padding: 20px 12px;
    background: var(--light-gray);
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray);
}

.luck-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.luck-label {
    font-size: 0.8rem;
    color: var(--dark-gray);
    margin-bottom: 4px;
}

.luck-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy);
}

/* 공유 섹션 */
.share-section {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--gray);
}

.share-section > p {
    font-size: 0.9rem;
    color: var(--dark-gray);
    margin-bottom: 12px;
}

.share-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.share-btn.kakao {
    background: #FEE500;
    color: #3C1E1E;
}

.share-btn.link {
    background: var(--light-gray);
    color: var(--text-color);
    border: 1px solid var(--gray);
}

.share-btn:hover {
    transform: translateY(-2px);
}

/* CTA 카드 */
.cta-card {
    background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 100%);
    text-align: center;
    color: var(--white);
}

.cta-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.cta-card h3 {
    color: var(--gold);
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.cta-card p {
    font-size: 0.9rem;
    opacity: 0.85;
    margin-bottom: 20px;
}

.cta-btn {
    display: inline-block;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
    color: var(--navy-dark);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s;
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

/* 더보기 메뉴 */
.more-menu {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.more-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    background: var(--light-gray);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.9rem;
    transition: all 0.3s;
    border: 1px solid var(--gray);
}

.more-item:hover {
    background: var(--gold-light);
    border-color: var(--gold);
}

.more-item span:first-child {
    font-size: 1.3rem;
}

/* ===================================
   반응형
   =================================== */

@media (max-width: 380px) {
    .luck-items {
        grid-template-columns: 1fr;
    }

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

    .more-menu {
        grid-template-columns: 1fr;
    }

    .saju-cell {
        font-size: 1.5rem !important;
    }
}

/* ===================================
   애니메이션
   =================================== */

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

.result-card {
    animation: fadeInUp 0.5s ease forwards;
}

.result-card:nth-child(2) { animation-delay: 0.1s; }
.result-card:nth-child(3) { animation-delay: 0.2s; }
.result-card:nth-child(4) { animation-delay: 0.3s; }
.result-card:nth-child(5) { animation-delay: 0.4s; }
.result-card:nth-child(6) { animation-delay: 0.5s; }
.result-card:nth-child(7) { animation-delay: 0.6s; }
