:root {
    --student-sidebar-bg: #1e293b;
    --student-sidebar-hover: rgba(255, 255, 255, 0.05);
    --student-primary: #2563eb;
    --student-primary-soft: #eff6ff;
    --student-body-bg: #f8fafc;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: #f1f5f9;
    color: #1e293b;
    overflow-x: hidden;
    min-height: 100vh;
    height: 100%;
    margin: 0;
    position: relative;
}

html {
    height: 100%;
}

.spmb-sidebar-layout {
    display: flex;
    width: 100%;
}

.spmb-decor-dots {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    opacity: 0.1;
}

.spmb-decor-dots span {
    width: 4px;
    height: 4px;
    background: #2563eb;
    border-radius: 50%;
    margin: 50px auto;
}

.spmb-student-sidebar,
.spmb-admin-sidebar {
    width: 280px;
    background: #1e293b;
    color: white;
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: all 0.3s;
    overflow-y: auto;
    /* Ensure sidebar is scrollable */
}

.sidebar-header {
    padding: 30px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-box {
    width: 45px;
    height: 45px;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.logo-box img {
    max-width: 100%;
    max-height: 100%;
}

.sidebar-menu {
    flex: 1;
    padding: 10px 15px;
}

.nav-item-student {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 14px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 5px;
    font-weight: 600;
    text-decoration: none;
}

.nav-item-student:hover {
    background: var(--student-sidebar-hover);
    color: white;
}

.nav-item-student.active {
    background: var(--student-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.nav-item-student i {
    font-size: 20px;
}

.sidebar-footer {
    padding: 20px 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
    /* Push to bottom */
}

.logout-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 14px;
    color: #ef4444;
    font-weight: 700;
    text-decoration: none;
}

.logout-link:hover {
    background: rgba(239, 68, 68, 0.1);
}

.spmb-student-content,
.spmb-admin-content {
    flex: 1;
    /* Occupy remaining space correctly in flex layout */
    width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.spmb-topbar {
    height: auto;
    min-height: 80px;
    background: white;
    position: sticky;
    top: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
}

/* Admin Mobile Topbar Style */
.admin-mobile-header {
    background: transparent !important;
    padding: 20px !important;
    border: none !important;
    margin-bottom: 10px !important;
}

.admin-toggle-btn {
    width: 55px;
    height: 55px;
    background: #fff !important;
    border-radius: 18px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid #f1f5f9 !important;
    color: #1e293b !important;
    font-size: 20px;
}

.avatar-circle {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 18px;
}

.bg-primary-soft {
    background-color: var(--student-primary-soft);
}

.text-primary {
    color: var(--student-primary);
}

.content-body {
    padding: 20px;
    /* Reduced from 40px for mobile */
    flex: 1;
}

@media (min-width: 992px) {
    .content-body {
        padding: 40px;
    }
}

.btn-light-soft {
    background: #f1f5f9;
    color: #64748b;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-light-soft:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* UTILS */
.font-weight-900 {
    font-weight: 900;
}

.font-weight-800 {
    font-weight: 800;
}

.font-weight-700 {
    font-weight: 700;
}

@media (max-width: 576px) {
    .identity-info {
        max-width: 120px;
        margin-right: 10px;
    }

    .progress-box {
        flex: 1;
    }
}

@media (max-width: 991px) {

    .spmb-student-sidebar,
    .spmb-admin-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1001;
        transform: translateX(-100%);
        width: 280px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .spmb-student-content,
    .spmb-admin-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 15px !important;
    }

    .spmb-student-sidebar.active,
    .spmb-admin-sidebar.active {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.2);
    }
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
    display: block;
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 75px;
    background: #ffffff;
    display: none;
    /* Hidden by default */
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    /* Max priority */
    border-top: 1px solid #f1f5f9;
    padding: 0 10px;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

@media (max-width: 991px) {
    body.sidebar-open {
        overflow: hidden !important;
        height: 100vh;
        position: sticky;
        /* Sticky instead of relative to maintain layout */
    }
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: #94a3b8;
    text-decoration: none !important;
    transition: all 0.3s;
    gap: 4px;
    padding-top: 5px;
}

.bottom-nav-item i {
    font-size: 24px;
    transition: transform 0.3s;
}

.bottom-nav-item span {
    font-size: 11px;
    font-weight: 700;
}

.bottom-nav-item.active {
    color: #2563eb;
}

.bottom-nav-item:active i {
    transform: scale(0.9);
}

/* Admin Dashboard Stat Cards - Scoped strictly */
.admin-stat-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 25px;
    border: none;
    margin-bottom: 20px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s;
}

.admin-stat-card .stat-label {
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 10px;
    line-height: 1.3;
}

.admin-stat-card .stat-value {
    font-size: 28px;
    font-weight: 900;
    color: #1e293b;
    margin-bottom: 10px;
}

.admin-stat-card .stat-icon {
    font-size: 20px;
    color: #94a3b8;
}

@media (max-width: 768px) {
    .admin-stat-card {
        border-radius: 35px;
        padding: 35px 25px;
        min-height: 200px;
    }

    .admin-stat-card .stat-label {
        font-size: 15px;
        margin-bottom: 15px;
    }

    .admin-stat-card .stat-value {
        font-size: 42px;
        margin-bottom: 15px;
    }

    .admin-stat-card .stat-icon {
        font-size: 24px;
        margin-top: auto;
    }
}

@media (max-width: 991px) {
    .mobile-bottom-nav {
        display: flex;
    }

    /* Push content up to avoid being hidden by nav */
    .spmb-premium-body,
    .spmb-sidebar-layout {
        padding-bottom: 75px !important;
    }

    .content-footer {
        padding-bottom: 20px !important;
    }
}

.premium-input-group {
    position: relative;
    margin-bottom: 20px;
    text-align: left;
}

.premium-input {
    width: 100%;
    height: 50px;
    border: 2px solid #cbd5e1;
    border-radius: 12px;
    padding: 0 15px;
    font-weight: 700;
    color: #1e293b;
    transition: all 0.3s;
    background: #f8fafc;
}

.premium-input:focus {
    border-color: #6d1b7b;
    background: white;
    outline: none;
}

.premium-input-group label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    color: #94a3b8;
    margin-bottom: 5px;
    margin-left: 5px;
    text-transform: uppercase;
}

.btn-premium-auth {
    width: 100%;
    height: 50px;
    background: #6d1b7b;
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 800;
    font-size: 16px;
    margin-top: 10px;
    box-shadow: 0 10px 20px rgba(109, 27, 123, 0.2);
    transition: all 0.3s;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-premium-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px rgba(109, 27, 123, 0.3);
    background: #8e24aa;
}

.pass-toggle {
    position: absolute;
    right: 15px;
    top: 35px;
    font-size: 18px;
    color: #94a3b8;
    cursor: pointer;
}

/* --- MODERN TRANSPARENT-LABEL INPUT STYLE --- */
.premium-fieldset {
    border: 2px solid #cbd5e1;
    border-radius: 16px;
    padding: 0 15px 5px 15px;
    margin-bottom: 25px;
    position: relative;
    transition: all 0.3s;
    background: transparent;
}

.premium-fieldset:focus-within {
    border-color: #6d1b7b;
    box-shadow: 0 0 0 4px rgba(109, 27, 123, 0.1);
}

.premium-legend {
    width: auto;
    float: none;
    padding: 0 8px;
    font-size: 11px;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    margin-bottom: 0;
    margin-left: 5px;
}

.premium-fieldset input,
.premium-fieldset select,
.premium-fieldset textarea {
    width: 100%;
    border: none !important;
    background: transparent !important;
    padding: 10px 0;
    font-weight: 700;
    color: #1e293b;
    outline: none !important;
    box-shadow: none !important;
}

.premium-fieldset textarea {
    height: 80px;
    resize: none;
}

.spmb-grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
    background-size: 30px 30px;
    opacity: 0.5;
    z-index: 1;
}

.spmb-curve-bg {
    position: fixed;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(135deg, rgba(109, 27, 123, 0.05) 0%, transparent 100%);
    z-index: 2;
}

.map-hint {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 10px;
    text-align: left;
}

/* --- SLIDING AUTH REDESIGN --- */
.spmb-auth-body {
    background: #eef2ff;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.auth-container {
    background: #fff;
    border-radius: 40px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    width: 1000px;
    max-width: 95%;
    min-height: min(800px, 90vh);
    /* More flexible height */
    z-index: 100;
    display: flex;
}

@media (max-width: 768px) {
    .auth-container {
        flex-direction: column;
        min-height: 100vh;
        max-height: calc(100vh - 80px);
        /* Leave space for bottom nav */
        border-radius: 25px 25px 0 0;
        margin-top: 10px;
        overflow-y: auto;
        box-shadow: none;
    }

    .sign-in-container,
    .sign-up-container {
        padding: 20px !important;
        overflow-y: visible !important;
    }
}

@media (min-width: 992px) {

    .sign-in-container,
    .sign-up-container {
        padding: clamp(25px, 5vh, 60px) clamp(25px, 5vw, 60px);
    }
}

/* Vertical Responsiveness for Laptop Screens with short height */
@media (min-width: 992px) and (max-height: 850px) {
    .auth-container {
        min-height: 95vh;
        border-radius: 25px;
    }

    .auth-form-title {
        font-size: 2rem !important;
        margin-bottom: 1.5rem !important;
    }

    .premium-input-group {
        margin-bottom: 15px !important;
    }

    .pe-2 {
        max-height: 45vh;
        overflow-y: auto;
    }
}

.sign-in-container,
.sign-up-container {
    position: absolute;
    top: 0;
    height: 100%;
    width: 50%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    transition: all 0.6s ease-in-out;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 25px;
    background: #fff;
}

@media (max-width: 768px) {

    .sign-in-container,
    .sign-up-container {
        position: relative;
        width: 100%;
        height: auto;
        opacity: 1 !important;
        transform: none !important;
        pointer-events: all !important;
    }

    .auth-container.right-panel-active .sign-in-container {
        display: none;
    }

    .sign-up-container {
        display: none;
    }

    .auth-container.right-panel-active .sign-up-container {
        display: flex;
    }
}

@media (min-width: 992px) {

    .sign-in-container,
    .sign-up-container {
        padding: 60px;
    }
}

.sign-in-container {
    left: 0;
    z-index: 2;
}

.auth-container.right-panel-active .sign-in-container {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
}

.sign-up-container {
    left: 0;
    opacity: 0;
    z-index: 1;
    pointer-events: none;
}

.auth-container.right-panel-active .sign-up-container {
    transform: translateX(100%);
    opacity: 1;
    z-index: 5;
    animation: show 0.6s;
    pointer-events: all;
}

@keyframes show {

    0%,
    49.99% {
        opacity: 0;
        z-index: 1;
    }

    50%,
    100% {
        opacity: 1;
        z-index: 5;
    }
}

.overlay-container {
    position: absolute;
    top: 0;
    left: 50%;
    width: 50%;
    height: 100%;
    overflow: hidden;
    transition: transform 0.6s ease-in-out;
    z-index: 100;
}

.auth-container.right-panel-active .overlay-container {
    transform: translateX(-100%);
}

.overlay {
    background: #6d1b7b;
    background: linear-gradient(to right, #8e24aa, #6d1b7b);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: 0 0;
    color: #FFFFFF;
    position: relative;
    left: -100%;
    height: 100%;
    width: 200%;
    transform: translateX(0);
    transition: transform 0.6s ease-in-out;
}

.auth-container.right-panel-active .overlay {
    transform: translateX(50%);
}

.overlay-panel {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0 40px;
    text-align: center;
    top: 0;
    height: 100%;
    width: 50%;
    transform: translateX(0);
    transition: transform 0.6s ease-in-out;
}

.overlay-left {
    transform: translateX(-20%);
}

.auth-container.right-panel-active .overlay-left {
    transform: translateX(0);
}

.overlay-right {
    right: 0;
    transform: translateX(0);
}

.auth-container.right-panel-active .overlay-right {
    transform: translateX(20%);
}

.btn-ghost {
    background-color: transparent;
    border: 2px solid #FFFFFF;
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 800;
    padding: 15px 45px;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: transform 80ms ease-in;
    border-radius: 50px;
    cursor: pointer;
    margin-top: 20px;
}

.btn-ghost:active {
    transform: scale(0.95);
}

.btn-ghost:focus {
    outline: none;
}

#register_map_sliding {
    height: 220px;
    width: 100%;
    border-radius: 12px;
    border: 2px dashed #cbd5e1;
    margin: 0;
    z-index: 10;
}

/* Map Trigger Card Style */
.map-trigger-wrapper {
    margin-top: 15px;
    margin-bottom: 25px;
}

.map-trigger-card {
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    padding: 18px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.map-trigger-card:hover {
    border-color: #3b82f6;
    background: #f8fbff;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.08);
}

.trigger-icon {
    width: 48px;
    height: 48px;
    background: #eff6ff;
    color: #3b82f6;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.trigger-text {
    display: flex;
    flex-direction: column;
}

.trigger-label {
    font-size: 11px;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.trigger-value {
    font-size: 14px;
    font-weight: 700;
    transition: all 0.3s;
}

.trigger-arrow {
    color: #94a3b8;
    font-size: 20px;
}

.map-modal-container {
    background: #f8fafc;
    border-radius: 20px;
    padding: 10px;
}

#register_map_popup {
    border: 2px solid #e2e8f0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.btn-map-action {
    background: #fff;
    border: 1.5px solid #3b82f6;
    color: #3b82f6;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    text-decoration: none !important;
}

.btn-map-action:hover {
    background: #eff6ff;
    transform: translateY(-1px);
}

.map-hint {
    display: none;
    /* Hide old hint as we have header */
}

/* Fix for Leaflet Controls visibility */
.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
    font-family: 'Lucida Console', Monaco, monospace !important;
    color: #1e293b !important;
    background-color: #fff !important;
}

.leaflet-control-layers-toggle {
    background-color: #fff !important;
    border-radius: 5px;
}

.leaflet-bar {
    border: none !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
}

.auth-form-title {
    font-weight: 900;
    font-size: 28px;
    /* Default smaller for mobile */
    margin-top: 0;
    margin-bottom: 15px;
    color: #1e293b;
    letter-spacing: -1px;
    line-height: 1.1;
}

@media (min-width: 992px) {
    .auth-form-title {
        font-size: 36px;
        letter-spacing: -1.5px;
    }
}

/* Custom Scrollbar for containers */
.sign-in-container::-webkit-scrollbar,
.sign-up-container::-webkit-scrollbar {
    width: 6px;
}

.sign-in-container::-webkit-scrollbar-track,
.sign-up-container::-webkit-scrollbar-track {
    background: transparent;
}

.sign-in-container::-webkit-scrollbar-thumb,
.sign-up-container::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

.sign-in-container::-webkit-scrollbar-thumb:hover,
.sign-up-container::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

@media (max-width: 768px) {
    .auth-container {
        width: 100%;
        min-height: 800px;
    }

    .overlay-container {
        display: none;
    }

    .sign-in-container,
    .sign-up-container {
        width: 100%;
    }

    .auth-container.right-panel-active .sign-in-container {
        display: none;
    }

    .auth-container.right-panel-active .sign-up-container {
        transform: none;
    }

}

/* --- UNIVERSAL BUTTON STANDARDIZATION --- */
.btn-primary,
.btn-danger,
.btn-success,
.btn-info,
.btn-warning {
    border-radius: 12px !important;
    padding: 0.6rem 1.2rem !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.btn-sm {
    padding: 0.4rem 0.8rem !important;
    border-radius: 10px !important;
    font-size: 0.8rem !important;
}

/* Modal Buttons Refinement */
.modal-footer .btn {
    padding: 0.5rem 1.25rem !important;
    border-radius: 12px !important;
    min-height: 38px !important;
    font-size: 0.9rem !important;
}

/* Select2 Transparency Fix inside Premium Fieldset */
.premium-fieldset .select2-container--bootstrap4 .select2-selection--single,
.premium-fieldset .select2-container--bootstrap4.select2-container--focus .select2-selection--single,
.premium-fieldset:hover .select2-container--bootstrap4 .select2-selection--single {
    background: transparent !important;
    border: none !important;
}