/* Sidebar Styles */
.sidebar {
    min-height: 100vh;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
    z-index: 1030;
    padding: 0;
    position: fixed;
    width: 240px;
    background-color: var(--bs-dark);
    transition: all 0.3s ease-in-out;
}

.sidebar .position-sticky {
    position: sticky;
    top: 0;
    height: calc(100vh - 1rem);
    padding-top: 0.5rem;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar .nav-link {
    font-weight: 500;
    color: var(--bs-gray-400);
    padding: .75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease-in-out;
    border-radius: 0.25rem;
    margin: 0.125rem 0.5rem;
}

.sidebar .nav-link:hover {
    color: var(--bs-white);
    background-color: var(--pink-hover);
    transform: translateX(4px);
}

.sidebar .nav-link.active {
    color: var(--bs-white);
    background-color: var(--pink-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.sidebar-group {
    margin-bottom: 1rem;
    padding: 0;
}

.sidebar-group:not(:last-child) {
    flex-shrink: 0;
}

.sidebar-group:last-child {
    margin-top: auto;
    margin-bottom: 0;
    padding: 0.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.sidebar-group-title {
    padding: 0.75rem 1.25rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--bs-gray-600);
    font-weight: bold;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.sidebar .feather {
    width: 18px;
    height: 18px;
    stroke-width: 2;
    transition: transform 0.2s ease-in-out;
}

.sidebar .nav-link:hover .feather {
    transform: scale(1.1);
}

/* Main content adjustment */
.main-content {
    margin-left: 240px;
    padding: 1rem;
    min-height: 100vh;
    transition: margin-left 0.3s ease-in-out;
    background-color: var(--bs-body-bg);
}

/* Scrollbar styling */
.sidebar .position-sticky::-webkit-scrollbar {
    width: 4px;
}

.sidebar .position-sticky::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar .position-sticky::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.sidebar .position-sticky::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 1040;
        width: 280px;
    }
    
    .sidebar.show {
        transform: translateX(0);
        box-shadow: 4px 0 8px rgba(0, 0, 0, 0.2);
    }
    
    /* Improved hamburger menu button */
    .sidebar-toggle {
        display: flex;
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 1041;
        background-color: var(--pink-primary);
        border-radius: 0.5rem;
        padding: 0.6rem;
        margin: 0;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        transition: all 0.2s ease-in-out;
    }

    .sidebar-toggle:hover {
        background-color: var(--pink-hover);
        transform: scale(1.05);
    }

    .sidebar-toggle:active {
        transform: scale(0.95);
    }

    .sidebar-toggle .feather {
        width: 24px;
        height: 24px;
        color: white;
    }

    .main-content {
        margin-left: 0;
        padding-top: 4rem;
    }

    /* Improved action buttons */
    .btn-group {
        display: flex;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .btn-group .btn {
        flex: 1;
        min-width: auto;
        padding: 0.5rem 1rem;
        margin: 0;
        border-radius: 0.375rem !important;
    }

    /* Sidebar overlay */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1035;
        backdrop-filter: blur(2px);
        transition: opacity 0.3s ease-in-out;
        opacity: 0;
    }

    .sidebar.show + .sidebar-overlay {
        display: block;
        opacity: 1;
    }

    /* Better spacing for action buttons in cards */
    .card .btn-group {
        margin: 0.5rem 0;
    }

    /* Improved table action buttons */
    .table .btn-group {
        display: flex;
        gap: 0.25rem;
    }

    .table .btn-group .btn {
        padding: 0.4rem;
    }

    .table .btn-group .feather {
        width: 16px;
        height: 16px;
    }
}

/* Base styles for sidebar toggle button */
.sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    border: none;
    color: white;
    transition: all 0.2s ease-in-out;
}

@media (max-width: 768px) {
    .sidebar-toggle {
        display: flex;
    }
}
