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

:root {
    --green: #3bd671;
    --green-bg: #e8f9ef;
    --amber: #f5a623;
    --amber-bg: #fef6e7;
    --red: #e74c3c;
    --red-bg: #fdecea;
    --blue: #3b82f6;
    --blue-bg: #eff6ff;
    --gray: #94a3b8;
    --gray-bg: #f1f5f9;
    --text: #1e293b;
    --text-secondary: #64748b;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 32px 16px;
}

/* ── Header ──────────────────────────────────────────── */
.site-header {
    text-align: center;
    margin-bottom: 32px;
}
.site-logo {
    max-height: 56px;
    margin-bottom: 10px;
}
.site-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
}
.env-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 10px;
    border-radius: 12px;
    margin-top: 4px;
}
.env-dev {
    background: var(--amber-bg);
    color: #b45309;
}
.env-prod {
    background: var(--green-bg);
    color: #15803d;
}

/* ── Status Banner ───────────────────────────────────── */
.status-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 24px;
    border-radius: var(--radius);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 28px;
}
.banner-up { background: var(--green-bg); color: #15803d; }
.banner-degraded { background: var(--amber-bg); color: #b45309; }
.banner-down { background: var(--red-bg); color: #dc2626; }
.banner-unknown { background: var(--gray-bg); color: var(--text-secondary); }

.status-icon::before {
    display: inline-block;
    font-size: 1.2em;
}
.banner-up .status-icon::before { content: '\2713'; }
.banner-degraded .status-icon::before { content: '\26A0'; }
.banner-down .status-icon::before { content: '\2715'; }
.banner-unknown .status-icon::before { content: '?'; }

/* ── Section Headings ────────────────────────────────── */
section h2 {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
}

/* ── Service Rows ────────────────────────────────────── */
.services-section {
    margin-bottom: 32px;
}
.service-row {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 8px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s;
}
.service-row:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.service-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.service-name {
    font-weight: 600;
    flex-grow: 1;
}
.service-status-text {
    font-size: 0.85rem;
    font-weight: 500;
}
.response-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--gray-bg);
    padding: 2px 8px;
    border-radius: 10px;
}

/* Status dots with pulse */
.status-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.status-up { background: var(--green); box-shadow: 0 0 0 0 rgba(59,214,113,0.4); animation: pulse-green 2s infinite; }
.status-degraded { background: var(--amber); box-shadow: 0 0 0 0 rgba(245,166,35,0.4); animation: pulse-amber 2s infinite; }
.status-down { background: var(--red); box-shadow: 0 0 0 0 rgba(231,76,60,0.4); animation: pulse-red 2s infinite; }
.status-unknown { background: var(--gray); }

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(59,214,113,0.4); }
    70% { box-shadow: 0 0 0 6px rgba(59,214,113,0); }
    100% { box-shadow: 0 0 0 0 rgba(59,214,113,0); }
}
@keyframes pulse-amber {
    0% { box-shadow: 0 0 0 0 rgba(245,166,35,0.4); }
    70% { box-shadow: 0 0 0 6px rgba(245,166,35,0); }
    100% { box-shadow: 0 0 0 0 rgba(245,166,35,0); }
}
@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(231,76,60,0.4); }
    70% { box-shadow: 0 0 0 6px rgba(231,76,60,0); }
    100% { box-shadow: 0 0 0 0 rgba(231,76,60,0); }
}

/* ── 90-Day Uptime Bar ───────────────────────────────── */
.uptime-bar {
    display: flex;
    gap: 1px;
    height: 32px;
    margin-bottom: 4px;
    border-radius: 3px;
    overflow: hidden;
}
.bar-segment {
    flex: 1;
    min-width: 2px;
    cursor: pointer;
    position: relative;
    transition: opacity 0.15s;
}
.bar-segment:hover { opacity: 0.7; }
.bar-up { background: var(--green); }
.bar-degraded { background: var(--amber); }
.bar-down { background: var(--red); }
.bar-none { background: #e9ecef; }

.uptime-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-secondary);
    padding: 0 2px;
}
.uptime-pct {
    font-weight: 600;
    color: var(--text);
}

/* ── Maintenance ─────────────────────────────────────── */
.maintenance-section {
    margin-bottom: 28px;
}
.maintenance-card {
    background: var(--blue-bg);
    border: 1px solid #bfdbfe;
    border-left: 4px solid var(--blue);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 8px;
}
.maintenance-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.maintenance-header h3 {
    font-size: 1rem;
    font-weight: 600;
    flex-grow: 1;
}
.maintenance-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.maintenance-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.badge-maintenance { background: var(--blue-bg); color: #1d4ed8; }

/* ── Incidents ───────────────────────────────────────── */
.incidents-section {
    margin-bottom: 32px;
}
.incident-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 8px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--gray);
}
.incident-card.severity-minor { border-left-color: var(--amber); }
.incident-card.severity-major { border-left-color: #f97316; }
.incident-card.severity-critical { border-left-color: var(--red); }
.incident-card.resolved { border-left-color: var(--green); opacity: 0.85; }

.incident-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.incident-header h3 {
    font-size: 1rem;
    font-weight: 600;
    flex-grow: 1;
}
.incident-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Badges */
.badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.badge-minor { background: var(--amber-bg); color: #b45309; }
.badge-major { background: #fff7ed; color: #c2410c; }
.badge-critical { background: var(--red-bg); color: #dc2626; }
.badge-resolved { background: var(--green-bg); color: #15803d; }
.badge-status { background: var(--gray-bg); color: var(--text-secondary); }

/* Timeline */
.incident-timeline {
    margin-top: 12px;
    padding-left: 16px;
    border-left: 2px solid var(--border);
}
.timeline-entry {
    margin-bottom: 10px;
    padding-left: 8px;
}
.timeline-entry:last-child { margin-bottom: 0; }
.timeline-status {
    font-weight: 600;
    font-size: 0.85rem;
}
.timeline-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-left: 8px;
}
.timeline-entry p {
    margin-top: 2px;
    font-size: 0.9rem;
}

/* ── Footer ──────────────────────────────────────────── */
.site-footer {
    text-align: center;
    padding-top: 24px;
    margin-top: 8px;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.footer-refresh {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 4px;
    font-size: 0.75rem;
}
.refresh-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--green);
    animation: pulse-green 2s infinite;
}
