/* Loaded only on singular pages containing a Student Dashboard shortcode. */
body.sdb-portal-page #tidio-chat,
body.sdb-portal-page #chaty-widget,
body.sdb-portal-page .chaty-widget,
body.sdb-portal-page .joinchat,
body.sdb-portal-page .ht-ctc-chat,
body.sdb-portal-page .qlwapp,
body.sdb-portal-page #qlwapp,
body.sdb-portal-page .tawk-min-container,
body.sdb-portal-page [class*="whatsapp" i],
body.sdb-portal-page [id*="whatsapp" i],
body.sdb-portal-page [class*="ai-chat" i],
body.sdb-portal-page [id*="ai-chat" i],
body.sdb-portal-page iframe[title*="chat" i],
body.sdb-portal-page iframe[title*="whatsapp" i] {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Full-canvas portal pages keep WordPress/WPML on the same domain without the theme shell. */
html:has(body.sdb-full-canvas),
body.sdb-portal-page.sdb-full-canvas {
    width: 100%;
    min-height: 100%;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden;
    color: #10213d;
    background: #f4f7fb;
}

body.sdb-portal-page #sdb-portal-canvas-root {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100%;
    min-height: 100dvh;
    margin: 0;
    padding: 0;
    font-family: Inter, Cairo, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    text-align: start;
}

/* The access-state card must remain visible even when a theme reset targets
 * generic app wrappers. This is also the safe recovery screen for an expired
 * parent cookie, so hiding it would leave an unexplained blank canvas. */
body.sdb-portal-page #sdb-portal-canvas-root > .sdb-student-gate {
    display: grid !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 2 !important;
    width: min(600px, calc(100% - 32px)) !important;
    box-sizing: border-box !important;
    margin: 80px auto !important;
    padding: 32px !important;
    color: #10213d !important;
    background: #fff !important;
    border: 1px solid #dbe4f0 !important;
}

body.sdb-portal-page #sdb-portal-canvas-root > .sdb-student-gate :where(h2, p, a, span) {
    visibility: visible !important;
    opacity: 1 !important;
}

body.sdb-portal-page .sdb-app,
body.sdb-portal-page .sdb-app :where(h1, h2, h3, h4, p, span, label, input, select, textarea, button, table) {
    font-family: Inter, Cairo, Arial, sans-serif;
}

/* Dashicons are an icon font; never let the portal typography reset replace it. */
body.sdb-portal-page .sdb-app .dashicons,
body.sdb-portal-page .dashicons {
    font-family: dashicons !important;
    font-style: normal !important;
    font-weight: 400 !important;
    speak: never;
}

body.sdb-portal-page .sdb-dashboard :where(.sdb-section__heading h2, .sdb-section__heading h3, .sdb-student-card h3, .sdb-student-row h3, .sdb-profile-requests h2, .sdb-profile-request h3) {
    color: #0f172a !important;
    text-shadow: none !important;
}

body.sdb-portal-page .sdb-dashboard .sdb-topbar h1,
body.sdb-portal-page .sdb-student-dashboard .sdb-student-topbar h1 {
    color: #0f172a !important;
    text-shadow: none !important;
}

body.sdb-portal-page .sdb-dashboard :where(.sdb-student-filters input, .sdb-student-filters select, .sdb-dashboard-settings input, .sdb-dashboard-settings select) {
    color: #0f172a !important;
    background: #fff !important;
    border-color: #cbd5e1 !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #0f172a !important;
}

body.sdb-portal-page .sdb-dashboard :where(input, textarea)::placeholder {
    color: #64748b !important;
    opacity: 1 !important;
}

body.sdb-portal-page .sdb-dashboard[dir="rtl"] :where(.sdb-student-filters, .sdb-dashboard-settings__actions, .sdb-profile-request form) {
    direction: rtl;
    justify-content: flex-start;
}

body.sdb-portal-page .sdb-dashboard .sdb-data-management-card :where(h3, p) {
    color: #0f172a !important;
}

body.sdb-portal-page .sdb-dashboard .sdb-data-management-card .sdb-button {
    color: #fff !important;
    background: #0878f9 !important;
    border-color: #0878f9 !important;
    -webkit-text-fill-color: #fff !important;
}

body.sdb-portal-page .sdb-dashboard .sdb-data-management-card .sdb-button--outline {
    color: #0878f9 !important;
    background: #fff !important;
    -webkit-text-fill-color: #0878f9 !important;
}

body.sdb-portal-page .sdb-student-forecast h3 {
    color: #3b2676 !important;
    text-shadow: none !important;
}

body.sdb-portal-page .sdb-student-forecast small,
body.sdb-portal-page .sdb-student-forecast__value span {
    color: #684f9c !important;
}

body.sdb-portal-page .sdb-toast__content {
    color: #334155 !important;
    -webkit-text-fill-color: #334155 !important;
}

body.sdb-portal-page :where(#callnowbutton, #call-now-button, .call-now-button, .call-nowbutton, .callnowbutton, #scrollUp, #scroll-up, .scrollUp, .scroll-up, .back-to-top, .backtotop, .scroll-to-top, .scrolltop, #wpfront-scroll-top-container, .wpfront-scroll-top-container, #to_top_scrollup, .site-scroll-top, .ast-scroll-top-icon, .elementor-widget-scroll-to-top, [data-elementor-type="floating-element"]) {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Desktop student/parent navigation is viewport-fixed like the Admin Dashboard. */
@media (min-width: 761px) {
    body.sdb-portal-page .sdb-student-dashboard {
        display: block !important;
        min-height: 100dvh;
    }

    body.sdb-portal-page .sdb-student-dashboard .sdb-student-sidebar {
        position: fixed !important;
        z-index: 30;
        inset-block: 0 !important;
        inset-inline-start: 0 !important;
        width: var(--student-sidebar, 260px) !important;
        height: 100dvh !important;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    body.sdb-portal-page .sdb-student-dashboard .sdb-student-main {
        width: auto;
        min-width: 0;
        margin-inline-start: var(--student-sidebar, 260px) !important;
    }
}

body.sdb-portal-page [data-sdb-auth-language-button]:disabled,
body.sdb-portal-page [data-sdb-student-language-button]:disabled,
body.sdb-portal-page [data-sdb-language]:disabled {
    cursor: not-allowed !important;
    opacity: .45 !important;
}
