
:root {
    /* GLOBAL */
    --bg-body: linear-gradient(90deg, rgba(16, 117, 87, 0.06), rgba(15, 132, 89, 0.04));
    --card-bg: #ffffff;
    --text: #1f2937;
    --white: #ffffff;
    --muted: #6b7280;

    /* COLORS */
    --accent: #058f00;
    --accent-2: #107557;
    --danger: #dc2626;
    --light-gray: #fbfbfb;
    --border-gray: #e6edf0;
    --blue-dark: #0369a1;
    --dark-text: #3f3f3f;
    --dark-green: #064e3b;
    --dark-red: #881717;
    --dark-blue: #065f46;
    --dark-red-2: #991b1b;
    --light-green: #fbfffb;
    --green-tint: #f7fff7;
    --green-border: #e6f6ea;
    --light-blue: #f0f9ff;
    --light-blue-2: #e0f2fe;
    --light-green-2: #f0fdf4;
    --light-red: #fef2f2;
    --glass: rgba(255, 255, 255, .6);

    /* GRADIENTS */
    --bg-hero: linear-gradient(to right, #107557, #0F8459, #0F5A55);
    --bg-green-gradient: linear-gradient(180deg, #fbfffb, #f7fff7);
    --bg-answer-gradient: linear-gradient(180deg, #fff, #fbfbfb);
    --bg-correct-gradient: linear-gradient(180deg, #ecfdf5, #dcfce7);
    --bg-wrong-gradient: linear-gradient(180deg, #fff1f2, #fee2e2);
    --bg-selected-gradient: linear-gradient(180deg, #f0fff9, #e6fff4);
    --bg-explanation: linear-gradient(180deg, #fbfdff, #f1fbff);
    --bg-hints: linear-gradient(180deg, #f0f9ff, #e0f2fe);
    --bg-solution: linear-gradient(180deg, #f0fdf4, #dcfce7);
    --bg-why-wrong: linear-gradient(180deg, #fef2f2, #fee2e2);

    /* SHADOWS */
    --shadow-card: 0 10px 30px rgba(2, 6, 23, .06);
    --shadow-light: 0 8px 30px rgba(2, 6, 23, .06);
    --shadow-hover: 0 8px 20px rgba(2, 6, 23, .06);
    --shadow-hover-2: 0 8px 20px rgba(2, 6, 23, .08);
    --shadow-history: 0 6px 20px rgba(2, 6, 23, .05);
    --shadow-help: 0 6px 20px rgba(16, 117, 87, .08);

    /* BORDERS */
    --border-correct: #bbf7d0;
    --border-correct-light: #eef7ff;
    --border-wrong: #fecaca;
    --border-wrong-2: #f87171;
    --border-blue: #0ea5e9;
    --border-green: #10b981;
    --border-red: #ef4444;
}

.invert-root {
    /* GLOBAL */
    --bg-body: #252525;
    --card-bg: #313131;
    --text: #e5e7eb;
    --white: #ffffff;
    --muted: #9ca3af;
    --bg-help: rgb(54, 54, 54);

    /* COLORS */
    --accent: #00af40;
    --accent-2: #16a34a;
    --danger: #ef4444;
    --light-gray: #ffffff;
    --border-gray: #444444;
    --blue-dark: #0ea5e9;
    --dark-text: #000000;
    --dark-green: #86efac;
    --dark-red: #fca5a5;
    --dark-blue: #4ade80;
    --dark-red-2: #fca5a5;
    --light-green: #1a2e1a;
    --green-tint: #213521;
    --green-border: #1d3d2d;
    --light-blue: #0c2340;
    --light-blue-2: #1e3a5f;
    --light-green-2: #1a3a1a;
    --light-red: #3a1a1a;
    --glass: rgba(0, 0, 0, .4);

    /* GRADIENTS */
    --bg-hero: #0F6956;
    --bg-green-gradient: linear-gradient(180deg, #1a2e1a, #213521);
    --bg-answer-gradient: linear-gradient(180deg, #2d2d2d, #333333);
    --bg-correct-gradient: linear-gradient(180deg, #1a3a1a, #2d5a2d);
    --bg-wrong-gradient: linear-gradient(180deg, #3a1a1a, #5a2d2d);
    --bg-selected-gradient: linear-gradient(180deg, #1a3a2d, #2d5a4d);
    --bg-explanation: linear-gradient(180deg, #1a2333, #2d3a4d);
    --bg-hints: linear-gradient(180deg, #0c2340, #1e3a5f);
    --bg-solution: linear-gradient(180deg, #1a3a1a, #2d5a2d);
    --bg-why-wrong: linear-gradient(180deg, #3a1a1a, #5a2d2d);

    /* SHADOWS */
    --shadow-card: 0 10px 30px rgba(0, 0, 0, .3);
    --shadow-light: 0 8px 30px rgba(0, 0, 0, .3);
    --shadow-hover: 0 8px 20px rgba(0, 0, 0, .4);
    --shadow-hover-2: 0 8px 20px rgba(0, 0, 0, .5);
    --shadow-history: 0 6px 20px rgba(0, 0, 0, .3);
    --shadow-help: 0 6px 20px rgba(34, 197, 94, .15);

    /* BORDERS */
    --border-correct: #22c55e;
    --border-correct-light: #1a3a2d;
    --border-wrong: #ef4444;
    --border-wrong-2: #f87171;
    --border-blue: #0ea5e9;
    --border-green: #22c55e;
    --border-red: #ef4444;
}

/* Reset */
* {
    box-sizing: border-box
}

body {
    margin: 0;
    font-family: "Nunito", sans-serif;
    background: var(--bg-body);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}



/* HERO */
.hero {
    color: var(--white);
    text-align: center;
    padding: 65px 10px;

    background: var(--bg-hero);
}

h1 {
    background-color: var(--white);
    color: var(--dark-text);
    letter-spacing: 1px;
    font-weight: 800;
    padding: 6px 18px;
    border-radius: 28px;
    width: fit-content;
    margin: 0 auto 30px;
}

#small-h1-percento {
    font-family: "Playpen Sans", sans-serif;
    font-weight: normal;
}




/* Layout */
.main-container {
    display: flex;
    gap: 28px;
    max-width: 1200px;
    margin: 22px auto;
    padding: 0 18px 80px;
}

/* Sidebar */
.control-panel {
    width: 320px;
    background: var(--card-bg);
    border-radius: 14px;
    padding: 18px;
    box-shadow: var(--shadow-card);
    position: sticky;
    top: 86px;
    height: fit-content;
}

.control-panel h2 {
    margin: 0 0 10px;
    font-size: 18px;
    color: var(--accent)
}

.control-panel label {
    display: block;
    margin-top: 12px;
    font-weight: 700;
    font-size: 13px;
    color: var(--muted)
}

.control-panel select {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border-gray);
    margin-top: 8px
}

.control-row {
    display: flex;
    gap: 8px;
    margin-top: 12px
}

.btn-primary {
    background: var(--accent);
    color: var(--white);
    padding: 10px 12px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 700
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border-gray);
    padding: 10px 10px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text);
}

.btn-link {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    margin-top: 8px;
    text-decoration: underline
}

.help-list {
    margin: 10px 0;
    padding-left: 18px;
    color: var(--muted);
    font-size: 14px
}

.stats-box {
    margin-top: 14px;
    background: var(--bg-green-gradient);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--green-border)
}

.stats-box h4 {
    margin: 0 0 8px;
    font-size: 14px;
    color: var(--accent)
}

.control-small {
    margin-top: 10px;
    font-size: 13px;
    color: var(--muted)
}

/* Practice area */
.practice-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 18px
}

/* Task card */
.task-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 14px;
    box-shadow: var(--shadow-card)
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px
}

.task-header h2 {
    margin: 0;
    font-size: 20px
}

.meta {
    font-size: 13px;
    color: var(--muted);
    display: flex;
    gap: 10px;
    align-items: center
}

#taskText {
    margin: 14px 0 18px;
    font-size: 18px;
    line-height: 1.4
}

/* answers grid */
.answers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px
}

.answers button {
    padding: 14px;
    border-radius: 10px;
    border: 1px solid var(--border-gray);
    background: var(--bg-answer-gradient);
    font-weight: 700;
    cursor: pointer;
    transition: all .18s;
    text-align: left;
    color: var(--text);
}

.answers button:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover)
}

.answers button.selected {
    outline: 3px solid rgba(15, 132, 89, .12)
}

/* answer states */
.answers button.correct {
    background: var(--bg-correct-gradient);
    border-color: var(--border-correct);
    color: var(--dark-green)
}

.answers button.wrong {
    background: var(--bg-wrong-gradient);
    border-color: #fecaca;
    color: var(--dark-red);
}

/* actions */
.action-row {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    align-items: center
}

.btn-help {
    background: var(--bg-help);
    border: 1px solid var(--border-gray);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text)
}

.btn-help:hover {
    box-shadow: var(--shadow-help)
}

.feedback {
    margin-top: 12px;
    font-weight: 800;
    color: var(--muted)
}

.feedback.success {
    color: #22c55e
}

.feedback.error {
    color: var(--danger)
}

/* explanation */
.explanation {
    margin-top: 16px;
    background: var(--bg-explanation);
    padding: 18px;
    border-radius: 10px;
    border: 1px solid #e0f2fe;
    line-height: 1.45
}

.explanation .step {
    margin-bottom: 12px;
    padding: 10px;
    background: var(--white);
    border-radius: 8px;
    border: 1px solid var(--border-correct-light);
    color: black;
}

.explanation .why-wrong {
    font-size: 13px;
    color: var(--muted);
    margin-top: 8px;
}

/* history */
.history-card {
    background: var(--card-bg);
    padding: 14px;
    border-radius: 12px;
    box-shadow: var(--shadow-history);
}

.history-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 180px;
    overflow: auto
}

.history-list li {
    padding: 8px;
    border-bottom: 1px dashed #f1f5f6;
    font-size: 14px
}

/* Responsive */
@media(max-width:980px) {
    .main-container {
        flex-direction: column;
        padding-bottom: 60px
    }

    .control-panel {
        position: static;
        width: 100%
    }

    .practice-area {
        width: 100%
    }

    .answers {
        grid-template-columns: 1fr
    }
}




/* Стилове за A-B-C-D отговори */
.answers {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    counter-reset: answer-letter;
}

.answer-btn {
    position: relative;
    padding: 14px 14px 14px 48px;
    /* Оставя място за буквата отляво */
    border-radius: 10px;
    border: 1px solid var(--border-gray);
    background: var(--bg-answer-gradient);
    font-weight: 700;
    cursor: pointer;
    transition: all .18s;
    text-align: left;
    font-size: 16px;
}

.answer-btn::first-letter {
    color: var(--white);
    font-weight: 900;
    background-color: var(--blue-dark);
    padding: 4px 8.75px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin-right: 5px;
}

/* Буквата A-B-C-D отляво
.answer-btn::before {
    counter-increment: answer-letter;
    content: counter(answer-letter, upper-alpha) ".";
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 800;
    color: var(--accent);
    font-size: 18px;
    width: 24px;
    text-align: center;
} */

/* Състояния на бутоните */
.answer-btn.selected {
    outline: 3px solid rgba(15, 132, 89, .25);
    background: var(--bg-selected-gradient);
    border-color: var(--accent);
}

.answer-btn.correct {
    background: var(--bg-correct-gradient);
    border-color: #22c55e;
    color: var(--dark-green);
}

.answer-btn.wrong {
    background: var(--bg-wrong-gradient);
    border-color: var(--border-wrong-2);
    color: var(--dark-red);
}

.answer-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Ховер ефект */
.answer-btn:not(:disabled):hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover-2);
}

/* За мобилни - една колона */
@media (max-width: 768px) {
    .answers {
        grid-template-columns: 1fr;
    }
}





/* Стилове за насоки и решения */
.hints {
    background: var(--bg-hints);
    padding: 16px;
    border-radius: 10px;
    border-left: 4px solid var(--border-blue);
    margin-bottom: 16px;
}

.hints strong {
    color: var(--blue-dark);
    display: block;
    margin-bottom: 10px;
    font-size: 16px;
}

.hints ul {
    margin: 8px 0;
    padding-left: 20px;
}

.hints li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.solution {
    background: var(--bg-solution);
    padding: 16px;
    border-radius: 10px;
    border-left: 4px solid var(--border-green);
    margin-bottom: 16px;
}

.solution strong {
    color: var(--dark-blue);
    display: block;
    margin-bottom: 10px;
    font-size: 16px;
}

.step {
    margin-bottom: 8px;
    padding: 8px;
    background: var(--white);
    border-radius: 6px;
    border: 1px solid var(--border-correct);
}

.why-wrong {
    background: var(--bg-why-wrong);
    padding: 16px;
    border-radius: 10px;
    border-left: 4px solid var(--border-red);
    margin-top: 16px;
}

.why-wrong strong {
    color: var(--dark-red-2);
    display: block;
    margin-bottom: 10px;
    font-size: 16px;
}

.why-wrong ul {
    margin: 8px 0;
    padding-left: 20px;
}

.why-wrong li {
    margin-bottom: 6px;
    line-height: 1.4;
    font-size: 14px;
}