/* ==========================================================================
   BracketFlow // System Status & Start.gg API Monitor Styles
   Clean, authentic, developer-grade infrastructure dashboard (No AI neon glow)
   ========================================================================== */

:root {
    --status-bg: #0d0f12;
    --status-surface: #13161c;
    --status-surface-elevated: #181c24;
    --status-surface-hover: #1c212a;
    --status-border: #232832;
    --status-border-subtle: #1c2028;
    --status-border-hover: #333a48;
    
    /* Semantic Status Colors (Matte & Professional, no glowing halos) */
    --status-green: #22c55e;
    --status-green-bg: rgba(34, 197, 94, 0.1);
    --status-green-border: rgba(34, 197, 94, 0.25);

    --status-yellow: #f59e0b;
    --status-yellow-bg: rgba(245, 158, 11, 0.1);
    --status-yellow-border: rgba(245, 158, 11, 0.25);

    --status-red: #ef4444;
    --status-red-bg: rgba(239, 68, 68, 0.1);
    --status-red-border: rgba(239, 68, 68, 0.25);

    --status-gray: #64748b;
    --status-gray-bg: rgba(100, 116, 139, 0.1);
    --status-gray-border: rgba(100, 116, 139, 0.2);

    --status-brand: #c5a880;

    /* Text & Neutral Hierarchy */
    --status-text-primary: #f1f5f9;
    --status-text-secondary: #94a3b8;
    --status-text-muted: #64748b;
}

/* Custom selection */
::selection {
    background: rgba(197, 168, 128, 0.25);
    color: #f8fafc;
}

.status-container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 32px 20px 80px 20px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* --------------------------------------------------------------------------
   Hero Status Banner (Solid & Serious, No Neon Halos)
   -------------------------------------------------------------------------- */
.status-hero-card {
    background: var(--status-surface);
    border: 1px solid var(--status-border);
    border-radius: 12px;
    padding: 24px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.hero-status-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.hero-status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hero-pulse-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--status-green);
    display: inline-block;
}

.hero-pulse-ring {
    display: none; /* No artificial neon halo */
}

.status-hero-card.degraded .hero-pulse-dot,
.status-hero-card.partial-outage .hero-pulse-dot {
    background: var(--status-yellow);
}

.status-hero-card.major-outage .hero-pulse-dot {
    background: var(--status-red);
}

.hero-status-title {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--status-text-primary);
    margin: 0 0 3px 0;
    letter-spacing: -0.01em;
}

.hero-status-subtitle {
    font-size: 13.5px;
    color: var(--status-text-secondary);
    margin: 0;
}

.hero-status-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(0, 0, 0, 0.25);
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--status-border-subtle);
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.meta-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--status-text-muted);
    font-weight: 600;
}

.meta-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--status-text-primary);
    font-variant-numeric: tabular-nums;
}

.meta-value.countdown {
    color: var(--status-text-secondary);
}

.btn-refresh {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--status-border);
    color: var(--status-text-primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-refresh:hover {
    background: var(--status-surface-hover);
    border-color: var(--status-border-hover);
}

.btn-refresh.spinning svg {
    animation: spin 0.8s linear infinite;
}

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

/* --------------------------------------------------------------------------
   Disclaimer Banner
   -------------------------------------------------------------------------- */
.status-disclaimer-banner {
    background: rgba(245, 158, 11, 0.04);
    border: 1px solid rgba(245, 158, 11, 0.18);
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    color: #cbd5e1;
    font-size: 12.5px;
    line-height: 1.5;
}

.disclaimer-icon {
    color: var(--status-yellow);
    flex-shrink: 0;
    margin-top: 1px;
}

.disclaimer-text code {
    background: rgba(245, 158, 11, 0.12);
    color: #fde68a;
    padding: 1px 5px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11.5px;
}

/* --------------------------------------------------------------------------
   KPIs Grid
   -------------------------------------------------------------------------- */
.status-kpis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.kpi-card {
    background: var(--status-surface);
    border: 1px solid var(--status-border);
    border-radius: 10px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kpi-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--status-text-muted);
    font-weight: 600;
}

.kpi-value {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--status-text-primary);
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}

.kpi-value.highlight-green {
    color: var(--status-green);
}

.kpi-value.highlight-yellow {
    color: var(--status-yellow);
}

.kpi-value.highlight-red {
    color: var(--status-red);
}

.kpi-subtext {
    font-size: 11.5px;
    color: var(--status-text-secondary);
}

/* --------------------------------------------------------------------------
   Sections & Component Cards
   -------------------------------------------------------------------------- */
.status-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--status-border-subtle);
    padding-bottom: 8px;
}

.section-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--status-text-primary);
    margin: 0;
}

.section-tag {
    font-size: 10.5px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--status-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.component-card {
    background: var(--status-surface);
    border: 1px solid var(--status-border);
    border-radius: 10px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.component-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.component-identity {
    display: flex;
    align-items: center;
    gap: 14px;
}

.component-icon-badge {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--status-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--status-text-secondary);
    flex-shrink: 0;
}

.component-icon-badge.startgg-badge {
    color: var(--status-brand);
    border-color: rgba(197, 168, 128, 0.2);
}

.component-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.component-title {
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--status-text-primary);
    margin: 0;
}

.badge-unofficial {
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.component-desc {
    font-size: 12.5px;
    color: var(--status-text-secondary);
    margin: 2px 0 0 0;
}

.component-desc code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.04);
    padding: 1px 4px;
    border-radius: 3px;
}

.component-status-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-family: 'Outfit', sans-serif;
    font-size: 11.5px;
    font-weight: 600;
}

