/* ===== CSS RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-red: #dc3545;
    --discord-blue: #5865F2;
    --success-green: #57F287;
    --border-radius: 10px;
    --shadow-light: 0 2px 6px rgba(0,0,0,0.05);
    --shadow-medium: 0 4px 12px rgba(0,0,0,0.08);
}

body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: #2c3e50;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
}

/* ===== LAYOUT STYLES ===== */
.server-container {
    margin-top: 20px;
}

.sidebar {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.server-content {
    background: #ffffff;
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow-medium);
    border-left: 4px solid var(--primary-red);
    min-height: 400px;
}

/* ===== BOOTSTRAP ICON FIXES ===== */
.bi::before {
    font-size: 1em !important;
}

/* Fix specific icon sizes */
.bi-hdd-stack {
    font-size: 2rem !important;
}

/* Button icons */
.btn .bi {
    font-size: 0.875rem !important;
}

/* Stats card icons */
.stats-card .bi {
    font-size: 2rem !important;
    opacity: 0.8;
}

/* ===== CARD STYLES ===== */
.card {
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    margin-bottom: 20px;
    background: #ffffff;
}

.card-header {
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    font-weight: 600;
    padding: 15px 20px;
    background-color: var(--discord-blue) !important;
    color: white !important;
}

/* ===== DATA TABLES ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    padding: 12px 15px;
    text-align: left;
}

.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

.data-table tr:hover {
    background-color: #f8f9fa;
}

/* ===== LIST GROUP STYLES ===== */
.list-group {
    border-radius: 8px;
    box-shadow: var(--shadow-light);
}

.list-group-item {
    border: 1px solid rgba(0,0,0,0.125);
    padding: 12px 20px;
}

.list-group-item:hover {
    background-color: #e9ecef;
}

.list-group-item.active {
    background-color: var(--discord-blue) !important;
    border-color: var(--discord-blue) !important;
    color: white !important;
}

/* ===== TAB STYLES ===== */
.nav-tabs {
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 25px;
}

.nav-tabs .nav-link {
    border: none;
    color: #495057;
    font-weight: 500;
    padding: 12px 20px;
}

.nav-tabs .nav-link:hover {
    background-color: #f1f1f1;
    color: var(--discord-blue);
}

.nav-tabs .nav-link.active {
    color: var(--discord-blue);
    background-color: transparent;
    border-bottom: 3px solid var(--discord-blue);
}

/* ===== QUICK STATS GRID ===== */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow-light);
    border-left: 4px solid var(--primary-red);
}

.stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
}

/* ===== SERVER HEADER ===== */
.server-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 25px;
    border-left: 4px solid var(--primary-red);
}

/* ===== USER AVATAR ===== */
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

