:root {
    --bg-gradient: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    --card-bg: rgba(15, 23, 42, 0.75);
    --muted: rgba(226, 232, 240, 0.6);
    --accent: #38bdf8;
    --success: #4ade80;
    --danger: #f87171;
    --warning: #facc15;
    --purple: #a78bfa;
    --pink: #f472b6;
    --orange: #fb923c;
}

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

body {
    min-height: 100vh;
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg-gradient);
    color: #f8fafc;
    padding: 2rem;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

header h1 {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.live-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(74, 222, 128, 0.15);
    border: 1px solid rgba(74, 222, 128, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    color: var(--success);
}

.live-badge .dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

.summary-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.card {
    backdrop-filter: blur(14px);
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.card.accent-response {
    border-left: 3px solid var(--pink);
}

.card.accent-dns {
    border-left: 3px solid var(--success);
}

.card.accent-tcp {
    border-left: 3px solid var(--warning);
}

.card.accent-ssl {
    border-left: 3px solid var(--purple);
}

.card.accent-ttfb {
    border-left: 3px solid var(--accent);
}

.card.accent-total {
    border-left: 3px solid var(--orange);
}

.card.primary {
    background: linear-gradient(135deg, rgba(244, 114, 182, 0.2), rgba(15, 23, 42, 0.75));
    border: 1px solid rgba(244, 114, 182, 0.3);
}

.card h2 {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.card strong {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
}

.card.primary strong {
    font-size: 2rem;
    color: var(--pink);
}

.card span {
    display: block;
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.8rem;
}

.charts-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.chart-card {
    padding: 1.5rem;
}

.chart-title {
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 1rem;
}

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

.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--muted);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
}

.table-card {
    overflow: hidden;
}

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

thead {
    color: var(--muted);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

th, td {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    text-align: left;
}

th:not(:first-child), td:not(:first-child) {
    text-align: right;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: rgba(148, 163, 184, 0.05);
}

.endpoint-name {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--accent);
}

.status-chip {
    display: inline-block;
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(148, 163, 184, 0.1);
}

.status-chip.success {
    color: var(--success);
    background: rgba(74, 222, 128, 0.1);
    border-color: rgba(74, 222, 128, 0.2);
}

.status-chip.danger {
    color: var(--danger);
    background: rgba(248, 113, 113, 0.1);
    border-color: rgba(248, 113, 113, 0.2);
}

.scroll-area {
    max-height: 350px;
    overflow-y: auto;
}

.scroll-area::-webkit-scrollbar {
    width: 5px;
}

.scroll-area::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.2);
    border-radius: 3px;
}

.timing-bar {
    display: flex;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    background: rgba(148, 163, 184, 0.1);
    min-width: 120px;
}

.timing-bar .dns {
    background: var(--success);
}

.timing-bar .tcp {
    background: var(--warning);
}

.timing-bar .ssl {
    background: var(--purple);
}

.timing-bar .response {
    background: var(--pink);
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
    font-size: 0.75rem;
    color: var(--muted);
}

.legend span {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.legend .dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

footer {
    text-align: center;
    color: var(--muted);
    font-size: 0.8rem;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

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