@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@100;300;400;500;700;900&family=Noto+Serif+KR:wght@400;500;600;700;900&display=swap');

:root {
    --primary-bg: #090e18;
    --secondary-bg: #111827;
    --card-bg: rgba(17, 24, 39, 0.7);
    --accent: #06b6d4;
    --accent-glow: rgba(6, 182, 212, 0.3);
    --accent-alt: #22d3ee;
    --accent-dark: #0891b2;
    --text-primary: #f3f4f6;
    --text-secondary: #d1d5db;
    --text-tertiary: #9ca3af;
    --border: rgba(31, 41, 55, 0.6);
    --glow-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
    --yang-line: #94a3b8; /* 양효(실선) - 부드러운 블루 */
    --yin-line: #94a3b8; /* 음효(점선) - 슬레이트 그레이 */
    --changing-yang: #ec4899; /* 변양효 - 주황색 */
    --changing-yin: #ec4899; /* 변음효 - 핑크색 */
}

/* Light Theme */
body.theme-light {
    --primary-bg: #ffffff;
    --secondary-bg: #f8f9fa;
    --card-bg: rgba(248, 249, 250, 0.8);
    --accent: #007bff; /* Example light theme accent */
    --accent-glow: rgba(0, 123, 255, 0.2);
    --accent-alt: #0056b3;
    --accent-dark: #004085;
    --text-primary: #212529;
    --text-secondary: #495057;
    --text-tertiary: #6c757d;
    --border: rgba(0, 0, 0, 0.1);
    --glow-shadow: 0 0 15px rgba(0, 123, 255, 0.2);

    /* 효의 색상 (Light) */
    --yang-line: #343a40;
    --yin-line: #6c757d;
    --changing-yang: #dc3545; /* Example: Red for changing yang */
    --changing-yin: #fd7e14; /* Example: Orange for changing yin */
}

/* Sepia Theme */
body.theme-sepia {
    --primary-bg: #f4f0e8;
    --secondary-bg: #e9e4d9;
    --card-bg: rgba(233, 228, 217, 0.8);
    --accent: #8b4513; /* SaddleBrown */
    --accent-glow: rgba(139, 69, 19, 0.2);
    --accent-alt: #a0522d; /* Sienna */
    --accent-dark: #5a2d0c;
    --text-primary: #5b4636;
    --text-secondary: #70594a;
    --text-tertiary: #856f61;
    --border: rgba(139, 69, 19, 0.2);
    --glow-shadow: 0 0 15px rgba(139, 69, 19, 0.2);

    /* 효의 색상 (Sepia) */
    --yang-line: #5b4636;
    --yin-line: #856f61;
    --changing-yang: #cd5c5c; /* IndianRed */
    --changing-yin: #e9967a; /* DarkSalmon */
}

/* Adjust specific elements for themes if needed */
body.theme-light .grid-overlay {
    background-image: 
        linear-gradient(to right, rgba(222, 226, 230, 0.5) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(222, 226, 230, 0.5) 1px, transparent 1px);
}

body.theme-sepia .grid-overlay {
     background-image: 
        linear-gradient(to right, rgba(210, 180, 140, 0.3) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(210, 180, 140, 0.3) 1px, transparent 1px);
}

/* Light theme specific adjustments */
body.theme-light .navbar {
    background-color: rgba(248, 249, 250, 0.9);
    border-bottom: 1px solid var(--border);
}

body.theme-light .btn-custom {
    border: 1px solid #ced4da; 
}

body.theme-light .btn-custom:hover {
     background-color: #e2e6ea;
     color: var(--text-primary);
}

body.theme-light .btn-custom.active {
     background-color: var(--accent);
     color: #fff;
}

body.theme-light .btn-custom.btn-accent {
     background-color: #007bff;
     color: #fff;
}
body.theme-light .btn-custom.btn-accent:hover {
     background-color: #0056b3;
}

body.theme-light .form-control {
     background-color: #fff;
     border: 1px solid #ced4da;
}

body.theme-light .modal-content {
    background-color: #fff;
}

/* Sepia theme specific adjustments */
body.theme-sepia .navbar {
    background-color: rgba(233, 228, 217, 0.9);
    border-bottom: 1px solid var(--border);
}

body.theme-sepia .btn-custom {
    border: 1px solid var(--border);
}

