:root {
    --bg-color: #050608;
    --grid-color: rgba(255, 255, 255, 0.02);
    --card-bg: rgba(13, 16, 23, 0.65);
    --card-border: rgba(255, 255, 255, 0.06);
    --card-border-hover: rgba(255, 176, 0, 0.3);
    --text-color: #e2e8f0;
    --text-muted: #6b7c93;

    --color-arithmetic: #38bdf8;
    --color-algebra: #f43f5e;
    --color-geometry: #10b981;
    --color-trig: #ffb000;
    --color-calculus: #6366f1;
    --color-stats: #a855f7;

    --transition-speed: 0.3s;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    background-image:
        radial-gradient(var(--grid-color) 1px, transparent 1px),
        radial-gradient(var(--grid-color) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: 0 0, 20px 20px;
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4rem 2rem;
}

/* Abstract Background Glows */
.bg-glow-1 {
    position: absolute;
    top: 10%;
    left: 20%;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 176, 0, 0.08) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
    filter: blur(40px);
}

.bg-glow-2 {
    position: absolute;
    bottom: 10%;
    right: 15%;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
    filter: blur(50px);
}

header {
    text-align: center;
    max-width: 800px;
    margin-bottom: 4rem;
    position: relative;
}

header h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ffffff 40%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    font-size: 1.15rem;
    color: var(--text-muted);
    font-weight: 400;
    line-height: 1.6;
}

/* Search Controls */
.controls-container {
    width: 100%;
    max-width: 600px;
    margin-bottom: 4rem;
    position: relative;
    z-index: 10;
}

.search-wrapper {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 1rem 1.5rem 1rem 3.25rem;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    color: var(--text-color);
    background: rgba(15, 18, 30, 0.55);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    outline: none;
    backdrop-filter: blur(20px);
    transition: all var(--transition-speed) ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.search-input:focus {
    border-color: rgba(255, 176, 0, 0.5);
    box-shadow: 0 4px 25px rgba(255, 176, 0, 0.15);
    background: rgba(15, 18, 30, 0.75);
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    fill: var(--text-muted);
    pointer-events: none;
    transition: fill var(--transition-speed) ease;
}

.search-input:focus+.search-icon {
    fill: var(--color-trig);
}

/* Pedagogical Spec Dropdown */
.spec-details {
    width: 100%;
    max-width: 600px;
    margin: -2.5rem auto 3rem auto;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1rem 1.5rem;
    backdrop-filter: blur(20px);
    transition: all var(--transition-speed) ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    text-align: left;
}

.spec-details[open] {
    border-color: rgba(255, 176, 0, 0.3);
    box-shadow: 0 4px 25px rgba(255, 176, 0, 0.15);
}

.spec-details summary {
    font-weight: 600;
    cursor: pointer;
    outline: none;
    color: var(--text-color);
    user-select: none;
    font-size: 0.95rem;
}

.spec-details summary::marker {
    color: var(--color-trig);
}

.spec-content {
    margin-top: 1rem;
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-muted);
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
    padding-top: 1rem;
}

.spec-content h4 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    font-weight: 700;
}

.spec-content p {
    margin-bottom: 0.75rem;
}

/* Roadmap Grid Layout */
.roadmap-container {
    width: 100%;
    max-width: 1200px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 2rem;
    position: relative;
}

/* Roadmap Cards */
.roadmap-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 2rem;
    backdrop-filter: blur(16px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all var(--transition-speed) cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Color Coding and Glow Indication per Domain */
.roadmap-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    transition: all var(--transition-speed) ease;
}

.roadmap-card[data-domain="arithmetic"]::before {
    background: var(--color-arithmetic);
}

.roadmap-card[data-domain="algebra"]::before {
    background: var(--color-algebra);
}

.roadmap-card[data-domain="geometry"]::before {
    background: var(--color-geometry);
}

.roadmap-card[data-domain="trigonometry"]::before {
    background: var(--color-trig);
}

.roadmap-card[data-domain="calculus"]::before {
    background: var(--color-calculus);
}

.roadmap-card[data-domain="statistics"]::before {
    background: var(--color-stats);
}

.roadmap-card:hover {
    transform: translateY(-5px);
    border-color: var(--card-border-hover);
    box-shadow: 0 15px 35px rgba(255, 176, 0, 0.08), 0 5px 15px rgba(0, 0, 0, 0.4);
}

.roadmap-card:hover[data-domain="arithmetic"] {
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 15px 35px rgba(56, 189, 248, 0.08), 0 5px 15px rgba(0, 0, 0, 0.4);
}

.roadmap-card:hover[data-domain="algebra"] {
    border-color: rgba(244, 63, 94, 0.4);
    box-shadow: 0 15px 35px rgba(244, 63, 94, 0.08), 0 5px 15px rgba(0, 0, 0, 0.4);
}

