/* 401 Clicks Status Page - Brand Theme */

:root {
    --bg: #0b0f0d;
    --panel: #101714;
    --panel-2: #0f1412;
    --line: #1d2a24;
    --text: #e6f1eb;
    --muted: #a0b3aa;
    --accent: #74ff9c;
    --accent-2: #ff9b4a;
    --warning: #ff6b4a;
    --glow: 0 0 18px rgba(116, 255, 156, 0.45);
    --mono: "IBM Plex Mono", "Courier New", monospace;
    --sans: "Space Grotesk", "Arial", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--sans);
    color: var(--text);
    background: radial-gradient(1200px 600px at 10% -10%, #1a2d24 0%, transparent 60%),
                radial-gradient(900px 500px at 90% 0%, #1d1a11 0%, transparent 55%),
                var(--bg);
    min-height: 100vh;
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Overlays */
.scanlines {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(0deg, rgba(255,255,255,0.03) 0px, rgba(255,255,255,0.03) 1px, transparent 1px, transparent 3px);
    opacity: 0.2;
    mix-blend-mode: screen;
    z-index: 1;
}

.noise {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.22'/%3E%3C/svg%3E");
    opacity: 0.08;
    mix-blend-mode: soft-light;
    z-index: 1;
}

/* Header */
header {
    position: sticky;
    top: 0;
    z-index: 3;
    background: rgba(11, 15, 13, 0.88);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--line);
}

.nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
}

.nav-actions a {
    text-decoration: none;
}

.cta {
    padding: 10px 16px;
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: 999px;
    box-shadow: var(--glow);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.2s ease;
}

.cta:hover {
    background: var(--accent);
    color: var(--bg);
}

/* Content */
.content {
    max-width: 100%;
    margin: 0 auto;
    padding: 40px 24px 72px;
    position: relative;
    z-index: 2;
    flex: 1;
}

/* Hero Status */
.hero-status {
    text-align: center;
    margin-bottom: 40px;
}

.section-title {
    font-family: var(--mono);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 12px;
    color: var(--accent-2);
    margin-bottom: 12px;
}

.hero-status h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.1;
    margin: 0 0 12px;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    color: var(--muted);
    font-size: 1rem;
    margin: 0;
}

/* Status Banner */
.status-banner {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 32px 24px;
    margin-bottom: 24px;
    background: var(--panel);
    animation: fadeIn 0.5s ease-out;
}

.status-banner-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.status-icon {
    font-size: 3rem;
}

.status-text {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.status-subtitle {
    color: var(--muted);
    font-size: 0.9rem;
}

/* Status banner states */
.status-banner.operational {
    background: linear-gradient(135deg, rgba(116, 255, 156, 0.08), rgba(116, 255, 156, 0.03));
    border-color: rgba(116, 255, 156, 0.3);
}

.status-banner.degraded {
    background: linear-gradient(135deg, rgba(255, 155, 74, 0.08), rgba(255, 155, 74, 0.03));
    border-color: rgba(255, 155, 74, 0.3);
}

.status-banner.outage {
    background: linear-gradient(135deg, rgba(255, 107, 74, 0.08), rgba(255, 107, 74, 0.03));
    border-color: rgba(255, 107, 74, 0.3);
}

/* Uptime Badge */
.uptime-badge {
    border: 1px solid var(--accent);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 32px;
    background: linear-gradient(135deg, rgba(116, 255, 156, 0.08), rgba(116, 255, 156, 0.03));
    box-shadow: var(--glow);
    animation: fadeIn 0.5s ease-out 0.1s both;
}

.uptime-badge-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.badge-label {
    font-family: var(--mono);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 8px;
}

.badge-value {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}

.badge-percent {
    font-size: 0.6em;
}

.badge-meta {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 4px;
}

.badge-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--muted);
}

.badge-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.check-icon {
    width: 20px;
    height: 20px;
    color: var(--accent);
}

.badge-refresh {
    font-family: var(--mono);
    font-size: 0.75rem;
    text-align: center;
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.service-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 20px;
    background: var(--panel);
    transition: transform 0.2s ease, border-color 0.2s ease;
    animation: fadeIn 0.5s ease-out;
}