body.theme-sepia .btn-custom:hover {
     background-color: #dcd5c9;
     color: var(--text-primary);
}

body.theme-sepia .btn-custom.active {
     background-color: var(--accent);
     color: var(--primary-bg);
}

body.theme-sepia .btn-custom.btn-accent {
     background-color: var(--accent-alt);
     color: var(--primary-bg);
}
body.theme-sepia .btn-custom.btn-accent:hover {
     background-color: var(--accent);
}

body.theme-sepia .form-control {
     background-color: var(--primary-bg);
     border: 1px solid var(--border);
}

body.theme-sepia .modal-content {
    background-color: var(--secondary-bg);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(6, 182, 212, 0.15) 0%, transparent 30%),
        radial-gradient(circle at 80% 70%, rgba(6, 182, 212, 0.1) 0%, transparent 20%);
}

.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(to right, rgba(17, 24, 39, 0.5) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(17, 24, 39, 0.5) 1px, transparent 1px);
    background-size: 30px 30px;
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(9, 14, 24, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}

.logo-icon {
    width: 30px;
    height: 30px;
    border: 2px solid var(--accent);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Noto Serif KR', serif;
    font-weight: 700;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--accent);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding-top: 60px;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
}

.particles {
    position: absolute;
    width: 100%;
    height: 100%;
}

.particle {
    position: absolute;
    background-color: var(--accent);
    border-radius: 50%;
    opacity: 0.3;
    animation: float linear infinite;
}

@keyframes float {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(-20vh) translateX(20vw);
        opacity: 0;
    }
}

.hero-content {
    text-align: center;
    z-index: 2;
    max-width: 800px;
    padding: 0 20px;
}

.hexagram-display {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hexagram-symbol {
    font-size: 8rem;
    color: var(--accent);
    margin-bottom: 1rem;
    text-shadow: var(--glow-shadow);
    animation: pulse 4s infinite;
}

@keyframes pulse {
    0% {
        text-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
    }
    50% {
        text-shadow: 0 0 30px rgba(6, 182, 212, 0.7);
    }
    100% {
        text-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
    }
}

.hexagram-lines {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hex-line {
    width: 120px;
    height: 8px;
    background-color: var(--accent);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--glow-shadow);
}

.hex-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 3s infinite;
}

.hex-line:nth-child(even)::after {
    animation-delay: 0.5s;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.hex-line.yin {
    background-color: transparent;
    display: flex;
    justify-content: space-between;
}

.hex-line.yin .line-segment {
    width: 55px;
    height: 8px;
    background-color: var(--accent);
    border-radius: 4px;
    box-shadow: var(--glow-shadow);
    position: relative;
    overflow: hidden;
}

.hex-line.yin .line-segment::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 3s infinite;
}

.hero-title {
    margin-bottom: 1rem;
}

.hero-title h1 {
    font-family: 'Noto Serif KR', serif;
    font-size: 4rem;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.hero-title .chinese {
    color: var(--accent);
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    color: var(--accent);
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 2rem;
}

.hero-description {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.1rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.scroll-indicator {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
    cursor: pointer;
    color: var(--accent);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) translateX(-50%);
    }
    40% {
        transform: translateY(-20px) translateX(-50%);
    }
    60% {
        transform: translateY(-10px) translateX(-50%);
    }
}

/* Main Content Sections */
.section-container {
    padding: 100px 0;
}

.section {
    margin-bottom: 120px;
    position: relative;
}

.section:last-child {
    margin-bottom: 0;
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 3rem;
    position: relative;
}

.section-number {
    font-family: 'Noto Serif KR', serif;
    font-size: 5rem;
    font-weight: 900;
    color: var(--accent);
    opacity: 0.2;
    position: absolute;
    left: -40px;
    top: -30px;
    z-index: -1;
    line-height: 1;
}

.section-title {
    font-family: 'Noto Serif KR', serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    position: relative;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 3px;
    background: linear-gradient(to right, var(--accent), transparent);
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--accent);
    font-weight: 300;
    margin-bottom: 2rem;
}

.divider {
    margin: 3rem 0;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--accent), transparent);
    opacity: 0.3;
}

