/**
 * ═══════════════════════════════════════════════════════════════════════════════
 * 📈 SERVER ANALYTICS - STYLES
 * ═══════════════════════════════════════════════════════════════════════════════
 */

/* ═══════════════════════════════════════════════════════════════════════════════
   RESET + GRUNDLAGEN
   ═══════════════════════════════════════════════════════════════════════════════ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0d1117 0%, #161b22 50%, #0d1117 100%);
    min-height: 100vh;
    color: #e6edf3;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   CONTAINER
   ═══════════════════════════════════════════════════════════════════════════════ */

.analytics-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 15px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════════════════════ */

.analytics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(30, 40, 55, 0.9);
    border-radius: 12px;
    border: 1px solid rgba(0, 255, 153, 0.2);
    margin-bottom: 15px;
    backdrop-filter: blur(10px);
}

.analytics-header h1 {
    font-size: 24px;
    color: #00ff99;
    text-shadow: 0 0 20px rgba(0, 255, 153, 0.3);
}

.analytics-header .subtitle {
    font-size: 12px;
    color: #8b949e;
    display: block;
    margin-top: 2px;
}

.btn-back {
    background: rgba(88, 166, 255, 0.15);
    border: 1px solid rgba(88, 166, 255, 0.4);
    color: #58a6ff;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-back:hover {
    background: rgba(88, 166, 255, 0.25);
    transform: translateX(-2px);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   KATEGORIE TABS
   ═══════════════════════════════════════════════════════════════════════════════ */

.category-tabs {
    display: flex;
    gap: 5px;
    padding: 10px 15px;
    background: rgba(13, 17, 23, 0.9);
    border-radius: 12px;
    border: 1px solid rgba(48, 54, 61, 0.5);
    margin-bottom: 15px;
    overflow-x: auto;
}

.tab-btn {
    background: rgba(48, 54, 61, 0.5);
    border: 1px solid rgba(48, 54, 61, 0.8);
    color: #8b949e;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: rgba(88, 166, 255, 0.15);
    border-color: rgba(88, 166, 255, 0.4);
    color: #58a6ff;
}

.tab-btn.active {
    background: rgba(0, 255, 153, 0.15);
    border-color: rgba(0, 255, 153, 0.5);
    color: #00ff99;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   PERIOD BAR
   ═══════════════════════════════════════════════════════════════════════════════ */

.period-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 15px;
    background: rgba(13, 17, 23, 0.8);
    border-radius: 10px;
    border: 1px solid rgba(48, 54, 61, 0.5);
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.period-label {
    color: #8b949e;
    font-size: 13px;
    font-weight: 500;
}

.period-buttons {
    display: flex;
    gap: 5px;
}

.btn-period {
    background: rgba(48, 54, 61, 0.6);
    border: 1px solid rgba(48, 54, 61, 0.8);
    color: #8b949e;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.btn-period:hover {
    background: rgba(88, 166, 255, 0.15);
    border-color: rgba(88, 166, 255, 0.4);
    color: #58a6ff;
}

.btn-period.active {
    background: rgba(0, 255, 153, 0.15);
    border-color: rgba(0, 255, 153, 0.5);
    color: #00ff99;
}

.auto-refresh {
    margin-left: auto;
    font-size: 12px;
    color: #8b949e;
}

.auto-refresh input {
    accent-color: #00ff99;
    margin-right: 5px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   STATS CARDS
   ═══════════════════════════════════════════════════════════════════════════════ */

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(13, 17, 23, 0.9);
    border-radius: 10px;
    border: 1px solid rgba(48, 54, 61, 0.5);
    padding: 12px 15px;
}

.stat-card.peak {
    border-color: rgba(0, 255, 153, 0.3);
    background: rgba(0, 255, 153, 0.05);
}

.stat-icon {
    font-size: 20px;
    opacity: 0.8;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 11px;
    color: #8b949e;
    text-transform: uppercase;
}

.stat-value {
    font-size: 20px;
    font-weight: bold;
    color: #e6edf3;
}

.stat-card.peak .stat-value {
    color: #00ff99;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   TAB CONTENT
   ═══════════════════════════════════════════════════════════════════════════════ */

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   CHART SECTIONS
   ═══════════════════════════════════════════════════════════════════════════════ */

.chart-section {
    background: rgba(13, 17, 23, 0.9);
    border-radius: 12px;
    border: 1px solid rgba(48, 54, 61, 0.5);
    padding: 15px;
    margin-bottom: 15px;
}

.chart-section.small {
    padding: 12px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(48, 54, 61, 0.4);
}

.chart-header h2 {
    font-size: 14px;
    font-weight: 600;
    color: #e6edf3;
}

.chart-container {
    min-height: 350px;
}

.chart-container.small {
    min-height: 280px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   CHART GRID (2-Spalten)
   ═══════════════════════════════════════════════════════════════════════════════ */

.chart-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   LOADING OVERLAY
   ═══════════════════════════════════════════════════════════════════════════════ */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(13, 17, 23, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: #8b949e;
    z-index: 1000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 255, 153, 0.2);
    border-top-color: #00ff99;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════════════════════ */

.analytics-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    font-size: 11px;
    color: #484f58;
}

.analytics-footer a {
    color: #58a6ff;
    text-decoration: none;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .analytics-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .category-tabs {
        justify-content: flex-start;
        padding: 8px 10px;
    }

    .tab-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .period-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .period-buttons {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
    }

    .auto-refresh {
        margin-left: 0;
        margin-top: 5px;
    }

    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .chart-grid-2 {
        grid-template-columns: 1fr;
    }

    .chart-container {
        min-height: 280px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   APEXCHARTS OVERRIDES
   ═══════════════════════════════════════════════════════════════════════════════ */

.apexcharts-tooltip {
    background: rgba(13, 17, 23, 0.95) !important;
    border: 1px solid rgba(48, 54, 61, 0.8) !important;
    border-radius: 8px !important;
}

.apexcharts-tooltip-title {
    background: rgba(30, 40, 55, 0.9) !important;
    border-bottom: 1px solid rgba(48, 54, 61, 0.5) !important;
}

.apexcharts-menu {
    background: rgba(13, 17, 23, 0.95) !important;
    border: 1px solid rgba(48, 54, 61, 0.8) !important;
}

.apexcharts-menu-item:hover {
    background: rgba(88, 166, 255, 0.2) !important;
}

.apexcharts-legend-text {
    color: #8b949e !important;
}
