/* Meezan Accounting Custom Styles */
:root {
    --meezan-primary: #2E5BFF;
    --meezan-secondary: #8C9EFF;
    --meezan-accent: #FFAB40;
    --meezan-bg: #F8FAFF;
    --meezan-sidebar-bg: #FFFFFF;
    --meezan-text: #1A202C;
    --meezan-glass: rgba(255, 255, 255, 0.7);
    --sidebar-width: 260px;
}

body {
    font-family: 'Plus Jakarta Sans', 'Cairo', sans-serif;
    background-color: var(--meezan-bg);
    color: var(--meezan-text);
    overflow-x: hidden;
}

/* RTL Specific Tweaks */
[dir="rtl"] {
    font-family: 'Cairo', 'Plus Jakarta Sans', sans-serif;
}

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

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

/* Glassmorphism Effect */
.glass-card {
    background: var(--meezan-glass);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

/* Sidebar Styling */
#wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

#sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: var(--meezan-sidebar-bg);
    color: var(--meezan-text);
    transition: all 0.3s;
    border-inline-end: 1px solid rgba(0,0,0,0.05);
    z-index: 1000;
    position: sticky;
    top: 0;
    height: 100vh;
}

#sidebar.active {
    margin-inline-start: calc(-1 * var(--sidebar-width));
}

#sidebar .sidebar-header {
    padding: 20px;
    background: var(--meezan-sidebar-bg);
}

#sidebar ul.components {
    padding: 20px 0;
}

#sidebar ul li a {
    padding: 12px 25px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    color: var(--meezan-text);
    text-decoration: none;
    transition: all 0.3s;
    border-radius: 0 50px 50px 0;
    margin-inline-end: 15px;
}

[dir="rtl"] #sidebar ul li a {
    border-radius: 50px 0 0 50px;
    margin-inline-start: 15px;
    margin-inline-end: 0;
}

#sidebar ul li a:hover, #sidebar ul li a.active {
    background: rgba(46, 91, 255, 0.1);
    color: var(--meezan-primary);
    font-weight: 600;
}

#sidebar ul li a i {
    margin-inline-end: 15px;
    font-size: 1.2rem;
}

/* Collapsible Sidebar Styles */
#sidebar ul.components li.sidebar-group-header > a {
    padding: 12px 25px;
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #6c757d;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0;
    margin-inline-end: 0;
}

#sidebar ul.components li.sidebar-group-header > a:hover {
    background: transparent;
    color: var(--meezan-primary);
}

#sidebar ul.components li.sidebar-group-header > a i.chevron {
    transition: transform 0.3s;
}

#sidebar ul.components li.sidebar-group-header > a[aria-expanded="true"] i.chevron {
    transform: rotate(180deg);
}

#sidebar ul.sub-menu li a {
    padding-inline-start: 50px;
    font-size: 0.95rem;
}

[dir="rtl"] #sidebar ul.sub-menu li a {
    padding-inline-end: 50px;
    padding-inline-start: 25px;
}

/* Main Content Styling */
#content {
    width: 100%;
    padding: 0;
    min-height: 100vh;
    transition: all 0.3s;
}

.top-navbar {
    padding: 15px 30px;
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* Hero Section */
.hero-gradient {
    background: linear-gradient(135deg, var(--meezan-primary) 0%, var(--meezan-secondary) 100%);
    border-radius: 24px;
    padding: 3rem;
    color: white;
    position: relative;
    overflow: hidden;
}

/* Buttons */
.btn-primary {
    background-color: var(--meezan-primary);
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
}

/* Dashboard Stats */
.stat-card {
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

/* Mobile Tweaks */
@media (max-width: 992px) {
    #sidebar {
        margin-inline-start: calc(-1 * var(--sidebar-width));
        position: fixed;
    }
    #sidebar.active {
        margin-inline-start: 0;
    }
    #content {
        width: 100%;
    }
}

/* Enhanced Responsiveness */

/* Container & Spacing Adjustments */
@media (max-width: 576px) {
    main.p-4 {
        padding: 1rem !important;
    }
    .hero-gradient {
        padding: 1.5rem;
    }
    .top-navbar {
        padding: 10px 15px;
    }
    h1, .h1 { font-size: 1.5rem; }
    h2, .h2 { font-size: 1.25rem; }
    h3, .h3 { font-size: 1.1rem; }
    h4, .h4 { font-size: 1rem; }
}

/* Sidebar Overlay for Mobile */
@media (max-width: 992px) {
    #sidebar {
        box-shadow: 0 0 20px rgba(0,0,0,0.1);
    }
    #sidebar.active {
        margin-inline-start: 0;
    }
    #sidebar:not(.active) {
        margin-inline-start: calc(-1 * var(--sidebar-width));
    }
    
    /* Overlay effect when sidebar is active */
    #sidebar.active::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0,0,0,0.2);
        z-index: -1;
        display: block;
    }
}

/* Table Card Styling for Mobile */
@media (max-width: 768px) {
    .table-responsive {
        border-radius: 12px;
        overflow: hidden;
    }
    .btn-sm {
        padding: 0.4rem 0.8rem;
    }
}

/* POS Specific Responsive Utilities */
.mobile-cart-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1030;
    border-radius: 50px;
    padding: 12px 24px;
    box-shadow: 0 4px 15px rgba(46, 91, 255, 0.4);
}

[dir="rtl"] .mobile-cart-toggle {
    right: auto;
    left: 20px;
}

@media (max-width: 991px) {
    .mobile-cart-toggle {
        display: flex;
        align-items: center;
    }
    .cart-container {
        position: fixed !important;
        top: 0 !important;
        right: -100% !important;
        width: 100% !important;
        height: 100% !important;
        z-index: 1040 !important;
        transition: right 0.3s ease;
        border-radius: 0 !important;
    }
    [dir="rtl"] .cart-container {
        right: auto !important;
        left: -100% !important;
        transition: left 0.3s ease;
    }
    .cart-container.show {
        right: 0 !important;
    }
    [dir="rtl"] .cart-container.show {
        left: 0 !important;
    }
    
    /* Ensure body doesn't scroll when cart is open */
    body.cart-open {
        overflow: hidden;
    }
}

/* Grid adjustments */
@media (max-width: 400px) {
    #productGrid .col {
        width: 100% !important;
    }
}
