﻿/* ===== OVERLAY ===== */
.block-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5,5,20,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.16,1,0.3,1);
}

    .block-overlay.active {
        opacity: 1;
        visibility: visible;
    }

        .block-overlay.active .block-card {
            transform: scale(1) translateY(0);
            opacity: 1;
        }

/* ===== CARD ===== */
.block-card {
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    background: linear-gradient(145deg, rgba(20,20,50,0.95), rgba(15,15,40,0.98));
    border-radius: 20px;
    padding: 0;
    position: relative;
    transform: scale(0.9) translateY(30px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.16,1,0.3,1);
}

    .block-card::-webkit-scrollbar {
        width: 4px;
    }

    .block-card::-webkit-scrollbar-track {
        background: transparent;
    }

    .block-card::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,0.15);
        border-radius: 2px;
    }

.block-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px 16px;
}

.block-number {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    flex-shrink: 0;
    color: white;
}

.block-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: white;
}

.block-body {
    padding: 0 24px 24px;
}



/* ===== HOOK ===== */
.hook-question {
    text-align: center;
    margin-bottom: 20px;
}

    .hook-question p {
        font-size: 0.9rem;
        color: rgba(255,255,255,0.7);
        margin-bottom: 12px;
        line-height: 1.6;
    }

.hook-sentence {
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 16px 20px;
    margin: 12px 0;
    border: 1px solid rgba(255,255,255,0.08);
}

    .hook-sentence .eng {
        font-size: 1.05rem;
        font-style: italic;
        color: rgba(255,255,255,0.9);
        margin-bottom: 4px;
    }

    .hook-sentence .label {
        font-size: 0.85rem;
        font-weight: 700;
        background: linear-gradient(135deg, #fbbf24, #f59e0b);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }

.hook-options {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
}

.hook-btn {
    flex: 1;
    max-width: 160px;
    padding: 14px 24px;
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

    .hook-btn .opt-label {
        width: 28px;
        height: 28px;
        border-radius: 8px;
        background: rgba(255,255,255,0.1);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.8rem;
        font-weight: 600;
    }

    .hook-btn:hover {
        border-color: rgba(139,92,246,0.5);
        background: rgba(139,92,246,0.1);
        transform: translateY(-2px);
    }

    .hook-btn.selected-correct {
        border-color: #10b981;
        background: rgba(16,185,129,0.15);
        animation: pulse-green 0.5s ease;
    }

    .hook-btn.selected-wrong {
        border-color: #ef4444;
        background: rgba(239,68,68,0.15);
        animation: shake 0.5s ease;
    }

.hook-hint {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.35);
    text-align: center;
    margin-top: 12px;
}

/* ===== EXPLANATION ===== */
.explain-intro {
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    border-left: 3px solid;
}

    .explain-intro h3 {
        font-size: 0.95rem;
        font-weight: 700;
        margin-bottom: 6px;
    }

    .explain-intro p {
        font-size: 0.85rem;
        color: rgba(255,255,255,0.65);
        line-height: 1.6;
    }

.explain-rule-box {
    background: rgba(255,255,255,0.04);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
    border: 1px solid rgba(255,255,255,0.06);
}

.rule-formula {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rule-chip {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
}

.chip-subject {
    background: rgba(251,191,36,0.15);
    color: #fbbf24;
    border: 1px solid rgba(251,191,36,0.3);
}

.chip-arrow {
    color: rgba(255,255,255,0.3);
    font-size: 1.2rem;
}

.chip-verb {
    background: rgba(59,130,246,0.15);
    color: #60a5fa;
    border: 1px solid rgba(59,130,246,0.3);
}

.explain-example {
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    margin-bottom: 8px;
    border-left: 2px solid rgba(255,255,255,0.1);
}

    .explain-example .eng {
        font-size: 0.9rem;
        color: rgba(255,255,255,0.85);
        margin-bottom: 2px;
    }

        .explain-example .eng strong {
            color: #60a5fa;
        }

    .explain-example .vi {
        font-size: 0.8rem;
        color: rgba(255,255,255,0.4);
        font-style: italic;
    }

.btn-continue {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

    .btn-continue:hover {
        transform: translateY(-2px);
    }

    .btn-continue.primary {
        color: white;
    }

/* ===== QUIZ ===== */
.quiz-question {
    margin-bottom: 16px;
}

.quiz-question-text {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.85);
    margin-bottom: 10px;
    line-height: 1.5;
}

    .quiz-question-text .blank {
        display: inline-block;
        width: 80px;
        border-bottom: 2px dashed rgba(255,255,255,0.3);
        margin: 0 4px;
    }

.quiz-options {
    display: flex;
    gap: 10px;
}

.quiz-opt-btn {
    flex: 1;
    padding: 10px 16px;
    border: 1.5px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.85);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

    .quiz-opt-btn .q-label {
        width: 24px;
        height: 24px;
        border-radius: 6px;
        background: rgba(255,255,255,0.08);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.75rem;
        font-weight: 700;
        color: rgba(255,255,255,0.5);
    }

    .quiz-opt-btn:hover {
        border-color: rgba(245,158,11,0.4);
        background: rgba(245,158,11,0.08);
    }

    .quiz-opt-btn.selected {
        border-color: #f59e0b;
        background: rgba(245,158,11,0.12);
    }

    .quiz-opt-btn.correct {
        border-color: #10b981;
        background: rgba(16,185,129,0.12);
    }

    .quiz-opt-btn.wrong {
        border-color: #ef4444;
        background: rgba(239,68,68,0.12);
    }

.quiz-divider {
    height: 1px;
    background: rgba(255,255,255,0.06);
    margin: 12px 0;
}

.quiz-hint {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.35);
    text-align: center;
    margin-top: 12px;
}

.btn-submit-quiz {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 12px;
}

    .btn-submit-quiz:hover {
        transform: translateY(-2px);
    }

    .btn-submit-quiz:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none;
    }

/* ===== FEEDBACK ===== */
.feedback-item {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 10px;
    border: 1px solid rgba(255,255,255,0.06);
}

    .feedback-item .fb-header {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 6px;
    }

.fb-number {
    font-size: 0.8rem;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
}

.fb-answer {
    font-weight: 700;
    font-size: 0.95rem;
}

    .fb-answer.correct {
        color: #10b981;
    }

    .fb-answer.wrong {
        color: #ef4444;
    }

.fb-badge {
    padding: 2px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

    .fb-badge.correct {
        background: rgba(16,185,129,0.15);
        color: #10b981;
    }

.fb-explain {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.55);
    line-height: 1.5;
    padding-left: 8px;
    border-left: 2px solid rgba(255,255,255,0.08);
    margin-top: 6px;
}

.fb-cta {
    text-align: center;
    padding: 12px;
    margin-top: 8px;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
}

/* ===== RECALL ===== */
.recall-desc {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.55);
    margin-bottom: 16px;
    line-height: 1.5;
}