.service-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}

.service-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.service-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--muted);
}

.status-indicator.up {
    background-color: var(--accent);
    box-shadow: 0 0 12px rgba(116, 255, 156, 0.6);
    animation: pulse-green 2s infinite;
}

.status-indicator.down {
    background-color: var(--warning);
    box-shadow: 0 0 12px rgba(255, 107, 74, 0.6);
    animation: pulse-red 2s infinite;
}

@keyframes pulse-green {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes pulse-red {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.service-metrics {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.metric-label {
    font-family: var(--mono);
    color: var(--muted);
    font-size: 0.8rem;
}

.metric-value {
    font-weight: 600;
    color: var(--text);
}

/* History Section */
.history-section {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    background: var(--panel);
    animation: fadeIn 0.5s ease-out 0.2s both;
}

.history-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0px;
}

.uptime-chart {
    height: 128px;
    display: flex;
    align-items: flex-end;
    gap: 1px;
    overflow-y: visible;
    padding: 40px 0 8px;
}

.loading-text {
    color: var(--muted);
    text-align: center;
    width: 100%;
    padding: 40px 0;
    font-family: var(--mono);
    font-size: 0.85rem;
}

.history-note {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--muted);
    text-align: right;
    margin-top: 12px;
}

/* Uptime chart bars */
.uptime-bar {
    width: 7px;
    border-radius: 3px;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
}

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

/* Custom tooltip */
.bar-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: var(--panel);
    color: var(--text);
    padding: 8px 12px;
    border-radius: 6px;
    font-family: var(--mono);
    font-size: 11px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    border: 1px solid var(--line);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

.bar-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--panel);
}

.uptime-bar:hover .bar-tooltip {
    opacity: 1;
    visibility: visible;
}

.uptime-bar.perfect {
    background-color: var(--accent);
}

.uptime-bar.good {
    background-color: #a0e080;
}

.uptime-bar.fair {
    background-color: var(--accent-2);
}

.uptime-bar.poor {
    background-color: #ff7b4a;
}

.uptime-bar.bad {
    background-color: var(--warning);
}

/* Update Info */
.update-info {
    text-align: center;
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 32px;
}

.refresh-info {
    margin-left: 16px;
}

/* Footer */
footer {
    text-align: center;
    padding-top: 32px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.85rem;
}

footer a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s ease;
}

footer a:hover {
    color: var(--text);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (min-width: 769px) {
    .content {
        padding: 64px 32px 96px;
    }

    .hero-status {
        margin-bottom: 56px;
    }

    .status-banner {
        padding: 40px 32px;
    }

    .status-banner-content {
        gap: 32px;
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .uptime-badge {
        padding: 32px;
    }

    .history-section {
        padding: 32px;
    }
}

@media (max-width: 768px) {
    .content {
        padding: 24px 16px 48px;
    }

    .nav {
        padding: 16px 20px;
    }

    .hero-status {
        margin-bottom: 32px;
    }

    .hero-status h1 {
        font-size: 1.8rem;
    }

    .status-banner {
        padding: 24px 16px;
        margin-bottom: 20px;
    }

    .status-banner-content {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    .status-icon {
        font-size: 2.5rem;
    }

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

    .uptime-badge {
        padding: 20px 16px;
        margin-bottom: 24px;
    }

    .uptime-badge-content {
        flex-direction: column;
        text-align: center;
    }

    .badge-value {
        font-size: 2.5rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .service-card {
        padding: 16px;
    }

    .history-section {
        padding: 20px 16px;
        margin-bottom: 20px;
    }

    .history-title {
        font-size: 1.1rem;
        margin-bottom: 16px;
    }

    .uptime-chart {
        height: 100px;
        padding: 30px 0 8px;
    }

    .uptime-bar {
        width: 6px;
    }

    .refresh-info {
        display: block;
        margin-left: 0;
        margin-top: 4px;
    }

    .update-info {
        font-size: 0.75rem;
    }
}
