/**
 * GEC Frontend Framework
 * Zalo link (Plugin markup design)
 *
 * The GEC Academic Operations plugin renders the Zalo link as markup only (owner 2026-10-25:
 * the plugin carries no design). This file designs it wherever it appears:
 *
 * - the Zalo card in the Student and Teacher Dashboard sidebars, built from the dashboards'
 *   own card and quick-action classes (`__card`, `__card-header`, `__actions-list`,
 *   `__action-item`), so only what those classes do not cover is here;
 * - the one-time QR panel the plugin's loader opens in that card (`.gec-zalo-qr-panel*`);
 * - the /ket-noi-zalo/ page the QR leads to (`.gec-zalo-qr*`, shortcode [gec_zalo_ket_noi]).
 *
 * The QR image itself (red dots, rounded eyes, logo) is drawn by the plugin as an SVG: it is
 * the code, not page styling.
 *
 * @package GEC_Academy_Child
 */

/* ==========================================================================
   Dashboard cards
   ========================================================================== */

.gec-student-dashboard__zalo-body,
.gec-teacher-dashboard__zalo-body {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    line-height: 1.55;
}

.gec-student-dashboard__zalo-body p,
.gec-teacher-dashboard__zalo-body p {
    margin: 0;
}

.gec-student-dashboard__zalo-oa-help,
.gec-teacher-dashboard__zalo-help,
.gec-student-dashboard__zalo-oa-status,
.gec-teacher-dashboard__zalo-status {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.gec-student-dashboard__zalo-oa-status:empty,
.gec-teacher-dashboard__zalo-status:empty {
    display: none;
}

/* The Teacher Dashboard styles its quick actions as links only; the Zalo card's are buttons. */
button.gec-teacher-dashboard__action-item {
    width: 100%;
    margin: 0;
    font-family: inherit;
    line-height: inherit;
    text-align: left;
    cursor: pointer;
    appearance: none;
}

button.gec-teacher-dashboard__action-item:focus-visible {
    outline: 2px solid var(--color-text-primary);
    outline-offset: 2px;
}

button.gec-student-dashboard__action-item:disabled,
button.gec-teacher-dashboard__action-item:disabled {
    cursor: progress;
    opacity: 0.6;
}

/* ==========================================================================
   One-time QR panel (opened in the card by the plugin's loader)
   ========================================================================== */

.gec-zalo-qr-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-card);
    background: var(--color-surface);
    text-align: center;
}

.gec-zalo-qr-panel__code {
    width: 220px;
    max-width: 100%;
}

.gec-zalo-qr-panel__code svg {
    display: block;
    width: 100%;
    height: auto;
}

.gec-zalo-qr-panel__help {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

/* ==========================================================================
   /ket-noi-zalo/ — the page the QR opens inside the Zalo app
   ========================================================================== */

.gec-zalo-qr {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    max-width: 480px;
    margin: var(--space-6) auto;
    padding: var(--space-6);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
    color: var(--color-text-secondary);
    font-size: var(--font-size-base);
    line-height: 1.6;
}

.gec-zalo-qr + .gec-zalo-qr {
    margin-top: 0;
}

.gec-zalo-qr h3 {
    margin: 0;
    color: var(--color-primary-700);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
}

.gec-zalo-qr p {
    margin: 0;
}

.gec-zalo-qr__who {
    color: var(--color-text-primary);
    font-weight: var(--font-weight-semibold);
}

.gec-zalo-qr__help {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.gec-zalo-qr__login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-full);
    background: var(--color-primary-600);
    color: var(--color-text-inverse);
    font-weight: var(--font-weight-semibold);
    text-decoration: none;
}

.gec-zalo-qr__login:hover,
.gec-zalo-qr__login:focus-visible {
    background: var(--color-primary-700);
    color: var(--color-text-inverse);
}

@media (max-width: 520px) {
    .gec-zalo-qr {
        margin: var(--space-4) var(--space-4);
        padding: var(--space-5);
    }
}

/* ==========================================================================
   The Zalo consent frame
   ========================================================================== */

/*
 * The Zalo SDK pins its consent frame to the bottom-right corner with inline styles
 * (position: fixed; 500×400). On a phone that box covers the page and swallows every tap,
 * and when the browser has no Zalo session it is an invisible box doing the same (owner
 * 2026-10-25). Keep it in the flow of the card or page that asked for it, at its width.
 */
.gec-student-dashboard__zalo-body .zalo-consent-widget,
.gec-teacher-dashboard__zalo-body .zalo-consent-widget,
.gec-zalo-qr .zalo-consent-widget {
    position: static !important;
    display: block !important;
    width: 100%;
    max-width: 100%;
}

.gec-student-dashboard__zalo-body .zalo-consent-widget iframe,
.gec-teacher-dashboard__zalo-body .zalo-consent-widget iframe,
.gec-zalo-qr .zalo-consent-widget iframe {
    display: block;
    width: 100% !important;
    max-width: 100%;
    border: 0;
}

.gec-student-dashboard__zalo-body .zalo-consent-widget[hidden],
.gec-teacher-dashboard__zalo-body .zalo-consent-widget[hidden],
.gec-zalo-qr .zalo-consent-widget[hidden] {
    display: none !important;
}