.recall-item {
    margin-bottom: 14px;
}

    .recall-item label {
        display: flex;
        align-items: baseline;
        gap: 8px;
        font-size: 0.9rem;
        color: rgba(255,255,255,0.8);
        margin-bottom: 6px;
        line-height: 1.5;
        flex-wrap: wrap;
    }

.recall-num {
    font-weight: 700;
    flex-shrink: 0;
}

.recall-input {
    display: inline-block;
    width: 120px;
    padding: 4px 10px;
    border: none;
    border-bottom: 2px dashed;
    border-radius: 6px 6px 0 0;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    outline: none;
    transition: all 0.25s ease;
    background: transparent;
    color: white;
}

    .recall-input:focus {
        background: rgba(255,255,255,0.06);
    }

    .recall-input.correct {
        border-bottom-color: #10b981 !important;
        background: rgba(16,185,129,0.1);
        color: #6ee7b7;
    }

    .recall-input.wrong {
        border-bottom-color: #ef4444 !important;
        background: rgba(239,68,68,0.1);
        color: #fca5a5;
    }

.recall-hint {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.3);
    font-style: italic;
}

.btn-block-action {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

    .btn-block-action:hover {
        transform: translateY(-2px);
    }

.btn-secondary-action {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    background: transparent;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-top: 8px;
    color: white;
}

/* ===== SPEAKING ===== */
.speaking-intro {
    text-align: center;
    margin-bottom: 16px;
}

    .speaking-intro p {
        font-size: 0.85rem;
        color: rgba(255,255,255,0.55);
    }

.speaking-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.5rem;
    position: relative;
}

    .speaking-icon::after {
        content: '';
        position: absolute;
        inset: -6px;
        border-radius: 50%;
        border: 2px solid;
        animation: pulse-ring 2s ease infinite;
    }

.speaking-sentence {
    text-align: center;
    font-size: 1.15rem;
    font-weight: 700;
    color: white;
    line-height: 1.6;
    padding: 16px 20px;
    background: rgba(255,255,255,0.04);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 16px;
}

