/* core.css
   Shared bits, navbar, email banner, toasts, skill cards, profile,
   review, shadowing, listening and placement test.
   Loaded after style.css and uses the same colors.
   Part of the old features.css, split in load order: see index.html. */

/* ---------- shared bits ---------- */

.setting-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.setting-btn:disabled:hover {
    background-color: var(--surface-3);
}

.link-btn {
    padding: 0;
    border: none;
    background: none;
    color: var(--primary-ink);
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
}

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

.badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 9px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: bold;
    vertical-align: middle;
}

.badge-good {
    background: rgba(34, 168, 102, 0.18);
    color: var(--success-ink);
}

.badge-warn {
    background: rgba(240, 180, 60, 0.18);
    color: var(--warning-ink);
}

/* ---------- navbar: username links to the profile ---------- */

.nav-profile {
    color: var(--muted);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s;
}

.nav-profile:hover,
.nav-profile.active {
    color: var(--ink);
}

/* ---------- email confirmation banner ---------- */

.verify-banner {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
    padding: 10px 16px;
    background: rgba(240, 180, 60, 0.12);
    border: 1px solid var(--warning);
    border-radius: 10px;
    color: var(--warning-ink);
    font-size: 14px;
    line-height: 1.4;
}

.verify-banner strong {
    color: var(--ink);
}

.verify-actions {
    display: flex;
    flex-shrink: 0;
    gap: 8px;
}

.verify-btn {
    padding: 6px 12px;
    border: 1px solid var(--warning);
    border-radius: 8px;
    background: transparent;
    color: var(--warning-ink);
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.verify-btn:hover {
    background: rgba(240, 180, 60, 0.2);
}

/* ---------- toasts ---------- */

.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 2000;
    max-width: 360px;
    padding: 12px 16px;
    background: var(--success-tint);
    border: 1px solid var(--success);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    color: var(--ink);
    font-size: 14px;
    line-height: 1.4;
    animation: toast-in 0.25s ease-out;
}

.toast-bad {
    background: var(--danger-tint);
    border-color: var(--danger);
}

.toast + .toast {
    bottom: 90px;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- skill training cards (Practice page) ---------- */

.section-title {
    margin: 30px 0 14px;
    font-size: 18px;
}

.skill-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.skill-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 22px 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, transform 0.2s;
}

.skill-card:hover {
    background: var(--surface-3);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.skill-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    min-width: 24px;
    padding: 3px 7px;
    border-radius: 12px;
    background: var(--danger);
    color: var(--on-color);
    font-size: 12px;
    font-weight: bold;
}

@media (max-width: 1100px) {
    .skill-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ---------- profile page ---------- */

.profile-head {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary);
    font-size: 32px;
    font-weight: bold;
}

.profile-id {
    flex: 1;
    min-width: 200px;
}

.profile-id h2 {
    margin-bottom: 2px;
}

.profile-id .settings-help {
    margin-bottom: 6px;
}

.profile-email-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 4px;
    color: var(--ink-2);
    font-size: 14px;
}

.profile-email-line .link-btn {
    margin-left: 8px;
}

.profile-level-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    padding: 14px 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.profile-level {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.profile-level-code {
    color: var(--success-ink);
    font-size: 30px;
    font-weight: bold;
}

.profile-level-text {
    color: var(--muted);
    font-size: 14px;
}

.profile-account {
    margin-top: 30px;
}

@media (max-width: 800px) {
    .profile-level-box {
        width: 100%;
        align-items: flex-start;
    }
}

/* ---------- review mistakes ---------- */

.review-stats {
    max-width: 760px;
    margin-bottom: 18px;
}

.review-note {
    max-width: 760px;
}

/* ---------- shadowing ---------- */

.shadow-level-note {
    margin-top: 16px;
    margin-bottom: 0;
}

.shadow-italian {
    margin-bottom: 6px;
    font-size: 24px;
    font-weight: bold;
    line-height: 1.4;
}

.shadow-translation {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 15px;
}

.shadow-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.shadow-controls .setting-btn {
    padding: 10px 16px;
}

.shadow-record.recording {
    background: var(--danger);
    border-color: var(--danger);
    animation: shadow-pulse 1.2s ease-in-out infinite;
}

@keyframes shadow-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0.6); }
    50% { box-shadow: 0 0 0 8px rgba(229, 72, 77, 0); }
}

.shadow-status {
    min-height: 20px;
    margin-top: 14px;
    color: var(--muted);
    font-size: 14px;
}

.shadow-status.shadow-error {
    color: var(--danger-ink);
}

.shadow-result {
    margin-top: 14px;
    padding: 14px 16px;
    background: var(--surface);
    border-radius: 10px;
}

.shadow-score-line {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 10px;
}

.shadow-stars {
    color: var(--warning-ink);
    font-size: 24px;
    letter-spacing: 2px;
}

.shadow-score {
    font-size: 26px;
    font-weight: bold;
}

.shadow-words {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.shadow-word {
    padding: 4px 9px;
    border-radius: 6px;
    font-size: 16px;
}

.shadow-word.correct {
    background: rgba(34, 168, 102, 0.2);
    color: var(--success-ink);
}

.shadow-word.close {
    background: rgba(240, 180, 60, 0.2);
    color: var(--warning-ink);
}

.shadow-word.missed {
    background: rgba(229, 72, 77, 0.2);
    color: var(--danger-ink);
}

.shadow-legend,
.shadow-heard {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

/* ---------- listening ---------- */

.listen-audio {
    display: block;
    width: 100%;
    margin-top: 10px;
}

.listen-questions {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 16px;
}

.listen-q-prompt {
    margin-bottom: 12px;
    font-size: 17px;
    line-height: 1.5;
}

.listen-why {
    margin-top: 10px;
}

#listen-play .quiz-actions {
    margin-top: 10px;
}

#listen-results {
    margin-top: 24px;
}

.listen-transcript-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.listen-transcript-head .setting-btn {
    padding: 8px 14px;
    font-size: 13px;
}

.translations-hidden .listen-translation {
    display: none;
}

/* ---------- placement test ---------- */

.placement-cefr {
    margin: 4px 0 6px;
    color: var(--success-ink);
    font-size: 64px;
    font-weight: bold;
    line-height: 1;
}

.tier-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

#placement-results .quiz-option-title {
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
}

.tier-chip {
    padding: 5px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    color: var(--muted);
    font-size: 13px;
}

.tier-chip.passed {
    border-color: var(--success);
    background: rgba(34, 168, 102, 0.15);
    color: var(--success-ink);
}

.placement-review-title {
    margin-bottom: 12px;
}

#placement-play .quiz-actions .setting-btn {
    padding: 12px 20px;
}

/* ---------- mobile ---------- */

@media (max-width: 800px) {
    .verify-banner {
        flex-direction: column;
        align-items: flex-start;
    }

    .toast {
        left: 16px;
        right: 16px;
        bottom: 16px;
        max-width: none;
    }

    .shadow-italian {
        font-size: 20px;
    }

    .placement-cefr {
        font-size: 48px;
    }
}

