@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: #1a1f35;
    --bg-card-hover: #222847;
    --border-color: #2a3050;
    --text-primary: #e8ecf4;
    --text-secondary: #8892a8;
    --text-muted: #5a6480;
    --accent-blue: #3b82f6;
    --accent-blue-glow: rgba(59, 130, 246, 0.3);
    --accent-green: #10b981;
    --accent-green-glow: rgba(16, 185, 129, 0.3);
    --accent-amber: #f59e0b;
    --accent-amber-glow: rgba(245, 158, 11, 0.3);
    --accent-purple: #8b5cf6;
    --accent-purple-glow: rgba(139, 92, 246, 0.3);
    --accent-red: #ef4444;
    --accent-red-glow: rgba(239, 68, 68, 0.3);
    --accent-cyan: #06b6d4;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-glow-blue: 0 0 20px rgba(59, 130, 246, 0.15);
    --shadow-glow-green: 0 0 20px rgba(16, 185, 129, 0.15);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(59, 130, 246, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(6, 182, 212, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(255, 255, 255, 0.003) 2px,
        rgba(255, 255, 255, 0.003) 4px
    );
    pointer-events: none;
    z-index: 9999;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px;
    position: relative;
    z-index: 1;
}

/* ===== NAVBAR ===== */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.beacon-icon {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-blue);
}

.beacon-icon svg {
    width: 24px;
    height: 24px;
    position: relative;
    z-index: 1;
}

.beacon-glow {
    position: absolute;
    inset: -4px;
    background: radial-gradient(circle, var(--accent-blue-glow), transparent 70%);
    border-radius: 50%;
    animation: beacon-pulse 3s ease-in-out infinite;
}

@keyframes beacon-pulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.3); }
}

.nav-title {
    display: flex;
    flex-direction: column;
}

.title-main {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.5px;
}

.title-sub {
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.nav-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-green);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-green-glow);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--accent-green-glow); }
    50% { opacity: 0.5; box-shadow: 0 0 16px var(--accent-green-glow); }
}

.update-time {
    color: var(--text-muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

/* ===== HERO ===== */
.hero {
    text-align: center;
    padding: 48px 0 32px;
    animation: fadeInUp 0.6s ease backwards;
}

.hero-beacon {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-ring {
    position: absolute;
    border-radius: 50%;
    border: 1.5px solid rgba(59, 130, 246, 0.15);
}

.hero-ring-1 {
    inset: 0;
    animation: ring-rotate 12s linear infinite;
    border-style: dashed;
}

.hero-ring-2 {
    inset: 20px;
    border-color: rgba(6, 182, 212, 0.12);
    animation: ring-rotate 8s linear infinite reverse;
}

.hero-ring-3 {
    inset: 40px;
    border-color: rgba(139, 92, 246, 0.1);
    animation: ring-rotate 16s linear infinite;
}

@keyframes ring-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.hero-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.hero-number {
    font-size: 56px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 40px var(--accent-blue-glow);
}

.hero-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 500;
}

.hero-sub {
    font-size: 15px;
    color: var(--text-secondary);
}

.hero-sub strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

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

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.card-total::before { background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan)); }
.card-total:hover { box-shadow: var(--shadow), var(--shadow-glow-blue); }

.card-online::before { background: linear-gradient(90deg, var(--accent-green), #34d399); }
.card-online:hover { box-shadow: var(--shadow), var(--shadow-glow-green); }

.card-rate::before { background: linear-gradient(90deg, var(--accent-amber), #fbbf24); }
.card-rate:hover { box-shadow: var(--shadow), 0 0 20px var(--accent-amber-glow); }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-total .stat-icon { background: rgba(59, 130, 246, 0.12); color: var(--accent-blue); }
.card-online .stat-icon { background: rgba(16, 185, 129, 0.12); color: var(--accent-green); }
.card-rate .stat-icon { background: rgba(245, 158, 11, 0.12); color: var(--accent-amber); }

.stat-icon svg {
    width: 24px;
    height: 24px;
}

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

.stat-value {
    font-size: 32px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.card-total .stat-value { color: var(--accent-blue); }
.card-online .stat-value { color: var(--accent-green); }
.card-rate .stat-value { color: var(--accent-amber); }

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

/* ===== SECTION CARD ===== */
.section-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.section-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 12px;
}

.section-header h3 {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.section-header h3 svg {
    color: var(--accent-blue);
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-input,
.filter-select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.search-input { width: 260px; }

.search-input:focus,
.filter-select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

.filter-select {
    cursor: pointer;
}

.search-input::placeholder {
    color: var(--text-muted);
}

/* ===== TABLE ===== */
.table-wrapper {
    overflow-x: auto;
}

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

.server-table thead th {
    padding: 14px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.server-table tbody tr {
    transition: background 0.15s;
    border-bottom: 1px solid rgba(42, 48, 80, 0.5);
}

.server-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

.server-table tbody td {
    padding: 14px 20px;
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-online {
    background: rgba(16, 185, 129, 0.12);
    color: var(--accent-green);
}

.status-online::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 6px var(--accent-green-glow);
}

.status-offline {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
}

.status-offline::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-red);
}

.server-id {
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    font-size: 12px;
    color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.08);
    padding: 3px 8px;
    border-radius: 4px;
}

.table-loading {
    text-align: center;
    color: var(--text-muted);
    padding: 40px !important;
    font-size: 14px;
}

.table-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 40px !important;
}

/* ===== FOOTER ===== */
.footer {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 12px;
    position: relative;
    z-index: 1;
}

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

.stat-card { animation: fadeInUp 0.5s ease backwards; }
.stat-card:nth-child(1) { animation-delay: 0.15s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.25s; }

.section-card { animation: fadeInUp 0.5s ease 0.35s backwards; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .container { padding: 16px; }
    .navbar { padding: 12px 16px; }
    .stats-grid { grid-template-columns: 1fr; gap: 12px; }
    .stat-card { padding: 18px; }
    .stat-value { font-size: 26px; }
    .section-header { flex-direction: column; align-items: flex-start; }
    .section-actions { width: 100%; flex-direction: column; }
    .search-input { width: 100%; }
    .hero-beacon { width: 160px; height: 160px; }
    .hero-number { font-size: 42px; }
    .hero { padding: 32px 0 24px; }
}

@media (max-width: 480px) {
    .nav-status { display: none; }
    .title-sub { display: none; }
    .hero-beacon { width: 130px; height: 130px; }
    .hero-number { font-size: 36px; }
}
