/* Learning Path Styles */

.learn-container {
    max-width: 1000px;
    padding-top: 30px;
    padding-bottom: 60px;
}

.learn-header {
    text-align: center;
    margin-bottom: 30px;
}

.learn-header h1 {
    font-size: 2em;
    color: var(--color-ink);
    margin: 0 0 10px 0;
}

.learn-subtitle {
    color: #666;
    font-size: 1.1em;
    margin: 0;
}

.learn-filters {
    margin-bottom: 25px;
}

.fable-search {
    width: 100%;
    padding: 12px 18px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    font-family: var(--font-serif);
    background: white;
    color: var(--color-ink);
}

.fable-search:focus {
    outline: none;
    border-color: var(--color-gold);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
}

/* Stage groups */
.stage-group {
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    background: white;
}

.stage-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    cursor: pointer;
    font-family: var(--font-serif);
    font-size: 0.95em;
    user-select: none;
}

.stage-header::-webkit-details-marker {
    display: none;
}

.stage-header::before {
    content: '\25B6';
    font-size: 0.7em;
    color: #999;
    transition: transform 0.2s;
}

details[open] .stage-header::before {
    transform: rotate(90deg);
}

.stage-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    white-space: nowrap;
}

.stage-badge.stage-1 { background: #e8f5e9; color: #2e7d32; }
.stage-badge.stage-2 { background: #e3f2fd; color: #1565c0; }
.stage-badge.stage-3 { background: #fff3e0; color: #e65100; }
.stage-badge.stage-4 { background: #fce4ec; color: #c2185b; }
.stage-badge.stage-5 { background: #f3e5f5; color: #7b1fa2; }
.stage-badge.stage-6 { background: #efebe9; color: #4e342e; }

.stage-desc {
    color: #666;
    font-size: 0.9em;
    flex: 1;
}

.stage-count {
    color: #999;
    font-size: 0.85em;
    white-space: nowrap;
}

/* Fable grid */
.fable-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    padding: 0 18px 18px;
}

.fable-card {
    display: block;
    padding: 14px 16px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    text-decoration: none;
    color: var(--color-ink);
    transition: all 0.2s;
    background: #fafafa;
}

.fable-card:hover {
    border-color: var(--color-gold);
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

.fable-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.fable-number {
    font-size: 0.8em;
    color: #999;
    font-weight: 600;
}

.fable-words {
    font-size: 0.75em;
    padding: 2px 8px;
    background: rgba(201, 162, 39, 0.15);
    color: var(--color-gold);
    border-radius: 10px;
    font-weight: 600;
}

.fable-title {
    font-weight: 600;
    font-size: 0.95em;
    line-height: 1.3;
    margin-bottom: 6px;
}

.fable-meta {
    font-size: 0.8em;
    color: #999;
}

.no-results {
    text-align: center;
    color: #999;
    padding: 40px 0;
    font-size: 1.1em;
}

/* Dark mode */
[data-theme="dark"] .learn-subtitle {
    color: #8898a8;
}

[data-theme="dark"] .fable-search {
    background: #1a2a3e;
    border-color: #2d4560;
    color: #e8e2d6;
}

[data-theme="dark"] .fable-search:focus {
    border-color: var(--color-gold);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.2);
}

[data-theme="dark"] .stage-group {
    background: #131e2e;
    border-color: #263346;
}

[data-theme="dark"] .stage-header::before {
    color: #607080;
}

[data-theme="dark"] .stage-desc {
    color: #8898a8;
}

[data-theme="dark"] .stage-count {
    color: #607080;
}

[data-theme="dark"] .stage-badge.stage-1 { background: #0a2510; color: #40a050; }
[data-theme="dark"] .stage-badge.stage-2 { background: #0a1a30; color: #5080c0; }
[data-theme="dark"] .stage-badge.stage-3 { background: #2a1a0a; color: #d09040; }
[data-theme="dark"] .stage-badge.stage-4 { background: #2a0a1a; color: #c05080; }
[data-theme="dark"] .stage-badge.stage-5 { background: #200a25; color: #a060c0; }
[data-theme="dark"] .stage-badge.stage-6 { background: #1a1510; color: #907060; }

[data-theme="dark"] .fable-card {
    background: #1a2a3e;
    border-color: #263346;
    color: #e8e2d6;
}

[data-theme="dark"] .fable-card:hover {
    border-color: var(--color-gold);
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

[data-theme="dark"] .fable-number {
    color: #607080;
}

[data-theme="dark"] .fable-words {
    background: rgba(201, 162, 39, 0.2);
}

[data-theme="dark"] .fable-meta {
    color: #607080;
}

/* Path selection grid */
.paths-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 10px;
}

.path-card {
    display: block;
    padding: 28px 24px;
    border: 2px solid #e0e0e0;
    border-radius: 14px;
    text-decoration: none;
    color: var(--color-ink);
    background: white;
    transition: all 0.2s;
    border-top: 4px solid var(--path-color, #8b6914);
}

.path-card:hover {
    border-color: var(--path-color, var(--color-gold));
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.path-icon {
    font-size: 2.2em;
    margin-bottom: 10px;
    color: var(--path-color, var(--color-gold));
}

.path-name {
    font-size: 1.3em;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--color-ink);
}

.path-desc {
    font-size: 0.9em;
    color: #666;
    line-height: 1.5;
    margin: 0 0 14px 0;
}

.path-meta {
    display: flex;
    gap: 16px;
}

.path-stat {
    font-size: 0.8em;
    color: #999;
    font-weight: 600;
}

[data-theme="dark"] .path-card {
    background: #131e2e;
    border-color: #263346;
    color: #e8e2d6;
}

[data-theme="dark"] .path-card:hover {
    border-color: var(--path-color, var(--color-gold));
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

[data-theme="dark"] .path-name {
    color: #e8e2d6;
}

[data-theme="dark"] .path-desc {
    color: #8898a8;
}

[data-theme="dark"] .path-stat {
    color: #607080;
}

/* Works grid (for individual path pages) */
.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    padding: 0 18px 18px;
}

.stage-description {
    padding: 0 18px 12px;
    font-size: 0.9em;
    color: #666;
    line-height: 1.4;
}

.stage-name-text {
    font-weight: 600;
    flex: 1;
}

.work-card {
    display: block;
    padding: 16px 18px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    text-decoration: none;
    color: var(--color-ink);
    transition: all 0.2s;
    background: #fafafa;
}

.work-card:hover {
    border-color: var(--color-gold);
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

.work-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.work-author {
    font-size: 0.8em;
    color: #999;
    font-weight: 600;
}

.work-badge {
    font-size: 0.7em;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.work-badge.aligned {
    background: rgba(46, 125, 50, 0.12);
    color: #2e7d32;
}

.work-title {
    font-weight: 700;
    font-size: 1.05em;
    line-height: 1.3;
    margin-bottom: 8px;
}

.work-meta {
    display: flex;
    gap: 12px;
}

.work-stat {
    font-size: 0.8em;
    color: #999;
}

.back-link {
    display: inline-block;
    margin-bottom: 12px;
    font-size: 0.9em;
    color: var(--color-gold);
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

[data-theme="dark"] .stage-description {
    color: #8898a8;
}

[data-theme="dark"] .stage-name-text {
    color: #e8e2d6;
}

[data-theme="dark"] .work-card {
    background: #1a2a3e;
    border-color: #263346;
    color: #e8e2d6;
}

[data-theme="dark"] .work-card:hover {
    border-color: var(--color-gold);
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

[data-theme="dark"] .work-author {
    color: #607080;
}

[data-theme="dark"] .work-badge.aligned {
    background: rgba(46, 125, 50, 0.25);
    color: #60b060;
}

[data-theme="dark"] .work-title {
    color: #e8e2d6;
}

[data-theme="dark"] .work-stat {
    color: #607080;
}

[data-theme="dark"] .back-link {
    color: var(--color-gold);
}

/* Responsive */
@media (max-width: 600px) {
    .learn-header h1 {
        font-size: 1.5em;
    }

    .fable-grid,
    .works-grid,
    .paths-grid {
        grid-template-columns: 1fr;
    }

    .stage-header {
        flex-wrap: wrap;
    }
}

/* User progress indicators */
.stage-progress-indicator {
    font-size: 0.75em;
    background: var(--color-gold);
    color: var(--color-navy);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.work-card.work-started {
    border-left: 3px solid var(--color-gold);
}

.work-badge.started {
    background: rgba(201, 162, 39, 0.15);
    color: var(--color-gold);
}

[data-theme="dark"] .work-card.work-started {
    border-left-color: var(--color-gold);
}
[data-theme="dark"] .stage-progress-indicator {
    color: #0d1520;
}
