/* =========================
   HIDE SCROLLBAR
========================= */
::-webkit-scrollbar {
    display: none;
}

html {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* =========================
   CONTENT WRAPPER
========================= */
#content-wrapper {
    margin-left: 225px;
    padding-top: 70px;
}

#content {
    overflow-y: auto;
    height: calc(100vh - 70px);
}

/* Adjust content when sidebar is collapsed */
.sidebar.toggled + #content-wrapper {
    margin-left: 105px !important;
}

/* =========================
   FIXED SIDEBAR
========================= */
#accordionSidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 225px;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1030;

    /* Hide scrollbar while keeping scroll */
    scrollbar-width: none;      /* Firefox */
    -ms-overflow-style: none;   /* IE 10+ */
}

#accordionSidebar::-webkit-scrollbar {
    width: 0;
    height: 0;
}

/* Sidebar collapsed */
.sidebar.toggled #accordionSidebar {
    width: 80px !important;
}

/* =========================
   SIDEBAR SUBMENU BEHAVIOR
========================= */

/* Base submenu positioning */
#accordionSidebar .collapse {
    position: static !important;
}

/* Common popup styles */
.collapse-inner {
    background: #DCC5A0 !important;
    border: 3px solid #DCC5A0 !important;
    box-shadow: 0 0.15rem 1.75rem rgba(58, 59, 69, 0.15) !important;
    border-radius: 0.35rem !important;
    padding: 0.5rem 0 !important;
    font-size: 0.85rem !important;
    z-index: 1040 !important;
}

.collapse-item {
    padding: 0.75rem 1rem !important;
    color: #3a3b45 !important;
    text-decoration: none !important;
    display: block !important;
    transition: all 0.2s ease-in-out !important;
    font-size: 0.85rem !important;
    line-height: 1.3rem !important;
    white-space: normal !important;
}

.collapse-item.active {
    background-color: #8B4513 !important;
    color: #ffffff !important;
}

.collapse-item:focus {
    outline: 2px solid #8B4513 !important;
    outline-offset: -2px !important;
}

/* Desktop & large tablet expanded sidebar */
@media (min-width: 768px) {
    #accordionSidebar:not(.sidebar.toggled) .collapse-inner {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        transform: none !important;
        width: 100% !important;
        max-width: none !important;
        max-height: 300px !important;
        margin: 0 !important;
        overflow: hidden !important;
    }

    #accordionSidebar:not(.sidebar.toggled) .collapse-item {
        padding: 0.4rem 0.5rem !important;
        border-bottom: 1px solid #f8f9fc00 !important;
    }

    .sidebar.toggled .collapse-inner {
        position: fixed !important;
        left: 115px !important;
        top: 27% !important;
        width: 205px !important;
        max-height: calc(100vh - 100px) !important;
    }
}

/* Mobile & tablet collapsed sidebar */
@media (max-width: 767px) {
    #accordionSidebar .collapse-inner,
    .sidebar.toggled .collapse-inner {
        position: fixed !important;
        left: 218px !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 100% !important;
        max-height: 80vh !important;
    }

    #accordionSidebar .collapse-inner,
    .sidebar.toggled .collapse-inner {
        max-width: 205px !important;
    }
}

/* Submenu arrow fix in collapsed state */
.sidebar.toggled .nav-link[data-toggle="collapse"]::after {
    display: none;
}

/* Smooth submenu transitions */
#accordionSidebar:not(.sidebar.toggled) .nav-item .collapse {
    overflow: hidden !important;
    transition: max-height 0.3s ease !important;
}

#accordionSidebar:not(.sidebar.toggled) .collapse:not(.show) {
    max-height: 0 !important;
}

#accordionSidebar:not(.sidebar.toggled) .collapse.show {
    max-height: 300px !important;
}

/* =========================
   MAIN CONTENT AREA
========================= */
#content {
    background-image: url('/img/bg/background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.page-heading {
    color: #6c757d !important;
    font-size: 1.5rem;
}

