html {
    height: 100%;
    margin: 0;
    padding: 0;
}

:root {
    --color-bg: #f4f5f7;
    --color-surface: #ffffff;
    --color-surface-muted: #f1f3f5;
    --color-border: #dee2e6;
    --color-text: #212529;
    --color-text-muted: #6c757d;
    --color-brand: #18181b;
    --color-brand-sub: #71717a;
    --color-accent: #0d6efd;
    --color-operational: #28a745;
    --color-degraded: #ffc107;
    --color-outage: #dc3545;
    --color-unknown: #adb5bd;
    --color-tooltip-bg: #212529;
    --color-header-btn: #e9ecef;
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.08);
    --footer-bg: #ffffff;
    --footer-border: #e5e7eb;
    --footer-muted: #6c757d;
    --footer-link: #495057;
    --footer-accent: #0d6efd;
    --footer-icon-bg: #f1f3f5;
}

[data-theme="dark"] {
    --color-bg: #0f1117;
    --color-surface: #1a1d27;
    --color-surface-muted: #252936;
    --color-border: #343847;
    --color-text: #e8eaed;
    --color-text-muted: #9aa0a6;
    --color-brand: #f4f4f5;
    --color-brand-sub: #a1a1aa;
    --color-accent: #6ea8fe;
    --color-operational: #3dd68c;
    --color-degraded: #f4bf50;
    --color-outage: #ff6b6b;
    --color-unknown: #6c757d;
    --color-tooltip-bg: #2b2f3a;
    --color-header-btn: #252936;
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.35);
    --footer-bg: #14161c;
    --footer-border: #2d3140;
    --footer-muted: #9aa0a6;
    --footer-link: #c4c8cc;
    --footer-accent: #6ea8fe;
    --footer-icon-bg: #252936;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--color-bg);
    color: var(--color-text);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

header {
    width: 100%;
    max-width: 1000px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}

.header-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.brand-logo {
    height: 32px;
    width: auto;
    flex-shrink: 0;
}

[data-theme="dark"] .brand-logo {
    filter: invert(1);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}

.brand-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-brand);
    letter-spacing: -0.01em;
}

.brand-subtitle {
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-brand-sub);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-button,
.rss-feed-button {
    background-color: var(--color-header-btn);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    color: var(--color-text);
    text-decoration: none;
    line-height: 1;
}

.icon-button {
    padding: 7px;
}

.rss-feed-button svg,
.icon-button svg {
    display: block;
}

.rss-feed-button svg {
    margin-right: 4px;
}

.theme-icon-dark {
    display: none;
}

[data-theme="dark"] .theme-icon-light {
    display: none;
}

[data-theme="dark"] .theme-icon-dark {
    display: block;
}

main {
    width: 100%;
    max-width: 1000px;
    padding: 0 20px 40px 20px; /* Changed padding-bottom to 40px */
    box-sizing: border-box;
    flex-grow: 1; /* Allow main to grow and push footer down */
}

.overall-status {
    text-align: center;
    margin-bottom: 24px;
    padding: 24px 0 16px;
}

.status-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 14px;
}

.status-icon.operational {
    background-color: var(--color-operational);
}

.status-icon.degraded {
    background-color: var(--color-degraded);
}

.status-icon.outage {
    background-color: var(--color-outage);
}

.overall-status h1 {
    font-size: 26px;
    margin-bottom: 8px;
    color: var(--color-text);
}

.overall-status p a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 14px;
}

.overall-status p a:hover {
    text-decoration: underline;
}

.outage-list {
    margin-top: 16px;
    padding: 16px;
    background-color: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    text-align: left;
}

.outage-list h3 {
    margin: 0 0 12px 0;
    color: #dc2626;
    font-size: 16px;
    font-weight: 600;
}

.outage-list ul {
    margin: 0;
    padding-left: 20px;
    list-style-type: disc;
}

.outage-list li {
    color: #991b1b;
    margin-bottom: 4px;
    font-weight: 500;
}

.live-status h2 {
    font-size: 18px;
    margin: 0;
    color: var(--color-text);
}

.live-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.live-status-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.last-updated {
    font-size: 12px;
    color: var(--color-text-muted);
    margin: 0;
}

.loading-message {
    text-align: center;
    color: #6c757d;
    padding: 40px 0;
}

@keyframes skeleton-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