/* Cards and Grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 3rem 0;
}

.concept-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.concept-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--accent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.concept-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--glow-shadow);
}

.concept-card:hover::before {
    opacity: 1;
}

.card-icon {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

.card-title {
    font-family: 'Noto Serif KR', serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.card-content {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Blockquote */
blockquote {
    margin: 3rem 0;
    padding: 2rem;
    background-color: var(--secondary-bg);
    border-left: 4px solid var(--accent);
    border-radius: 10px;
    position: relative;
}

blockquote p {
    font-family: 'Noto Serif KR', serif;
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

blockquote p:last-child {
    margin-bottom: 0;
    color: var(--accent);
    font-size: 1rem;
}

/* Table */
.table-container {
    margin: 3rem 0;
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: var(--glow-shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--card-bg);
    border: 1px solid var(--border);
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background-color: rgba(6, 182, 212, 0.1);
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

tr:hover {
    background-color: rgba(6, 182, 212, 0.05);
}

td:first-child {
    font-weight: 500;
    color: var(--accent);
}

/* Dragon Journey Steps */
.journey-steps {
    margin: 3rem 0;
    position: relative;
}

.journey-line {
    position: absolute;
    left: 25px;
    top: 35px;
    bottom: 35px;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent), var(--accent-dark));
    z-index: 1;
}

.journey-step {
    display: flex;
    margin-bottom: 2.5rem;
    position: relative;
    z-index: 2;
}

.journey-step:last-child {
    margin-bottom: 0;
}

.step-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--secondary-bg);
    border: 2px solid var(--accent);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Noto Serif KR', serif;
    font-weight: 700;
    font-size: 1.2rem;
    margin-right: 1.5rem;
    flex-shrink: 0;
    box-shadow: var(--glow-shadow);
}

.step-content {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    flex-grow: 1;
    transition: transform 0.3s ease;
}

.journey-step:hover .step-content {
    transform: translateX(5px);
    box-shadow: var(--glow-shadow);
}

.step-title {
    font-family: 'Noto Serif KR', serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.step-chinese {
    color: var(--accent);
    font-size: 1rem;
}

.step-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Visualization */
.visualization {
    margin: 3rem 0;
    text-align: center;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    position: relative;
}

.trigram-display {
    display: flex;
    justify-content: space-around;
    margin: 3rem 0;
}

.trigram-card {
    background-color: var(--secondary-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 2rem;
    width: 45%;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.trigram-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--glow-shadow);
}

.trigram-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.1) 0%, transparent 70%);
    z-index: 0;
}

.trigram-symbol {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.trigram-name {
    font-family: 'Noto Serif KR', serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.trigram-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    position: relative;
    z-index: 1;
}

/* Related Hexagrams */
.hexagram-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    margin: 3rem 0;
}

.related-item {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s ease;
}

.related-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--glow-shadow);
}

.related-lines {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin-bottom: 1.5rem;
}

.related-line {
    width: 60px;
    height: 6px;
    background-color: var(--accent);
    border-radius: 3px;
}

.related-line.yin {
    display: flex;
    justify-content: space-between;
    background-color: transparent;
}

.related-line.yin .segment {
    width: 25px;
    height: 6px;
    background-color: var(--accent);
    border-radius: 3px;
}

