/* Общие стили для syllabus */

/* Syllabus header / footer */
.syllabus-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    margin-bottom: 20px;
}

.syllabus-logo {
    text-decoration: none;
    color: var(--primary);
    font-weight: 800;
    font-size: 1.2em;
    letter-spacing: 0.5px;
}

.syllabus-logo-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.syllabus-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.syllabus-footer {
    text-align: center;
    padding: 30px 0 10px;
    color: var(--text-muted);
    font-size: 0.9em;
}

/* Hero */
.hero {
    text-align: center;
    margin-bottom: 28px;
}

.hero-title {
    font-size: 2.4em;
    margin-bottom: 14px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, #9a96ff 60%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.hero-subtitle {
    font-size: 1.1em;
    color: var(--text-light);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Trainer section title */
.trainer-section-title {
    font-size: 1.15em;
    font-weight: 700;
    margin: 28px 0 18px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* Trainer cards on home */
.trainer-grid-syllabus {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.trainer-card-syllabus {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    border: none;
    font: inherit;
    text-align: left;
    width: 100%;
    overflow: hidden;
}

.trainer-card-syllabus::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, #a5a2ff 100%);
    opacity: 0.85;
    transition: height 0.25s ease;
}

.trainer-card-syllabus:hover:not(.locked) {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.trainer-card-syllabus:hover:not(.locked)::before {
    height: 6px;
}

.trainer-card-syllabus.locked {
    opacity: 0.62;
    cursor: not-allowed;
    background: linear-gradient(135deg, #fafaff 0%, #f4f5ff 100%);
}

.trainer-card-syllabus.locked::before {
    background: var(--border);
}

.trainer-card-icon-large {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary-lighter) 0%, var(--primary-soft) 100%);
    border-radius: 18px;
    box-shadow: inset 0 0 0 1px rgba(123, 119, 255, 0.12);
}

.trainer-card-info {
    flex: 1;
    min-width: 0;
}

.trainer-card-title {
    font-weight: 700;
    font-size: 1.1em;
    margin-bottom: 6px;
}

.trainer-card-desc {
    font-size: 0.9em;
    color: var(--text-light);
    margin-top: 4px;
}

.trainer-card-progress {
    margin-bottom: 6px;
}

.trainer-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85em;
    color: var(--text-light);
}

.trainer-card-stars {
    color: var(--warning);
    font-weight: 700;
}

.trainer-card-lock {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1em;
    background: var(--bg-light);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.trainer-card-lock-reason {
    display: inline-block;
    font-size: 0.78em;
    color: var(--primary-dark);
    margin-top: 8px;
    font-weight: 700;
    background: var(--primary-lighter);
    padding: 4px 10px;
    border-radius: 999px;
}

.trainer-card-free-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78em;
    color: var(--primary-dark);
    margin-top: 8px;
    font-weight: 700;
    background: var(--primary-lighter);
    padding: 4px 10px;
    border-radius: 999px;
    width: fit-content;
}

/* Progress bar (syllabus-common) */
.progress-bar-bg {
    height: 8px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
    flex: 1;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, #a5a2ff 100%);
    border-radius: 999px;
    transition: width 0.4s ease;
}

.progress-bar-text {
    font-size: 0.85em;
    color: var(--text-light);
    min-width: 36px;
    text-align: right;
}

/* Stars */
.star {
    color: var(--border);
}

.star.filled {
    color: var(--warning);
}

/* Login prompt (shared helper) */
.login-prompt {
    margin-top: 24px;
    padding: 24px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    text-align: center;
    border: 1px solid var(--border);
}

.login-prompt-text {
    color: var(--text-light);
    margin-bottom: 16px;
}

.auth-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.free-action {
    margin-top: 8px;
}

/* Trainer hero (syllabus page) */
.trainer-hero {
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 28px;
    text-align: center;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(123, 119, 255, 0.1);
}

.trainer-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary) 0%, #a5a2ff 100%);
}

.trainer-hero-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.trainer-hero-title {
    font-size: 1.7em;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--text);
}

.trainer-hero-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    font-size: 0.9em;
}

/* Level & chapters */
.level-section {
    margin-bottom: 32px;
}

.level-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding: 18px 22px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    flex-wrap: wrap;
    border-left: 4px solid var(--primary);
}

.level-title {
    font-size: 1.15em;
    font-weight: 700;
    color: var(--text);
}

.level-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 140px;
    color: var(--text-light);
    font-size: 0.9em;
}

