:root {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-card: rgba(20, 20, 20, 0.8);
    --bg-card-hover: rgba(30, 30, 30, 0.9);
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #6a6a7a;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border-color: rgba(255, 255, 255, 0.08);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

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

/* Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    pointer-events: none;
    z-index: -1;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
.header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 3rem;
    text-align: center;
}

.logo {
    width: 120px;
    height: 120px;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.3));
    transition: var(--transition);
}

.logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 30px rgba(99, 102, 241, 0.5));
}

.site-title {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.site-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 400;
}

/* Navigation */
.nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.nav-link {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.nav-link:hover,
.nav-link.active {
    background: var(--accent-gradient);
    color: var(--text-primary);
    border-color: transparent;
    box-shadow: var(--shadow-glow);
}

/* Card */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-glow);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

/* Table */
.status-table {
    width: 100%;
    border-collapse: collapse;
}

.status-table th,
.status-table td {
    padding: 1rem 1.25rem;
    text-align: left;
}

.status-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

.status-table tbody tr {
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
}

.status-table tbody tr:last-child {
    border-bottom: none;
}

.status-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.domain-cell {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.ip-count {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.last-check {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.node-count {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    min-width: 85px;
    text-align: center;
}

.status-table td:nth-child(2),
.status-table td:nth-child(3) {
    white-space: nowrap;
}

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

.status-badge.degraded {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

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

.status-badge.loading {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary);
}

.status-badge.no-data {
    background: rgba(107, 114, 128, 0.15);
    color: #9ca3af;
}

.status-icon {
    font-size: 1rem;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Chart Container */
.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer a {
    color: var(--accent-primary);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Filter Controls */
.filter-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-select {
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

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

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .site-title {
        font-size: 1.75rem;
    }

    .status-table th,
    .status-table td {
        padding: 0.75rem;
    }

    .domain-cell {
        font-size: 0.85rem;
    }

    .nav-link {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

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

@media (max-width: 480px) {

    .status-table th,
    .status-table td {
        padding: 0.5rem;
        font-size: 0.8rem;
    }

    .status-badge {
        min-width: 70px;
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }

    .domain-cell {
        font-size: 0.7rem;
        word-break: break-all;
    }

    .node-count {
        font-size: 0.75rem;
    }
}