/* Load theme variables */
@import url("theme.css");

/* =======================================================\
   FOUC PREVENTION – MUST BE FIRST!
   ======================================================= */
html { visibility: hidden; }
html.theme-loaded { visibility: visible; }



/* -----------------------------------------------------------
   ORIGINAL GLOBAL STYLES (from your style.css)
----------------------------------------------------------- */
html,
body {
    height: var(--height-body);
    width: var(--width-body);
}

.loader-wrapper {
    background: var(--bg-loader) !important;
}

.mid-large {
    width: var(--width-mid-large) !important;
    max-width: var(--max-width-mid-large);
}

.body-wrapper .main-wrapper .page-wrapper .content-wrapper {
    min-height: calc(100vh - 84px - 62px) !important;
}

#POS-field {
    height: var(--height-pos-field);
}

/* THEME-INJECTED PRIMARY COLORS */
.mdc-card.info-card.info-card--primary .card-inner .card-icon-wrapper {
    background: var(--color-primary) !important;
    box-shadow: 0 0 10px 5px var(--shadow-primary);
}

.bg-primary {
    background: var(--color-primary) !important;
}

.text-primary {
    color: var(--color-primary) !important;
}

.mdc-drawer {
    background: var(--bg-transparent);
}

.mdc-drawer__header,
.mdc-drawer__content {
    margin: var(--margin-drawer) !important;
}

.mdc-list-item.mdc-drawer-item {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* -----------------------------------------------------------
   BASE.HTML INLINE STYLES (added without removing anything)
----------------------------------------------------------- */

/* Global font */
body {
    font-family: var(--font-family);
    font-size: var(--font-body);
    line-height: 1.5;
    color: var(--text-dark) !important;
}

/* Top Nav */
.top-nav {
    font-size: var(--font-top-nav);
    font-weight: var(--font-weight-medium);
}

/* Side Nav */
.side-nav {
    font-size: var(--font-side-nav);
    font-weight: var(--font-weight-medium);
}

/* Page Titles */
h1, .page-title {
    font-size: var(--font-h1);
    font-weight: var(--font-weight-semibold);
}

h2, h3, .card-title {
    font-size: var(--font-h2);
    font-weight: var(--font-weight-semibold);
}

/* Subtitles or helper text */
h6, .sub-text {
    font-size: var(--font-h6);
    font-style: italic;
    color: var(--text-sub);
}

/* Buttons */
.mdc-button {
    font-size: var(--font-button);
    font-weight: var(--font-weight-medium);
}

/* Typography Scale */
.text-title {
    font-size: var(--font-text-title);
    font-weight: var(--font-weight-semibold);
    text-align: center;
}

.text-subtitle {
    font-size: var(--font-text-subtitle);
    font-weight: var(--font-weight-medium);
}

.text-body {
    font-size: var(--font-text-body);
    font-weight: var(--font-weight-regular);
}

.text-sub {
    font-size: var(--font-text-sub);
    color: var(--text-sub);
}

.text-caption {
    font-size: var(--font-text-caption);
    color: var(--text-caption);
    font-style: italic;
}

/* Buttons */
.btn {
    border-radius: var(--radius-btn) !important;
    padding: var(--padding-btn);
    font-size: var(--font-btn-small);
    font-weight: var(--font-weight-medium);
    transition: transform var(--transition-hover), background 0.3s;
}

.btn:hover {
    transform: translateY(-2px);
}

.fab-button {
    border-radius: var(--radius-btn-small) !important;
    padding: var(--padding-btn-small);
    transition: transform var(--transition-hover), background 0.3s;
}

.fab-button:hover {
    transform: translateY(-2px);
}

.btn-light {
    border-radius: var(--radius-btn-small) !important;
    padding: var(--padding-btn-small);
    transition: transform var(--transition-hover), background 0.3s;
}

.btn-light:hover {
    transform: translateY(-2px);
}

.modal-content {
    border-radius: var(--radius-modal) !important;
}

.info-card {
    border-radius: var(--radius-card) !important;
    overflow: hidden;
}

.card-icon-wrapper {
    margin-right: 15px;
}

.mdc-card {
    border-radius: var(--radius-card) !important;
    overflow: hidden;
}

/* -----------------------------------------------------------
   NAVIGATION.HTML STYLES (added completely, THEMED)
----------------------------------------------------------- */

.mdc-drawer, .mdc-drawer-app-content {
    opacity: 0;
    transition: opacity var(--transition-opacity);
}

.mdc-drawer--loaded, .mdc-drawer--loaded ~ .mdc-drawer-app-content {
    opacity: 1;
}

/* Child menu */
.mdc-list .collapse .mdc-list-item {
    font-size: 0.78rem;
    padding: 4px 12px 4px 28px;
    border-radius: var(--radius-card);
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.9;
}

.mdc-list-item[data-bs-toggle="collapse"] {
    cursor: pointer;
}

.mdc-list-item[data-bs-toggle="collapse"] .mdi-chevron-down {
    transition: transform 0.2s;
}

.mdc-list-item[aria-expanded="true"] .mdi-chevron-down {
    transform: rotate(180deg);
}

.sidebar-header {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-light) !important;
    height: 25%;
    padding: 10px;
    text-align: center;
    background: linear-gradient(135deg, var(--sidebar-bg-top), var(--sidebar-bg-bottom));
    border-radius: 1rem;
}

.sidebar-gradient {
    background: linear-gradient(135deg, var(--sidebar-bg-top), var(--sidebar-bg-bottom));
    color: var(--text-light) !important;
}

.sidebar-gradient a {
    color: var(--sidebar-link-color) !important;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: var(--padding-sidebar-link);
    border-radius: 8px;
    transition: background var(--transition-hover), color var(--transition-hover);
}

