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

:root {
    /* 메인 색상 - 부드러운 파스텔 톤 */
    --primary-color: #5b6cd4;
    --secondary-color: #7c8db5;
    --accent-color: #ff6b6b;
    
    /* 텍스트 색상 */
    --text-primary: #2d3436;
    --text-secondary: #636e72;
    --text-light: #b2bec3;
    
    /* 배경 색상 */
    --bg-main: #ffffff;
    --bg-light: #f8f9fa;
    --bg-card: #ffffff;
    
    /* 기타 */
    --border-color: #e9ecef;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.12);
    --radius: 12px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
}

/* 로딩 화면 */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s ease;
}

.loading-content {
    text-align: center;
    color: white;
}

.yin-yang {
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 50%;
    position: relative;
    margin: 0 auto 20px;
    animation: rotate 2s linear infinite;
}

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

.loading-text {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* 헤더 */
.header-gradient {
    background-color: var(--bg-main);
    border-bottom: 1px solid var(--border-color);
    padding: 2rem 0;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

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

.logo-icon {
    font-size: 2rem;
    color: var(--primary-color);
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* SEO 해시태그 숨김 */
.seo-hashtags {
    display: none;
}

/* 메인 컨테이너 */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 20px;
}

/* 입력 섹션 */
.input-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-header i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: block;
}

.section-header h1, .section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.description {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* SEO 콘텐츠 숨김 */
.seo-content {
    display: none;
}

/* 폼 스타일 */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.form-card {
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.form-card.full-width {
    grid-column: 1 / -1;
}

/* 기본 정보 그리드 */
.basic-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.info-section h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.form-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1rem;
}

.form-card-header i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.form-card-header label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

/* 성별/달력 버튼 */
.gender-buttons,
.calendar-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.gender-btn,
.calendar-btn {
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-main);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.gender-btn:hover,
.calendar-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.gender-btn.active,
.calendar-btn.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

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

.gender-btn i,
.calendar-btn i {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.gender-btn span,
.calendar-btn span {
    font-weight: 500;
}

/* 날짜 및 시간 입력 */
.date-time-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.date-inputs {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 1rem;
}

.time-input {
    display: flex;
    align-items: center;
}

.input-group {
    position: relative;
}

.input-group input,
.input-group select,
#hour {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    background: var(--bg-main);
    transition: var(--transition);
}

.input-group input:focus,
.input-group select:focus,
#hour:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(91, 108, 212, 0.1);
}

.input-label {
    position: absolute;
    top: -10px;
    right: 12px;
    background: var(--bg-light);
    padding: 0 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* 제출 버튼 */
.submit-btn {
    width: 100%;
    padding: 1rem 2rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.submit-btn:hover {
    background-color: #4a5ac3;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

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

.btn-shine {
    display: none;
}

/* 결과 섹션 */
.result-section {
    animation: fadeIn 0.5s ease;
}

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

.result-header {
    text-align: center;
    margin-bottom: 3rem;
}

.result-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: block;
}

.result-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

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

.result-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
}

.result-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.result-stat i {
    color: var(--primary-color);
}

/* 사주 차트 */
.saju-chart-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.chart-header {
    text-align: center;
    margin-bottom: 2rem;
}

.chart-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.chart-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* 사주 테이블 */
#sajuTable {
    width: 100%;
    margin: 2rem 0;
    border-collapse: collapse;
}

#sajuTable th {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem;
    font-weight: 500;
}

#sajuTable td {
    padding: 1.5rem;
    text-align: center;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
}

.pillar-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.pillar-header i {
    font-size: 1.2rem;
    opacity: 0.9;
}

.pillar-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.pillar-char {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

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

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.legend-color.cheongan {
    background-color: var(--primary-color);
}

.legend-color.jiji {
    background-color: var(--secondary-color);
}

.chart-description {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: var(--radius);
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
}

.chart-decorations {
    display: none;
}

/* 운세 탭 */
.fortune-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.fortune-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1rem;
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: var(--radius);
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-light);
}

.tab-btn.active {
    color: var(--primary-color);
    background: rgba(91, 108, 212, 0.1);
}

.tab-btn i {
    font-size: 1rem;
}

/* 운세 내용 */
.fortune-content {
    min-height: 300px;
}

.fortune-section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.fortune-section-header h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

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

