        @import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@200;300;400;500;700;800;900&display=swap');

body {
    font-family: "tajawal", Arial, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    font-size: 14px;
}

#wrapper {
    min-height: 100vh;
    display: flex;
}

/* Menu styling */
#sidebar {
    min-width: 250px;
    max-width: 250px;
    background:linear-gradient(180deg, rgb(54 96 111 / 75%) 0%, rgba(15, 45, 32, 0.95) 100%), url(images/figure-pattern-wall.jpg);
    background-repeat: no-repeat, repeat;
    background-size: 100% 100%, 200px;
    background-blend-mode: multiply;
    transition: all 0.3s;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
    z-index: 1000;
    position: relative;
}

#sidebar.active {
    width: 70px;
    min-width: 70px;
    max-width: 70px;
}

#sidebar .sidebar-header {
    padding: 15px;
    background-color: #1C333B;
    border-bottom: 1px solid #396372;
    display: flex;
    justify-content: space-between;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
}

#sidebar .sidebar-header h5 {
    color: #ffffff;
    margin: 0;
    font-weight: bold;
    font-size: 1rem;
}

#sidebar.active .sidebar-header h5 {
    display: none;
}

#sidebar ul.components {
    padding: 15px 0;
    white-space: nowrap;
}

#sidebar ul li {
    padding: 0;
    margin-bottom: 3px;
}

#sidebar ul li a {
    padding: 8px 15px;
    display: flex;
    align-items: center;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.3s;
    white-space: nowrap;
    opacity: 0.9;
    font-size: 0.9rem;
}

#sidebar ul li a:hover {
    background-color: #d4b14d;
    color: #ffffff;
    opacity: 1;
}

#sidebar ul li a.active {
    background-color: #1e5b40;
    color: #ffffff;
    opacity: 1;
    border-right: 3px solid #d4b14d;
}

#sidebar.active ul li a span {
    display: none;
}

#sidebar .nav-icon {
    width: 20px;
    text-align: center;
    margin-left: 10px;
    font-size: 1.1em;
    color: #ffffff;
}

/* Submenu styling */
#sidebar ul.collapse {
    padding-right: 20px;
}

#sidebar ul.collapse li a {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* Burger icon styling */
.burger-icon {
    width: 16px;
    height: 2px;
    background-color: #ffffff;
    margin: 2px 0;
    transition: all 0.3s;
}

#sidebarCollapse {
    background-color: transparent;
    border: none;
    padding: 6px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background-color: #d4b14d;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    z-index: 1;
}

#sidebarCollapse:hover {
    background-color: #c19a3d;
}

#content {
    width: 100%;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

/* Top Header Styling */
.navbar {
    padding: 0.3rem 0.8rem;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    width: 100%;
    margin: 0;
    min-height: auto;
}

.navbar.mb-4 {
    margin-bottom: 0.8rem !important;
}

.user-dropdown {
    background: none;
    border: none;
    color: #1a4d36;
    display: flex;
    align-items: center;
    padding: 0.25rem 0.8rem;
    font-size: 0.9rem;
    height: 32px;
}

.user-dropdown:hover, 
.user-dropdown:focus {
    background: rgba(26, 77, 54, 0.1);
    color: #1a4d36;
}

.user-dropdown i {
    font-size: 1.2rem;
    margin-left: 0.5rem;
}

.dropdown-menu {
    min-width: 180px;
    padding: 0.3rem 0;
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15);
    border-radius: 0.5rem;
    font-size: 0.9rem;
    margin-top: 0.2rem;
}

.dropdown-item {
    padding: 0.4rem 0.8rem;
    color: #333;
    display: flex;
    align-items: center;
    min-height: 32px;
}

.dropdown-item i {
    margin-left: 0.75rem;
    width: 20px;
    text-align: center;
    color: #1a4d36;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background-color: rgba(26, 77, 54, 0.1);
    color: #1a4d36;
}

.dropdown-item.text-danger i {
    color: #dc3545;
}

