﻿/* ==========================================================================
   Online Examination Support Portal — Core Stylesheet
   ========================================================================== */

:root {
    /* Brand palette */
    --primary: #2955a8;
    --primary-dark: #1c3d7d;
    --primary-light: #eef3fc;
    --orange: #f2611d;
    --orange-dark: #d94f10;
    --orange-light: #fff1e8;
    /* Neutrals */
    --bg: #eef1f5;
    --surface: #ffffff;
    --border-color: #e8ebef;
    --text: #232733;
    --text-muted: #6b7280;
    --text-soft: #9aa1ac;
    /* Effects */
    --shadow-sm: 0 2px 8px rgba(20, 30, 60, 0.05);
    --shadow: 0 8px 24px rgba(20, 30, 60, 0.08);
    --shadow-lg: 0 16px 40px rgba(20, 30, 60, 0.12);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-pill: 999px;
    /* Layout */
    --header-h: 64px;
    --announce-h: 44px;
    --sidebar-collapsed: 72px;
    --sidebar-expanded: 250px;
    --right-panel-w: 320px;
    --transition: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

img {
    max-width: 100%;
    display: block;
}

/* ==========================================================================
   HEADER
   ========================================================================== */

.topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.topbar-inner {
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 20px;
}

.mobile-menu-btn {
    display: none;
}

.brand-cluster {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.brand-logo-img {
    height: 46px;
    object-fit: cover;
    flex-shrink: 0;
}

.exam-tags {
    gap: 10px;
    flex-shrink: 0;
}

.tag-btn {
    border: 1.5px solid var(--orange);
    color: var(--orange);
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.3px;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    transition: all var(--transition);
    background: var(--surface);
}

    .tag-btn:hover {
        background: var(--orange);
        color: #fff;
        transform: translateY(-2px);
        box-shadow: var(--shadow-sm);
    }

.portal-title {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    border-left: 1px solid var(--border-color);
    padding-left: 18px;
    flex-shrink: 0;
}

.portal-title-main {
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 500;
}

.portal-title-sub {
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.welcome-text {
    font-size: 0.9rem;
    color: var(--text-muted);
}

    .welcome-text strong {
        color: var(--text);
    }

.profile-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* Announcement marquee bar */
.announce-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #f4f5f7;
    border-bottom: 1px solid var(--border-color);
    height: var(--announce-h);
    padding: 0 20px;
    overflow: hidden;
    flex-shrink: 0;
}

.announce-icon {
    color: var(--orange);
    font-size: 1.05rem;
    flex-shrink: 0;
}

.marquee-wrap {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    mask-image: linear-gradient(to right, transparent 0, #000 40px, #000 calc(100% - 40px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 40px, #000 calc(100% - 40px), transparent 100%);
}

.marquee-track {
    display: inline-flex;
    gap: 60px;
    animation: marquee 26s linear infinite;
    width: max-content;
}

    .marquee-track span {
        font-size: 0.88rem;
        color: var(--text-muted);
    }

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.announce-bar:hover .marquee-track {
    animation-play-state: paused;
}

/* ==========================================================================
   APP SHELL
   ========================================================================== */

.app-shell {
    display: flex;
    align-items: stretch;
    gap: 0;
    position: relative;
}

/* ==========================================================================
   SIDEBAR — full height, hamburger sits at the very top so it lines up
   with the announcement bar beside it
   ========================================================================== */

.sidebar {
    position: sticky;
    top: var(--header-h);
    height: calc(100vh - var(--header-h));
    width: var(--sidebar-collapsed);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: width var(--transition);
    overflow-x: hidden;
    z-index: 900;
}

    .sidebar.expanded {
        width: var(--sidebar-expanded);
    }

.sidebar-toggle-btn {
    border: none;
    background: transparent;
    font-size: 1.35rem;
    color: var(--text);
    width: 100%;
    height: var(--announce-h);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    flex-shrink: 0;
    border-bottom: 1px solid var(--border-color);
}

.sidebar.expanded .sidebar-toggle-btn {
    justify-content: flex-start;
    padding-left: 24px;
}

.sidebar-toggle-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    padding: 14px 10px;
}

.sidebar-item {
    margin-bottom: 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border-radius: var(--radius-sm);
    color: var(--orange);
    font-weight: 500;
    font-size: 0.92rem;
    white-space: nowrap;
    transition: background var(--transition), color var(--transition);
    position: relative;
    /* justify-content: center; */
    justify-content: flex-start;
}

.sidebar.expanded .sidebar-link {
    justify-content: flex-start;
}

.sidebar-link:hover {
    background: var(--orange-light);
}

.sidebar-link.active {
    background: #fff1d6;
    color: #fff;
    display: flex;
    justify-content: flex-start;
}

.sidebar-icon {
    width: 22px;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: opacity var(--transition);
    color: var(--text);
}

.sidebar.expanded .sidebar-text {
    opacity: 1;
    width: auto;
}

.sidebar-link.active .sidebar-text {
    color: black;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 850;
    opacity: 0;
    transition: opacity var(--transition);
}

/* Floating logout button — bottom-left, matches reference */
.logout-fab {
    position: fixed;
    left: 16px;
    bottom: 16px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    color: #fff;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    cursor: pointer;
    z-index: 950;
    transition: all var(--transition);
}

    .logout-fab:hover {
        background: var(--orange-dark);
        transform: translateY(-3px);
    }

/* ==========================================================================
   CONTENT AREA — announcement bar + (main content / right panel) row
   ========================================================================== */

.content-area {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.content-row {
    display: flex;
    align-items: flex-start;
    flex: 1;
    min-width: 0;
}

/* ==========================================================================
   MAIN CONTENT
   ========================================================================== */

.main-content {
    flex: 1;
    min-width: 0;
    padding: 24px;
}

/* Course cards */
.course-card {
    border: none;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
    background: var(--surface);
}

    .course-card:hover {
        transform: translateY(-8px);
        box-shadow: var(--shadow-lg);
    }

.course-img-wrap {
    overflow: hidden;
    border-radius: var(--radius) var(--radius) 0 0;
}

.course-card .card-body {
    padding: 18px 20px 20px;
}

.course-img-wrap img {
    width: 100%;
    height: 155px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.course-card:hover .course-img-wrap img {
    transform: scale(1.08);
}

.course-title {
    font-weight: 700;
    color: #001740;
    border-bottom: 3px solid var(--orange);
    display: inline-block;
    padding-bottom: 4px;
    margin-bottom: 10px;
    font-size: 1.15rem;
}

.course-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 14px;
}

.explore-btn {
    background: var(--primary);
    border: none;
    border-radius: var(--radius-pill);
    padding: 7px 20px;
    font-weight: 600;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition);
}

    .explore-btn i {
        transition: transform var(--transition);
    }

    .explore-btn:hover {
        background: var(--primary-dark);
        transform: translateY(-2px);
        box-shadow: var(--shadow);
    }

        .explore-btn:hover i {
            transform: translateX(4px);
        }

/* Support Center */
.support-center {
    margin-top: 28px;
}

.section-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 24px;
}

.section-heading {
    font-weight: 700;
    font-size: 1.35rem;
    margin-bottom: 20px;
    color: var(--text);
}

.support-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px;
    height: 100%;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    background: var(--surface);
}

    .support-card:hover {
        transform: translateY(-6px);
        box-shadow: var(--shadow);
        border-color: transparent;
    }