.sidebar-gradient a:hover {
    background: var(--bg-hover);
    color: var(--sidebar-link-hover) !important;
}

/* Sidebar items */
.sidebar-gradient .mdc-list-item {
    color: var(--sidebar-link-color) !important;
    background: var(--bg-transparent) !important;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: var(--padding-sidebar-link);
    border-radius: 8px;
}

.sidebar-gradient .mdc-list-item:hover {
    background: var(--bg-hover) !important;
    color: var(--sidebar-link-hover) !important;
}

.sidebar-gradient .mdc-list-item i {
    color: var(--sidebar-link-color) !important;
}

.sidebar-gradient .mdi-chevron-down {
    color: var(--sidebar-link-color) !important;
    margin-left: auto;
}

/* Desktop Drawer */
@media (min-width: 992px) {
    .mdc-drawer--dismissible.mdc-drawer--open ~ .mdc-drawer-app-content {
        margin-left: var(--drawer-width);
        transition: margin-left .2s ease;
    }

    .mdc-drawer--dismissible {
        transform: translateX(0);
        width: var(--drawer-width);
    }

    #app-drawer.mdc-drawer--open {
        box-shadow: 4px 0 20px var(--shadow-dark);
    }
}

/* Mobile Drawer */
@media (max-width: 991.98px) {
    #app-drawer.mdc-drawer {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        transform: translateX(-100%);
        z-index: 1040;
        transition: transform var(--transition-transform);
        width: var(--drawer-width);
    }

    #app-drawer.mdc-drawer--open {
        box-shadow: 0 8px 20px var(--shadow-dark);
    }

    #app-drawer.mdc-drawer.mdc-drawer--open {
        transform: translateX(0);
    }

    #drawer-scrim {
        background: var(--scrim-bg);
        z-index: 1035;
    }

    #app-drawer.mdc-drawer.mdc-drawer--open ~ #drawer-scrim {
        display: block;
        position: fixed;
        inset: 0;
        background: var(--scrim-bg);
        z-index: 1035;
    }
}

/* -----------------------------------------------------------
   TOP NAVIGATION STYLES
----------------------------------------------------------- */

.hp-dropdown {
    position: relative;
}

.hp-dropdown .btn {
    line-height: 1;
}

.hp-dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + .25rem);
    min-width: 12rem;
    background: var(--dropdown-bg);
    border-radius: var(--radius-dropdown);
    padding: var(--padding-dropdown);
    display: none;
    z-index: 2000;
}

.hp-dropdown.open .hp-dropdown-menu {
    display: block;
}

.hp-dropdown-menu .dropdown-item {
    display: block;
    width: 100%;
    padding: var(--padding-dropdown-item);
    border-radius: var(--radius-dropdown-item);
    text-decoration: none;
    color: var(--text-dropdown);
}

.hp-dropdown-menu .dropdown-item:hover {
    background: var(--dropdown-hover);
}

.dropdown-divider {
    height: 1px;
    margin: .5rem 0;
    background: var(--divider-color);
}

/* -----------------------------------------------------------
   BUTTON PRIMARY THEME (applied to all .btn-primary)
----------------------------------------------------------- */

.btn-primary {
    background-color: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
    color: var(--text-light) !important; /* text on primary buttons */
    transition: background-color 0.2s, border-color 0.2s, transform 0.2s;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--color-primary-dark) !important;
    border-color: var(--color-primary-dark) !important;
    transform: translateY(-1px);
}

/* -----------------------------------------------------------
   POS.HTML STYLES
----------------------------------------------------------- */

.full-width-input {
    width: 100% !important;
    min-width: 50px;
}

@media (max-width: 576px) {
    .full-width-input {
        min-width: 100px;
    }
}

/* Make header responsive */
.mdc-top-app-bar__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
}

.mdc-top-app-bar__section {
    display: flex;
    align-items: center;
}

/* Profile dropdown responsive fix */
.hp-dropdown {
    position: relative;
}

.hp-dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    min-width: 180px;
    background: #fff;
    border-radius: 6px;
    display: none;
}

.hp-dropdown.open .hp-dropdown-menu {
    display: block;
}

/* ---------------------------------------
   MOBILE STYLES (phone & small tablets)
--------------------------------------- */
@media (max-width: 768px) {

    /* Shrink header */
    .mdc-top-app-bar__title {
        font-size: 0.85rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
    }

    /* Buttons tighter */
    .mdc-icon-button {
        transform: scale(0.9);
    }

    /* Hide Text "Theme" (optional) */
    #themeSettingsBtn {
        padding: 4px 8px;
        font-size: 0.75rem;
    }

    /* Make profile button tighter */
    #profileBtn {
        padding: 4px 8px;
    }

    #profileBtn img {
        width: 24px;
        height: 24px;
    }

    #profileBtn span {
        display: none;  /* hide username on small screens */
    }

    #profileBtn i {
        margin-left: 0;
    }
}

/* Extremely small devices (< 400px) */
@media (max-width: 400px) {
    .mdc-top-app-bar__title {
        display: none; /* remove greeting entirely */
    }
}
.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;  /* controls the space between Theme button & profile dropdown */
}
/* Make theme button + profile button equal height */
#themeSettingsBtn,
#profileBtn {
    height: 38px;              /* same for both */
    display: flex;
    align-items: center;
    padding: 0 12px;
    border-radius: 6px;
}
#profileBtn img {
    width: 28px;
    height: 28px;
    object-fit: cover;
}
@media (max-width: 768px) {
    #themeSettingsBtn,
    #profileBtn {
        height: 32px;
        padding: 0 8px;
    }

    #profileBtn img {
        width: 24px;
        height: 24px;
    }
}