.speaking-tip {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
    text-align: center;
    margin-bottom: 16px;
    line-height: 1.5;
}

    .speaking-tip strong {
        color: rgba(255,255,255,0.6);
    }

.speaking-counter {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
}

.speak-dot {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 2px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.4);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
}

.btn-speaking-done {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

    .btn-speaking-done.inactive {
        background: rgba(255,255,255,0.06);
        color: rgba(255,255,255,0.3);
        cursor: not-allowed;
    }

    .btn-speaking-done.active:hover {
        transform: translateY(-2px);
    }

/* ===== APPLY ===== */
.apply-desc {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.55);
    margin-bottom: 16px;
}

.apply-item {
    margin-bottom: 14px;
}

    .apply-item label {
        display: flex;
        align-items: baseline;
        gap: 8px;
        font-size: 0.9rem;
        color: rgba(255,255,255,0.7);
        margin-bottom: 6px;
    }

.apply-num {
    font-weight: 700;
    flex-shrink: 0;
}

.apply-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.25s ease;
    background: transparent;
    color: white;
}

    .apply-input::placeholder {
        color: rgba(255,255,255,0.2);
    }

    .apply-input.correct {
        border-color: #10b981 !important;
        background: rgba(16,185,129,0.08);
    }

    .apply-input.wrong {
        border-color: #ef4444 !important;
        background: rgba(239,68,68,0.08);
    }

.apply-correction {
    font-size: 0.8rem;
    color: #6ee7b7;
    margin-top: 4px;
    padding-left: 24px;
    display: none;
}

    .apply-correction.show {
        display: block;
    }

/* ===== SPACED REPETITION ===== */
.sr-desc {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.55);
    margin-bottom: 16px;
    text-align: center;
}

.sr-question-box {
    background: rgba(255,255,255,0.04);
    border-radius: 12px;
    padding: 16px 20px;
    text-align: center;
    margin-bottom: 16px;
    border: 1px solid rgba(255,255,255,0.06);
}

    .sr-question-box p {
        font-size: 1rem;
        color: rgba(255,255,255,0.8);
    }

    .sr-question-box .blank {
        display: inline-block;
        width: 90px;
        border-bottom: 2px dashed;
    }

.sr-options {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 16px;
}

.sr-opt-btn {
    flex: 1;
    max-width: 180px;
    height: -webkit-fill-available;
    padding: 14px 20px;
    border: 1.5px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

    .sr-opt-btn .sr-label {
        width: 26px;
        height: 26px;
        border-radius: 8px;
        background: rgba(255,255,255,0.08);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.75rem;
        font-weight: 700;
        color: rgba(255,255,255,0.5);
    }

    .sr-opt-btn:hover {
        transform: translateY(-2px);
    }

    .sr-opt-btn.selected-correct {
        border-color: #10b981;
        background: rgba(16,185,129,0.12);
    }

    .sr-opt-btn.selected-wrong {
        border-color: #ef4444;
        background: rgba(239,68,68,0.12);
    }

.sr-result {
    text-align: center;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 12px;
    display: none;
}

    .sr-result.show {
        display: block;
    }

    .sr-result.correct {
        background: rgba(16,185,129,0.1);
        border: 1px solid rgba(16,185,129,0.2);
        color: #6ee7b7;
    }

    .sr-result.wrong {
        background: rgba(239,68,68,0.1);
        border: 1px solid rgba(239,68,68,0.2);
        color: #fca5a5;
    }

.sr-tips {
    text-align: center;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
    line-height: 1.6;
}

/* ===== ANIMATIONS ===== */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-8px);
    }

    40% {
        transform: translateX(8px);
    }

    60% {
        transform: translateX(-4px);
    }

    80% {
        transform: translateX(4px);
    }
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(16,185,129,0.4);
    }

    100% {
        box-shadow: 0 0 0 12px rgba(16,185,129,0);
    }
}

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.4s ease forwards;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    .app-container {
        padding: 12px;
    }

    .block-body {
        padding: 0 16px 16px;
    }

    .block-header {
        padding: 16px 16px 12px;
    }

    .blocks-status {
        grid-template-columns: repeat(4, 1fr);
    }

    .hook-options {
        flex-direction: column;
    }

    .hook-btn {
        max-width: 100%;
    }

    .sr-options {
        align-items: center;
    }

    .sr-opt-btn {
        max-width: 100%;
    }
}