.skeleton {
    background: linear-gradient(90deg, #e9ecef 25%, #f8f9fa 50%, #e9ecef 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.4s ease-in-out infinite;
    border-radius: 6px;
}

.skeleton-card {
    pointer-events: none;
}

.skeleton-heading {
    height: 14px;
    width: 80px;
    margin-bottom: 12px;
}

.skeleton-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-line {
    height: 14px;
    width: 180px;
}

.skeleton-line.short {
    width: 100px;
}

.skeleton-uptime {
    height: 16px;
    width: 72px;
    justify-self: end;
}

.skeleton-bars {
    grid-column: 1 / -1;
    height: 40px;
}

.bars-loading {
    grid-column: 1 / -1;
    font-size: 12px;
    color: #adb5bd;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    background: #f1f3f5;
    border-radius: 4px;
}

.category-section {
    margin-bottom: 28px;
}

.category-heading {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #dee2e6;
}

.category-services {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.status-indicator.unknown {
    background-color: #adb5bd;
}

.outage-list.degraded-list {
    background-color: #fef3c7;
    border-color: #fde68a;
}

.outage-list.degraded-list h3 {
    color: #b45309;
}

.outage-list.degraded-list li {
    color: #92400e;
}

.tabs {
    margin-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    gap: 4px;
}

.tab-panel {
    display: none;
    flex-direction: column;
    gap: 8px;
}

.tab-panel.active {
    display: flex;
}

.tab-button {
    background: none;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    color: var(--color-text-muted);
    border-bottom: 2px solid transparent;
}

.tab-button.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

.time-range {
    display: flex;
    gap: 4px;
}

.time-button {
    background-color: var(--color-surface-muted);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
    color: var(--color-text-muted);
}

.time-button.active {
    background-color: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
}

.status-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.service-status {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 10px 12px;
    box-shadow: var(--shadow-card);
}

.service-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.service-info {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1;
}

.service-icon {
    margin-right: 10px;
    flex-shrink: 0;
}

.service-icon img {
    border-radius: 50%;
    display: block;
    width: 20px;
    height: 20px;
}

.service-info h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.service-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.status-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--color-surface-muted);
    color: var(--color-text-muted);
}

.status-badge.operational {
    color: var(--color-operational);
    background: color-mix(in srgb, var(--color-operational) 14%, transparent);
}

.status-badge.degraded {
    color: #9a6700;
    background: color-mix(in srgb, var(--color-degraded) 22%, transparent);
}

[data-theme="dark"] .status-badge.degraded {
    color: var(--color-degraded);
}

.status-badge.outage {
    color: var(--color-outage);
    background: color-mix(in srgb, var(--color-outage) 14%, transparent);
}

.status-badge.unknown {
    color: var(--color-unknown);
}

.uptime-compact {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    min-width: 52px;
    text-align: right;
}

.status-bars-wrap {
    width: 100%;
}

.status-bars {
    display: flex;
    gap: 1px;
    height: 24px;
    background-color: var(--color-surface-muted);
    padding: 2px;
    border-radius: 4px;
}

.status-bar {
    flex-grow: 1;
    background-color: var(--color-operational);
    border-radius: 1px;
    min-width: 2px;
}

.status-bar.degraded {
    background-color: var(--color-degraded);
}

.status-bar.outage {
    background-color: var(--color-outage);
}

.status-bar.no-data {
    background-color: var(--color-unknown);
    opacity: 0.35;
}

.status-bar.has-incident {
    box-shadow: inset 0 -2px 0 rgba(255, 255, 255, 0.85);
}

.bars-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 11px;
    color: var(--color-text-muted);
}

.bars-loading {
    font-size: 11px;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    background: var(--color-surface-muted);
    border-radius: 4px;
}

@media (max-width: 768px) {
    .service-row {
        flex-wrap: wrap;
    }

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

    .live-status-header {
        flex-direction: column;
        align-items: flex-start;
    }

    header {
        flex-direction: row;
        align-items: center;
    }

    .header-actions {
        margin-left: auto;
    }
}

@media (max-width: 480px) {
    .overall-status h1 {
        font-size: 28px;
    }
    .live-status h2 {
        font-size: 20px;
    }
    .tab-button, .time-button {
        font-size: 13px;
        padding: 8px 10px;
    }
    .service-info h3 {
        font-size: 16px;
    }
    .status-text, .uptime-label {
        font-size: 12px;
    }
    .uptime-percentage {
        font-size: 14px;
    }
    .connect-section h2 {
        font-size: 20px;
    }
    .email-link {
        font-size: 14px;
    }
    .social-icons svg {
        width: 20px;
        height: 20px;
    }
    .footer-brand-logo {
        height: 24px;
    }
    .sr-cert-seal {
        width: 48px;
        height: 48px;
    }

    .sr-cert {
        width: 96px;
    }
    .sr-grade-value {
        font-size: 1rem;
    }
    .sr-grade-label {
        font-size: 0.6875rem;
    }
    .footer-links a {
        font-size: 12px;
    }
}