/* =========================
   SIDEBAR STYLES
========================= */
.sidebar-toggle-clean {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.sidebar-toggle-clean i {
    background: transparent !important;
    text-shadow: none !important;
    font-size: 1.5rem !important;
}

.sidebar-toggle-mobile {
    padding: 0 !important;
}

.bg-custom-sidebar {
    background-color: #ffffff !important;
}

.bg-custom-sidebar .sidebar-brand-text,
.bg-custom-sidebar .nav-link,
.bg-custom-sidebar .sidebar-heading {
    color: #6c757d !important;
}

.bg-custom-sidebar .nav-link i {
    color: #6c757d !important;
}

.bg-custom-sidebar .nav-link:hover {
    background-color: rgba(0,0,0,0.1) !important;
    color: #70391B !important;
}

.bg-custom-sidebar .nav-link:hover i {
    color: #70391B !important;
}

.bg-custom-sidebar .nav-item.active .nav-link {
    background-color: rgba(78,115,223,0.1) !important;
    color: #70391B !important;
    font-weight: bold;
    width: 95%;
    margin-left: 6px;
    border-radius: 10px;
}

.bg-custom-sidebar .nav-item.active .nav-link i {
    color: #70391B !important;
}

.bg-custom-sidebar .collapse-inner {
    background-color: #f8f9fc !important;
}

.bg-custom-sidebar .collapse-item {
    color: #858796 !important;
}

.bg-custom-sidebar .collapse-item:hover {
    background-color: #eaecf4 !important;
    color: #70391B !important;
}

.bg-custom-sidebar .collapse-item.active {
    background-color: #e3e6f0 !important;
    color: #70391B !important;
    font-weight: bold;
}

.sidebar-divider {
    border: 2px solid #000000;
}

/* =========================
   TOPBAR/NAVBAR STYLES
========================= */
.bg-custom-navbar {
    background-color: #ffffff;
    color: #ffffff;
    border-bottom: 1px solid #ffffff;
}

.icon-bars {
    font-size: 1.5rem;
    color: #70391B;
    cursor: pointer;
    margin-left: 10px;
}

/* =========================
   BUTTONS
========================= */
.btn-search {
    background-color: #70391B !important;
    color: #fff !important;
    border: none;
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-search:hover {
    color: #000000 !important;
    background-color: #DCC5A0 !important;
}

.btn-bestsellers {
    background-color: #70391B !important;
    color: #fff !important;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    font-weight: 500;
    transition: background-color 0.2s;
}

.btn-bestsellers:hover {
    color: #000000 !important;
    background-color: #DCC5A0 !important;
}

/* =========================
   LOGOUT MODAL
========================= */
.modal-content {
    background-color: #ffffff;
    color: #333333;
    border: 1px solid #ddd;
    border-radius: 0.35rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

.modal-header {
    border-bottom: 1px solid #e3e3e3;
}

.modal-title {
    color: #333333;
}

.modal-header .close span {
    color: #555555;
}

.modal-header .close:hover span {
    color: #000000;
}

.modal-footer {
    border-top: 1px solid #e3e3e3;
}

.btn-logout-cancel {
    background-color: #6c757d;
    color: #ffffff;
    border: none;
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s;
}

.btn-logout-cancel:hover {
    background-color: #5a6268;
}

.btn-logout-confirm {
    background-color: #70391B;
    color: #ffffff;
    border: none;
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s;
}

.btn-logout-confirm:hover {
    background-color: #DCC5A0;
    color: #000000;
}

/* =========================
   NOTIFICATION DROPDOWN
========================= */
.notification-dropdown {
    position: relative;
}

.notification-dropdown .nav-link {
    color: #70391B;
    position: relative;
}

.notification-dropdown .nav-link:hover {
    color: #5a2e16;
}

.notification-dropdown .notification-menu {
    min-width: 20rem;
    border-radius: 0.5rem;
    overflow: hidden;
}

.notification-dropdown .dropdown-notification-header {
    background-color: #70391B;
    color: #fff;
    font-weight: bold;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

.notification-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    transition: background-color 0.2s;
}

.notification-dropdown .dropdown-item:hover {
    background-color: #70391b;
    color: #ffffff;
    text-decoration: none;
}

.notification-dropdown .icon-circle {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
}

.notification-dropdown .icon-circle.bg-primary { background-color: #007bff; }
.notification-dropdown .icon-circle.bg-success { background-color: #28a745; }
.notification-dropdown .icon-circle.bg-warning { background-color: #ffc107; }

.notification-dropdown .dropdown-text-color {
    color: #6c757d;
    font-size: 0.75rem;
}

/* =========================
   USER DROPDOWN
========================= */
.user-dropdown .nav-link {
    display: flex;
    align-items: center;
    color: #70391B;
}

.user-dropdown .nav-link:hover {
    color: #5a2e16;
}

.user-dropdown .img-profile {
    width: 2rem;
    height: 2rem;
}

.user-dropdown .user-menu {
    min-width: 15rem;
    border-radius: 0.5rem;
}

.user-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    transition: background-color 0.2s;
    color: #495057;
}

.user-dropdown .dropdown-item:hover {
    background-color: #70391b;
    color: #ffffff;
    text-decoration: none;
}

.user-dropdown .dropdown-divider {
    margin: 0.5rem 0;
    border-top: 3px solid #dee2e6;
}

.user-dropdown .btn-logout {
    color: #dc3545;
    font-weight: 500;
}

.user-dropdown .btn-logout:hover {
    background-color: #70391b;
    color: #ffffff;
    text-decoration: none;
}

/* =========================
   SCROLL TO TOP BUTTON
========================= */
.scroll-to-top {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    display: none;
    width: 3rem;
    height: 3rem;
    text-align: center;
    color: white;
    background: rgba(139, 69, 19, 0.85);
    line-height: 3rem;
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 9999;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.4);
    text-decoration: none;
}

.scroll-to-top:focus,
.scroll-to-top:hover {
    color: white;
    background: rgba(139, 69, 19, 1);
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 25px rgba(139, 69, 19, 0.6);
}

.scroll-to-top i {
    font-weight: 800;
    transition: transform 0.3s ease;
}

.scroll-to-top:hover i {
    transform: translateY(-2px);
}

.scroll-to-top.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px) scale(0.8); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.scroll-to-top.hide {
    animation: fadeOutDown 0.4s ease-in forwards;
}

@keyframes fadeOutDown {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(30px) scale(0.8); }
}

/* ============================================================
   DARK MODE BASE
============================================================ */
body.dark-mode {
    background-color: #121212 !important;
    color: #e5e5e5 !important;
}

/* Hide Scrollbars */
body.dark-mode ::-webkit-scrollbar {
    display: none;
}
body.dark-mode {
    -ms-overflow-style: none;  /* IE & Edge */
    scrollbar-width: none;     /* Firefox */
}

/* ============================================================
   SIDEBAR STYLES
============================================================ */
body.dark-mode #accordionSidebar {
    background-color: #1e1e1e !important;
    border-right: 1px solid #2a2a2a;
}

body.dark-mode .bg-custom-sidebar {
    background-color: #1e1e1e !important;
}

body.dark-mode .bg-custom-sidebar .sidebar-brand-text,
body.dark-mode .bg-custom-sidebar .nav-link,
body.dark-mode .bg-custom-sidebar .sidebar-heading {
    color: #c7c7c7 !important;
}

body.dark-mode .bg-custom-sidebar .nav-link i {
    color: #bbb !important;
}

body.dark-mode .bg-custom-sidebar .nav-link:hover {
    background-color: #2e2e2e !important;
    color: #ffd9b3 !important;
}

body.dark-mode .bg-custom-sidebar .nav-link:hover i {
    color: #ffd9b3 !important;
}

body.dark-mode .bg-custom-sidebar .nav-item.active .nav-link {
    background-color: #3a3a3a !important;
    color: #ffbf80 !important;
}

body.dark-mode .bg-custom-sidebar .nav-item.active .nav-link i {
    color: #ffbf80 !important;
}

body.dark-mode .sidebar-divider {
    border-top: 2px solid #dee2e6 !important;
}

/* ============================================================
   TOPBAR / NAVBAR STYLES
============================================================ */
body.dark-mode .bg-custom-navbar {
    background-color: #1a1a1a !important;
    border-bottom: 1px solid #333;
}

body.dark-mode .icon-bars {
    color: #ffbf80;
}

/* ============================================================
   SUBMENUS / COLLAPSE ITEMS
============================================================ */
body.dark-mode .collapse-inner {
    background: #222 !important;
    border: 2px solid #333 !important;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6) !important;
}

body.dark-mode .collapse-item {
    color: #dcdcdc !important;
}

body.dark-mode .collapse-item:hover,
body.dark-mode .sidebar.toggled .collapse-item:hover {
    background-color: #333 !important;
    color: #ffdfb8 !important;
}

body.dark-mode .collapse-item.active {
    background-color: #5a3a22 !important;
    color: #fff !important;
}

/* ============================================================
   MAIN CONTENT AREA
============================================================ */
body.dark-mode #content {
    background-color: #555555 !important;
    background-image: none !important;
}