/* 운세 카드 */
.fortune-card {
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.fortune-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.fortune-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.fortune-card-header i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.fortune-card-header h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.fortune-card-content {
    color: var(--text-secondary);
    line-height: 1.8;
}

.fortune-card-content p {
    margin-bottom: 1rem;
    white-space: pre-line;
}

/* 운세 팁 */
.fortune-tip {
    background: rgba(91, 108, 212, 0.1);
    border-left: 3px solid var(--primary-color);
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.fortune-tip i {
    color: var(--primary-color);
    margin-right: 8px;
}

/* 오행 균형 */
.element-balance {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.element-balance h5 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.element-balance ul {
    list-style: none;
    padding: 0;
}

.element-balance li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.element-balance li:before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

/* 행운 가이드 */
.lucky-guide {
    background: var(--bg-main);
    padding: 1rem;
    border-radius: var(--radius);
    margin-top: 1rem;
}

.lucky-guide h5 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* 성격 분석 */
.personality-overview {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: var(--radius);
    margin-bottom: 2rem;
}

.personality-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.personality-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.personality-details {
    display: grid;
    gap: 1.5rem;
}

/* 연애운 */
.love-overview {
    margin-bottom: 2rem;
}

.love-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.love-advice {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.05) 0%, rgba(255, 107, 107, 0.1) 100%);
    border: 1px solid rgba(255, 107, 107, 0.2);
}

.love-tip {
    background: rgba(255, 107, 107, 0.1);
    padding: 1rem;
    border-radius: var(--radius);
    margin-top: 1rem;
}

/* 재물운 */
.money-meter {
    background: var(--bg-main);
    padding: 1rem;
    border-radius: var(--radius);
    margin-top: 1rem;
}

.money-meter h5 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.meter-bar {
    height: 20px;
    background: var(--bg-light);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.meter-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
    transition: width 1s ease;
}

.meter-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
}

.money-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.investment-guide {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.investment-guide h5 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.investment-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.investment-tag {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

/* 건강운 */
.health-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.health-recommendations {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* 직업운 */
.career-tags {
    margin-top: 1.5rem;
}

.career-tags h5 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.career-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.career-tag {
    background: rgba(91, 108, 212, 0.1);
    color: var(--primary-color);
    padding: 0.25rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid rgba(91, 108, 212, 0.2);
}

.career-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.career-roadmap {
    background: var(--bg-main);
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-top: 1.5rem;
}

.career-roadmap h5 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.career-roadmap ul {
    list-style: none;
    padding: 0;
}

.career-roadmap li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.career-roadmap li:last-child {
    border-bottom: none;
}

.career-roadmap strong {
    color: var(--primary-color);
    margin-right: 8px;
}

/* 반응형 디자인 추가 */
@media (max-width: 768px) {
    .love-details-grid,
    .money-details-grid,
    .health-grid,
    .health-recommendations,
    .career-details-grid {
        grid-template-columns: 1fr;
    }
    
    .fortune-section-header h3 {
        font-size: 1.4rem;
    }
    
    .fortune-card {
        padding: 1rem;
    }
    
    .fortune-card-header h4 {
        font-size: 1rem;
    }
}

.loading-fortune {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: var(--text-secondary);
}

.fortune-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* 전체 화면 로딩 */
.full-screen-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-main);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
}

.loading-content-center {
    text-align: center;
}

.yin-yang-large {
    width: 100px;
    height: 100px;
    background: var(--primary-color);
    border-radius: 50%;
    position: relative;
    margin: 0 auto 30px;
    animation: rotate 2s linear infinite;
}

.yin-yang-large::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: white;
    border-radius: 50px 0 0 50px;
}

.yin-yang-large::after {
    content: '';
    position: absolute;
    top: 25%;
    left: 25%;
    width: 50%;
    height: 50%;
    background: var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 -50px 0 white;
}

.loading-content-center h2 {
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.loading-progress {
    width: 300px;
    height: 4px;
    background: var(--bg-light);
    border-radius: 2px;
    margin: 0 auto 20px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary-color);
    width: 0;
    animation: progressFill 2s ease-out forwards;
}

@keyframes progressFill {
    to { width: 100%; }
}

.loading-messages {
    color: var(--text-secondary);
    font-size: 1rem;
    animation: fadeInOut 2s ease infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* 추가 기능 */
.additional-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.feature-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.feature-card i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: block;
}

.feature-card h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.feature-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.feature-btn:hover {
    background-color: #4a5ac3;
    transform: translateY(-2px);
}

/* 푸터 */
.footer {
    background-color: var(--bg-light);
    padding: 2rem 0;
    margin-top: 4rem;
    border-top: 1px solid var(--border-color);
}

.footer-bottom {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.footer-bottom p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.footer-seo {
    display: none;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .container {
        padding: 1rem;
    }
    
    .input-section,
    .saju-chart-container,
    .fortune-section {
        padding: 1.5rem;
    }
    
    .form-grid {
        gap: 1rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .basic-info-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .date-time-inputs {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .date-inputs {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .fortune-tabs {
        justify-content: center;
    }
    
    .tab-btn {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
    
    #sajuTable {
        font-size: 0.9rem;
    }
    
    #sajuTable th,
    #sajuTable td {
        padding: 0.75rem;
    }
    
    .pillar-char {
        font-size: 1.4rem;
    }
    
    .additional-features {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .gender-buttons,
    .calendar-buttons {
        grid-template-columns: 1fr;
    }
    
    .result-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .fortune-tabs {
        gap: 0.3rem;
    }
    
    .tab-btn {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
    
    .tab-btn i {
        display: none;
    }
}