/* extras din 13din15 invata.html */

/* ── Reset & container ─────────────────────────────── */
#learn-wrap {
    max-width: 640px;
    margin: 0 auto;
    padding: 16px 16px 80px;
    font-family: inherit;
    -webkit-text-fill-color: initial !important;
}

/* ── Header ────────────────────────────────────────── */
#learn-header {
    text-align: center;
    margin-bottom: 20px;
}
#learn-header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.4;
    color: #1d2327;
    margin: 0 0 4px;
    padding-bottom: 2px;
    -webkit-text-fill-color: #1d2327 !important;
}
#learn-header p {
    font-size: 0.85rem;
    color: #6c757d;
    margin: 0;
    -webkit-text-fill-color: #6c757d !important;
}

/* ── Selector categorie ────────────────────────────── */
#learn-cat-wrap {
    margin-bottom: 18px;
}
#learn-cat-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
    -webkit-text-fill-color: #6c757d !important;
}
#learn-cat-select {
    width: 100%;
    padding: 12px 14px;
    font-size: 1rem;
    border: 2px solid #e2e4e7;
    border-radius: 10px;
    background: #fff;
    color: #1d2327;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236c757d' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
    transition: border-color 0.2s;
    min-height: 48px;
}
#learn-cat-select:focus {
    outline: none;
    border-color: #27ae60;
}

/* ── Progress bar ──────────────────────────────────── */
#learn-progress-wrap {
    margin-bottom: 16px;
}
#learn-progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 6px;
    -webkit-text-fill-color: #6c757d !important;
}
#learn-progress-label span:last-child {
    font-weight: 600;
    color: #1d2327;
    -webkit-text-fill-color: #1d2327 !important;
}
#learn-progress-bar-bg {
    width: 100%;
    height: 6px;
    background: #e9ecef;
    border-radius: 99px;
    overflow: hidden;
}
#learn-progress-bar-fill {
    height: 100%;
    background: #27ae60;
    border-radius: 99px;
    transition: width 0.35s ease;
    width: 0%;
}

/* ── Card flashcard ────────────────────────────────── */
#learn-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    padding: 24px 20px 20px;
    margin-bottom: 14px;
}
#learn-category-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #27ae60;
    background: rgba(39,174,96,0.1);
    border-radius: 6px;
    padding: 3px 8px;
    margin-bottom: 12px;
    -webkit-text-fill-color: #27ae60 !important;
}
#learn-question-text {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1d2327;
    line-height: 1.5;
    margin-bottom: 20px;
    -webkit-text-fill-color: #1d2327 !important;
}

/* ── Butoane răspunsuri ────────────────────────────── */
#learn-answers {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.learn-answer-btn {
    width: 100%;
    min-height: 56px;
    padding: 0;
    text-align: left;
    border: 1px solid #e2e4e7;
    border-radius: 10px;
    background: #fff;
    color: #1d2327;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    display: flex;
    align-items: stretch;
    overflow: hidden;
    -webkit-text-fill-color: #1d2327 !important;
}
.learn-answer-btn:hover:not(:disabled) {
    border-color: #b0b8c1;
    background: #f8f9fa;
}
.learn-answer-btn:disabled {
    cursor: default;
}
.learn-answer-label {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    width: 48px;
    background: #e9ecef;
    font-size: 1rem;
    font-weight: 700;
    color: #495057;
    -webkit-text-fill-color: #495057 !important;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}
.learn-answer-text {
    padding: 12px 14px;
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.45;
    color: #1d2327;
    -webkit-text-fill-color: #1d2327 !important;
    flex: 1;
    display: flex;
    align-items: center;
}
/* Stare corecte / greșite */
.learn-answer-btn.correct {
    border-color: #27ae60 !important;
    background: #fff !important;
}
.learn-answer-btn.correct .learn-answer-label {
    background: #27ae60 !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}
.learn-answer-btn.correct .learn-answer-text {
    color: #155724 !important;
    -webkit-text-fill-color: #155724 !important;
    font-weight: 600;
}
.learn-answer-btn.wrong {
    border-color: #dc3545 !important;
    background: #fff !important;
}
.learn-answer-btn.wrong .learn-answer-label {
    background: #dc3545 !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}
.learn-answer-btn.wrong .learn-answer-text {
    color: #721c24 !important;
    -webkit-text-fill-color: #721c24 !important;
}

/* ── Feedback text ─────────────────────────────────── */
#learn-feedback {
    display: none;
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    -webkit-text-fill-color: initial !important;
}
#learn-feedback.correct {
    background: rgba(39,174,96,0.12);
    color: #155724;
    -webkit-text-fill-color: #155724 !important;
}
#learn-feedback.wrong {
    background: rgba(220,53,69,0.08);
    color: #721c24;
    -webkit-text-fill-color: #721c24 !important;
}

