/* =========================================================================
   Modern student panel
   -------------------------------------------------------------------------
   Everything here is scoped to body.ui-student, so the admin panel keeps
   its existing look. To apply it to admins as well, change the body class
   in header.php - no rules below need touching.

   Loaded after sb-admin-2.min.css so it can override the theme.
   ========================================================================= */

body.ui-student{
    --s-ink:#0f172a;
    --s-muted:#64748b;
    --s-line:#e6ebf2;
    --s-page:#f4f6fa;
    --s-card:#ffffff;
    --s-brand:#ea580c;
    --s-brand-dark:#c2410c;
    --s-brand-soft:#fff7ed;
    --s-ok:#16a34a;
    --s-warn:#d97706;
    --s-bad:#dc2626;

    background:var(--s-page);
    color:var(--s-ink);
    -webkit-font-smoothing:antialiased;
}

/* ---------- sidebar ---------------------------------------------------- */
/* white panel with orange accents - the logo is yellow on transparent, so it
   reads far better on white than on an orange field */
body.ui-student .sidebar{
    background:#ffffff !important;
    border-right:1px solid var(--s-line);
    box-shadow:1px 0 10px rgba(15,23,42,.05);
}
/* inset via the li, so the pill cannot run to the sidebar edge no matter
   what width the theme puts on .nav-link */
body.ui-student .sidebar .nav-item{
    padding:0 12px;
}
body.ui-student .sidebar .nav-item .nav-link{
    margin:3px 0;
    padding:11px 14px;
    border-radius:11px;
    font-size:14.5px;
    font-weight:600;
    color:#475569;
    width:auto;
    transition:background-color .15s, color .15s, transform .12s;
}
body.ui-student .sidebar .nav-item .nav-link:hover{
    background:#fff7ed;
    color:#c2410c;
    transform:translateX(2px);
}
body.ui-student .sidebar .nav-item .nav-link:hover i{ color:#ea580c; }

/* current page - solid orange block, white text */
body.ui-student .sidebar .nav-item.active > .nav-link,
body.ui-student .sidebar .nav-item > .nav-link.active{
    background:linear-gradient(145deg,#fb923c,#ea580c);
    color:#ffffff;
    font-weight:700;
    box-shadow:0 3px 10px rgba(234,88,12,.30);
}
body.ui-student .sidebar .nav-item.active > .nav-link i,
body.ui-student .sidebar .nav-item > .nav-link.active i{
    color:#ffffff;
}
body.ui-student .sidebar .nav-item .nav-link i{
    margin-right:9px;
    color:#94a3b8;
    width:18px;
    text-align:center;
    transition:color .15s;
}
body.ui-student .sidebar-divider{
    border-color:var(--s-line);
    margin:12px 18px;
}
body.ui-student .sidebar-brand{
    padding:6px 10px 2px 10px;
}
/* sb-admin-2 puts "background:#fff; padding:10px" plus a 3.5rem top margin on
   .sidebar-brand-text, which draws a white plate behind the logo. The logo png
   is already transparent, so the plate is stripped off here. */
body.ui-student .sidebar-brand-text{
    background:none !important;
    padding:0 !important;
    margin:14px 12px 6px 12px !important;
    border-radius:0;
    box-shadow:none;
}
body.ui-student .sidebar-brand img{
    background:none;
    border:0;
    padding:0;
    box-shadow:none;
}

/* dropdown submenus (Competition -> Quiz List)
   The theme styles these with six-class selectors, e.g.
     .sidebar .nav-item .collapse .collapse-inner .collapse-item.active
   which sets a blue #4e73df. The selectors below deliberately mirror that
   depth so they win, rather than resorting to !important everywhere. */
body.ui-student .sidebar .nav-item .collapse .collapse-inner,
body.ui-student .sidebar .nav-item .collapsing .collapse-inner{
    background:transparent !important;
    border:0;
    border-left:2px solid #fed7aa;
    border-radius:0;
    margin:2px 0 8px 27px;
    padding:2px 0 2px 7px;
    box-shadow:none;
}
body.ui-student .sidebar .nav-item .collapse .collapse-inner .collapse-item,
body.ui-student .sidebar .nav-item .collapsing .collapse-inner .collapse-item{
    margin:2px 0;
    padding:9px 12px;
    border-radius:9px;
    font-size:14px;
    font-weight:600;
    color:#64748b;
    transition:background-color .14s, color .14s;
}
body.ui-student .sidebar .nav-item .collapse .collapse-inner .collapse-item:hover,
body.ui-student .sidebar .nav-item .collapsing .collapse-inner .collapse-item:hover{
    background:#fff7ed;
    color:#c2410c;
}
body.ui-student .sidebar .nav-item .collapse .collapse-inner .collapse-item.active,
body.ui-student .sidebar .nav-item .collapsing .collapse-inner .collapse-item.active{
    background:#ffedd5;
    color:#c2410c;
    font-weight:700;
}

/* ---------- topbar ------------------------------------------------------ */
body.ui-student .topbar{
    background:var(--s-card) !important;
    border-bottom:1px solid var(--s-line);
    box-shadow:0 1px 3px rgba(15,23,42,.05) !important;
    height:66px;
}
body.ui-student .topbar .nav-link{
    color:var(--s-ink) !important;
    font-weight:600;
}
/* the theme's base .btn rule paints every button solid purple - .btn-link
   never resets that, so the mobile sidebar toggle (a .btn.btn-link) renders
   as a solid purple circle floating over the topbar below the md breakpoint */
body.ui-student .btn-link{
    background:transparent !important;
    box-shadow:none !important;
    color:var(--s-ink);
}
body.ui-student .topbar #sidebarToggleTop{
    color:var(--s-muted);
}
body.ui-student .topbar #sidebarToggleTop:hover{
    color:var(--s-brand);
    background-color:var(--s-brand-soft) !important;
}