.dropdown-item.text-danger:hover {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

/* Container styling */
.container-fluid {
    padding: 0.6rem;
    width: 100%;
}

/* Mobile Navigation Styles */
.mobile-nav {
    background: linear-gradient(90deg, #488a6c 0%, #0f2d20 100%);
    margin: -0.3rem -0.6rem 0.3rem -0.6rem;
    padding: 0.8rem;
}

.mobile-title {
    color: white;
    margin: 0 1rem !important;
    font-size: 1rem;
    flex-grow: 1;
    text-align: center;
}

.mobile-menu-btn {
    background: transparent;
    border: none;
    padding: 6px;
    width: 35px;
    height: 35px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.mobile-menu-btn .burger-icon {
    width: 20px;
    height: 2px;
    background-color: white;
    margin: 2px 0;
    transition: all 0.3s;
}

/* Responsive styling */
@media (max-width: 768px) {
    body {
        font-size: 13px;
        overflow-x: hidden;
    }

    #wrapper {
        position: relative;
        overflow: hidden;
    }

    #sidebar {
        margin-right: -250px;
        position: fixed;
        height: 100vh;
        top: 0;
        right: 0;
        transition: margin-right 0.3s ease-in-out;
    }

    #sidebar.active {
        margin-right: 0;
        width: 250px;
        min-width: 250px;
        max-width: 250px;
    }

    #sidebar.active .sidebar-header h5 {
        display: block;
    }

    #sidebar.active ul li a span {
        display: inline;
    }

    #content {
        width: 100%;
        padding: 0;
        margin-right: 0;
        transition: margin-right 0.3s ease-in-out;
    }

    .navbar {
        padding: 0 !important;
        flex-wrap: wrap;
        position: sticky;
        top: 0;
        background: white;
        z-index: 999;
    }

    .navbar.mb-4 {
        margin-bottom: 0.6rem !important;
    }

    .user-dropdown {
        padding: 0.2rem 0.6rem;
        font-size: 0.85rem;
        height: 28px;
    }

    .user-dropdown i {
        font-size: 1.1rem;
    }

    .dropdown-menu {
        min-width: 160px;
        font-size: 0.85rem;
        padding: 0.2rem 0;
    }

    .dropdown-item {
        padding: 0.3rem 0.6rem;
        min-height: 28px;
    }

    /* Overlay when sidebar is open */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
        transition: all 0.3s;
    }

    #sidebar.active + .sidebar-overlay {
        display: block;
    }

    /* Adjust sidebar items for touch */
    #sidebar ul li a {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    #sidebar ul.collapse li a {
        padding: 8px 25px;
    }

    /* Make dropdown toggles more touch-friendly */
    .dropdown-toggle {
        min-height: 44px;
    }

    .mobile-nav {
        order: -1;
        width: 100%;
    }

    .dropdown {
        margin-right: auto;
        padding: 0.3rem 0.6rem;
    }
}

@media (max-width: 576px) {
    body {
        font-size: 12px;
    }

    #sidebar {
        width: 100%;
        max-width: 280px;
        margin-right: -280px;
    }

    #sidebar.active {
        width: 280px;
        min-width: 280px;
        max-width: 280px;
    }

    .navbar {
        padding: 0.2rem 0.5rem;
    }

    .navbar.mb-4 {
        margin-bottom: 0.5rem !important;
    }

    .container-fluid {
        padding: 0.5rem;
    }

    .mobile-nav {
        margin: -0.2rem -0.5rem 0.2rem -0.5rem;
        padding: 0.6rem;
    }

    .mobile-title {
        font-size: 0.9rem;
        margin: 0 0.8rem !important;
    }

    .mobile-menu-btn {
        width: 32px;
        height: 32px;
    }

    .mobile-menu-btn .burger-icon {
        width: 18px;
    }

    /* Larger touch targets for very small screens */
    #sidebar ul li a {
        padding: 12px 15px;
    }

    #sidebar ul.collapse li a {
        padding: 10px 25px;
    }

    .user-dropdown {
        height: 32px;
    }
}

/* Prevent body scroll when sidebar is open on mobile */
body.sidebar-open {
    overflow: hidden;
}
