:root {
    --bg-primary: #050505;
    --bg-secondary: #0c0c0e;
    --bg-card: #0c0c0e;
    --border-color: #1a1a1e;
    
    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --text-muted: #52525b;

    /* Semantic Red (Brutalist Apple-like accent) */
    --red-primary: #ef4444;
    --red-secondary: #7f1d1d;
    --red-bg: #18090a;
    --red-border: #450a0a;

    /* Semantic Green */
    --green-primary: #10b981;
    --green-secondary: #065f46;
    --green-bg: #04120c;
    --green-border: #064e3b;

    /* Semantic Amber / Warning */
    --amber-primary: #f59e0b;
    --amber-secondary: #78350f;
    --amber-bg: #1a0f02;
    --amber-border: #451a03;

    /* Semantic Blue / Maintenance */
    --blue-primary: #3b82f6;
    --blue-secondary: #1e3a8a;
    --blue-bg: #081125;
    --blue-border: #1e3a8a;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace;
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    padding: 40px 20px;
    flex: 1;
}

/* Header Section */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.brand-title {
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.meta-time {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
}

/* Global Status Banner */
.status-banner {
    padding: 24px;
    border-radius: 0px; /* Brutalist sharp edges */
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    margin-bottom: 32px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

/* Global Status Variants */
.status-banner.operational {
    border-left: 4px solid var(--green-primary);
    background-color: var(--green-bg);
    border-color: var(--green-border);
}

.status-banner.degraded {
    border-left: 4px solid var(--amber-primary);
    background-color: var(--amber-bg);
    border-color: var(--amber-border);
}

.status-banner.outage {
    border-left: 4px solid var(--red-primary);
    background-color: var(--red-bg);
    border-color: var(--red-border);
}

.status-banner.unknown {
    border-left: 4px solid var(--text-muted);
    background-color: var(--bg-secondary);
}

.status-banner h1 {
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.status-header-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-banner-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status-banner.operational .status-banner-dot {
    background-color: var(--green-primary);
    box-shadow: 0 0 8px var(--green-primary);
}

.status-banner.degraded .status-banner-dot {
    background-color: var(--amber-primary);
    box-shadow: 0 0 8px var(--amber-primary);
}

.status-banner.outage .status-banner-dot {
    background-color: var(--red-primary);
    box-shadow: 0 0 8px var(--red-primary);
}

.status-banner.unknown .status-banner-dot {
    background-color: var(--text-muted);
}

.status-banner p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Section Styling */
.section-title {
    font-size: 0.8rem;
    text-transform: lowercase; /* Brutalist lowercase */
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section {
    margin-bottom: 40px;
}

/* Services Grid/List */
.services-list {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
}

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

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

.service-item:hover {
    background-color: #121215;
}

.service-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.service-name {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.service-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.status-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

/* Service Status Colors */
.service-item.up .status-indicator {
    background-color: var(--green-primary);
    box-shadow: 0 0 8px var(--green-primary);
}

.service-item.up .status-text {
    color: var(--green-primary);
}

.service-item.down .status-indicator {
    background-color: var(--red-primary);
    box-shadow: 0 0 8px var(--red-primary);
}

.service-item.down .status-text {
    color: var(--red-primary);
}

.service-item.maintenance .status-indicator {
    background-color: var(--blue-primary);
    box-shadow: 0 0 8px var(--blue-primary);
}

.service-item.maintenance .status-text {
    color: var(--blue-primary);
}

/* Maintenance Banner on Service */
.maintenance-details {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background-color: var(--blue-bg);
    border: 1px solid var(--blue-border);
    padding: 12px 16px;
    margin-top: 8px;
    font-family: var(--font-mono);
}

.maintenance-details span {
    color: var(--blue-primary);
    font-weight: 500;
}

/* Incidents Section */
.incidents-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.incident-card {
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    padding: 20px;
}

.incident-card.active {
    border-left: 3px solid var(--red-primary);
}

.incident-card.resolved {
    border-left: 3px solid var(--text-muted);
}

.incident-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 16px;
}

.incident-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

.incident-badge {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 2px 8px;
    border: 1px solid transparent;
}

.incident-badge.active-critical {
    background-color: var(--red-bg);
    border-color: var(--red-primary);
    color: var(--red-primary);
}

.incident-badge.active-minor {
    background-color: var(--amber-bg);
    border-color: var(--amber-primary);
    color: var(--amber-primary);
}

.incident-badge.resolved-status {
    background-color: var(--bg-primary);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.incident-updates {
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-left: 1px solid var(--border-color);
    padding-left: 16px;
    margin-left: 6px;
}

.update-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.update-time {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.update-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* API Docs Specific Styles */
.docs-section {
    line-height: 1.7;
}

.docs-section h2 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 24px 0 12px 0;
    color: var(--text-primary);
}

.docs-section p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.endpoint-block {
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    margin-bottom: 24px;
}

.endpoint-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: #0f0f12;
}

.method {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    background-color: var(--green-bg);
    color: var(--green-primary);
    border: 1px solid var(--green-border);
    padding: 2px 6px;
}

.path {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

.endpoint-details {
    padding: 20px;
}

pre {
    background-color: #030304;
    border: 1px solid var(--border-color);
    padding: 16px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    overflow-x: auto;
    margin: 12px 0;
    color: #e4e4e7;
}

code {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    background-color: #121214;
    padding: 2px 6px;
    color: var(--red-primary);
}

pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
}

/* Footer Section */
footer {
    border-top: 1px solid var(--border-color);
    padding: 24px 0 40px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s ease;
    border-bottom: 1px solid transparent;
}

.footer-links a:hover {
    color: var(--red-primary);
    border-bottom: 1px solid var(--red-primary);
}

/* Redirect Notice Styling */
.redirect-alert {
    padding: 32px;
    border-radius: 0px; /* Brutalist sharp edges */
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    margin-bottom: 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.redirect-alert.status-up {
    border-left: 4px solid var(--green-primary);
    background: linear-gradient(180deg, var(--green-bg) 0%, var(--bg-secondary) 100%);
    border-color: var(--green-border) var(--border-color) var(--border-color) var(--green-primary);
}

.redirect-alert.status-down {
    border-left: 4px solid var(--red-primary);
    background: linear-gradient(180deg, var(--red-bg) 0%, var(--bg-secondary) 100%);
    border-color: var(--red-border) var(--border-color) var(--border-color) var(--red-primary);
}

.redirect-alert.status-maintenance {
    border-left: 4px solid var(--blue-primary);
    background: linear-gradient(180deg, var(--blue-bg) 0%, var(--bg-secondary) 100%);
    border-color: var(--blue-border) var(--border-color) var(--border-color) var(--blue-primary);
}

.redirect-alert.status-degraded {
    border-left: 4px solid var(--amber-primary);
    background: linear-gradient(180deg, var(--amber-bg) 0%, var(--bg-secondary) 100%);
    border-color: var(--amber-border) var(--border-color) var(--border-color) var(--amber-primary);
}

.redirect-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.redirect-title {
    font-size: 1.15rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.redirect-title code {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 2px 6px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.95rem;
}

.redirect-title strong {
    font-weight: 600;
}

.redirect-message {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.redirect-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.btn-primary {
    background-color: var(--text-primary);
    color: var(--bg-primary);
    border: 1px solid var(--text-primary);
    padding: 8px 16px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: lowercase;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--text-primary);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: lowercase;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

/* Pulsing indicators */
.pulse-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    position: relative;
    display: inline-block;
}

.pulse-dot::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    opacity: 0.4;
}

.status-down .pulse-dot {
    background-color: var(--red-primary);
}
.status-down .pulse-dot::after {
    border: 2px solid var(--red-primary);
    animation: pulse-red-anim 2s infinite ease-in-out;
}

.status-maintenance .pulse-dot {
    background-color: var(--blue-primary);
}
.status-maintenance .pulse-dot::after {
    border: 2px solid var(--blue-primary);
    animation: pulse-blue-anim 2s infinite ease-in-out;
}

.status-degraded .pulse-dot {
    background-color: var(--amber-primary);
}
.status-degraded .pulse-dot::after {
    border: 2px solid var(--amber-primary);
    animation: pulse-amber-anim 2s infinite ease-in-out;
}

.status-up .pulse-dot {
    background-color: var(--green-primary);
}
.status-up .pulse-dot::after {
    border: 2px solid var(--green-primary);
    animation: pulse-green-anim 2s infinite ease-in-out;
}

@keyframes pulse-red-anim {
    0% { transform: scale(0.9); opacity: 0.8; }
    50% { transform: scale(1.4); opacity: 0.1; }
    100% { transform: scale(0.9); opacity: 0.8; }
}

@keyframes pulse-blue-anim {
    0% { transform: scale(0.9); opacity: 0.8; }
    50% { transform: scale(1.4); opacity: 0.1; }
    100% { transform: scale(0.9); opacity: 0.8; }
}

@keyframes pulse-amber-anim {
    0% { transform: scale(0.9); opacity: 0.8; }
    50% { transform: scale(1.4); opacity: 0.1; }
    100% { transform: scale(0.9); opacity: 0.8; }
}

@keyframes pulse-green-anim {
    0% { transform: scale(0.9); opacity: 0.8; }
    50% { transform: scale(1.4); opacity: 0.1; }
    100% { transform: scale(0.9); opacity: 0.8; }
}

/* Related incidents under redirect alert */
.redirect-incidents {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    margin-top: 8px;
}

.redirect-incidents-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: lowercase;
    display: block;
    margin-bottom: 12px;
    letter-spacing: 0.05em;
}

.redirect-incidents-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.redirect-incident-item {
    background-color: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    padding: 16px 20px;
}

.redirect-incident-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 16px;
}

.redirect-incident-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
}

.redirect-incident-updates {
    border-left: 1px solid var(--border-color);
    padding-left: 16px;
    margin-left: 4px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Responsive Adjustments for redirect alert */
@media (max-width: 600px) {
    .redirect-alert {
        padding: 20px;
    }
    
    .redirect-title-row {
        align-items: flex-start;
    }
    
    .redirect-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .container {
        padding: 20px 15px;
    }
    
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .meta-time {
        text-align: left;
    }
    
    footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}
