:root {
    --bg-color: #1a1b1e;
    --card-bg: #25262b;
    --text-color: #c1c2c5;
    --heading-color: #fff;
    --success: #40c057;
    --danger: #fa5252;
    --warning: #fab005;
    --border-color: #2c2e33;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 2rem;
    line-height: 1.5;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

header {
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    color: var(--heading-color);
    margin: 0;
    font-size: 1.5rem;
}

.refresh-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.refresh-btn:hover {
    background: #2c2e33;
    color: var(--heading-color);
}

.status-grid {
    display: grid;
    gap: 1rem;
}

.site-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    align-items: start;
    /* Changed from center to start for headers alignment */
    border: 1px solid var(--border-color);
    gap: 1rem;
    /* Added gap for better spacing */
}

.site-info h2 {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    color: var(--heading-color);
}

.site-url {
    font-size: 0.85rem;
    color: #909296;
    text-decoration: none;
}

.site-url:hover {
    text-decoration: underline;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-weight: 600;
    font-size: 0.85rem;
}

.status-up {
    background: rgba(64, 192, 87, 0.15);
    color: var(--success);
}

.status-down {
    background: rgba(250, 82, 82, 0.15);
    color: var(--danger);
}

.metric {
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
}

.metric-label {
    color: #909296;
    margin-bottom: 0.25rem;
}

.metric-value {
    color: var(--heading-color);
    font-weight: 500;
}

.history-graph {
    display: flex;
    align-items: flex-end;
    height: 30px;
    gap: 2px;
    grid-column: 1 / -1;
    /* Make graph span full width */
    margin-top: 1rem;
}

.history-bar {
    flex: 1;
    background: var(--border-color);
    border-radius: 1px;
    min-width: 4px;
    transition: opacity 0.2s;
}

.history-bar.up {
    background: var(--success);
}

.history-bar.down {
    background: var(--danger);
}

.history-bar:hover {
    opacity: 0.8;
}

/* Headers Section */
.headers-section {
    grid-column: 1 / -1;
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    margin-top: 0.5rem;
}

details summary {
    cursor: pointer;
    color: #909296;
    user-select: none;
}

details summary:hover {
    color: var(--text-color);
}

.headers-content {
    margin-top: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.5rem;
    border-radius: 4px;
    font-family: monospace;
    overflow-x: auto;
}

.header-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.header-key {
    color: #909296;
    font-weight: bold;
    min-width: 120px;
}

.header-value {
    color: var(--text-color);
    word-break: break-all;
}

@media (max-width: 768px) {
    .site-card {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}