/* Tooltip Styles */
.tooltip {
    position: absolute;
    background-color: var(--color-tooltip-bg);
    color: white;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    max-width: 280px;
    white-space: normal;
}

.tooltip.tooltip-interactive {
    pointer-events: auto;
}

.tooltip-incidents {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    border-top: 1px solid rgba(255,255,255,0.15);
    padding-top: 8px;
}

.tooltip-incidents li + li {
    margin-top: 4px;
}

.tooltip-incidents a {
    color: #9ec5fe;
    text-decoration: none;
    font-size: 12px;
}

.tooltip-incidents a:hover {
    text-decoration: underline;
}

.tooltip-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
    /* This will be adjusted by JS to point up or down */
}

.tooltip p {
    margin: 4px 0;
}

.tooltip-date {
    font-size: 12px;
    color: #adb5bd; /* Lighter text for date */
}

.tooltip-uptime strong {
    color: white;
}

.tooltip-downtime {
    color: #ced4da; /* Slightly lighter for downtime specifics */
}

footer {
    margin-top: auto;
    border-top: 1px solid var(--footer-border);
    background: var(--footer-bg);
    color: var(--footer-link);
    padding: 32px 20px 28px;
    width: 100%;
    box-sizing: border-box;
}

.footer-inner {
    max-width: 1000px;
    margin: 0 auto;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--footer-border);
}

.connect-section h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 10px;
    color: var(--color-text);
}

.email-link {
    color: var(--footer-accent);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9375rem;
}

.email-link:hover {
    text-decoration: underline;
}

.email-link svg {
    flex-shrink: 0;
}

