/* 기본 설정 */
:root {
    --color-wood: #2d8659;
    --color-fire: #dc143c;
    --color-earth: #daa520;
    --color-metal: #c0c0c0;
    --color-water: #191970;
    --color-bg: #f8f9fa;
    --color-white: #ffffff;
    --color-text: #333333;
    --color-text-light: #666666;
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
}

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

body {
    font-family: 'Noto Sans KR', sans-serif;
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 헤더 */
.header {
    background: linear-gradient(135deg, var(--color-water), var(--color-wood));
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-family: 'Noto Serif KR', serif;
    font-size: 1.5rem;
    font-weight: 900;
}

.logo-sub {
    font-size: 0.8rem;
    font-weight: 400;
    margin-left: 0.5rem;
    opacity: 0.9;
}

.nav {
    display: flex;
    gap: 1.5rem;
}

.nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.nav a:hover {
    opacity: 0.8;
}

/* 히어로 섹션 */
.hero {
    background: linear-gradient(135deg, var(--color-wood), var(--color-fire));
    color: white;
    padding: 5rem 0;
    text-align: center;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
    font-family: 'Noto Serif KR', serif;
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.hero-features {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

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

/* 버튼 */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-earth), var(--color-fire));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* 섹션 공통 */
.section-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    font-family: 'Noto Serif KR', serif;
}

.section-subtitle {
    text-align: center;
    color: var(--color-text-light);
    margin-bottom: 3rem;
}

/* 사주 입력 섹션 */
.section-input {
    padding: 5rem 0;
    background: white;
}

.saju-form {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

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

.radio-group {
    display: flex;
    gap: 1rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

/* 결과 섹션 */
.section-result {
    padding: 5rem 0;
    background: var(--color-bg);
}

.result-profile {
    margin-bottom: 3rem;
}

.profile-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

.saju-pillars {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 2rem 0;
}

.pillar {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
    border-radius: 12px;
}

.pillar-title {
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--color-water);
}

.pillar-chars {
    font-size: 1.5rem;
    font-weight: 900;
    margin: 0.5rem 0;
    font-family: 'Noto Serif KR', serif;
}

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

.element-chart {
    max-width: 400px;
    margin: 2rem auto;
}

/* 추천 경전 */
.recommendations {
    margin: 3rem 0;
}

.scripture-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border-left: 5px solid var(--color-wood);
}

.scripture-card.rank-1 {
    border-left-color: var(--color-fire);
}

.scripture-card.rank-2 {
    border-left-color: var(--color-earth);
}

.scripture-card.rank-3 {
    border-left-color: var(--color-metal);
}

.scripture-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.scripture-title {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Noto Serif KR', serif;
}

.scripture-score {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-fire);
}

.scripture-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--color-bg);
    border-radius: 8px;
}

/* 경전 도서관 */
.section-library {
    padding: 5rem 0;
    background: white;
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--color-wood);
    color: white;
    border-color: var(--color-wood);
}

.scripture-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.scripture-item {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

.scripture-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* 분류표 */
.section-classification {
    padding: 5rem 0;
    background: var(--color-bg);
}

.classification-table {
    overflow-x: auto;
    margin: 2rem 0;
}

.classification-table table {
    width: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.classification-table th,
.classification-table td {
    padding: 1rem;
    text-align: center;
}

.classification-table th {
    background: var(--color-water);
    color: white;
    font-weight: 700;
}

.classification-table tr:nth-child(even) {
    background: var(--color-bg);
}

.element-wood { color: var(--color-wood); font-weight: 700; }
.element-fire { color: var(--color-fire); font-weight: 700; }
.element-earth { color: var(--color-earth); font-weight: 700; }
.element-metal { color: var(--color-metal); font-weight: 700; text-shadow: 0 0 1px #666; }
.element-water { color: var(--color-water); font-weight: 700; }

.external-link {
    text-align: center;
    margin-top: 2rem;
}

/* 상담 문의 */
.section-contact {
    padding: 5rem 0;
    background: white;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.contact-card {
    background: var(--color-bg);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
}

.contact-card h3 {
    margin-bottom: 1rem;
    color: var(--color-water);
}

.contact-info {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0.5rem 0;
}

.contact-note {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin-top: 0.5rem;
}

.consultation-areas {
    margin-top: 3rem;
    text-align: center;
}

.consultation-areas h3 {
    margin-bottom: 1.5rem;
    color: var(--color-water);
}

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

.areas-grid span {
    background: var(--color-bg);
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 500;
}

/* 푸터 */
.footer {
    background: linear-gradient(135deg, var(--color-water), var(--color-wood));
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.footer-quote {
    font-size: 1.1rem;
    font-style: italic;
    margin-bottom: 1rem;
    opacity: 0.95;
}

.footer-copyright {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* 반응형 */
@media (max-width: 768px) {
    .hero-title {
        font-size: 1.8rem;
    }
    
    .nav {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .saju-pillars {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filter-buttons {
        flex-direction: column;
        align-items: stretch;
    }
}