/* =========================================================================
   LESSON CHEATSHEETS — Шпаргалки до уроків
   Bold Koodi Style
   ========================================================================= */

/* ============ HERO ============ */
.lcs-hero {
    background: var(--lime);
    padding: 140px 40px 50px;
    text-align: center;
    border-bottom: 3px solid var(--black);
}

.lcs-hero-title {
    font-family: 'Rubik', sans-serif;
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--black);
    margin-bottom: 12px;
}

.lcs-hero-subtitle {
    font-size: 1.1rem;
    color: var(--black);
    opacity: 0.8;
    max-width: 500px;
    margin: 0 auto 30px;
    font-weight: 500;
}

.lcs-hero-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.lcs-stat {
    background: var(--white);
    border: 3px solid var(--black);
    border-radius: 16px;
    padding: 14px 28px;
    box-shadow: 4px 4px 0 var(--black);
    text-align: center;
}

.lcs-stat-value {
    display: block;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--black);
}

.lcs-stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============ PAGE LAYOUT ============ */
.lcs-page {
    max-width: 1300px;
    margin: 0 auto;
    padding: 40px 30px 80px;
}

.lcs-content {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* ============ LEVEL TABS ============ */
.lcs-level-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    background: #f0f0f0;
    border-radius: 14px;
    padding: 4px;
    border: 2px solid var(--black);
}

.lcs-level-tab {
    flex: 1;
    padding: 8px 4px;
    border: none;
    border-radius: 10px;
    font-family: 'Rubik', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    color: #888;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.lcs-level-tab:hover {
    color: var(--black);
    background: rgba(255, 255, 255, 0.5);
}

.lcs-level-tab.active {
    background: var(--white);
    color: var(--black);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* ============ SIDEBAR ============ */
.lcs-sidebar {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lcs-course-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: var(--white);
    border: 3px solid var(--black);
    border-radius: 16px;
    box-shadow: 4px 4px 0 var(--black);
    cursor: pointer;
    font-family: 'Rubik', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--black);
    transition: all 0.2s ease;
    text-align: left;
}

.lcs-course-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--black);
}

.lcs-course-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--black);
}

.lcs-course-btn.active {
    background: var(--lime);
    transform: none;
    box-shadow: 4px 4px 0 var(--black);
}

.lcs-course-icon {
    font-size: 1.3rem;
    width: 30px;
    text-align: center;
    flex-shrink: 0;
}

.lcs-course-name {
    flex: 1;
}

.lcs-course-badge {
    background: var(--black);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}

.lcs-course-btn.active .lcs-course-badge {
    background: var(--white);
    color: var(--black);
}

/* ============ MAIN AREA ============ */
.lcs-main {
    flex: 1;
    min-width: 0;
}

.lcs-course-header {
    margin-bottom: 24px;
}

.lcs-course-header h2 {
    font-family: 'Rubik', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--black);
    margin-bottom: 12px;
}

.lcs-progress-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lcs-progress-bar {
    flex: 1;
    height: 12px;
    background: #e8e8e8;
    border-radius: 8px;
    border: 2px solid var(--black);
    overflow: hidden;
}

.lcs-progress-fill {
    height: 100%;
    background: var(--lime);
    border-radius: 6px;
    transition: width 0.5s ease;
}

.lcs-progress-text {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--black);
    white-space: nowrap;
}

/* ============ CARDS GRID ============ */
.lcs-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

/* ============ CARD BASE ============ */
.lcs-card {
    background: var(--white);
    border: 3px solid var(--black);
    border-radius: 20px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    animation: lcsCardIn 0.4s ease both;
}

.lcs-card:hover {
    transform: translate(-2px, -4px);
    box-shadow: 6px 8px 0 var(--black);
}

.lcs-card:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--black);
}

@keyframes lcsCardIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.lcs-card-num {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
    opacity: 0.6;
}

.lcs-card-title {
    font-family: 'Rubik', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--black);
    margin-bottom: 8px;
    line-height: 1.3;
}

.lcs-card-desc {
    font-size: 0.82rem;
    color: #666;
    line-height: 1.4;
    margin-bottom: 10px;
}