.social-icons {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.social-icons a {
    color: var(--footer-muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--footer-icon-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.social-icons a:hover {
    color: var(--color-text);
    background: var(--color-border);
}

.social-icons svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding-top: 20px;
}

.footer-brand-block {
    display: flex;
    align-items: center;
    gap: 14px;
}

.footer-brand-logo {
    height: 28px;
    width: auto;
}

[data-theme="dark"] .footer-brand-logo {
    filter: invert(1);
}

.staking-rewards-badge {
    display: flex;
    align-items: center;
    gap: 20px;
    text-decoration: none;
    color: var(--color-text);
}

.staking-rewards-badge:hover .sr-cert-title,
.staking-rewards-badge:hover .sr-grade-value {
    text-decoration: underline;
}

.sr-cert {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 112px;
    text-align: center;
}

.sr-cert-seal {
    display: block;
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.sr-cert-title {
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--color-text);
}

.sr-cert-brand {
    font-size: 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.sr-grade {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.1;
}

.sr-grade-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: 0.02em;
}

.sr-grade-label {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.footer-links {
    display: flex;
    gap: 20px;
    flex-shrink: 0;
}

.footer-links a {
    color: var(--footer-muted);
    text-decoration: none;
    font-size: 0.875rem;
}

.footer-links a:hover {
    color: var(--color-text);
    text-decoration: underline;
}

@media (max-width: 768px) {
    .footer-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-links {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .connect-section h2 {
        font-size: 1rem;
    }

    .email-link {
        font-size: 0.875rem;
    }

    .social-icons a {
        width: 34px;
        height: 34px;
    }

    .social-icons svg {
        width: 16px;
        height: 16px;
    }

    .sr-cert-seal {
        width: 44px;
        height: 44px;
    }

    .sr-cert-title {
        font-size: 11px;
    }

    .sr-cert-brand {
        font-size: 9px;
    }

    .sr-grade-value {
        font-size: 0.9375rem;
    }

    .sr-grade-label {
        font-size: 0.6875rem;
    }

    .footer-links a {
        font-size: 0.8125rem;
    }
}

/* Styles for Incident History Page (incident-history.html) */

/* Body specific to incident page if needed, or ensure general body styles apply well */
/* .incident-history-page body { ... } */ /* Example if you add a class to body in incident-history.html */

/* Header styling is likely shared from existing styles, ensure .logo, etc. are covered */
.incident-history-page .back-link a {
    /* Assuming general 'a' or header 'a' styles might not cover this specifically if not in header */
    color: white; /* This was in inline, ensure it's correctly scoped or inherited */
    text-decoration: none;
    font-size: 1em;
}

/* Main content area for incident history page */
.incident-history-page main {
    padding: 20px;
    max-width: 900px;
    margin: 20px auto;
    border-radius: 8px;
}

.incident-history-page h1 {
    color: #2c3e50;
    margin-bottom: 30px;
    text-align: center;
}

.incident {
    background-color: white; 
    border-radius: 8px; 
    padding: 20px;
    margin-bottom: 20px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: none; 
}

.incident-title {
    font-size: 1.4em; /* Larger title */
    margin-top: 0;
    margin-bottom: 8px;
}
.incident-title a {
    color: #0056b3; /* Darker blue for title link */
    text-decoration: none;
}
.incident-title a:hover {
    text-decoration: underline;
}

.incident-meta {
    font-size: 0.85em;
    color: #6c757d; /* Grey for meta text */
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap; /* Allow meta items to wrap on small screens */
    gap: 5px 15px; /* Row and column gap for meta items */
}

.incident-meta span {
    display: inline-flex; 
    align-items: center;
    padding: 2px 0px; /* Small padding for meta items */
}

.incident-date::before { /* Optional: icon for date */
    /* content: '📅'; margin-right: 5px; */
}

.incident-status-display {
    font-weight: bold;
    padding: 3px 8px; /* Default padding for badge appearance */
    border-radius: 4px;
    font-size: 0.9em;   /* Consistent font size with severity badges */
    display: inline-block; /* Ensure padding and background apply correctly */
    line-height: 1.5; /* Ensure text fits well within the badge */
}

/* --- Status Text Colors & Badges --- */
/* These classes are added to the .incident-status-display span */

.incident-status-display.status-resolved {
    background-color: #28a745; /* Prominent Green (Bootstrap success) */
    color: white;
}

.incident-status-display.status-monitoring {
    background-color: #fd7e14; /* Orange (Bootstrap warning-ish) */
    color: white;
}

.incident-status-display.status-investigating {
    background-color: #0dcaf0; /* Info Blue/Teal (Bootstrap info) */
    color: #000; /* Dark text for lighter backgrounds */
}

.incident-status-display.status-identified {
    background-color: #6f42c1; /* Purple (custom or Bootstrap-inspired) */
    color: white;
}

/* REMOVE any old styling blocks for: */
/* .status-resolved { color: #2ecc71; } (old green) */
/* .status-monitoring { color: #f39c12; } (old orange) */
/* .status-investigating { color: #3498db; } (old blue) */
/* AND the specific block: */
/* .incident .status { ... } */

/* Severity styling (already added) */
.incident-severity {
    font-weight: bold;
    padding: 2px 6px; /* Add some padding to severity similar to a badge */
    border-radius: 4px;
    font-size: 0.9em; /* Slightly smaller text */
    color: white; /* Default text color for severity badges */
}

/* Severity Level Colors (customize as needed) */
.incident-severity-critical {
    background-color: #dc3545; /* Red */
}
.incident-severity-high {
    background-color: #fd7e14; /* Orange */
}
.incident-severity-medium {
    background-color: #ffc107; /* Yellow */
    color: #212529; /* Darker text for yellow background for readability */
}
.incident-severity-low {
    background-color: #17a2b8; /* Info Blue */
}
.incident-severity-informational { /* Added for informational severity */
    background-color: #5bc0de; /* Light blue */
    color: white;
}
.incident-severity-unknown {
    background-color: #6c757d; /* Grey */
}

.incident-affected-services {
    /* Styles for affected services if needed, e.g., to make it look like tags */
    font-style: italic;
}

/* Status colors are already defined: .status-resolved, .status-monitoring, etc. */
/* Ensure these are the colors you want */
/* .status-resolved { color: #28a745; } REMOVE THIS LINE */
/* .status-monitoring { color: #fd7e14; } REMOVE THIS LINE */
/* .status-investigating { color: #0dcaf0; } REMOVE THIS LINE */
/* .status-identified { color: #6f42c1; } REMOVE THIS LINE */

/* .incident .status { REMOVE THIS OLD RULE 
     font-weight: bold;
     margin-bottom: 10px;
} */

/* ... rest of existing CSS ... */

.incident .date { /* This was for the old date style, now using .incident-date */
    /* Remove or adjust */
}

/* .incident .status { REMOVE THIS OLD RULE 
     font-weight: bold;
     margin-bottom: 10px;
} */

/* ... rest of existing CSS ... */

/* Read More Button Styling */
.read-more-button {
    background-color: #007bff; /* Bootstrap primary blue */
    color: white;
    border: none;
    border-radius: 5px;
    padding: 8px 15px;
    font-size: 0.9em;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    display: inline-block; /* Or block if it should take full width of its container */
    margin-top: 10px; /* Space above the button */
    transition: background-color 0.2s ease-in-out, transform 0.1s ease;
}

.read-more-button:hover,
.read-more-button:focus { /* Added :focus for accessibility and keyboard navigation */
    background-color: #0056b3; /* Darker blue on hover/focus */
    outline: none; /* Remove default focus outline if custom styling is sufficient */
}

.read-more-button:active {
    background-color: #004085; /* Even darker blue when clicked */
    transform: translateY(1px); /* Slight press effect */
} 