/* ==========================================================
   PART 1: NORMAL / GLOBAL CSS (ALL DEVICES & DESKTOP)
========================================================== */

:root {
    --sidebar-width: 260px; /* আপনার সাইডবারের সাইজ অনুযায়ী পরিবর্তন করতে পারেন */
    --topbar-height: 50px;
}

body, html {
    height: 100%;
    margin: 0;
    /* Standard global web app background - soft off-white/grey */
    background-color: #f4f7f6; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #334155;
}

.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
    min-height: 100vh;
}

/* ------------------------------------------
   1. Sidebar Styling (Fixed & Scrollable)
------------------------------------------ */
#sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    height: 100vh; /* স্ক্রিনের সম্পূর্ণ উচ্চতা */
    background-color: #ffffff; /* Clean white */
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease-in-out;
}

#sidebar.collapsed {
    margin-left: calc(var(--sidebar-width) * -1);
}

/* সাইডবারের ভেতরের মেনু স্ক্রল করার জন্য */
.sidebar-menu-wrapper {
    overflow-y: auto;
    overflow-x: hidden;
    height: calc(100vh - var(--topbar-height)); /* হেডার বাদে বাকি অংশ */
}

/* Custom Scrollbar for Sidebar */
.sidebar-menu-wrapper::-webkit-scrollbar {
    width: 5px;
}
.sidebar-menu-wrapper::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

#sidebar ul li {
    margin: 0.2rem 0.75rem;
}

#sidebar ul li a {
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
    text-decoration: none;
    color: #475569; /* Slate grey text */
    border-radius: 0.375rem; /* Rounded corners for modern feel */
    transition: background-color 0.2s ease, color 0.2s ease;
}

#sidebar ul li a:hover, 
#sidebar ul li.active > a {
    background-color: #eff6ff; /* Soft primary blue background */
    color: #2563eb !important; /* Bold primary blue text */
}

/* Icons inside the sidebar normal vs active */
#sidebar ul li a i {
    color: #94a3b8; /* Light slate for icons */
    transition: color 0.2s ease;
}

#sidebar ul li a:hover i,
#sidebar ul li.active > a i {
    color: #2563eb; 
}

/* Sidebar Dropdown Arrows */
.dropdown-toggle-custom[aria-expanded="true"] .toggle-arrow {
    transform: rotate(180deg);
}

.toggle-arrow {
    transition: transform 0.2s ease;
}

/* ------------------------------------------
   2. Topbar Styling (Fixed)
------------------------------------------ */
.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    z-index: 1020;
    transition: all 0.3s ease-in-out;
}

/* Topbar Icon Hover States */
.nav-icon-hover {
    transition: color 0.2s ease;
}
.nav-icon-hover:hover {
    color: #2563eb !important;
}

/* Custom Dropdown arrow override for topbar user profile */
.dropdown-toggle-user::after {
    display: inline-block;
    margin-left: 0.3em;
    vertical-align: 0.2em;
    content: "";
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
    color: #94a3b8;
}

/* ------------------------------------------
   3. Main Content Area
------------------------------------------ */
#content {
    margin-left: var(--sidebar-width);
    /*padding-top: var(--topbar-height);*/
    padding-top: 63px;
    width: calc(100% - var(--sidebar-width));
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease-in-out;
}

/* ------------------------------------------
   4. Sidebar Overlay (Default Hidden)
------------------------------------------ */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    z-index: 1035; /* টপবার(1020)-এর উপরে এবং সাইডবার(1040)-এর নিচে */
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ------------------------------------------
   5. Helper Utilities
------------------------------------------ */
.cursor-pointer { cursor: pointer; }
.fs-7 { font-size: 0.875rem !important; }
.fs-8 { font-size: 0.75rem !important; }
.fs-9 { font-size: 0.65rem !important; }
.letter-spacing-1 { letter-spacing: 0.05em; }
.transition-200 { transition: all 0.2s ease-in-out; }
.hover-bg-light:hover { background-color: #f8fafc !important; }

/* ------------------------------------------
   6. Offcanvas & Professional Ecommerce Menu
------------------------------------------ */
.offcanvas {
    border-left: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.03);
}

/* Full-screen Offcanvas */
.offcanvas-fullscreen {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important; /* Mobile browser address bar fix */
    background-color: #ffffff !important;
}

/* Sub-offcanvas main menu-r upore thakar jonno */
#eraviqSubOffcanvas {
    z-index: 1060;
}

/* Ecommerce Menu List (Pure Black & Right Arrow) */
.ecom-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ecom-menu-list li {
    border-bottom: 1px solid #f0f0f0; /* Bottom horizontal line */
}

.ecom-menu-list li:last-child {
    border-bottom: none;
}

.ecom-menu-link {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 15px 4px;
    color: #111111 !important; /* Strictly Black */
    text-decoration: none !important;
    font-size: 15px;
    font-weight: 500;
    background: transparent;
    border: none;
    transition: background-color 0.15s ease;
}

.ecom-menu-link:hover,
.ecom-menu-link:focus,
.ecom-menu-link:active {
    color: #000000 !important;
    background-color: #fafafa;
}

.ecom-menu-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ecom-menu-left i {
    width: 20px;
    text-align: center;
    color: #222222;
    font-size: 15px;
}

.ecom-menu-arrow {
    color: #888888;
    font-size: 12px;
    margin-left: auto; /* Pull arrow strictly to the right */
}


/* ==========================================================
   PART 2: RESPONSIVE CSS (TABLET & MOBILE)
========================================================== */

/* Tablet & Mobile (991.98px and below - App-like view) */
@media (max-width: 991.98px) {
    #sidebar {
        transform: translateX(-100%); /* স্ক্রিনের বাইরে হাইড থাকবে */
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.05);
    }

    /* টগল বাটনে ক্লিক করলে .active বা .mobile-show যুক্ত হলে সাইডবার শো করবে */
    #sidebar.active,
    #sidebar.mobile-show {
        transform: translateX(0);
    }

    #content {
        margin-left: 0;
        width: 100%;
    }

    .topbar {
        left: 0 !important;
        height: var(--topbar-height) !important;
    }
}

/* Small Mobile Specific (768px and below - Legacy compatibility) */
@media (max-width: 768px) {
    #sidebar {
        position: fixed;
        height: 100vh;
    }
}