/* Filters Sidebar */
.filters-sidebar {
    position: fixed;
    top: 0;
    left: -350px;
    width: 350px;
    height: 100vh;
    background: linear-gradient(180deg, #1a1a1a 0%, #252525 100%);
    border-right: 1px solid rgba(187, 134, 252, 0.3);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    z-index: 1050;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.filters-sidebar.active {
    left: 0;
}

.filters-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(187, 134, 252, 0.2);
    background: linear-gradient(135deg, rgba(187, 134, 252, 0.1) 0%, rgba(3, 218, 198, 0.05) 100%);
    position: sticky;
    top: 0;
    z-index: 10;
}

.filters-sidebar-header h5 {
    margin: 0;
    color: #ffffff;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.btn-close-sidebar {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e0e0e0;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-close-sidebar:hover {
    background: rgba(255, 68, 68, 0.2);
    border-color: #ff4444;
    color: #ff4444;
}

.filters-sidebar-body {
    padding: 1.5rem;
}

/* Filters Toggle Button */
.filters-toggle-btn {
    position: fixed;
    left: 20px;
    bottom: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #bb86fc, #03dac6);
    border: none;
    box-shadow: 0 4px 20px rgba(187, 134, 252, 0.4);
    z-index: 1040;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #000000;
    transition: all 0.3s ease;
}

.filters-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(187, 134, 252, 0.6);
}

.filters-toggle-btn i {
    font-size: 1.25rem;
}

/* Layout lock button */
.layout-lock-btn {
    position: fixed;
    left: 20px;
    bottom: 90px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #bb86fc, #9d6ee8);
    border: none;
    box-shadow: 0 4px 20px rgba(187, 134, 252, 0.4);
    z-index: 1040;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #000000;
    transition: all 0.3s ease;
}

.layout-lock-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(187, 134, 252, 0.6);
}

.layout-lock-btn i {
    font-size: 1.25rem;
}

/* Export data button */
.export-data-btn {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4caf50, #45a049);
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.4);
    z-index: 1040;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: all 0.3s ease;
    text-decoration: none;
}

.export-data-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(76, 175, 80, 0.6);
    color: #ffffff;
}

.export-data-btn i {
    font-size: 1.25rem;
}



/* Resize handles */
.resizable-card {
    position: relative;
}

.resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 12px;
    cursor: ew-resize;
    background: rgba(187, 134, 252, 0.25);
    z-index: 100;
    transition: background 0.2s ease;
    display: none;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.resize-handle:hover {
    background: rgba(187, 134, 252, 0.5);
}

.resize-handle::before {
    content: '⋮';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(187, 134, 252, 1);
    font-size: 18px;
    font-weight: bold;
}

.resize-handle:hover::before {
    color: #bb86fc;
}

.draggable-item {
    transition: opacity 0.2s ease;
    position: relative;
    padding: 0.5rem;
}

.draggable-item[draggable="true"] {
    cursor: move;
}

.overview-content {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-header {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    margin-bottom: 2rem !important;
}

.overview-content > .row {
    flex: 0 0 100% !important;
    max-width: 100% !important;
}

.overview-content.sidebar-active {
    margin-left: 350px;
}

/* Select2 in sidebar */
.filters-sidebar .select2-container {
    width: 100% !important;
}

/* Scrollbar for sidebar */
.filters-sidebar::-webkit-scrollbar {
    width: 8px;
}

.filters-sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.filters-sidebar::-webkit-scrollbar-thumb {
    background: rgba(187, 134, 252, 0.5);
    border-radius: 4px;
}

.filters-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(187, 134, 252, 0.7);
}

/* Overview content width */
.overview-content {
    width: 100%;
    padding: 0 1rem;
}

.overview-content.sidebar-active {
    width: calc(100% - 350px);
}

/* Responsive */
@media (max-width: 768px) {
    .filters-sidebar {
        width: 100%;
        left: -100%;
    }
    
    .filters-sidebar.active {
        left: 0;
    }
    
    .overview-content.sidebar-active {
        margin-left: 0;
        width: 100%;
    }
}

/* Fix Select2 dropdown background */
.select2-container--custom-dark .select2-results {
    background: #1e1e1e;
}

.select2-container--custom-dark .select2-results__options {
    background: #1e1e1e;
}