/* ── Buton Următoarea ──────────────────────────────── */
#learn-next-btn {
    display: none;
    width: 100%;
    min-height: 52px;
    padding: 14px;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    background: #27ae60;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
    -webkit-text-fill-color: #fff !important;
}
#learn-next-btn:hover {
    background: #219a52;
}

/* ── Ecran felicitare ──────────────────────────────── */
#learn-congrats {
    display: none;
    text-align: center;
    padding: 40px 20px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
#learn-congrats .congrats-emoji {
    font-size: 3.5rem;
    margin-bottom: 16px;
}
#learn-congrats h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1d2327;
    margin: 0 0 8px;
    -webkit-text-fill-color: #1d2327 !important;
}
#learn-congrats p {
    font-size: 0.95rem;
    color: #6c757d;
    margin: 0 0 24px;
    -webkit-text-fill-color: #6c757d !important;
}
#learn-restart-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    background: #27ae60;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
    -webkit-text-fill-color: #fff !important;
}
#learn-restart-btn:hover {
    background: #219a52;
}

/* ── Toast "Continuăm?" ────────────────────────────── */
#learn-toast {
    display: none;
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #1d2327;
    color: #fff;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 500;
    z-index: 9999;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    white-space: nowrap;
    max-width: 90vw;
    text-align: center;
    -webkit-text-fill-color: #fff !important;
    animation: learn-toast-in 0.3s ease;
}
@keyframes learn-toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(12px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Toggle mod răspuns ────────────────────────────── */
#learn-mode-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
    border: 1px solid #e2e4e7;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 18px;
}
#learn-mode-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: #495057;
    -webkit-text-fill-color: #495057 !important;
    line-height: 1.3;
}
#learn-mode-sublabel {
    font-size: 0.75rem;
    font-weight: 400;
    color: #6c757d;
    -webkit-text-fill-color: #6c757d !important;
    display: block;
    margin-top: 2px;
}
/* Toggle switch */
#learn-mode-toggle {
    position: relative;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
    margin-left: 12px;
}
#learn-mode-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
#learn-mode-slider {
    position: absolute;
    inset: 0;
    background: #ced4da;
    border-radius: 26px;
    cursor: pointer;
    transition: background 0.2s;
}
#learn-mode-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
#learn-mode-toggle input:checked + #learn-mode-slider {
    background: #27ae60;
}
#learn-mode-toggle input:checked + #learn-mode-slider::before {
    transform: translateX(22px);
}
/* Buton Trimite */
#learn-submit-btn {
    display: none;
    width: 100%;
    min-height: 52px;
    padding: 14px;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    background: #27ae60;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 14px;
    -webkit-text-fill-color: #fff !important;
}
#learn-submit-btn:hover {
    background: #219a52;
}
#learn-submit-btn:disabled {
    background: #ced4da;
    cursor: default;
}
/* Răspuns selectat (mod după Trimite) */
.learn-answer-btn.selected {
    border-color: #fdcb6e !important;
    background: #ffeaa7 !important;
}
.learn-answer-btn.selected .learn-answer-label {
    background: #fdcb6e !important;
    color: #2d3436 !important;
    -webkit-text-fill-color: #2d3436 !important;
}
.learn-answer-btn.selected .learn-answer-text {
    color: #2d3436 !important;
    -webkit-text-fill-color: #2d3436 !important;
}
#learn-spinner {
    display: none;
    text-align: center;
    padding: 40px 0;
}
#learn-spinner::after {
    content: '';
    display: inline-block;
    width: 36px;
    height: 36px;
    border: 3px solid #e2e4e7;
    border-top-color: #27ae60;
    border-radius: 50%;
    animation: learn-spin 0.7s linear infinite;
}
@keyframes learn-spin {
    to { transform: rotate(360deg); }
}

/* ── Eroare ────────────────────────────────────────── */
#learn-error {
    display: none;
    text-align: center;
    padding: 30px 20px;
    color: #721c24;
    background: rgba(220,53,69,0.08);
    border-radius: 12px;
    font-size: 0.95rem;
    -webkit-text-fill-color: #721c24 !important;
}