/* ===== LOADING SPINNER ===== */
.spinner-container {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* ===== BUTTON STYLES ===== */
.btn {
    border-radius: 6px;
    font-weight: 500;
}

.btn-outline-danger {
    color: var(--primary-red);
    border-color: var(--primary-red);
}

.btn-outline-danger:hover {
    background-color: var(--primary-red);
    color: white;
}

/* ===== PROGRESS BARS ===== */
.progress {
    height: 8px;
    border-radius: 4px;
}

/* ===== ALERT STYLES ===== */
.alert {
    border-radius: 8px;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .sidebar {
        position: static;
        margin-bottom: 20px;
    }
    
    .server-content {
        padding: 15px;
    }
    
    .quick-stats {
        grid-template-columns: 1fr;
    }
}

/* Search box improvements */
.search-box .input-group {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 6px;
}

.search-box .form-control:focus {
    border-color: #5865F2;
    box-shadow: 0 0 0 0.2rem rgba(88, 101, 242, 0.25);
}
/* ===== DARK MODE STYLES ===== */
[data-bs-theme="dark"] {
    --bs-body-bg: #1a1d21 !important;
    --bs-body-color: #ffffff !important;
    --primary-red: #e74c3c;
    --discord-blue: #7289da;
}

[data-bs-theme="dark"] body {
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] .server-content {
    background: #2f3136 !important;
    color: #ffffff !important;
    border-left-color: var(--primary-red);
}

[data-bs-theme="dark"] .sidebar {
    background: #2f3136 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .card {
    background: #36393f !important;
    border-color: #40444b !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .card-header {
    background: #5865F2 !important;
    color: white !important;
}

[data-bs-theme="dark"] .stat-card,
[data-bs-theme="dark"] .data-section {
    background: #36393f !important;
    color: #ffffff !important;
    border-color: #40444b;
}

[data-bs-theme="dark"] .server-header {
    background: linear-gradient(135deg, #2f3136 0%, #36393f 100%) !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .list-group-item {
    background: #36393f !important;
    border-color: #40444b !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .list-group-item:hover {
    background: #40444b !important;
}

[data-bs-theme="dark"] .list-group-item.active {
    background: var(--discord-blue) !important;
    border-color: var(--discord-blue) !important;
    color: white !important;
}

[data-bs-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-color: #ffffff;
}

[data-bs-theme="dark"] .data-table th {
    background: #36393f !important;
    color: #ffffff !important;
    border-color: #40444b !important;
}

[data-bs-theme="dark"] .data-table td {
    background: #2f3136 !important;
    color: #ffffff !important;
    border-color: #40444b !important;
}

[data-bs-theme="dark"] .data-table tr:hover {
    background: #40444b !important;
}

[data-bs-theme="dark"] .alert {
    background: #36393f !important;
    border-color: #40444b !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .alert-info {
    background: #1c3d5a !important;
    border-color: #2a4d6d !important;
}

[data-bs-theme="dark"] .alert-warning {
    background: #4d3c1a !important;
    border-color: #6d5526 !important;
}

[data-bs-theme="dark"] .alert-danger {
    background: #5a1c1c !important;
    border-color: #7d2626 !important;
}

[data-bs-theme="dark"] .form-control {
    background: #36393f !important;
    border-color: #40444b !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .form-control:focus {
    background: #36393f !important;
    border-color: #5865F2 !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 0.2rem rgba(88, 101, 242, 0.25) !important;
}

[data-bs-theme="dark"] .input-group-text {
    background: #40444b !important;
    border-color: #40444b !important;
    color: #b9bbbe !important;
}

[data-bs-theme="dark"] .progress {
    background: #40444b !important;
}

[data-bs-theme="dark"] .btn-outline-primary {
    color: #7289da !important;
    border-color: #7289da !important;
}

[data-bs-theme="dark"] .btn-outline-primary:hover {
    background: #7289da !important;
    color: white !important;
}

[data-bs-theme="dark"] .btn-outline-secondary {
    color: #b9bbbe !important;
    border-color: #b9bbbe !important;
}

[data-bs-theme="dark"] .btn-outline-secondary:hover {
    background: #b9bbbe !important;
    color: #36393f !important;
}

[data-bs-theme="dark"] .text-muted {
    color: #b9bbbe !important;
}

/* ===== ANIMATIONS & TRANSITIONS ===== */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.skeleton-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

[data-bs-theme="dark"] .skeleton-loading {
    background: linear-gradient(90deg, #2f3136 25%, #40444b 50%, #2f3136 75%);
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== ENHANCED COMPONENT STYLES ===== */
/* Progress bars in tables */
.progress {
    height: 20px;
    border-radius: 10px;
    background: #e9ecef;
}

[data-bs-theme="dark"] .progress {
    background: #40444b;
}

.progress-bar {
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 20px;
}

/* Badge enhancements */
.badge-premium {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: #000;
    font-weight: 600;
}

/* User rank highlighting */
.user-rank-1 {
    background: linear-gradient(45deg, rgba(255,215,0,0.1), rgba(255,165,0,0.1)) !important;
}

.user-rank-2 {
    background: rgba(108,117,125,0.1) !important;
}

.user-rank-3 {
    background: rgba(13,202,240,0.1) !important;
}

[data-bs-theme="dark"] .user-rank-1 {
    background: linear-gradient(45deg, rgba(255,215,0,0.2), rgba(255,165,0,0.2)) !important;
}

[data-bs-theme="dark"] .user-rank-2 {
    background: rgba(108,117,125,0.2) !important;
}

[data-bs-theme="dark"] .user-rank-3 {
    background: rgba(13,202,240,0.2) !important;
}

/* ===== MOBILE ENHANCEMENTS ===== */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background: var(--primary-red);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    color: white;
    box-shadow: var(--shadow-medium);
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease-in-out;
        overflow-y: auto;
        background: white;
        padding: 20px;
        box-shadow: var(--shadow-medium);
    }
    
    [data-bs-theme="dark"] .sidebar {
        background: var(--bg-secondary);
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .quick-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .server-content {
        margin-top: 60px;
        padding: 15px;
    }
    
    .data-table {
        font-size: 0.8rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 10px;
    }
}

/* ===== CHART CONTAINERS ===== */
.chart-container {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-light);
}

[data-bs-theme="dark"] .chart-container {
    background: var(--bg-tertiary);
}

/* ===== ENHANCED INTERACTION STATES ===== */
.btn {
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.list-group-item {
    transition: all 0.2s ease;
}

.stat-card {
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

/* ===== SCROLLBAR STYLING ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-track {
    background: #2f3136;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #40444b;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #4f545c;
}