/* ============ CARD: LOCKED ============ */
.lcs-card.locked {
    box-shadow: 4px 4px 0 var(--black);
}

.lcs-card.locked .lcs-card-lock {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--orange);
    margin-top: 8px;
}

/* ============ CARD: UNLOCKED ============ */
.lcs-card.unlocked {
    box-shadow: 4px 4px 0 var(--black);
}

.lcs-card.unlocked .lcs-card-color-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    border-radius: 20px 0 0 20px;
}

.lcs-card-code-preview {
    background: #1e1e1e;
    color: #d4d4d4;
    font-family: 'Courier New', monospace;
    font-size: 0.72rem;
    padding: 10px 12px;
    border-radius: 10px;
    overflow: hidden;
    max-height: 70px;
    line-height: 1.4;
    border: 2px solid var(--black);
    white-space: pre;
}

.lcs-card-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 10px;
}

.lcs-card-status.done { color: #4CAF50; }
.lcs-card-status.open { color: var(--blue); }

/* ============ CARD: CLUB-LOCKED ============ */
.lcs-card.club-locked {
    background: linear-gradient(135deg, #fff0f5, #ffe8f0);
    border-color: var(--pink);
    box-shadow: 4px 4px 0 var(--pink);
    opacity: 0.9;
}

.lcs-card.club-locked .lcs-card-club-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--pink);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 10px;
    margin-top: 10px;
    width: fit-content;
}

/* ============ COMPLETED BADGE ============ */
.lcs-card-completed {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    background: #4CAF50;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    border: 2px solid var(--black);
}

/* ============ MODALS ============ */
.lcs-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(19, 16, 16, 0.6);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.lcs-modal-overlay.active {
    display: flex;
}

.lcs-modal {
    background: var(--white);
    border: 3px solid var(--black);
    border-radius: 24px;
    box-shadow: 8px 8px 0 var(--black);
    padding: 36px;
    max-width: 460px;
    width: 100%;
    position: relative;
    animation: lcsModalIn 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.lcs-modal-wide {
    max-width: 600px;
}

@keyframes lcsModalIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.lcs-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border: 2px solid var(--black);
    border-radius: 50%;
    background: var(--white);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.lcs-modal-close:hover {
    background: var(--black);
    color: var(--white);
}

.lcs-modal-icon {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 8px;
}

.lcs-modal-title {
    font-family: 'Rubik', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--black);
    text-align: center;
    margin-bottom: 4px;
}

.lcs-modal-lesson {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
    margin-bottom: 24px;
}

/* ============ QUIZ SECTION ============ */
.lcs-quiz-question {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--black);
    text-align: center;
    margin-bottom: 18px;
    line-height: 1.4;
}

.lcs-quiz-input-wrapper {
    display: flex;
    gap: 8px;
}

.lcs-quiz-input {
    flex: 1;
    padding: 14px 16px;
    border: 3px solid var(--black);
    border-radius: 14px;
    font-family: 'Rubik', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    outline: none;
    transition: all 0.2s;
}

.lcs-quiz-input:focus {
    box-shadow: 0 0 0 3px rgba(198, 223, 43, 0.4);
}

.lcs-quiz-submit {
    padding: 14px 20px;
    background: var(--lime);
    color: var(--black);
    border: 3px solid var(--black);
    border-radius: 14px;
    font-family: 'Rubik', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 3px 3px 0 var(--black);
    transition: all 0.2s;
    white-space: nowrap;
}

.lcs-quiz-submit:hover {
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 var(--black);
}

.lcs-quiz-submit:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 var(--black);
}

.lcs-quiz-feedback {
    text-align: center;
    margin-top: 14px;
    font-size: 0.9rem;
    font-weight: 600;
    min-height: 22px;
}

.lcs-quiz-feedback.success { color: #4CAF50; }
.lcs-quiz-feedback.error { color: var(--pink); }

/* ============ SKIP SECTION ============ */
.lcs-skip-divider {
    text-align: center;
    margin: 20px 0 16px;
    position: relative;
}

.lcs-skip-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: #e0e0e0;
}