body.dark-mode .page-heading {
    color: #ffdfb8 !important;
    font-size: 1.5rem;
}

/* ============================================================
   MENU CARDS
============================================================ */
body.dark-mode .menu-card {
    background: #1c1c1c !important;
    box-shadow: 0 15px 30px rgba(0,0,0,0.4) !important;
}

body.dark-mode .menu-card:hover {
    box-shadow: 0 25px 50px rgba(0,0,0,0.6) !important;
}

body.dark-mode .card-title,
body.dark-mode .description-title {
    color: #ffbf80 !important;
}

body.dark-mode .description-overlay {
    background: linear-gradient(to top, rgba(20, 20, 20, 0.95) 70%, transparent) !important;
}

body.dark-mode .description-text {
    color: #d0b49c !important;
}

body.dark-mode .floating-badge {
    background: #2a2a2a;
    color: #ffbf80;
    box-shadow: 0 3px 12px rgba(0,0,0,0.6);
}

/* ============================================================
   BUTTONS
============================================================ */
/* Search button */
body.dark-mode .btn-search {
    background-color: #DCC5A0;
    color: #000000;
    border: none;
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

body.dark-mode .btn-search:hover {
    color: #ffffff;
    background-color: #70391B;
}

/* XS Search button & Notification Icon */
body.dark-mode .btn-search-xs,
body.dark-mode .notification-icon {
    color: #ffffff;
}

body.dark-mode .btn-search-xs:hover,
body.dark-mode .notification-icon:hover {
    color: #DCC5A0;
}

/* Best sellers button */
body.dark-mode .btn-bestsellers {
    background-color: #DCC5A0;
    color: #000000;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    font-weight: 500;
    transition: background-color 0.2s;
}

body.dark-mode .btn-bestsellers:hover {
    color: #ffffff;
    background-color: #70391B;
}

/* ============================================================
   LOGOUT MODAL
============================================================ */
body.dark-mode .modal-content {
    background-color: #1e1e1e !important;
    color: #e5e5e5 !important;
    border: 1px solid #333 !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.7);
}

body.dark-mode .modal-header {
    border-bottom: 1px solid #333 !important;
}

body.dark-mode .modal-title {
    color: #ffbf80 !important;
}

body.dark-mode .modal-header .close span {
    color: #ffbf80 !important;
}

body.dark-mode .modal-header .close:hover span {
    color: #ffdfb8 !important;
}

body.dark-mode .modal-body {
    color: #dcdcdc !important;
}

body.dark-mode .modal-footer {
    border-top: 1px solid #333 !important;
}

body.dark-mode .btn-logout-cancel {
    background-color: #555 !important;
    color: #ffffff !important;
}

body.dark-mode .btn-logout-cancel:hover {
    background-color: #666 !important;
}

body.dark-mode .btn-logout-confirm {
    background-color: #ffbf80 !important;
    color: #1c1c1c !important;
}

body.dark-mode .btn-logout-confirm:hover {
    background-color: #d29c63 !important;
    color: #000 !important;
}

/* ============================================================
   DROPDOWNS (NOTIFICATIONS & USER MENU)
============================================================ */
body.dark-mode .dropdown-menu,
body.dark-mode .notification-menu,
body.dark-mode .user-menu {
    background-color: #1e1e1e !important;
    border: 1px solid #333 !important;
    color: #e6e6e6 !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.6) !important;
}

body.dark-mode .dropdown-header {
    color: #ffdfb8 !important;
    font-weight: 700;
}

body.dark-mode .dropdown-item {
    color: #dcdcdc !important;
    background: transparent !important;
}

body.dark-mode .dropdown-item:hover,
body.dark-mode .dropdown-item:focus {
    background-color: #2f2f2f !important;
    color: #ffdfb8 !important;
}

body.dark-mode .dropdown-divider {
    border-top: 3px solid #333 !important;
}

body.dark-mode .icon-circle {
    background-color: #2a2a2a !important;
    color: #ffd9b3 !important;
}

body.dark-mode .page-heading-color,
body.dark-mode .dropdown-text-color {
    color: #9a9a9a !important;
}

body.dark-mode .dropdown-toggle::after {
    border-top-color: #ffbf80 !important;
}

/* Scrollbars inside dropdowns */
body.dark-mode .notification-menu::-webkit-scrollbar,
body.dark-mode .dropdown-menu::-webkit-scrollbar {
    width: 8px;
}

body.dark-mode .notification-menu::-webkit-scrollbar-thumb,
body.dark-mode .dropdown-menu::-webkit-scrollbar-thumb {
    background: #333;
}

/* ============================================================
   SCROLL TO TOP BUTTON
============================================================ */
body.dark-mode .scroll-to-top {
    background: rgba(255, 191, 128, 0.85) !important;
    color: #1c1c1c !important;
}

body.dark-mode .scroll-to-top:hover {
    background: rgba(255, 191, 128, 1) !important;
    color: #000;
}