.component-status-pill.status-operational {
    background: var(--status-green-bg);
    border: 1px solid var(--status-green-border);
    color: var(--status-green);
}
.component-status-pill.status-operational .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--status-green);
}

.component-status-pill.status-degraded {
    background: var(--status-yellow-bg);
    border: 1px solid var(--status-yellow-border);
    color: var(--status-yellow);
}
.component-status-pill.status-degraded .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--status-yellow);
}

.component-status-pill.status-outage {
    background: var(--status-red-bg);
    border: 1px solid var(--status-red-border);
    color: var(--status-red);
}
.component-status-pill.status-outage .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--status-red);
}

/* --------------------------------------------------------------------------
   90-Days Matte Uptime Bars Strip
   -------------------------------------------------------------------------- */
.uptime-history-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 14px 16px;
    border-radius: 8px;
    border: 1px solid var(--status-border-subtle);
}

.uptime-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--status-text-secondary);
}

.history-value {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--status-text-primary);
    font-variant-numeric: tabular-nums;
}

.uptime-bars-strip {
    display: flex;
    gap: 3px;
    height: 30px;
    align-items: stretch;
    width: 100%;
}

.uptime-bar {
    flex: 1;
    min-width: 2px;
    border-radius: 2px;
    transition: opacity 0.1s ease, transform 0.1s ease;
    cursor: pointer;
}

.uptime-bar:hover {
    opacity: 0.8;
    transform: scaleY(1.15);
}

.uptime-bar.bar-operational {
    background: #22c55e;
}

.uptime-bar.bar-degraded {
    background: #f59e0b;
}

.uptime-bar.bar-outage {
    background: #ef4444;
}

.uptime-bar.bar-no-data {
    background: #1e232b;
}

.uptime-history-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10.5px;
    color: var(--status-text-muted);
}

.legend-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 2px;
}

.legend-dot.green { background: #22c55e; }
.legend-dot.yellow { background: #f59e0b; }
.legend-dot.red { background: #ef4444; }
.legend-dot.gray { background: #1e232b; }

/* --------------------------------------------------------------------------
   Internal Infrastructure Components Grid
   -------------------------------------------------------------------------- */
.internal-components-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.component-card.compact {
    padding: 14px 16px;
    gap: 10px;
}

.component-card.compact .component-title {
    font-size: 14px;
}

.component-card-metrics {
    display: flex;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--status-border-subtle);
    flex-wrap: wrap;
}

.metric-chip {
    font-size: 11.5px;
    color: var(--status-text-secondary);
}

.metric-chip strong {
    color: var(--status-text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Charts Grid (Sober, Minimalist & Serious)
   -------------------------------------------------------------------------- */
.status-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 16px;
}

.chart-card {
    background: var(--status-surface);
    border: 1px solid var(--status-border);
    border-radius: 10px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chart-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.chart-title {
    font-family: 'Outfit', sans-serif;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--status-text-primary);
    margin: 0 0 2px 0;
}

.chart-subtitle {
    font-size: 11.5px;
    color: var(--status-text-muted);
    margin: 0;
}

.chart-badge {
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    background: rgba(255, 255, 255, 0.04);
    color: var(--status-text-secondary);
    padding: 2px 6px;
    border-radius: 4px;
}

.chart-container {
    position: relative;
    height: 190px;
    width: 100%;
}

/* --------------------------------------------------------------------------
   Incidents Log
   -------------------------------------------------------------------------- */
.incidents-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.no-incidents-card {
    background: var(--status-surface);
    border: 1px solid var(--status-border);
    border-radius: 10px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.no-incidents-card h4 {
    margin: 0 0 2px 0;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--status-green);
}

.no-incidents-card p {
    margin: 0;
    font-size: 12.5px;
    color: var(--status-text-secondary);
}

.incident-card {
    background: var(--status-surface);
    border: 1px solid var(--status-border);
    border-radius: 10px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.incident-card.critical {
    border-color: rgba(239, 68, 68, 0.3);
}

.incident-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
}

.incident-title {
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--status-text-primary);
    margin: 0 0 2px 0;
}

.incident-date {
    font-size: 11.5px;
    color: var(--status-text-muted);
}

.incident-desc {
    font-size: 12.5px;
    color: #cbd5e1;
    line-height: 1.45;
    margin: 0;
}

.incident-pill {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 4px;
}

.incident-pill.resolved {
    background: var(--status-green-bg);
    color: var(--status-green);
    border: 1px solid var(--status-green-border);
}

.incident-pill.investigating {
    background: var(--status-yellow-bg);
    color: var(--status-yellow);
    border: 1px solid var(--status-yellow-border);
}

/* --------------------------------------------------------------------------
   Hover Tooltip for 90 Days Bar
   -------------------------------------------------------------------------- */
.status-tooltip {
    position: fixed;
    display: none;
    pointer-events: none;
    background: #181b22;
    border: 1px solid #2e3440;
    border-radius: 6px;
    padding: 8px 12px;
    color: #f8fafc;
    font-size: 11.5px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    transform: translate(-50%, -115%);
    white-space: nowrap;
}

.tooltip-date {
    font-weight: 700;
    color: var(--status-text-primary);
    margin-bottom: 4px;
    font-size: 11.5px;
}

.tooltip-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    color: var(--status-text-secondary);
    line-height: 1.35;
}

.tooltip-row strong {
    color: var(--status-text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .status-container {
        padding: 16px 14px 60px 14px;
        gap: 20px;
    }

    .status-hero-card {
        padding: 16px 18px;
    }

    .hero-status-title {
        font-size: 17px;
    }

    .hero-status-meta {
        width: 100%;
        justify-content: space-between;
    }

    .uptime-bars-strip {
        gap: 1.5px;
    }

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