.support-img-wrap {
    width: 100%;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 10px;
    background: var(--bg);
}

    .support-img-wrap img {
        width: 100%;
        height: 120px;
        object-fit: cover;
        transition: transform 0.5s ease;
    }

.support-card:hover .support-img-wrap img {
    transform: scale(1.06);
}

.support-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
    margin: 0;
    line-height: 1.35;
}

.rbte-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--orange-dark);
    text-align: center;
    margin-bottom: 15px;
}

.rbte-contact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border: 1px solid #ececec;
    border-left: 3px solid var(--orange);
    border-radius: 8px;
    background: #fff;
    transition: .25s ease;
    min-height: 48px;
}

    .rbte-contact:hover {
        border-color: #ffd4bd;
        box-shadow: 0 4px 10px rgba(0,0,0,.05);
        transform: translateY(-1px);
    }

    .rbte-contact .city {
        font-size: 13px;
        font-weight: 600;
        color: #333;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding-right: 12px;
    }

    .rbte-contact a {
        font-size: 12px;
        color: var(--primary);
        text-decoration: none;
        white-space: nowrap;
        font-weight: 600;
    }

        .rbte-contact a:hover {
            color: var(--orange);
        }

@media(max-width:768px) {

    .rbte-contact {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        min-height: auto;
    }

        .rbte-contact .city,
        .rbte-contact a {
            white-space: normal;
        }
}

