/* Sidebar toggle button styles */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 200;
    background-color: var(--primary-color);
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.sidebar-toggle:hover {
    background-color: var(--element-active-color);
    color: #fff;
}

/* Ensure the sidebar is visible on mobile when toggled */
.sidebar {
    z-index: 1050; /* Higher than other elements */
    position: fixed;
    width: 100%;
    max-width: 290px;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    background-color: #EBFBE5; /* Ensure background is visible */
}

/* When the sidebar is toggled, make it visible */
.sidebar-visible .sidebar {
    transform: translateX(0);
}

/* Adjust content margin when sidebar is visible */
.sidebar-visible .content {
    margin-left: 290px;
    transition: margin-left 0.3s ease;
}

/* Adjustments for sidebar visibility */
.sidebar-hidden .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.sidebar-hidden .content {
    margin-left: 0;
    transition: margin-left 0.3s ease;
}

/* Sidebar behavior based on device size */
@media (min-width: 768px) {
    /* Desktop and tablet - sidebar always visible */
    .sidebar {
        transform: translateX(0) !important;
        z-index: 1050;
        position: fixed;
        width: 290px;
        max-width: 290px;
        height: 100vh;
        left: 0;
        top: 0;
    }

    .sidebar-toggle {
        display: none !important; /* Hide toggle button on desktop */
    }

    .content {
        margin-left: 290px;
    }
}

@media (max-width: 767px) {
    /* Mobile - sidebar hidden by default */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1050;
        position: fixed;
        width: 100%;
        min-width: 100%;
        height: 100%;
        left: 0;
        top: 0;
        box-shadow: 3px 0 10px rgba(0, 0, 0, 0.2);
    }

    .sidebar-visible .sidebar {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: block;
        position: fixed;
        top: 10px;
        left: 10px;
        z-index: 1060;
        background-color: var(--primary-color);
        border: none;
        padding: 10px;
        border-radius: 5px;
        cursor: pointer;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    }

    .content {
        margin-left: 0;
        width: 100%;
        transition: margin-left 0.3s ease;
    }

    .sidebar-visible .content {
        margin-left: 0;
    }
}