.chapters-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.chapter-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chapter-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.chapter-card.locked {
    background: linear-gradient(135deg, #fafaff 0%, #f4f5ff 100%);
    opacity: 0.9;
    position: relative;
}

.chapter-card.locked::after {
    content: '🔒';
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 1.3em;
    opacity: 0.35;
}

.chapter-card.locked .chapter-title {
    color: var(--text-light);
}

.chapter-title {
    font-size: 1.05em;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text);
}

.chapter-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 0.9em;
    color: var(--text-light);
}

.chapter-free-badge {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    background: linear-gradient(135deg, var(--primary-lighter) 0%, var(--primary-soft) 100%);
    color: var(--primary-dark);
    padding: 8px 12px;
    border-radius: 12px;
    margin-bottom: 12px;
    font-weight: 700;
    font-size: 0.85em;
    width: fit-content;
    box-shadow: inset 0 0 0 1px rgba(123, 119, 255, 0.12);
}

.chapter-free-badge small {
    font-weight: 600;
    font-size: 0.85em;
    opacity: 0.85;
}

.chapter-cta {
    margin-bottom: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chapter-cta .btn {
    flex: 1 1 auto;
    min-width: 120px;
    font-size: 0.85em;
    padding: 8px 12px;
}

.chapter-locked-reason {
    display: inline-block;
    color: var(--text-light);
    font-weight: 700;
    background: var(--bg-light);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.9em;
}

.drill-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.drill-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    min-height: 48px;
    background: var(--surface);
    border-radius: 14px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s ease;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

.drill-row:hover {
    background: var(--primary-lighter);
    border-color: var(--primary-soft);
    box-shadow: var(--shadow);
    transform: translateX(6px);
}

.drill-row:active {
    transform: scale(0.995);
}

.drill-row:focus-visible {
    outline: 3px solid rgba(123, 119, 255, 0.35);
    outline-offset: 2px;
}

.drill-row.disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background: var(--bg-light);
    transform: none;
    border-color: transparent;
    box-shadow: none;
}

.drill-title {
    font-weight: 600;
    font-size: 0.95em;
    flex: 1;
}

.drill-stars {
    color: var(--warning);
    font-size: 1em;
    letter-spacing: 1px;
    flex-shrink: 0;
}

.drill-action {
    color: var(--primary);
    font-size: 1.1em;
    line-height: 1;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.drill-row:hover .drill-action {
    transform: translateX(3px);
}

/* Upgrade box on home */
.upgrade-box-syllabus {
    margin-top: 24px;
    padding: 28px;
    background: linear-gradient(135deg, var(--surface) 0%, var(--primary-lighter) 100%);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    text-align: center;
    border: 1px solid rgba(123, 119, 255, 0.15);
    position: relative;
    overflow: hidden;
}

.upgrade-box-syllabus::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(123, 119, 255, 0.12) 0%, transparent 70%);
    border-radius: 50%;
}

.upgrade-box-syllabus h3 {
    font-size: 1.3em;
    margin-bottom: 10px;
    color: var(--text);
}

.upgrade-box-syllabus p {
    color: var(--text-light);
    margin-bottom: 16px;
}

.upgrade-box-syllabus .price {
    font-size: 1.8em;
    font-weight: 800;
    margin-bottom: 18px;
    color: var(--primary);
}

/* Drill shell result upgrade */
.drill-result-upgrade {
    background: linear-gradient(135deg, var(--primary-lighter) 0%, var(--primary-soft) 100%);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin: 16px 0;
    border: 1px solid rgba(123, 119, 255, 0.2);
}

.drill-result-upgrade h3 {
    font-size: 1.1em;
    margin-bottom: 6px;
    color: var(--text);
}

.drill-result-upgrade p {
    font-size: 0.9em;
    color: var(--text-light);
    margin-bottom: 12px;
}

/* Locked notice (legacy) */
.locked-notice {
    text-align: center;
    padding: 40px 20px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.locked-notice h2 {
    margin-bottom: 20px;
    color: var(--text);
}

/* Адаптивность */
@media (min-width: 760px) {
    .chapters-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .trainer-card-syllabus {
        padding: 18px;
        gap: 14px;
    }

    .trainer-card-icon-large {
        width: 52px;
        height: 52px;
        font-size: 1.6em;
        border-radius: 14px;
    }

    .hero-title {
        font-size: 1.7em;
    }

    .level-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .level-progress {
        width: 100%;
    }

    .chapters-grid {
        grid-template-columns: 1fr;
    }

    .syllabus-actions .btn {
        padding: 8px 12px;
        font-size: 0.85em;
    }

    .drill-row {
        padding: 16px;
        min-height: 52px;
        border-radius: 16px;
    }

    .drill-title {
        font-size: 1em;
    }
}
