:root {
    --bg-color: #0d0d0f;
    --card-bg: rgba(255, 255, 255, 0.05);
    --accent-color: #d4af37;
    /* Metallic Gold */
    --accent-glow: rgba(212, 175, 55, 0.3);
    --text-primary: #f0f0f0;
    --text-secondary: #a0a0a0;
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Outfit', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    color: var(--accent-color);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header & Hero */
header {
    padding: 4rem 0;
    text-align: center;
    background: radial-gradient(circle at center, rgba(212, 175, 55, 0.1) 0%, transparent 70%);
}

.hero-title {
    font-size: 5rem;
    margin-bottom: 1rem;
    letter-spacing: 0.1rem;
    text-transform: uppercase;
}

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

/* Dashboard Section */
.dashboard-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 4rem;
    flex-wrap: wrap;
}

.progress-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    flex: 1;
    min-width: 280px;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.3s ease;
}

.progress-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
}

.progress-card h3 {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin: 0;
}

.circular-chart {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: conic-gradient(var(--accent-color) 0deg, rgba(255, 255, 255, 0.05) 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

.circular-chart::before {
    content: "";
    position: absolute;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background-color: var(--bg-color);
}

.chart-text {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chart-percent {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-color);
}

.chart-stats {
    font-size: 1.1rem;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

.action-btn {
    margin-top: 1rem;
    width: 80%;
    font-size: 1.1rem;
    font-weight: bold;
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
}

.action-btn:hover {
    background: var(--accent-color);
    color: #000;
    box-shadow: 0 0 15px var(--accent-glow);
    transform: translateY(-2px);
}

/* Navigation Bar */
.hanja-index-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.nav-char-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.nav-char-btn:hover {
    background: var(--primary-color);
    color: #000;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Hanja Grid */
.hanja-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2rem;
}

.hanja-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.hanja-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transform: translateX(-100%);
    transition: 0.5s;
}

.hanja-card:hover::before {
    transform: translateX(100%);
}

.hanja-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: scale(1.05);
    border-color: var(--accent-color);
    box-shadow: 0 0 20px var(--accent-glow);
}

.hanja-char {
    font-size: 4rem;
    font-family: 'Noto Serif KR', serif;
    margin-bottom: 1rem;
    display: block;
}

.hanja-reading {
    font-size: 1.5rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

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

.badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.7rem;
    background: var(--accent-color);
    color: #000;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: bold;
}

.hanja-radical {
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
    padding: 2px 6px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
}

/* Main Layout */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* Menu Buttons */
/* Menu Sections */
.menu-section {
    margin-bottom: 4rem;
    animation: fadeInUp 0.8s ease-out;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    border-left: 5px solid var(--accent-color);
    padding-left: 1rem;
    color: var(--text-primary);
}

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

.menu-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 2.5rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    /* For badge positioning */
    overflow: hidden;
    /* Ensure content doesn't spill if needed */
}

.menu-btn:not(.disabled):hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    border-color: rgba(212, 175, 55, 0.4);
    background: rgba(212, 175, 55, 0.05);
}

.menu-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    /* Ensure border persists */
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
    transform: none;
    box-shadow: none;
    pointer-events: none;
}

.coming-soon-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.5);
    color: #aaa;
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
}

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

/* Sticky Navigation */
.sticky-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    margin-left: -1.5rem;
    margin-right: -1.5rem;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    font-size: 0.9rem;
    white-space: nowrap;
}

.nav-btn:hover {
    background: var(--accent-color);
    color: #000;
}

.sticky-nav h2 {
    font-size: 1.3rem;
    margin: 0;
    flex-grow: 1;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#toggle-reading-btn {
    margin-left: auto;
}

.nav-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--accent-color);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    max-width: 200px;
}

.nav-select option {
    background: var(--bg-color);
    color: var(--text-primary);
}

/* Analects Styles */
.analects-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.analects-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(212, 175, 55, 0.2);
    padding: 2.5rem;
    border-radius: 20px;
}

.analects-title {
    color: var(--accent-color);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.analects-content {
    font-size: 1.8rem;
    line-height: 2.2;
    margin-bottom: 1.5rem;
    font-family: 'Noto Serif KR', serif;
}

rt {
    font-size: 0.8rem;
    color: var(--accent-color);
    font-family: 'Outfit', sans-serif;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.hide-reading rt {
    opacity: 0;
    pointer-events: none;
}

.analects-translation {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .container {
        padding: 1rem;
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.modal-content {
    background: var(--bg-color);
    margin: 5% auto;
    padding: 3rem;
    border: 1px solid var(--accent-color);
    border-radius: 30px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    position: relative;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.4s ease-out;
}

.close-btn {
    position: absolute;
    right: 2rem;
    top: 1.5rem;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s;
}

.close-btn:hover {
    color: var(--accent-color);
}

.btn {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s;
    margin: 0.5rem;
}

.btn:hover {
    background: var(--accent-color);
    color: #000;
    box-shadow: 0 0 15px var(--accent-glow);
}

.btn.primary {
    background: var(--accent-color);
    color: #000;
}

.modal-controls {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

#writer-container {
    width: 260px;
    height: 260px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(212, 175, 55, 0.1);
    border-radius: 20px;
}

#writer-container svg {
    border-radius: 10px;
}

.learned-card {
    border-color: #4CAF50 !important;
    background: rgba(76, 175, 80, 0.1) !important;
}

/* Section Headers */
.section-header {
    width: 100%;
    color: var(--accent-color);
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    font-family: var(--font-heading);
}

/* Footer */
footer {
    text-align: center;
    padding: 3rem 0;
    margin-top: 4rem;
    border-top: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.3);
}

footer p {
    line-height: 1.8;
}

/* Intro Text */
.intro-text {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    line-height: 1.6;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}