/* Sidebar Styling */
:root {
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 0;
    --sidebar-bg: #f8f9fa;
    --sidebar-active-bg: #4e73df;
    --sidebar-active-text: #fff;
    --sidebar-text: #6c757d;
    --sidebar-hover-bg: #e9ecef;
    --transition-speed: 0.3s;
}

/* Main sidebar container */
.sidebar-wrapper {
    position: relative;
    z-index: 1000;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    height: 100vh;
    padding: 0;
    background-color: var(--sidebar-bg);
    box-shadow: 0 0.15rem 1.75rem rgba(0, 0, 0, 0.15);
    transition: all var(--transition-speed) ease;
    overflow-y: auto;
    z-index: 1030;
}

/* Sidebar logo and brand */
.sidebar-header {
    background-color: rgba(78, 115, 223, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}


.sidebar-brand {
    color: #4e73df;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Sidebar menu items */
.sidebar .nav-item {
    position: relative;
    width: 100%;
    margin-bottom: 4px;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--sidebar-text);
    border-radius: 0 30px 30px 0;
    margin-right: 16px;
    transition: all var(--transition-speed) ease;
}

.sidebar .nav-link:hover {
    background-color: var(--sidebar-hover-bg);
    color: #4e73df;
}

.sidebar .nav-link.active {
    background-color: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    box-shadow: 0 0.15rem 0.5rem rgba(78, 115, 223, 0.3);
}

.sidebar .nav-link i {
    font-size: 1.1rem;
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Sidebar divider */
.sidebar-divider {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    margin: 0 20px;
}

/* Subscription info section */
.sidebar-subscription-info {
    background-color: rgba(78, 115, 223, 0.05);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    margin: 0 16px 16px;
}

/* Collapsed sidebar styling */
body.sidebar-collapsed .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-width)));
}

body.sidebar-collapsed .content-wrapper {
    margin-left: var(--sidebar-collapsed-width);
}

/* Overlay for mobile */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1020;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-speed) ease;
}

body.sidebar-visible .sidebar-overlay {
    opacity: 1;
    visibility: visible;
}

body.sidebar-visible .sidebar {
    transform: translateX(0);
}

/* Content wrapper adjustments */
.content-wrapper {
    margin-left: var(--sidebar-width);
    transition: all var(--transition-speed) ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Main content container for proper spacing */
.content-wrapper > .container-fluid {
    flex: 1;
}

/* Toggle button */
.sidebar-toggle-btn {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1040;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #4e73df;
    box-shadow: 0 0.15rem 0.5rem rgba(0, 0, 0, 0.2);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive adaptations */
@media (max-width: 767.98px) {
    .content-wrapper {
        margin-left: 0 !important;
    }
    
    .sidebar {
        transform: translateX(calc(-1 * var(--sidebar-width)));
    }
    
    .sidebar-toggle-btn {
        display: flex;
    }
    
    body.sidebar-visible .sidebar-toggle-btn {
        left: calc(var(--sidebar-width) + 15px);
    }
    
    /* Footer adjustments for mobile */
    footer {
        margin-left: 0 !important;
    }
}

/* Medium screens - collapsed by default */
@media (min-width: 768px) and (max-width: 991.98px) {
    .sidebar {
        width: var(--sidebar-width);
    }
    
    body.sidebar-collapsed .content-wrapper {
        margin-left: 0;
    }
}

/* Large screens - expanded by default */
@media (min-width: 992px) {
    .sidebar {
        width: var(--sidebar-width);
    }
    
    .content-wrapper {
        margin-left: var(--sidebar-width);
    }
    
    body.sidebar-collapsed .content-wrapper {
        margin-left: 0;
    }
}

/* Custom scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.2);
}