/* ==========================================================================
   RIGHT PANEL
   ========================================================================== */

.right-panel {
    width: var(--right-panel-w);
    flex-shrink: 0;
    padding: 24px 24px 24px 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.widget-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
}

.widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

    .widget-header h4 {
        font-size: 1.05rem;
        font-weight: 700;
        margin: 0;
    }

.view-all-link {
    color: var(--orange);
    font-size: 0.8rem;
    font-weight: 600;
    transition: color var(--transition);
}

    .view-all-link:hover {
        color: var(--orange-dark);
    }

.notification-list {
    max-height: 320px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .notification-list::-webkit-scrollbar {
        width: 5px;
    }

    .notification-list::-webkit-scrollbar-thumb {
        background: var(--border-color);
        border-radius: var(--radius-pill);
    }

    .notification-list li {
        display: flex;
        align-items: flex-start;
        gap: 12px;
        padding: 10px 8px;
        border-radius: var(--radius-sm);
        transition: background var(--transition);
        cursor: pointer;
    }

        .notification-list li:hover {
            background: var(--primary-light);
        }

.notif-icon {
    color: var(--orange);
    font-size: 0.95rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.notif-text {
    font-size: 0.83rem;
    color: var(--text);
    line-height: 1.4;
}

.download-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .download-list li {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 8px;
        border-radius: var(--radius-sm);
        transition: background var(--transition);
        cursor: pointer;
        font-size: 0.83rem;
    }

        .download-list li:hover {
            background: var(--orange-light);
        }

.download-icon {
    color: var(--primary);
    font-size: 1rem;
    flex-shrink: 0;
}

/* ==========================================================================
   BACK TO TOP
   ========================================================================== */

.back-to-top {
    position: fixed;
    bottom: 26px;
    right: 26px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: #fff;
    font-size: 1.1rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition);
    z-index: 1200;
}

    .back-to-top.visible {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .back-to-top:hover {
        background: var(--orange);
        transform: translateY(-3px);
    }



/* ==========================================================================
   LOGIN MODAL
   ========================================================================== */

.login-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(10px, 3vh, 28px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition), visibility var(--transition);
}

    .login-modal-overlay.active {
        opacity: 1;
        visibility: visible;
    }

.login-modal-card {
    position: relative;
    width: min(940px, 100%);
    max-height: 94vh;
    display: flex;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transform: translateY(14px) scale(0.98);
    transition: transform var(--transition);
}

.login-modal-overlay.active .login-modal-card {
    transform: translateY(0) scale(1);
}

.login-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: var(--bg);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: background var(--transition), color var(--transition);
    font-size: 0.95rem;
}

    .login-modal-close:hover {
        background: var(--orange-light);
        color: var(--orange);
    }

