﻿/* Universal reset and font definition */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Poppins', sans-serif;
}

/* ========================================= */
/*         LOGIN LAYOUT & PAGES             */
/* ========================================= */

.main-login-layout {
    background-color: #215841;
    min-height: 100vh; /* Ensures it fills the screen height */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/*  logo image  */
.logo-image {
    padding-bottom: 5px;
    /*    margin-top: 0px;
    margin-bottom: 0px;*/
}

/* ========================================= */
/*         LOGIN LAYOUT & PAGES             */
/* ========================================= */

.main-login-layout {
    background-color: #215841;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

    /* Outer box removed / made completely transparent */
    .main-login-layout .login-panel {
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
        width: 100%;
        max-width: 480px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

/* Clean centered login form card */
.login-form-card {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    text-align: left;
    padding: 2.25rem 2rem;
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* ========================================= */
/*           ROLE SELECTION PAGE              */
/* ========================================= */

.main-login-layout .role-selection-container h3 {
    color: #215841;
    font-weight: 600;
    font-size: 1.5rem;
}

.main-login-layout .role-selection-container p {
    color: #555;
    font-weight: 400;
    margin-top: -1rem;
    margin-bottom: -1rem;
}

.main-login-layout .role-options {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2.5rem;
}

.main-login-layout .role-box {
    width: 170px;
    height: 190px;
    background-color: #215841;
    border-radius: 12px;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

    .main-login-layout .role-box:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 15px rgba(0,0,0,0.2);
    }

    .main-login-layout .role-box img {
        height: 90px;
        width: 90px;
        filter: brightness(0) invert(1);
    }

    .main-login-layout .role-box h4 {
        margin-top: 1rem;
        margin-bottom: 0rem;
        font-weight: 600;
        font-size: 1.1rem;
    }

.sidebar {
    background: #215841 !important;
    width: 250px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease-in-out;
}

.nav-heading {
    padding: 0.75rem 1.25rem;
    font-size: 0.75rem;
    color: #b7b9cc;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 1rem;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    height: 3rem;
    gap: 0.5rem;
}


.sidebar .nav-icon {
    width: 1.5rem;
    font-size: 1.1rem;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Ensure text does not shift vertically */
.sidebar .nav-text {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.nav-scrollable {
    flex: 1;
    overflow-y: auto;
}

/* =============================== */
/*   Sidebar Scrollbar Styling     */
/* =============================== */

/* ===== Firefox ===== */
* {
    scrollbar-width: auto;
    scrollbar-color: #215841 transparent;
}

    /* ===== Chrome, Edge, Safari ===== */
    *::-webkit-scrollbar {
        width: 14px;
        height: 14px;
    }

    /* Remove arrow buttons completely */
    *::-webkit-scrollbar-button:single-button {
        display: none;
        width: 0;
        height: 0;
    }

    /* Also target increment/decrement buttons */
    *::-webkit-scrollbar-button {
        display: none !important;
    }

    /* Track */
    *::-webkit-scrollbar-track {
        background: transparent;
    }

    /* Thumb */
    *::-webkit-scrollbar-thumb {
        background-color: #215841;
        border-radius: 8px;
        border: 3px solid transparent;
        background-clip: content-box;
    }

        *::-webkit-scrollbar-thumb:hover {
            background-color: #003f7a;
        }

/* ========================================= */
/*                 FOOTER                    */
/* ========================================= */

.powered-by-link {
    color: #4ade80;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

    .powered-by-link:hover {
        color: #ffffff;
        text-decoration: underline;
    }


/* Style for the button spinner */
.btn-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    vertical-align: text-bottom;
    border: .2em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    -webkit-animation: .75s linear infinite spinner-border;
    animation: .75s linear infinite spinner-border;
    margin-right: 0.5rem;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

/* Validation message text */
.validation-message {
    /*    display: none;*/
    color: red;
}

input.invalid,
textarea.invalid,
select.invalid {
    border: 2px solid #d32f2f !important;
}

/* ================================================= */
/* ======== MAIN DASHBOARD LAYOUT STYLES =========== */
/* ================================================= */

.page {
    display: flex;
    flex-direction: row;
    height: 100vh;
}

.sidebar {
    background: #215841 !important;
    width: 250px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease-in-out;
    z-index: 1040;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.top-row {
    height: 70px;
    min-height: 70px;
    flex-shrink: 0;
    background-color: rgba(190, 190, 190, 0.4); /* slightly transparent */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* Safari support */

    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
}

.content {
    flex: 1;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

/*h1 {
    font-size: 40px !important;
}*/



/* --- RECEIPT STYLES --- */
.receipt-container {
    width: 80mm;
    margin: 20px auto;
    padding: 10px;
    font-family: 'Courier New', Courier, monospace;
    position: relative;
    border: 1px solid #ccc;
}

.receipt-header {
    text-align: center;
}

    .receipt-header h1 {
        font-size: 1.2em;
        margin: 5px 0;
    }

    .receipt-header p {
        font-size: 0.8em;
        margin: 2px 0;
    }

    .receipt-header .logo {
        max-height: 60px;
        margin-bottom: 10px;
    }

.receipt-body .row {
    font-size: 0.9em;
}

.receipt-body table {
    font-size: 0.9em;
}

    .receipt-body table th, .receipt-body table td {
        padding: 4px;
    }

.receipt-footer {
    margin-top: 20px;
    font-size: 0.8em;
}

.watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    font-size: 100px;
    color: rgba(255, 0, 0, 0.15);
    font-weight: bold;
    pointer-events: none;
    z-index: 1000;
}

@media print {
    body {
        margin: 0;
    }

    .receipt-container {
        margin: 0;
        border: none;
        width: 100%;
    }
}

/* ========================================= */
/*            MOBILE RESPONSIVE               */
/* ========================================= */

@media (max-width: 768px) {
    .main-login-layout .login-panel {
        width: 90vw;
        max-width: 90vw;
        padding: 2rem 1.5rem;
    }

    /*  logo image  */
    .logo-image {
        padding-bottom: 0px;
        margin-top: 0px;
        margin-bottom: 15px;
    }

    .main-login-layout .role-options {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }

    .main-login-layout .role-box {
        width: 180px;
        height: 180px;
    }

    .main-login-layout .login-footer {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }

    .main-login-layout .footer-links {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

        .main-login-layout .footer-links a {
            margin-left: 0;
        }
}

@media (max-width: 768px) {
    .main-login-layout .login-panel {
        width: 100%;
        max-width: 100%;
        padding: 0;
        background: transparent;
        box-shadow: none;
    }

    .login-form-card {
        padding: 1.75rem 1.25rem;
    }
}


/* ========================================= */
/*      NEW MOBILE NAVBAR STYLES             */
/* ========================================= */

.mobile-top-navbar {
    display: none;
    background-color: #215841;
    color: white;
    height: 70px;
    padding: 0 1rem;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1050;
}

.navbar-toggler {
    border: none;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.8)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
}

    .sidebar .nav-link:hover, .sidebar .nav-link.active {
        color: white !important;
        background-color: rgba(255, 255, 255, 0.1);
    }

@media (max-width: 768px) {

    .mobile-top-navbar {
        display: flex;
    }

    .main-content .top-row {
        display: none;
    }

    .main-content {
        padding-top: 70px;
        margin-left: 0 !important;
    }

    .sidebar {
        transform: translateX(-100%);
    }

        .sidebar.open {
            transform: translateX(0);
        }
}


/* =========================================
   MOBILE NAV FIX (REAL FIX)
========================================= */

@media (max-width: 768px) {

    .sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        width: 250px;
        height: 100dvh;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        z-index: 2000;
        background: #215841;
    }

        .sidebar .nav-scrollable {
            min-height: 100%;
            overflow-y: auto !important;
            padding-bottom: 80px;
        }

    /* Make sure nothing clips it */
    body, html {
        overflow-x: hidden;
    }

    /* Remove clipping from parent layout containers */
    .page,
    .layout,
    .main,
    .content {
        overflow: visible !important;
    }
}



.blazored-toast-container {
    z-index: 9999 !important;
}

.blazored-toast {
    z-index: 10000 !important;
}

/*registration form tab switch*/
.nav-link {
    cursor: pointer;
}

.cursor-pointer {
    cursor: pointer;
}


.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1055;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
    margin-top: 2px;
    overflow: hidden;
}

.search-dropdown-list {
    max-height: 250px;
    overflow-y: auto;
}

.search-dropdown .dropdown-item {
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
}

    .search-dropdown .dropdown-item:hover {
        background-color: var(--bs-secondary-bg);
    }

.search-dropdown-list::-webkit-scrollbar {
    width: 6px;
}

.search-dropdown-list::-webkit-scrollbar-thumb {
    border-radius: 10px;
}


.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
    margin-top: 2px;
}

.search-dropdown-list {
    max-height: 250px;
    overflow-y: auto;
}

.search-dropdown .dropdown-item {
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 0.5rem 0.75rem;
}

    .search-dropdown .dropdown-item:hover {
        background-color: var(--bs-secondary-bg);
    }
