/* ==================== ОСНОВНЫЕ СТИЛИ ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --primary-light: #7f9cf5;
    --secondary: #764ba2;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --dark: #1f2937;
    --gray: #6b7280;
    --light: #f9fafb;
    --white: #ffffff;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1);
    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    --gradient-hover: linear-gradient(135deg, var(--primary-dark) 0%, #6b46a0 100%);
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--gradient);
    color: var(--dark);
    overflow-x: hidden;
    position: relative;
}

/* Анимированный фон */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="40" r="3" fill="rgba(255,255,255,0.1)"/><circle cx="40" cy="70" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="90" cy="80" r="4" fill="rgba(255,255,255,0.1)"/><circle cx="10" cy="90" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
    pointer-events: none;
    z-index: -1;
}

/* Курсор с эффектом свечения */
.cursor-glow {
    position: fixed;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(102,126,234,0.15) 0%, rgba(102,126,234,0) 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.1s;
    transform: translate(-50%, -50%);
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    width: 280px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: all 0.3s ease;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.logo {
    padding: 30px 20px;
    text-align: center;
    border-bottom: 2px solid #f0f0f0;
    position: relative;
    overflow: hidden;
}

.logo::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102,126,234,0.1), transparent);
    transition: left 0.5s;
}

.logo:hover::before {
    left: 100%;
}

.logo-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 28px;
    color: white;
    box-shadow: var(--shadow-lg);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.logo h2 {
    font-size: 20px;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
}

.logo p {
    color: var(--gray);
    font-size: 12px;
    font-weight: 500;
}

.nav-menu {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: var(--gray);
    text-decoration: none;
    transition: all 0.3s ease;
    margin: 4px 12px;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.nav-item i {
    font-size: 20px;
    margin-right: 12px;
    width: 24px;
    transition: transform 0.3s;
}

.nav-item span {
    font-weight: 500;
}

.nav-indicator {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--gradient);
    border-radius: 3px;
    transition: height 0.3s;
}

.nav-item:hover {
    background: #f7f7f7;
    color: var(--primary);
    transform: translateX(5px);
}

.nav-item:hover i {
    transform: scale(1.1);
}

.nav-item.active {
    background: var(--gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

.nav-item.active .nav-indicator {
    height: 20px;
}

.server-info {
    padding: 20px;
    border-top: 1px solid #e5e7eb;
}

.status-card {
    background: #f7f7f7;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 5px var(--success);
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.ping-info {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--gray);
}

.ping-info i {
    font-size: 12px;
}

.server-id {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--gray);
    background: #f7f7f7;
    padding: 8px 12px;
    border-radius: 8px;
}

.server-id code {
    font-family: monospace;
    font-size: 10px;
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 20px;
    min-height: 100vh;
}

.top-bar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px 30px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255,255,255,0.2);
}

.page-title h1 {
    font-size: 24px;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
}

.page-title p {
    font-size: 13px;
    color: var(--gray);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.refresh-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--gray);
}

.refresh-info i {
    font-size: 14px;
}

.refresh-btn {
    background: var(--gradient);
    border: none;
    padding: 8px 20px;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.refresh-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

/* ==================== PAGES ==================== */
.page {
    display: none;
    animation: fadeInUp 0.5s ease;
}

.page.active {
    display: block;
}

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

/* ==================== STATS CARDS ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    align-items: center;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
    animation: slideIn 0.5s ease forwards;
    opacity: 0;
    transform: translateX(-20px);
}

.stat-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.stat-icon {
    position: relative;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
}

.stat-icon i {
    font-size: 32px;
    color: var(--primary);
    z-index: 1;
}

.stat-icon-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(102,126,234,0.1);
    border-radius: 15px;
    animation: pulseBg 2s ease-in-out infinite;
}

@keyframes pulseBg {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--gray);
    margin-top: 5px;
    font-weight: 500;
}

.stat-trend {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
}

.stat-trend.positive {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stat-trend.neutral {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

/* ==================== CHARTS ==================== */
.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 1200px) {
    .charts-row {
        grid-template-columns: 1fr;
    }
}