.roadmap-card:hover[data-domain="geometry"] {
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 15px 35px rgba(16, 185, 129, 0.08), 0 5px 15px rgba(0, 0, 0, 0.4);
}

.roadmap-card:hover[data-domain="trigonometry"] {
    border-color: rgba(255, 176, 0, 0.4);
    box-shadow: 0 15px 35px rgba(255, 176, 0, 0.08), 0 5px 15px rgba(0, 0, 0, 0.4);
}

.roadmap-card:hover[data-domain="calculus"] {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.08), 0 5px 15px rgba(0, 0, 0, 0.4);
}

.roadmap-card:hover[data-domain="statistics"] {
    border-color: rgba(168, 85, 247, 0.4);
    box-shadow: 0 15px 35px rgba(168, 85, 247, 0.08), 0 5px 15px rgba(0, 0, 0, 0.4);
}

.domain-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.domain-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    text-transform: uppercase;
}

[data-domain="arithmetic"] .domain-badge {
    color: var(--color-arithmetic);
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.15);
}

[data-domain="algebra"] .domain-badge {
    color: var(--color-algebra);
    background: rgba(244, 63, 94, 0.08);
    border: 1px solid rgba(244, 63, 94, 0.15);
}

[data-domain="geometry"] .domain-badge {
    color: var(--color-geometry);
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.15);
}

[data-domain="trigonometry"] .domain-badge {
    color: var(--color-trig);
    background: rgba(255, 176, 0, 0.08);
    border: 1px solid rgba(255, 176, 0, 0.15);
}

[data-domain="calculus"] .domain-badge {
    color: var(--color-calculus);
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
}

[data-domain="statistics"] .domain-badge {
    color: var(--color-stats);
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid rgba(168, 85, 247, 0.15);
}

.wip-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    text-transform: uppercase;
    color: #ff9f0a;
    background: rgba(255, 159, 10, 0.08);
    border: 1px solid rgba(255, 159, 10, 0.15);
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
}

.wip-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #ff9f0a;
    margin-right: 6px;
    box-shadow: 0 0 8px #ff9f0a;
    animation: pulse-orange 1.5s infinite alternate;
}

@keyframes pulse-orange {
    0% {
        opacity: 0.4;
        box-shadow: 0 0 2px #ff9f0a;
    }

    100% {
        opacity: 1;
        box-shadow: 0 0 10px #ff9f0a;
    }
}

.domain-step {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.domain-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.category-link {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

[data-domain="arithmetic"] .category-link:hover {
    color: var(--color-arithmetic);
}

[data-domain="algebra"] .category-link:hover {
    color: var(--color-algebra);
}

[data-domain="geometry"] .category-link:hover {
    color: var(--color-geometry);
}

[data-domain="trigonometry"] .category-link:hover {
    color: var(--color-trig);
}

[data-domain="calculus"] .category-link:hover {
    color: var(--color-calculus);
}

[data-domain="statistics"] .category-link:hover {
    color: var(--color-stats);
}

.domain-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 1.75rem;
}

/* Subtopics List */
.subtopics-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
    flex-grow: 1;
}

.subtopic-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.85rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 0.9rem;
    transition: all var(--transition-speed) ease;
}

.subtopic-item.active-module {
    background: rgba(255, 176, 0, 0.03);
    border-color: rgba(255, 176, 0, 0.15);
    cursor: pointer;
}

.subtopic-item.active-module:hover {
    background: rgba(255, 176, 0, 0.08);
    border-color: rgba(255, 176, 0, 0.3);
    transform: translateX(4px);
}

.subtopic-name {
    font-weight: 500;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.orange-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--color-trig);
    box-shadow: 0 0 8px var(--color-trig);
    flex-shrink: 0;
    display: inline-block;
    animation: pulse-glow 2s infinite ease-in-out;
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem;
    background: var(--card-bg);
    border: 1px dashed var(--card-border);
    border-radius: 24px;
    display: none;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.empty-state p {
    color: var(--text-muted);
}

/* Footer */
footer {
    margin-top: 6rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-family: 'JetBrains Mono', monospace;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 2rem;
    width: 100%;
    max-width: 1200px;
}

/* Animations */
@keyframes pulse-glow {

    0%,
    100% {
        opacity: 0.7;
        filter: drop-shadow(0 0 2px var(--color-trig));
    }

    50% {
        opacity: 1;
        filter: drop-shadow(0 0 8px var(--color-trig));
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    body {
        padding: 2rem 1rem;
    }

    header h1 {
        font-size: 2.25rem;
    }

    .roadmap-container {
        grid-template-columns: 1fr;
    }
}