/* ---------- page shell -------------------------------------------------- */
body.ui-student #content-wrapper{
    background:var(--s-page) !important;
}
body.ui-student .container-fluid{
    padding:22px 24px;
}

/* ---------- cards ------------------------------------------------------- */
body.ui-student .card{
    background:var(--s-card);
    border:1px solid var(--s-line);
    border-radius:16px;
    box-shadow:0 1px 3px rgba(15,23,42,.05);
    overflow:hidden;
}
body.ui-student .card-header,
body.ui-student .card-heading{
    background:var(--s-card);
    border-bottom:1px solid var(--s-line);
    padding:16px 20px;
    font-weight:700;
}
body.ui-student .card-body{
    padding:20px;
}
body.ui-student h1, body.ui-student h2,
body.ui-student h3, body.ui-student h4{
    font-weight:700;
    color:var(--s-ink);
}
/* page titles that sit loose above a table */
body.ui-student .container-fluid > h3,
body.ui-student .container-fluid > h1{
    font-size:24px;
    margin:0 0 18px 0;
}

/* ---------- tables ------------------------------------------------------ */
/* some views wrap the table in a .card, others drop a bare <table> straight
   onto the page - so the table itself carries the card surface, and that is
   then removed again when it really is inside a card */
body.ui-student .table{
    border-collapse:separate;
    border-spacing:0;
    margin-bottom:0;
    background:var(--s-card);
    border:1px solid var(--s-line);
    border-radius:16px;
    box-shadow:0 1px 3px rgba(15,23,42,.05);
}
body.ui-student .card .table{
    border:0;
    border-radius:0;
    box-shadow:none;
}

