// Thinkera Academy — rules added after Boost.

// Arabic is a joined script: never letter-space it.
body { letter-spacing: 0; }

// ---------------------------------------------------------------- top bar
.navbar.fixed-top {
    background: #fff !important;
    border-bottom: 1px solid #DDE3EC;
    box-shadow: 0 1px 2px rgba(15, 27, 45, .05);
}
.navbar .navbar-brand .logo { max-height: 34px; }
.navbar .primary-navigation .nav-link.active,
.navbar .primary-navigation .nav-link[aria-current="true"] {
    color: $tk-royal;
    border-bottom-color: $tk-royal !important;
}

// ---------------------------------------------------------------- buttons
.btn-primary { background-color: $tk-royal; border-color: $tk-royal; }
.btn-primary:hover, .btn-primary:focus { background-color: $tk-royal-600; border-color: $tk-royal-600; }
.btn-secondary { background-color: #fff; border-color: #C3CDDC; color: $tk-royal; }
.btn-secondary:hover { background-color: $tk-pale; color: $tk-royal; }
:focus-visible { outline: 3px solid $tk-royal-600; outline-offset: 2px; }

// ---------------------------------------------------------------- login page
.pagelayout-login #page {
    background:
        radial-gradient(circle at 85% 0%, rgba(143, 179, 230, .22), transparent 45%),
        linear-gradient(160deg, $tk-royal 0%, #0C2B58 45%, $tk-navy 100%);
    min-height: 100vh;
}
.pagelayout-login .login-container {
    background: #fff;
    border-radius: 22px;
    border: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
    padding: 2.5rem 2.25rem;
}
.pagelayout-login .login-logo img { max-height: 64px; }
.pagelayout-login h1.login-heading { color: $tk-ink; font-weight: 600; }
.pagelayout-login .login-divider { border-color: #DDE3EC; }
.pagelayout-login #loginbtn { width: 100%; }

// Thinkera side panel: brand navy with the teal glow instead of the vendor's photo and figures
.login-layout-left {
    background: radial-gradient(circle at 15% 0%, rgba(143, 179, 230, .24), transparent 50%), $tk-navy !important;
    background-image: radial-gradient(circle at 15% 0%, rgba(143, 179, 230, .24), transparent 50%) !important;
    &::before, &::after { display: none !important; content: none !important; }
}
.thinkera-login-panel { color: #D7E3F5; max-width: 480px; }
.thinkera-login-panel h1 { color: #fff; font-weight: 700; line-height: 1.35; }
.thinkera-login-logo {
    display: block; width: 220px; height: 44px; margin-bottom: 2.5rem;
    background: url([[pix:theme|logo-white]]) no-repeat left center / contain;
}
[dir="rtl"] .thinkera-login-logo { background-position: right center; }
.thinkera-login-facts { display: flex; gap: 2rem; margin: 2rem 0 0; }
.thinkera-login-facts li { display: flex; flex-direction: column; }
.thinkera-login-facts strong { font-size: 2rem; color: #fff; line-height: 1.1; }
.thinkera-login-facts span { font-size: .85rem; color: #A9BEDB; }

// ---------------------------------------------------------------- page chrome
// A Latin title in an Arabic page (a lesson named "1-1 How AI Works") keeps its own reading order.
.page-header-headings h1, #page-header h1, .breadcrumb-item, .activity-name, .instancename { unicode-bidi: plaintext; }
.page-header-headings h1, #page-header h1 { color: $tk-ink; }
.card { box-shadow: 0 1px 2px rgba(15, 27, 45, .05); }
.course-card .card-img, .dashboard-card-img { background-color: $tk-royal !important; }
.progress-bar { background-color: $tk-azure; }

// ---------------------------------------------------------------- footer
#page-footer .btn-footer-popover { background-color: $tk-royal !important; color: #fff; }
#page-footer .thinkera-footer-brand { display: flex; align-items: center; gap: .75rem; }
#page-footer .thinkera-footer-logo {
    display: inline-block; width: 130px; height: 26px; flex: none;
    background: url([[pix:theme|logo]]) no-repeat center / contain;
}
#page-footer .thinkera-footer-brand small { color: $tk-muted; }

// ---------------------------------------------------------------- the protected video player
.filter-tkvideo { box-shadow: 0 10px 30px rgba(15, 27, 45, .12); }

// ---------------------------------------------------------------- sign-in and sign-up, mobile first
// Every field 16px (below that, iPhone zooms in on focus) and every tap target at least 48px high.
.pagelayout-login {
    input.form-control, select.form-select, .custom-select { font-size: 16px; min-height: 48px; border-radius: 12px; }
    .btn { min-height: 48px; }
    // "No account? Create account" becomes a full-width outlined button under the sign-in button
    .text-center.small:has(> a[href$="/login/signup.php"]) {
        font-size: 1rem !important; display: flex; flex-direction: column; gap: .5rem; align-items: stretch;
    }
    a[href$="/login/signup.php"] {
        display: flex; align-items: center; justify-content: center; min-height: 48px;
        border: 2px solid $tk-royal; border-radius: 999px; color: $tk-royal; font-weight: 600; text-decoration: none;
        &:hover, &:focus { background: $tk-pale; }
    }
    // "Sign in with Google" (shown once GOOGLE_OAUTH_* is set in .env)
    .login-identityprovider-btn {
        display: flex; align-items: center; justify-content: center; gap: .6rem; min-height: 48px;
        border: 1px solid #C3CDDC; border-radius: 999px; background: #fff; color: $tk-ink; font-weight: 600;
        &:hover { background: $tk-pale; }
        img { width: 20px; height: 20px; }
    }
    .login-identityproviders { margin-bottom: 1rem; }
}
// The sign-up page: same card as sign-in, labels above fields on phones
#page-login-signup {
    .login-container { max-width: 560px; margin-inline: auto; }
    .mform .fitem { margin-bottom: .9rem; }
    #fitem_id_passwordpolicyinfo .form-control-static { font-size: .85rem; color: $tk-muted; }
    @include media-breakpoint-down(sm) {
        .login-container { padding: 1.5rem 1.1rem; border-radius: 18px; }
        .mform .col-md-3, .mform .col-md-9 { flex: 0 0 100%; max-width: 100%; }
    }
}

// The sign-in page shows the product only: Arabic is the one language, and no vendor help or cookie footnote.
.pagelayout-login {
    .login-cookiesnotice, .login-container .action-menu, .login-languagemenu, .btn-footer-popover,
    [data-region="footer-container-popover"], .logininfo { display: none !important; }
}
.progress-bar { background-color: $tk-azure; }

// ------------------------------------------------------- the reading size a student chose
// Everything in this theme is sized in rem, so moving the root size scales the text, the buttons and the
// space around them together — which is what someone who wants larger text actually wants. The two bars
// keep their own size so the frame of the app stays the shape it is on a phone.
:root:has(body.tk-text-large) { font-size: 17.6px; }
:root:has(body.tk-text-xlarge) { font-size: 19.2px; }
body:is(.tk-text-large, .tk-text-xlarge) {
    .tk-appbar, .tk-tabbar, .tk-footer { font-size: 16px; }
}
