/* ============================================================
   status.css – Styles for status.html
   Requires: css/style.css (base theme, nav, footer, buttons)
   ============================================================ */

/* ── Hero ──────────────────────────────────────────────────── */
.status-hero {
    padding: 110px 0 40px;
    position: relative;
    z-index: 1;
}

.status-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 50% at 50% 0%, rgba(79, 142, 247, 0.12), transparent 70%);
    pointer-events: none;
}

.status-hero__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    flex-wrap: wrap;
}

.status-page-tag {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.status-hero__title {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 900;
    letter-spacing: -1.5px;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.status-hero__sub {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Overall status banner */
.status-overall {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 16px;
    padding: 18px 24px;
    transition: background 0.4s, border-color 0.4s;
    min-width: 280px;
}

.status-overall--ok {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.2);
}

.status-overall--warn {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.2);
}

.status-overall--down {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
}

.status-overall__icon {
    font-size: 2rem;
    line-height: 1;
}

.status-overall__label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.status-overall__sub {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Summary bar ───────────────────────────────────────────── */
.summary-bar {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(20px);
    position: sticky;
    top: 64px;
    z-index: 50;
}

.summary-bar__inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    flex-wrap: wrap;
}

.summary-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 14px;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.summary-pill--up {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.summary-pill--warn {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.summary-pill--down {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.pill-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pill-dot--up {
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
    animation: blink 2s infinite;
}

.pill-dot--warn {
    background: #f59e0b;
}

.pill-dot--down {
    background: #ef4444;
}

.summary-refresh {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: auto;
}

.refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.82rem;
    cursor: pointer;
    transition: var(--transition);
}

.refresh-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.spinning {
    animation: spin 0.6s linear;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.auto-refresh-label {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ── Main content ──────────────────────────────────────────── */
.status-main {
    padding: 48px 0 80px;
}

.status-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-muted);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

/* ── Service grid ──────────────────────────────────────────── */
.service-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 56px;
}

@media (max-width: 800px) {
    .service-grid {
        grid-template-columns: 1fr;
    }
}

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 24px;
    backdrop-filter: blur(20px);
    transition: border-color var(--transition), transform var(--transition);
}

.service-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.service-card__header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.service-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.service-icon--cp {
    background: rgba(249, 115, 22, 0.12);
    border: 1px solid rgba(249, 115, 22, 0.2);
}

.service-icon--ts {
    background: rgba(79, 142, 247, 0.12);
    border: 1px solid rgba(79, 142, 247, 0.2);
}

.service-icon--web {
    background: rgba(34, 211, 238, 0.12);
    border: 1px solid rgba(34, 211, 238, 0.2);
}

.service-icon--cdn {
    background: rgba(168, 85, 247, 0.12);
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.service-icon--wg {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.service-icon--img {
    background: rgba(244, 63, 94, 0.12);
    border: 1px solid rgba(244, 63, 94, 0.2);
}

.service-card__info {
    flex: 1;
    min-width: 0;
}

.service-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
}

.service-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Status badge */
.service-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
    transition: all 0.4s ease;
    flex-shrink: 0;
}

.status-up {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.25);
    color: #10b981;
}

.status-warn {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.25);
    color: #f59e0b;
}

.status-down {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.25);
    color: #ef4444;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: blink 2s infinite;
}

/* Metrics row */
.service-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.metric {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
}

.metric-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.metric-val {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
}

.uptime-val {
    color: #10b981;
}

/* Uptime bar */
.uptime-bar-wrap {
    margin-bottom: 10px;
}

.uptime-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.73rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.uptime-bar {
    display: flex;
    gap: 2px;
    height: 28px;
    border-radius: 6px;
    overflow: hidden;
}

.seg {
    flex: 1;
    border-radius: 2px;
    transition: opacity 0.2s;
    cursor: default;
}

.seg:hover {
    opacity: 0.7;
}

.seg-up {
    background: #10b981;
}

.seg-warn {
    background: #f59e0b;
}

.seg-down {
    background: #ef4444;
}

/* Response meter */
.response-meter {
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
}

.response-meter__bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.6s ease, background 0.4s ease;
}

/* ── History grid ──────────────────────────────────────────── */
.history-section {
    margin-bottom: 56px;
}

.history-grid {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
}

.hist-cell {
    width: 16px;
    height: 24px;
    border-radius: 3px;
    cursor: default;
    transition: opacity 0.2s, transform 0.2s;
    position: relative;
}

.hist-cell:hover {
    opacity: 0.75;
    transform: scaleY(1.15);
}

.hist-up {
    background: #10b981;
}

.hist-warn {
    background: #f59e0b;
}

.hist-down {
    background: #ef4444;
}

.hist-legend {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ── Incidents ─────────────────────────────────────────────── */
.incident-section {
    margin-bottom: 56px;
}

.incident-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.incident-item {
    display: flex;
    gap: 20px;
    padding: 28px 0;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.incident-item:last-child {
    border-bottom: none;
}

.incident-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
    position: relative;
    z-index: 1;
}

.incident-dot--resolved {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.incident-dot--active {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
    animation: blink 1.5s infinite;
}

.incident-dot--warn {
    background: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

/* Connector line between dots */
.incident-item:not(:last-child) .incident-dot::after {
    content: '';
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    background: var(--border);
    bottom: calc(-28px - 100%);
}

.incident-body {
    flex: 1;
    min-width: 0;
}

.incident-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.incident-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.incident-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.incident-status-pill {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 14px;
}

.pill-resolved {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #10b981;
}

.pill-active {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #ef4444;
}

.pill-warn {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: #f59e0b;
}

.incident-updates {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.incident-update {
    display: flex;
    gap: 14px;
    font-size: 0.855rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.update-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-shrink: 0;
    min-width: 60px;
}

.incident-none {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.incident-none-icon {
    font-size: 1.5rem;
}

/* ── Infrastructure ────────────────────────────────────────── */
.infra-section {
    margin-bottom: 16px;
}

.infra-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 800px) {
    .infra-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .infra-grid {
        grid-template-columns: 1fr;
    }
}

.infra-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    transition: border-color var(--transition), transform var(--transition);
}

.infra-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.infra-card__icon {
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.infra-card__title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.infra-card__val {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.infra-card__sub {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 640px) {
    .status-hero {
        padding: 90px 0 32px;
    }

    .status-hero__inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .status-overall {
        width: 100%;
    }

    .summary-bar__inner {
        gap: 8px;
    }

    .summary-refresh {
        width: 100%;
        justify-content: space-between;
    }

    .service-metrics {
        grid-template-columns: repeat(2, 1fr);
    }

    .hist-cell {
        width: 12px;
    }

    .incident-update {
        flex-direction: column;
        gap: 3px;
    }

    .update-time {
        min-width: unset;
    }
}