.login-modal-illustration {
    flex: 1;
    background: linear-gradient(150deg, var(--primary-light), #e4ebfa);
    align-items: center;
    justify-content: center;
    padding: clamp(14px, 3vh, 32px);
}

    .login-modal-illustration img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

.login-modal-form {
    flex: 1.15;
    padding: clamp(20px, 4vh, 44px) clamp(24px, 4vw, 50px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.login-form-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: clamp(12px, 2.5vh, 22px);
}

.login-lock-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--orange-light);
    color: var(--orange);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.login-form-header h2 {
    margin: 0 0 3px;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    font-weight: 700;
    color: var(--text);
}

.login-form-header p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    display: inline-block;
    padding-bottom: 6px;
    border-bottom: 3px solid var(--orange);
}

.login-field {
    margin-bottom: clamp(10px, 2vh, 16px);
}

    .login-field label {
        display: block;
        font-size: 0.85rem;
        font-weight: 600;
        margin-bottom: 6px;
        color: var(--text);
    }

.login-input-wrap {
    position: relative;
}

    .login-input-wrap i {
        position: absolute;
        left: 13px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--text-soft);
        font-size: 0.9rem;
    }

    .login-input-wrap input {
        width: 100%;
        padding: 10px 40px 10px 38px;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-sm);
        font-size: 0.8rem;
        font-family: inherit;
        background: var(--bg);
        outline: none;
        transition: border-color var(--transition), background var(--transition);
    }

        .login-input-wrap input:focus {
            border-color: var(--primary);
            background: var(--surface);
        }

.login-toggle-eye {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: var(--text-soft);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
}

.login-captcha-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-captcha-box {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 9px 16px;
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: 5px;
    color: var(--primary-dark);
    font-family: 'Courier New', monospace;
    user-select: none;
    flex-shrink: 0;
}

.login-refresh-captcha {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
    transition: color var(--transition), border-color var(--transition);
}

    .login-refresh-captcha:hover {
        color: var(--primary);
        border-color: var(--primary);
    }

.login-captcha-input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-family: inherit;
    background: var(--bg);
    outline: none;
}

    .login-captcha-input:focus {
        border-color: var(--primary);
        background: var(--surface);
    }

.login-row-between {
    display: flex;
    align-items: center;
    margin: clamp(10px, 2vh, 18px) 0;
    font-size: 0.85rem;
    display: flex;
    justify-content: end;
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text);
    cursor: pointer;
}

    .login-remember input {
        accent-color: var(--primary);
        width: 15px;
        height: 15px;
    }

.login-forgot {
    color: var(--primary);
    font-weight: 500;
}

    .login-forgot:hover {
        color: var(--orange);
    }

.login-btn {
    width: 100%;
    padding: clamp(10px, 1.6vh, 13px);
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}

    .login-btn:hover {
        background: var(--primary-dark);
    }

    .login-btn:active {
        transform: translateY(1px);
    }

.login-footnote {
    text-align: center;
    font-size: 0.65rem;
    color: var(--text-muted);
    margin: clamp(10px, 2vh, 16px) 0 0;
}

@media (max-width: 991.98px) {
    .login-modal-form {
        padding: 26px 24px;
    }
}

@media (max-height: 700px) {
    .login-form-header {
        margin-bottom: 10px;
    }

    .login-field {
        margin-bottom: 8px;
    }

    .login-row-between {
        margin: 8px 0;
    }
}


.submenu-arrow {
    margin-left: auto;
    font-size: 0.8rem;
    transition: transform 0.25s ease;
}

.has-submenu.open > .submenu-toggle .submenu-arrow {
    transform: rotate(180deg);
}

.sidebar-submenu {
    list-style: none;
    margin: 0;
    padding: 0 0 0 1rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.has-submenu.open > .sidebar-submenu {
    max-height: 500px;
}

.sidebar-submenu .sidebar-link {
    font-size: 0.9em;
}