/* several tables have no <thead> at all, so th is targeted directly */
body.ui-student .table th{
    background:#f8fafc;
    border:0;
    border-bottom:1px solid var(--s-line);
    color:var(--s-muted);
    font-size:12px;
    font-weight:700;
    letter-spacing:.06em;
    text-transform:uppercase;
    padding:13px 14px;
    vertical-align:middle;
}
body.ui-student .table td{
    border:0;
    border-bottom:1px solid #f1f5f9;
    padding:14px;
    font-size:14.5px;
    vertical-align:middle;
    color:#334155;
}
body.ui-student .table tr:last-child td{ border-bottom:0; }
body.ui-student .table tbody tr,
body.ui-student .table tr{ transition:background-color .12s; }
body.ui-student .table tbody tr:hover td{ background:#fafbfd; }

body.ui-student .table-bordered,
body.ui-student .table-bordered td,
body.ui-student .table-bordered th{ border-left:0; border-right:0; }

/* round the outer corners - tables ignore overflow clipping */
body.ui-student .table tr:first-child th:first-child{ border-top-left-radius:15px; }
body.ui-student .table tr:first-child th:last-child{ border-top-right-radius:15px; }
body.ui-student .table tr:last-child td:first-child{ border-bottom-left-radius:15px; }
body.ui-student .table tr:last-child td:last-child{ border-bottom-right-radius:15px; }
body.ui-student .card .table tr:first-child th:first-child,
body.ui-student .card .table tr:first-child th:last-child,
body.ui-student .card .table tr:last-child td:first-child,
body.ui-student .card .table tr:last-child td:last-child{ border-radius:0; }

/* wide tables scroll instead of squashing the page */
body.ui-student .table-responsive{ border-radius:16px; }

/* ---------- buttons ----------------------------------------------------- */
body.ui-student .btn{
    border-radius:10px;
    font-weight:600;
    font-size:14.5px;
    padding:9px 18px;
    border:0;
    transition:transform .12s, box-shadow .12s, background-color .15s;
}
body.ui-student .btn:hover{ transform:translateY(-1px); }
body.ui-student .btn i{ margin-right:6px; }

/* btn-info is what this app uses for its main page action ("Request for Quiz",
   "Search"), so it takes the brand orange rather than the theme's blue */
body.ui-student .btn-info{
    background:linear-gradient(145deg,#fb923c,#ea580c);
    box-shadow:0 2px 8px rgba(234,88,12,.30);
}
body.ui-student .btn-info:hover{
    background:linear-gradient(145deg,#ea580c,#c2410c);
    box-shadow:0 4px 14px rgba(234,88,12,.38);
}

/* Back / Next paging sits quietly - it should not compete with the real action */
body.ui-student .btn-primary{
    background:#ffffff;
    border:1px solid var(--s-line);
    color:#475569;
    box-shadow:0 1px 2px rgba(15,23,42,.05);
}
body.ui-student .btn-primary:hover{
    background:#fff7ed;
    border-color:#fdba74;
    color:#c2410c;
    box-shadow:0 2px 6px rgba(234,88,12,.14);
}
body.ui-student .btn-success{
    background:linear-gradient(145deg,#22c55e,#16a34a);
    box-shadow:0 2px 8px rgba(22,163,74,.26);
}
body.ui-student .btn-danger{
    background:linear-gradient(145deg,#ef4444,#dc2626);
    box-shadow:0 2px 8px rgba(220,38,38,.26);
}
body.ui-student .btn-warning{
    background:linear-gradient(145deg,#f59e0b,#d97706);
    color:#fff;
    box-shadow:0 2px 8px rgba(217,119,6,.26);
}
body.ui-student .btn-default{
    background:#fff;
    border:1px solid var(--s-line);
    color:var(--s-ink);
}

/* ---------- status pills ------------------------------------------------ */
body.ui-student .badge,
body.ui-student .label{
    display:inline-block;
    border-radius:999px;
    padding:5px 12px;
    font-size:12px;
    font-weight:700;
    letter-spacing:.02em;
}
body.ui-student .badge-success,
body.ui-student .label-success{ background:#dcfce7; color:#15803d; }
body.ui-student .badge-danger,
body.ui-student .label-danger{ background:#fee2e2; color:#b91c1c; }
body.ui-student .badge-warning,
body.ui-student .label-warning{ background:#fef3c7; color:#b45309; }
body.ui-student .badge-info,
body.ui-student .label-info{ background:#e0f2fe; color:#0369a1; }

/* ---------- forms ------------------------------------------------------- */
body.ui-student .form-control,
body.ui-student select.form-control{
    border:1.5px solid var(--s-line);
    border-radius:10px;
    padding:10px 13px;
    font-size:14.5px;
    height:auto;
    color:var(--s-ink);
}
body.ui-student .form-control:focus{
    border-color:var(--s-brand);
    box-shadow:0 0 0 3px rgba(234,88,12,.14);
}
body.ui-student label{
    font-weight:600;
    font-size:13.5px;
    color:#475569;
    margin-bottom:5px;
}

/* ---------- empty state ------------------------------------------------- */
body.ui-student .table tbody tr td[colspan],
body.ui-student .no_record{
    color:var(--s-muted);
    font-style:normal;
}

@media (max-width:768px){
    body.ui-student .container-fluid{ padding:14px 12px; }
    body.ui-student .card-body{ padding:14px; }
    body.ui-student .table thead th,
    body.ui-student .table tbody td{ padding:11px 9px; font-size:13.5px; }
}

/* ---------- mobile sidebar (below md) ------------------------------------
   sb-admin-2's mobile behaviour keeps the icon-only nav-link width (6.5rem)
   from its unscoped base rule and lets the sidebar push #content-wrapper
   as a flex sibling - so "open" is a cramped 70px icon rail that squeezes
   the page rather than a real drawer. Below overrides that with a fixed,
   full-height slide-in panel with proper label width, over a dim backdrop,
   so mobile matches the desktop sidebar instead of looking like a
   leftover icon strip. */
@media (max-width:767.98px){
    body.ui-student .sidebar{
        position:fixed;
        top:0;
        left:0;
        z-index:1050;
        width:250px !important;
        max-width:80vw;
        transform:translateX(-100%);
        transition:transform .28s ease;
        overflow-y:auto;
    }
    body.ui-student .sidebar.openside{
        transform:translateX(0);
        box-shadow:2px 0 24px rgba(15,23,42,.18);
    }
    /* the sidebar no longer pushes layout, so the page stays full width */
    body.ui-student #content-wrapper{
        width:100%;
        margin-left:0 !important;
    }
    body.ui-student .sidebar .nav-item{ padding:0 14px; }
    body.ui-student .sidebar .nav-item .nav-link{
        width:auto;
        text-align:left;
        display:flex;
        align-items:center;
    }
    body.ui-student .sidebar .nav-item .nav-link span{
        display:inline;
        font-size:14.5px;
    }
    body.ui-student .sidebar .nav-item .nav-link i{
        font-size:15px;
        width:22px;
        margin-right:10px;
    }
    body.ui-student .sidebar-brand{ justify-content:flex-start !important; }
    /* sb-admin-2's mobile rule pops the collapse submenu out to the right of
       the icon rail (position:absolute, left:calc(6.5rem + ...)) - inside the
       real drawer that lands off the visible edge, floating over the content.
       Make it drop down inline instead, same as the >=768px accordion. */
    body.ui-student .sidebar .nav-item .collapse,
    body.ui-student .sidebar .nav-item .collapsing{
        position:relative !important;
        left:0 !important;
        top:0 !important;
        margin:0 !important;
        width:auto !important;
    }
    body.ui-student .sidebar .nav-item .collapse .collapse-inner,
    body.ui-student .sidebar .nav-item .collapsing .collapse-inner{
        box-shadow:none !important;
    }
    body.ui-student .sidebar-backdrop{
        display:none;
        position:fixed;
        inset:0;
        background:rgba(15,23,42,.4);
        z-index:1040;
    }
    body.ui-student .sidebar-backdrop.show{ display:block; }
}

/* =========================================================================
   Login / register / forgot password
   -------------------------------------------------------------------------
   These use login_header.php + login_footer.php, a layout with no sidebar,
   so they carry .ui-auth on top of .ui-student.

   login_footer.php ends with an inline <style> block placed AFTER </html>.
   Browsers still apply it, and being last in the document it beats any rule
   here of equal weight. It sets, among other things:
       .login_container, .login_page { min-height:550px }
       .lofin_button_section { padding-left:1.1rem; padding-right:1.1rem }
       .forgot_button { float:right }
   Every one of those is reset explicitly below - leaving any of them unset
   means it silently comes back.
   ========================================================================= */

body.ui-auth{
    background:linear-gradient(170deg,#fff7ed 0%,#f4f6fa 46%,#f4f6fa 100%);
    display:flex;
    flex-direction:column;
    min-height:100vh;
}

/* --- top nav ------------------------------------------------------------ */
body.ui-auth .navbar{
    background:#ffffff;
    border:0 !important;
    border-bottom:1px solid var(--s-line) !important;
    border-radius:0 !important;
    padding:12px 26px;
    box-shadow:0 1px 3px rgba(15,23,42,.05);
}
body.ui-auth .navbar-brand{ padding:0; margin:0; }
body.ui-auth .navbar-brand img{ max-height:44px; width:auto; }
body.ui-auth .navbar .nav-item .btn{
    padding:8px 18px;
    font-size:14px;
    border-radius:10px;
}
/* registering is the invitation, so it carries the accent */
body.ui-auth .navbar .nav-item:last-child .btn{
    background:linear-gradient(145deg,#fb923c,#ea580c);
    color:#ffffff;
    border:0;
    box-shadow:0 2px 8px rgba(234,88,12,.28);
}
body.ui-auth .navbar .nav-item:last-child .btn:hover{
    background:linear-gradient(145deg,#ea580c,#c2410c);
    color:#ffffff;
}

/* --- the card ----------------------------------------------------------- */
/* min-height / padding are reset here because login_footer.php sets them */
body.ui-auth .login_container,
body.ui-auth .login_container.login_page,
body.ui-auth .login_page{
    min-height:0 !important;
    max-width:430px;
    width:100%;
    margin:56px auto;
    background:#ffffff;
    border:1px solid var(--s-line);
    border-radius:18px;
    padding:34px 32px 30px 32px !important;
    box-shadow:0 10px 34px rgba(15,23,42,.09);
}
body.ui-auth .login_container h3{
    text-align:center;
    font-size:23px;
    margin:0 0 6px 0;
}
body.ui-auth .login_container .row,
body.ui-auth .login_container [class^="col-"]{
    margin:0;
    padding:0;
    max-width:100%;
    flex:0 0 100%;
}
body.ui-auth .login_container form{ margin-top:20px; }
body.ui-auth .login_container .form-group{ margin-bottom:14px; }

/* --- fields ------------------------------------------------------------- */
body.ui-auth .form-control,
body.ui-auth .form-control-user{
    border:1.5px solid var(--s-line) !important;
    border-radius:11px !important;
    padding:12px 15px !important;
    font-size:15px !important;
    height:auto !important;
}
body.ui-auth .form-control:focus{
    border-color:var(--s-brand) !important;
    box-shadow:0 0 0 3px rgba(234,88,12,.14) !important;
}

/* the eye button must sit inside the field, not wrap onto its own line -
   a width:100% on the input is what pushed it down */
body.ui-auth .input-group{
    display:flex;
    flex-wrap:nowrap;
    width:100%;
}
body.ui-auth .input-group > .form-control{
    flex:1 1 auto;
    width:1% !important;
    border-top-right-radius:0 !important;
    border-bottom-right-radius:0 !important;
    border-right:0 !important;
}
body.ui-auth .input-group-append{ display:flex; margin:0; }
body.ui-auth .password_show_hide{
    background:#ffffff;
    border:1.5px solid var(--s-line);
    border-left:0;
    border-radius:0 11px 11px 0 !important;
    color:var(--s-muted);
    padding:0 16px;
    box-shadow:none;
}
body.ui-auth .password_show_hide:hover{
    color:var(--s-brand);
    transform:none;
}
body.ui-auth .password_show_hide i{ margin:0; }

/* --- buttons ------------------------------------------------------------ */
body.ui-auth .lofin_button_section{
    margin-top:22px;
    padding:0 !important;
    display:flex;
    flex-direction:column;
    gap:10px;
}
/* the markup puts col-md-4 / col-md-5 on these, which is why they came out
   at odd widths - the grid sizing is dropped so they simply stack */
body.ui-auth .lofin_button_section .btn{
    float:none !important;
    width:100%;
    max-width:100%;
    flex:0 0 auto;
    margin:0;
}
body.ui-auth .lofin_button_section button[type=submit]{
    background:linear-gradient(145deg,#fb923c,#ea580c);
    color:#ffffff;
    border:0;
    border-radius:11px;
    padding:13px 18px;
    font-size:15.5px;
    font-weight:650;
    box-shadow:0 3px 10px rgba(234,88,12,.30);
}
body.ui-auth .lofin_button_section button[type=submit]:hover{
    background:linear-gradient(145deg,#ea580c,#c2410c);
    box-shadow:0 5px 16px rgba(234,88,12,.38);
}
/* forgot password is a quiet link, not a second large button */
body.ui-auth .forgot_button{
    background:none !important;
    border:0 !important;
    box-shadow:none !important;
    color:var(--s-muted) !important;
    font-size:14px;
    font-weight:600;
    padding:6px !important;
    text-align:center;
}
body.ui-auth .forgot_button:hover{
    color:var(--s-brand) !important;
    text-decoration:underline;
    transform:none;
}

body.ui-auth .alert{
    border:0;
    border-radius:11px;
    font-size:14px;
    padding:12px 15px;
    margin-bottom:16px;
}
body.ui-auth .alert-danger{ background:#fee2e2; color:#b91c1c; }
body.ui-auth .alert-success{ background:#dcfce7; color:#15803d; }

/* --- footer ------------------------------------------------------------- */
body.ui-auth footer{
    margin-top:auto;
    background:#ffffff !important;
    border-top:1px solid var(--s-line);
    padding:18px 0 !important;
}
body.ui-auth footer a{
    color:var(--s-muted) !important;
    font-size:13.5px;
    text-decoration:none;
}
body.ui-auth footer a:hover{ color:var(--s-brand) !important; }

@media (max-width:520px){
    body.ui-auth .login_container,
    body.ui-auth .login_container.login_page{
        margin:24px 14px;
        padding:26px 20px !important;
    }
    body.ui-auth .navbar{ padding:10px 14px; }
}
