:root {
    --bg-dark: #0a0a0f;
    --bg-card: #12121a;
    --bg-card-hover: #16161f;
    --border: #2a2a3a;

    --text-primary: #f0f0f5;
    --text-secondary: #8b8b9e;
    --text-muted: #5a5a6e;

    --accent: #f59e0b;
    --accent-glow: rgba(245, 158, 11, 0.3);

    --done: #10b981;
    --in-progress: #f59e0b;
    --locked: #3a3a4a;

    --font-sans: 'Inter', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

/* Navbar */
.navbar {
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border);
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

/* Main */
.main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    margin-bottom: 32px;
}

.breadcrumb a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.2s;
}

.breadcrumb a:hover {
    opacity: 0.8;
}

.breadcrumb span {
    color: var(--text-muted);
}

.breadcrumb .current {
    color: var(--text-secondary);
}

/* Page header */
.page-header {
    text-align: center;
    margin-bottom: 16px;
}

.page-tag {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.page-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Topic navigation */
.topic-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 40px;
}

.nav-arrow {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 18px;
}

.nav-arrow:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(245, 158, 11, 0.1);
}

.topic-indicator {
    font-size: 14px;
    color: var(--text-secondary);
}

.topic-indicator strong {
    color: var(--text-primary);
    font-weight: 500;
}

/* Progress summary */
.progress-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 20px 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    margin-bottom: 40px;
}

.progress-stat {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-stat-icon {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.progress-stat-icon.done {
    background: var(--done);
}

.progress-stat-icon.in-progress {
    background: var(--in-progress);
}

.progress-stat-icon.pending {
    background: var(--locked);
}

.progress-stat-text {
    font-size: 14px;
    color: var(--text-secondary);
}

.progress-stat-text strong {
    color: var(--text-primary);
    font-family: var(--font-mono);
}

/* Section grid */
.sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

/* Section card */
.section-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    transition: all 0.3s ease;
    scroll-margin-top: 100px;
    /* Compensa la altura del navbar fijo */
}

.section-card:hover {
    border-color: var(--accent);
    box-shadow: 0 10px 30px -10px var(--accent-glow);
}

.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    flex: 1;
    padding-right: 12px;
}

.section-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(16, 185, 129, 0.15);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    color: var(--done);
    flex-shrink: 0;
}

.section-badge.in-progress {
    background: rgba(245, 158, 11, 0.15);
    color: var(--in-progress);
}

.section-badge svg {
    width: 12px;
    height: 12px;
}

/* Exercise grid */
.exercise-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Exercise pill */
.exercise-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    height: 34px;
    padding: 0 12px;
    border-radius: 17px;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    position: relative;
}

/* Estados */
.exercise-pill.done {
    background: var(--done);
    color: white;
}

.exercise-pill.done:hover {
    background: #0d9668;
    transform: translateY(-2px);
}

.exercise-pill.in-progress {
    background: var(--in-progress);
    color: white;
}

.exercise-pill.in-progress:hover {
    background: #d97706;
    transform: translateY(-2px);
}

.exercise-pill.pending {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.exercise-pill.pending:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

/* Difficulty dots */
.exercise-pill .difficulty {
    display: flex;
    gap: 2px;
    margin-left: 6px;
}

.exercise-pill .difficulty-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.4;
}

.exercise-pill .difficulty-dot.active {
    opacity: 1;
}

/* Professor exercise pills */
.prof-exercises-section {
    margin-bottom: 12px;
}

.prof-exercises-label {
    display: inline-block;
    font-size: 0.75rem;
    color: #c084fc;
    margin-bottom: 6px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.exercise-pill.prof {
    border: 1px solid #c084fc;
    color: #c084fc;
}

.exercise-pill.prof.done {
    background: #7c3aed;
    border-color: #7c3aed;
    color: white;
}

.exercise-pill.prof.in-progress {
    background: #a855f7;
    border-color: #a855f7;
    color: white;
}

/* Student (alumno) exercise pills */
.alumno-exercises-section {
    margin-bottom: 12px;
}

.alumno-exercises-label {
    display: inline-block;
    font-size: 0.75rem;
    color: #4fc3f7;
    margin-bottom: 6px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.exercise-pill.alumno {
    border: 1px solid #4fc3f7;
    color: #4fc3f7;
}

.exercise-pill.alumno.done {
    background: #0288d1;
    border-color: #0288d1;
    color: white;
}

.exercise-pill.alumno.in-progress {
    background: #039be5;
    border-color: #039be5;
    color: white;
}

/* Section progress */
.section-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.section-progress-bar {
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.section-progress-fill {
    height: 100%;
    background: var(--done);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.section-progress-text {
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* Legend */
.legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

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

.legend-dot {
    width: 16px;
    height: 16px;
    border-radius: 8px;
}

.legend-dot.done {
    background: var(--done);
}

.legend-dot.in-progress {
    background: var(--in-progress);
}

.legend-dot.pending {
    background: transparent;
    border: 1px solid var(--border);
}

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

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

.section-card {
    animation: fadeInUp 0.5s ease backwards;
}

.section-card:nth-child(1) {
    animation-delay: 0.05s;
}

.section-card:nth-child(2) {
    animation-delay: 0.1s;
}

.section-card:nth-child(3) {
    animation-delay: 0.15s;
}

.section-card:nth-child(4) {
    animation-delay: 0.2s;
}

.section-card:nth-child(5) {
    animation-delay: 0.25s;
}

.section-card:nth-child(6) {
    animation-delay: 0.3s;
}

/* Responsive */
@media (max-width: 768px) {
    .sections-grid {
        grid-template-columns: 1fr;
    }

    .progress-summary {
        flex-direction: column;
        gap: 16px;
    }

    .legend {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .main {
        padding: 24px 16px;
    }

    .page-title {
        font-size: 22px;
    }

    .section-card {
        padding: 20px;
    }
}