.lcs-skip-divider span {
    background: var(--white);
    padding: 0 16px;
    position: relative;
    color: #999;
    font-size: 0.85rem;
    font-weight: 500;
}

.lcs-skip-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 2px dashed #ccc;
    border-radius: 14px;
    font-family: 'Rubik', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: #888;
    cursor: pointer;
    transition: all 0.2s;
}

.lcs-skip-btn:hover {
    border-color: var(--orange);
    color: var(--orange);
    background: rgba(255, 159, 0, 0.05);
}

.lcs-skip-cost {
    color: var(--pink);
    font-weight: 700;
}

/* ============ VIEW MODAL ============ */
.lcs-view-desc {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
}

.lcs-code-wrapper {
    position: relative;
}

.lcs-copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 6px 12px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    color: #aaa;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    z-index: 2;
    transition: all 0.2s;
}

.lcs-copy-btn:hover {
    background: rgba(255,255,255,0.2);
    color: white;
}

.lcs-code-block {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 20px;
    border-radius: 16px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    overflow-x: auto;
    border: 3px solid var(--black);
    white-space: pre;
    margin: 0;
}

/* ============ TOAST ============ */
.lcs-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--black);
    color: var(--white);
    padding: 14px 28px;
    border-radius: 16px;
    font-family: 'Rubik', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 11000;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 4px 4px 0 rgba(0,0,0,0.3);
}

.lcs-toast.show {
    transform: translateX(-50%) translateY(0);
}

/* ============ LOGIN PROMPT ============ */
.lcs-login-prompt {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--black);
    color: var(--white);
    padding: 16px 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: 'Rubik', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 9999;
}

.lcs-login-btn {
    background: var(--lime);
    color: var(--black);
    padding: 8px 20px;
    border-radius: 10px;
    font-weight: 700;
    text-decoration: none;
    border: 2px solid var(--lime);
    transition: all 0.2s;
}

.lcs-login-btn:hover {
    background: transparent;
    color: var(--lime);
}

/* ============ LOADING ============ */
.lcs-loading {
    text-align: center;
    padding: 60px 20px;
    font-size: 1.1rem;
    color: #999;
    font-weight: 500;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 960px) {
    .lcs-content {
        flex-direction: column;
    }

    .lcs-sidebar {
        width: 100%;
        position: static;
        max-height: none;
        flex-direction: row;
        flex-wrap: wrap;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }

    .lcs-sidebar::-webkit-scrollbar { height: 0; }

    .lcs-level-tabs {
        width: 100%;
        flex-shrink: 0;
        margin-bottom: 6px;
    }

    .lcs-course-btn {
        flex-shrink: 0;
        width: auto;
        padding: 10px 14px;
        font-size: 0.82rem;
        white-space: nowrap;
    }

    .lcs-course-name { display: none; }

    .lcs-course-btn .lcs-course-icon {
        font-size: 1.1rem;
        width: auto;
    }
}

@media (max-width: 768px) {
    .lcs-hero {
        padding: 130px 20px 40px;
    }

    .lcs-hero-title { font-size: 2rem; }
    .lcs-hero-subtitle { font-size: 0.95rem; }

    .lcs-hero-stats { gap: 12px; }

    .lcs-stat {
        padding: 10px 18px;
        box-shadow: 3px 3px 0 var(--black);
    }

    .lcs-stat-value { font-size: 1.3rem; }

    .lcs-page { padding: 24px 16px 60px; }

    .lcs-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 12px;
    }

    .lcs-card { padding: 16px; }

    .lcs-modal {
        padding: 28px 20px;
        box-shadow: 6px 6px 0 var(--black);
        border-radius: 20px;
    }
}

@media (max-width: 480px) {
    .lcs-hero { padding: 120px 16px 30px; }
    .lcs-hero-title { font-size: 1.6rem; }

    .lcs-hero-stats { flex-wrap: wrap; }

    .lcs-cards-grid {
        grid-template-columns: 1fr;
    }

    .lcs-quiz-input-wrapper {
        flex-direction: column;
    }

    .lcs-quiz-submit { width: 100%; }
}