.chart-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    transition: all 0.3s ease;
}

.chart-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-header h3 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-header h3 i {
    color: var(--primary);
}

.chart-container {
    position: relative;
    height: 300px;
}

.chart-container.large {
    height: 400px;
}

.chart-controls {
    display: flex;
    gap: 8px;
}

.chart-btn {
    background: #f3f4f6;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.chart-btn.active {
    background: var(--gradient);
    color: white;
}

.chart-btn:hover:not(.active) {
    background: #e5e7eb;
}

/* Tooltip */
.info-tooltip {
    position: relative;
    cursor: help;
}

.tooltip-text {
    visibility: hidden;
    background: var(--dark);
    color: white;
    text-align: center;
    padding: 5px 10px;
    border-radius: 6px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s;
}

.info-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* ==================== TABLES ==================== */
.table-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.table-header h3 {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    background: #f3f4f6;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.action-btn:hover {
    background: var(--gradient);
    color: white;
    transform: scale(1.05);
}

.stats-badge {
    background: var(--gradient);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
}

.data-table th {
    padding: 15px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table th i {
    margin-right: 5px;
    font-size: 12px;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
}

.data-table tbody tr {
    transition: all 0.3s;
}

.data-table tbody tr:hover {
    background: rgba(102,126,234,0.05);
    transform: scale(1.01);
}

/* Progress Bar */
.progress-container {
    width: 100%;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success), var(--warning), var(--danger));
    transition: width 0.5s ease;
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    font-size: 11px;
    color: var(--gray);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.active {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.status-badge.expired {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-badge.online {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-badge i {
    font-size: 8px;
}

/* ==================== FILTERS ==================== */
.filter-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-wrapper {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-wrapper i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
}

.search-input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.filter-select {
    padding: 10px 15px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* ==================== MODERATORS LIST ==================== */
.moderators-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.moderator-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f9fafb;
    border-radius: 12px;
    transition: all 0.3s;
    cursor: pointer;
}

.moderator-item:hover {
    transform: translateX(5px);
    background: #f3f4f6;
}

.moderator-name {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.moderator-name i {
    color: var(--primary);
}

.moderator-count {
    background: var(--gradient);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* Reasons List */
.reasons-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reason-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f9fafb;
    border-radius: 12px;
}

.reason-text {
    font-size: 14px;
    color: var(--dark);
}

.reason-count {
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* ==================== SETTINGS ==================== */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.settings-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
}

.settings-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-card h3 i {
    color: var(--primary);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.setting-item label {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.setting-item label i {
    color: var(--primary);
    width: 20px;
}

.setting-item code {
    background: #f3f4f6;
    padding: 4px 10px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 12px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.info-label {
    font-weight: 500;
    color: var(--gray);
}

.info-value {
    font-weight: 600;
    color: var(--dark);
}

/* ==================== LOADER ==================== */
.loader {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f4f6;
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    text-align: center;
    color: var(--gray);
    padding: 40px;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .sidebar {
        width: 80px;
    }
    
    .sidebar .logo h2,
    .sidebar .logo p,
    .sidebar .nav-item span,
    .sidebar .server-info .status-card span:not(.status-dot),
    .sidebar .server-id span,
    .sidebar .ping-info span:first-child {
        display: none;
    }
    
    .sidebar .nav-item i {
        margin-right: 0;
    }
    
    .sidebar .nav-item {
        justify-content: center;
    }
    
    .main-content {
        margin-left: 80px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .top-bar {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .filter-bar {
        flex-direction: column;
    }
}

/* ==================== ANIMATIONS ==================== */
@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px var(--primary); }
    50% { box-shadow: 0 0 20px var(--primary); }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}