.related-name {
    font-family: 'Noto Serif KR', serif;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.related-description {
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

/* Navigation */
.navigation {
    display: flex;
    justify-content: space-between;
    margin: 5rem 0;
}

.nav-button {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    padding: 0.8rem 1.5rem;
    background-color: var(--secondary-bg);
    border: 1px solid var(--border);
    border-radius: 50px;
    transition: all 0.3s ease;
}

.nav-button:hover {
    background-color: var(--accent);
    color: var(--primary-bg);
    box-shadow: var(--glow-shadow);
}

.nav-icon {
    font-size: 1.5rem;
}

.prev-button .nav-icon {
    margin-right: 0.8rem;
}

.next-button {
    flex-direction: row-reverse;
}

.next-button .nav-icon {
    margin-left: 0.8rem;
}

/* Footer */
footer {
    background-color: var(--secondary-bg);
    border-top: 1px solid var(--border);
    padding: 5rem 0 2rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-info {
    flex: 0 0 40%;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.footer-description {
    color: var(--text-tertiary);
    margin-bottom: 2rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.footer-nav {
    flex: 0 0 25%;
}

.footer-heading {
    font-family: 'Noto Serif KR', serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--accent);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-contact {
    flex: 0 0 25%;
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    color: var(--text-tertiary);
    font-size: 0.95rem;
}

.contact-icon {
    margin-right: 0.8rem;
    color: var(--accent);
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .trigram-display {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .trigram-card {
        width: 100%;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 2rem;
    }
    
    .footer-info, .footer-nav, .footer-contact {
        flex: 0 0 100%;
    }
}

@media (max-width: 768px) {
    .hero-title h1 {
        font-size: 3rem;
    }
    
    .hero-title .chinese {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .nav-links {
        display: none;
    }
    
    .journey-step {
        flex-direction: column;
    }
    
    .step-number {
        margin-bottom: 1rem;
        margin-right: 0;
    }
    
    .journey-line {
        display: none;
    }
}

@media (max-width: 576px) {
    .hero-title h1 {
        font-size: 2.5rem;
    }
    
    .hero-title .chinese {
        font-size: 1.8rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
    }
    
    .hexagram-grid {
        grid-template-columns: 1fr;
    }
}

/* Utilities */
.text-accent {
    color: var(--accent);
}

.text-gradient {
    background: linear-gradient(to right, var(--accent), var(--accent-alt));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.highlight {
    background-color: rgba(6, 182, 212, 0.1);
    color: var(--accent);
    padding: 0 4px;
    border-radius: 3px;
}

.chinese-text {
    font-family: 'Noto Serif KR', serif;
    color: var(--accent);
}

/* Main Content specific to index */
.main-content {
    padding-top: 100px; /* Adjust as needed if different from i-ching pages */
    padding-bottom: 50px;
}

.title-section {
    text-align: center;
    margin-bottom: 3rem;
}

.main-title {
    font-family: 'Noto Serif KR', serif;
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.chinese-title {
    color: var(--accent);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto 2rem;
}

/* 점괘 선택 영역 */
.divination-container {
    background-color: var(--secondary-bg);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 3rem;
    box-shadow: var(--glow-shadow);
    border: 1px solid var(--border);
}

.hexagram-row {
    display: flex;
    flex-direction: column; /* Changed from grid to column for index layout */
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* 효선 표시 영역 스타일 수정 */
.hexagram-line {
    background-color: var(--card-bg);
    border: 2px dashed rgba(6, 182, 212, 0.4); /* 점선 테두리로 변경 */
    border-radius: 10px;
    padding: 1.5rem;
    height: 80px; /* Or specific height for index */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-bottom: 1.2rem; /* Added margin */
}

.hexagram-line:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: var(--glow-shadow);
}

/* 활성화된 효 스타일 */
.hexagram-line.active {
    border: 2px solid var(--accent); /* 테두리를 실선으로 변경 */
    border-color: var(--accent);
    background-color: rgba(6, 182, 212, 0.1);
    box-shadow: var(--glow-shadow);
}

/* 효번호 스타일 */
.line-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    opacity: 0.8; /* Added opacity */
    text-align: center;
}

/* 효선은 초기에 숨김 */
.line-display {
    display: none; /* Initially hidden */
    position: absolute; /* Position it absolutely for reveal */
    width: 80%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hexagram-line.active .line-display {
    display: block; /* Show when active */
    opacity: 1;
}

.hexagram-line.active .line-number {
    opacity: 0; /* Hide number when active */
    transition: opacity 0.3s ease;
}


.hexagram-line::before { /* Glow effect on hover? */
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.05) 0%, transparent 70%);
    z-index: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hexagram-line:hover::before {
     opacity: 1;
}


/* 효 선 표시 */
.line-content {
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* 양효(실선) */
.yang-line {
    width: 80%;
    height: 14px;
    background-color: var(--yang-line);
    border-radius: 7px;
    box-shadow: 0 0 5px rgba(14, 165, 233, 0.3);
}

/* 음효(점선) */
.yin-line {
    width: 80%;
    display: flex;
    justify-content: space-between;
}

.yin-segment {
    width: 45%;
    height: 14px;
    background-color: var(--yin-line);
    border-radius: 7px;
}

/* 변양효 */
.changing-yang {
    width: 80%;
    height: 14px;
    background-color: var(--changing-yang);
    border-radius: 7px;
    box-shadow: 0 0 5px rgba(245, 158, 11, 0.3);
    position: relative;
}

.changing-yang::before {
    content: 'o';
    position: absolute;
    top: -18px; /* Adjust positioning */
    left: 50%;
    transform: translateX(-50%);
    color: var(--changing-yang);
    font-size: 1.2rem;
    font-weight: bold;
}

/* 변음효 */
.changing-yin {
    width: 80%;
    display: flex;
    justify-content: space-between;
    position: relative;
}

.changing-yin .yin-segment {
    background-color: var(--changing-yin);
    box-shadow: 0 0 5px rgba(236, 72, 153, 0.3);
}

.changing-yin::before {
    content: 'x';
    position: absolute;
    top: -18px; /* Adjust positioning */
    left: 50%;
    transform: translateX(-50%);
    color: var(--changing-yin);
    font-size: 1.2rem;
    font-weight: bold;
}


.button-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

/* General Button Style - May conflict if defined differently earlier */

.btn-custom {
    background-color: var(--secondary-bg);
    color: var(--text-primary);
    border: 1px solid var(--accent-subtle);
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 0 5px rgba(6, 182, 212, 0.1);
    text-decoration: none;
    display: inline-block;
}

.btn-custom:hover {
    background-color: var(--accent-subtle);
    color: var(--primary-bg);
    transform: translateY(-3px);
    box-shadow: var(--glow-shadow);
}

/* Specific button variations for index */
.btn-custom.btn-accent {
    background-color: var(--accent-subtle);
    color: var(--text-primary);
}

.btn-custom.btn-accent:hover {
    background-color: var(--accent);
}

/* 활성화된 버튼 스타일 */
.btn-custom.active {
    background-color: var(--accent);
    color: var(--primary-bg);
    box-shadow: var(--glow-shadow);
}


/* 로딩 오버레이 스타일 수정 - 완전히 불투명하게 */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(9, 14, 24, 1); /* 완전히 불투명하게 변경 */
    z-index: 2000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    backdrop-filter: none; /* 블러 효과 제거 */
}

/* 로딩 스피너 강조 */
.loading-spinner {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 5px solid rgba(6, 182, 212, 0.2);
    border-top: 5px solid var(--accent);
    animation: spin 1.5s linear infinite;
    margin-bottom: 1.5rem;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
    position: relative;
}

.loading-inner {
    position: absolute;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 4px solid transparent;
    border-right: 4px solid var(--accent-alt);
    top: 10px;
    left: 10px;
    animation: spin-reverse 2s linear infinite;
}

.loading-text {
    color: var(--accent);
    font-size: 1.3rem;
    text-align: center;
    max-width: 80%;
    margin-top: 2rem;
    text-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

.loading-overlay .hexagram-symbol { /* Specific selector for loading hexagram */
    font-size: 3.5rem;
    color: var(--accent);
    animation: float 4s ease-in-out infinite;
    text-shadow: 0 0 15px rgba(6, 182, 212, 0.6);
    margin-top: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes spin-reverse {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(-360deg); }
}

/* pulse animation might be defined already */
/*
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}
*/

/* float animation might be defined already */
/*
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
*/


/* 결과 스타일 */
.result-container {
    background-color: var(--secondary-bg);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 3rem;
    box-shadow: var(--glow-shadow);
    border: 1px solid var(--border);
}

.result-title {
    font-family: 'Noto Serif KR', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.result-content {
    border-left: 2px solid var(--accent-subtle);
    padding-left: 1.5rem;
    margin-bottom: 2rem;
}

.result-content p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1rem;
}

/* Hyo list styles - might be specific to results */
.hyo ul {
    list-style: none;
    padding-left: 0;
}

.hyo ul li {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background-color: var(--card-bg);
    transition: all 0.3s ease;
}

.hyo ul li:hover {
    box-shadow: var(--glow-shadow);
}

.hyo ul li dt {
    font-family: 'Noto Serif KR', serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 1rem;
}

.hyo ul li dl {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.8;
}

.hyo ul li a {
    color: var(--accent-alt);
    text-decoration: none;
    font-size: 0.9rem;
    margin-left: 1rem;
    transition: color 0.3s ease;
}

.hyo ul li a:hover {
    color: var(--accent);
}

.font-control {
    color: var(--accent);
    cursor: pointer;
    font-size: 0.9rem;
    margin-left: 1rem;
}

/* 이메일 모달 스타일 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1100;
    background-color: rgba(9, 14, 24, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--secondary-bg);
    padding: 2rem;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--glow-shadow);
    border: 1px solid var(--border);
}

.modal-header {
    margin-bottom: 1.5rem;
}

.modal-title {
    font-family: 'Noto Serif KR', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: var(--text-secondary);
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: var(--accent);
}

.modal-body {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    background-color: var(--primary-bg);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.2);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Footer styles might be shared, but added here if needed for index */
/*
.footer {
    ...
}
*/

/* 반응형 디자인 - index-specific adjustments */
@media (max-width: 768px) {
    /* Adjustments specific to index.html layout */
    .main-title {
        font-size: 2.5rem;
    }
    .chinese-title {
        font-size: 1.8rem;
    }
    /* .nav-links might be hidden globally or only here */
     .nav-links {
         display: none; /* Hiding nav links on smaller screens for index */
     }
    .button-container {
        flex-direction: column;
        gap: 0.5rem;
    }
    .btn-custom { /* Make buttons full width */
         width: 100%;
    }
     /* Mobile Result Container Adjustments */
    .result-container {
        padding: 1.5rem 1rem;
    }
    .hyo ul li {
        padding: 1.2rem 0.8rem;
        margin-bottom: 1rem;
    }
    .hyo ul li dt { margin: 0 0 0.8rem 0; font-size: 1.1rem; }
    .hyo ul li dl { margin: 0.8rem 0; font-size: 0.95rem; }
    .minus_button, .plus_button { margin-left: 5px; font-size: 0.85rem; }
    .hyo h3 { font-size: 1.5rem; margin-bottom: 1rem; }
    .result-content p { margin-bottom: 0.5rem; }

    /* Mobile Divination Container */
     .hexagram-line {
         height: 70px; /* Adjust height */
         padding: 1rem 0.5rem;
     }
     .yang-line, .changing-yang, .yin-line, .changing-yin { width: 90%; }
     .yang-line, .changing-yang, .yin-segment { height: 12px; }

     /* Mobile Loading Overlay */
     .loading-spinner { width: 100px; height: 100px; }
     .loading-inner { width: 80px; height: 80px; }
     .loading-text { font-size: 1rem; width: 90%; }

}

@media (max-width: 576px) {
     /* Further adjustments for very small screens */
    .main-title { font-size: 2rem; }
    .chinese-title { font-size: 1.5rem; margin-bottom: 1rem;}
    .description { font-size: 1rem; margin-bottom: 1.5rem; }
    .title-section { margin-bottom: 1.5rem; }

    .divination-container, .result-container {
        padding: 1rem 0.5rem;
        margin-bottom: 1.5rem;
    }
    .hexagram-line {
        height: 60px; /* Adjust height */
        padding: 0.8rem 0.4rem;
        margin-bottom: 0.8rem;
    }
     .yang-line, .changing-yang, .yin-line, .changing-yin { width: 95%; }
     .yang-line, .changing-yang, .yin-segment { height: 10px; }

    /* Mobile Result Container Small */
    .hyo ul li { padding: 1rem 0.5rem; margin-bottom: 0.8rem; }
    .hyo ul li dt { font-size: 1rem; margin-bottom: 0.5rem; }
    .hyo ul li dl { font-size: 0.9rem; line-height: 1.6; }

     /* Mobile Buttons Small */
     .btn-custom { padding: 0.6rem 1rem; font-size: 0.9rem; }
}

/* Theme Switcher Styles */
.theme-switcher {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    justify-content: center; /* Center the buttons */
    padding: 1rem 0;
}

.theme-switcher span {
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

.theme-button {
    background-color: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.theme-button:hover {
    background-color: var(--card-bg);
    color: var(--text-primary);
    border-color: var(--accent);
}

.theme-button.active {
    background-color: var(--accent);
    color: var(--primary-bg);
    border-color: var(--accent);
    font-weight: 500;
}

/* Theme specific button adjustments */
body.theme-light .theme-button {
    border-color: #ced4da;
}
body.theme-light .theme-button.active {
    color: #fff;
}

body.theme-sepia .theme-button {
    border-color: var(--border);
}
body.theme-sepia .theme-button.active {
    color: var(--primary-bg);
}