/* Sefaria Status Page Styles */

:root {
    /* Sefaria Brand Colors */
    --sefaria-blue: #18345D;
    --sefaria-gold: #CCB479;
    --sefaria-light-blue: #2D4A7C;

    /* Status colors */
    --status-up: #10B981;
    --status-down: #EF4444;
    --status-partial: #F59E0B;
    --status-unknown: #6B7280;
    --status-resolved: #6B7280;

    /* UI colors */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #475569;

    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background-color: #0f172a;
    /* var(--bg-primary) fallback */
    background-color: var(--bg-primary);
}

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, var(--bg-primary) 0%, #1a2744 100%) fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2rem;
}

.header-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.logo-link {
    display: flex;
    align-items: center;
    margin-bottom: 0;
}

.logo {
    height: 40px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: 0.9;
    transition: opacity 0.2s;
}

.logo:hover {
    opacity: 1;
}

header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

header .subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Overall Status Banner */
.overall-status {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.overall-status.status-operational {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(16, 185, 129, 0.04));
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.overall-status.status-partial {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0.04));
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.overall-status.status-major {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(239, 68, 68, 0.04));
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.status-indicator {
    flex-shrink: 0;
}

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

.status-operational .status-dot {
    background: var(--status-up);
}

.status-partial .status-dot {
    background: var(--status-partial);
}

.status-major .status-dot {
    background: var(--status-down);
}

.status-dot.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
}

.status-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.status-text {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
}

.status-operational .status-text {
    color: var(--status-up);
}

.status-partial .status-text {
    color: var(--status-partial);
}

.status-major .status-text {
    color: var(--status-down);
}

.last-updated {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Services Section */
.services {
    margin-bottom: 2rem;
}

.services h2 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.service-list {
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.service-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}

.service-item:last-child {
    border-bottom: none;
}

.service-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.service-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.service-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.service-dot.status-up {
    background: var(--status-up);
}

.service-dot.status-down {
    background: var(--status-down);
    animation: pulse-small 2s infinite;
}

.service-dot.status-unknown {
    background: var(--status-unknown);
}

@keyframes pulse-small {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }
}

.service-name {
    font-weight: 500;
    font-size: 0.95rem;
}

.service-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.status-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.status-badge.status-up {
    background: rgba(16, 185, 129, 0.12);
    color: var(--status-up);
}

.status-badge.status-down {
    background: rgba(239, 68, 68, 0.12);
    color: var(--status-down);
}

.status-badge.status-unknown {
    background: rgba(107, 114, 128, 0.12);
    color: var(--status-unknown);
}

.response-time {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

.error-hint {
    color: var(--status-down);
    cursor: help;
    font-size: 0.85rem;
}

/* Incidents */
.incidents {
    margin-bottom: 2rem;
}

.incidents h2 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.incident {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
}

.incident-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.severity-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.severity-high .severity-badge {
    background: rgba(239, 68, 68, 0.12);
    color: var(--status-down);
}

.severity-medium .severity-badge {
    background: rgba(245, 158, 11, 0.12);
    color: var(--status-partial);
}

.severity-resolved .severity-badge,
.severity-badge.resolved {
    background: rgba(107, 114, 128, 0.12);
    color: var(--status-resolved);
}

.incident-times {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15rem;
}

.incident-header time {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.incident-header .updated-time {
    font-style: italic;
    opacity: 0.8;
}

.incident-text {
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.no-services {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
}

/* Footer */
footer {
    margin-top: auto;
    text-align: center;
    padding-top: 2rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.15s;
}

.footer-links a:hover {
    color: var(--sefaria-gold);
}

.footer-links .divider {
    color: var(--border-color);
}

.copyright {
    color: var(--text-secondary);
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .overall-status {
        padding: 1rem;
    }

    .status-text {
        font-size: 1rem;
    }

    .service-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .service-status {
        padding-left: 1.75rem;
    }
}