/* ================== TORA FLASHCARD CONTROLS - v5 (Đồng bộ hoàn toàn, Light/Dark mode, áp dụng bảng màu Quiz/Brand Tora) ================== */
/* Namespace: .tora-flashcard-plugin */

/* ======= BẢNG MÀU TORA ĐỒNG BỘ (theo guideline Quiz chuẩn hóa) ======= */

/* Light mode */
.tora-flashcard-plugin.tora-light-mode {
    /* Primary Brand Colors */
    --tora-primary: #FF6B00;
    --tora-primary-hover: #e65f00;
    --tora-secondary: #00B389;

    /* Accent Colors */
    --tora-accent: #1976D2;
    --tora-accent-hover: #145ea8;

    /* Info/Status Colors */
    --tora-info: #0097A7;
    --tora-info-bg: #E0F7FA;
    --tora-success: #2E7D32;
    --tora-success-bg: #E6FCF4;
    --tora-error: #E53935;
    --tora-error-bg: #FFECEC;
    --tora-warning: #FDC800;
    --tora-warning-bg: #FEF6E0;

    /* Neutral Colors */
    --tora-bg-light: #FFFFFF;
    --tora-bg-dark: #0F172A;
    --tora-surface: #F8F9FB;
    --tora-surface-dark: #1e293b;
    --tora-card-bg: #F8F9FB;
    --tora-card-bg-dark: #162032;
    --tora-border: #E0E0E0;
    --tora-divider: #D9D9D9;
    --tora-hover: #FFF5EC;
    --tora-quiz-hover: #FFEEE0;

    /* Text Colors */
    --tora-text-main: #222B45;
    --tora-text-sub: #666666;
    --tora-text-light: #FFFFFF;
    --tora-text-dark: #1A1A1A;
    --tora-text-disabled: #B0B4BA;
}

/* Dark mode */
.tora-flashcard-plugin.tora-dark-mode {
    /* Primary Brand Colors */
    --tora-primary: #FF6B00;
    --tora-primary-hover: #e65f00;
    --tora-secondary: #00B389;

    /* Accent Colors */
    --tora-accent: #1976D2;
    --tora-accent-hover: #145ea8;

    /* Info/Status Colors */
    --tora-info: #0097A7;
    --tora-info-bg: #1A2A3A;
    --tora-success: #2E7D32;
    --tora-success-bg: #1e2f26;
    --tora-error: #E53935;
    --tora-error-bg: #331a1a;
    --tora-warning: #FDC800;
    --tora-warning-bg: #2d2917;

    /* Neutral Colors */
    --tora-bg-light: #FFFFFF;
    --tora-bg-dark: #0F172A;
    --tora-surface: #1e293b;
    --tora-surface-dark: #1e293b;
    --tora-card-bg: #162032;
    --tora-card-bg-dark: #162032;
    --tora-border: #222e3c;
    --tora-divider: #283046;
    --tora-hover: #2B2320;
    --tora-quiz-hover: #2B2320;

    /* Text Colors */
    --tora-text-main: #F1F5F9;
    --tora-text-sub: #A3AED6;
    --tora-text-light: #FFFFFF;
    --tora-text-dark: #F1F5F9;
    --tora-text-disabled: #5A5A72;
}

/* ================== FLASHCARD CONTROLS LAYOUT ================== */

.tora-flashcard-plugin .flashcard-control-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
    width: 100%;
    box-sizing: border-box;
}

/* Thanh tiến trình */
.tora-flashcard-plugin .flashcard-progress {
    width: 100%;
    max-width: 300px;
    height: 8px;
    background-color: var(--tora-border);
    border-radius: 4px;
    margin-bottom: 10px;
    overflow: hidden;
    padding: 0;
    box-sizing: border-box;
}
.tora-flashcard-plugin .flashcard-progress .progress-bar {
    height: 100%;
    background-color: var(--tora-secondary);
    width: 0;
    transition: width 0.3s ease-in-out;
}

/* Nút điều hướng */
.tora-flashcard-plugin .flashcard-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 0;
}
.tora-flashcard-plugin .nav-button {
    padding: 0;
    background-color: var(--tora-info);
    color: var(--tora-text-light);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 30px;
    font-weight: 900;
    width: 50px;
    height: 50px;
    line-height: 50px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.10);
    transition: background 0.2s;
}
.tora-flashcard-plugin .nav-button:hover,
.tora-flashcard-plugin .nav-button:active,
.tora-flashcard-plugin .nav-button:focus {
    background-color: var(--tora-info) !important;
    transform: none !important;
    outline: none !important;
}

/* Bộ đếm flashcard */
.tora-flashcard-plugin .flashcard-counter {
    font-size: 20px;
    color: var(--tora-text-main);
    font-weight: bold;
}

/* 4 khối chức năng (actions) */
.tora-flashcard-plugin .flashcard-actions {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0;
}
.tora-flashcard-plugin .flashcard-action {
    flex: 1;
    min-width: 120px;
    padding: 10px;
    background-color: var(--tora-info-bg);
    border: 2px solid var(--tora-info);
    border-radius: 5px;
    text-align: center;
    cursor: pointer;
    font-size: clamp(14px, 2vw, 16px);
    color: var(--tora-text-main);
    transition: background-color 0.3s, border-color 0.3s;
    margin: 0;
    box-sizing: border-box;
}
.tora-flashcard-plugin .flashcard-action:hover {
    background-color: var(--tora-quiz-hover);
    border-color: var(--tora-accent);
}

/* =================== RESPONSIVE =================== */
@media (max-width: 768px) {
    .tora-flashcard-plugin .flashcard-action {
        flex: 0 0 48%;
        max-width: 48%;
    }
}

@media (max-width: 480px) {
    .tora-flashcard-plugin .nav-button {
        width: 40px;
        height: 40px;
        line-height: 40px;
        font-size: 24px;
        font-weight: 900;
    }
    .tora-flashcard-plugin .flashcard-counter {
        font-size: 16px;
        color: var(--tora-text-main);
        font-weight: bold;
    }
    .tora-flashcard-plugin .flashcard-progress {
        max-width: 200px;
        height: 6px;
    }
}
