/* Modern Vibrant Design - Inspired by 2025 UI Trends */

:root {
    /* Background Colors */
    --bg-primary: #0f0f12;
    --bg-surface: #1a1a1f;
    --bg-surface-elevated: #25252b;
    --bg-hover: #2f2f35;

    /* Text Colors */
    --text-primary: #f5f5f7;
    --text-secondary: #a8a8b0;
    --text-tertiary: #71717a;

    /* Status Colors - Vibrant */
    --status-operational: #00e599;
    --status-degraded: #ffb020;
    --status-partial: #ff6b6b;
    --status-major: #ff3b3b;
    --status-maintenance: #6366f1;
    --status-unknown: #64748b;

    /* Accent Colors */
    --accent-primary: #7c3aed;
    --accent-secondary: #8b5cf6;
    --accent-tertiary: #6366f1;

    /* Border Colors */
    --border-default: #2f2f35;
    --border-hover: #3f3f45;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md:
        0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg:
        0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.4);
}

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

body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter",
        sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 0;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header - Elegant and minimal */
header {
    background: var(--bg-surface);
    padding: 48px 0;
    margin-bottom: 48px;
    position: relative;
    border-bottom: 1px solid var(--border-default);
}

header .container {
    position: relative;
}

header::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--status-operational) 50%,
        transparent 100%
    );
    opacity: 0.4;
}

h1 {
    color: var(--text-primary);
    text-align: center;
    font-size: 42px;
    font-weight: 700;
    letter-spacing: -1.5px;
    position: relative;
}

/* Overall Status Card */
.overall-status {
    background: var(--bg-surface);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 32px;
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.overall-status:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
}

.overall-status h2 {
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Status Grid */
.status-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 48px;
}

.status-card {
    background: var(--bg-surface);
    border-radius: 16px;
    padding: 28px;
    border: 1px solid var(--border-default);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 28px;
    align-items: start;
    box-shadow: var(--shadow-sm);
}

.status-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-surface-elevated);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

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

.status-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    gap: 14px;
}

.status-indicator {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 12px currentColor;
    animation: pulse-glow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-glow {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.operational {
    background: var(--status-operational);
    color: var(--status-operational);
}
.degraded {
    background: var(--status-degraded);
    color: var(--status-degraded);
}
.partial_outage {
    background: var(--status-partial);
    color: var(--status-partial);
}
.major_outage {
    background: var(--status-major);
    color: var(--status-major);
}
.maintenance {
    background: var(--status-maintenance);
    color: var(--status-maintenance);
}
.unknown {
    background: var(--status-unknown);
    color: var(--status-unknown);
}

.service-name {
    font-weight: 700;
    font-size: 20px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.status-description {
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.6;
    font-size: 15px;
}

/* Incidents */
.incidents {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-default);
}

.incident {
    background: rgba(255, 176, 32, 0.1);
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 10px;
    font-size: 14px;
    color: var(--status-degraded);
    border-left: 3px solid var(--status-degraded);
    backdrop-filter: blur(10px);
}

.last-checked {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: 14px;
}

/* Buttons */
.refresh-btn {
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 12px;
}

.refresh-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.refresh-btn:active {
    transform: translateY(0);
}

/* Loading State */
.loading {
    text-align: center;
    padding: 48px;
    color: var(--text-secondary);
    font-size: 16px;
}

.error {
    background: rgba(255, 59, 59, 0.1);
    color: var(--status-major);
    padding: 18px;
    border-radius: 12px;
    margin-bottom: 24px;
    border-left: 3px solid var(--status-major);
    backdrop-filter: blur(10px);
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading-indicator {
    animation: pulse 2s infinite;
}

/* Timeline - Enhanced */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.timeline-label {
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.timeline-uptime {
    font-size: 15px;
    color: var(--status-operational);
    font-weight: 700;
}

.timeline-days {
    display: flex;
    gap: 4px;
    height: 42px;
}

/* Timeline responsive variants - show/hide based on screen size */
.timeline-days-desktop,
.timeline-label-desktop {
    display: flex;
}

.timeline-days-tablet,
.timeline-label-tablet,
.timeline-days-mobile,
.timeline-label-mobile {
    display: none;
}

.timeline-day {
    flex: 1;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.timeline-day:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 4px 12px currentColor;
    z-index: 5;
}

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

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

.timeline-day.partial_outage,
.timeline-day.major_outage {
    background: var(--status-partial);
    color: var(--status-partial);
}

.timeline-day.maintenance {
    background: var(--status-maintenance);
    color: var(--status-maintenance);
}

.timeline-day.unknown {
    background: var(--status-unknown);
    color: var(--status-unknown);
}

.timeline-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(26, 26, 31, 0.95);
    backdrop-filter: blur(12px);
    color: white;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 10px;
    z-index: 10;
    border: 1px solid var(--border-default);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.timeline-day:hover .timeline-tooltip {
    opacity: 1;
}

.timeline-legend {
    display: flex;
    gap: 20px;
    margin-top: 14px;
    font-size: 13px;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.timeline-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.timeline-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Responsive Design - Tablet */
@media (max-width: 768px) {
    .status-card {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .timeline-days {
        gap: 3px;
    }

    .timeline-day {
        min-width: 5px;
    }

    /* Show tablet timeline (45 days) */
    .timeline-days-desktop,
    .timeline-label-desktop {
        display: none;
    }

    .timeline-days-tablet,
    .timeline-label-tablet {
        display: flex;
    }
}

/* Responsive Design - Mobile */
@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    header {
        padding: 32px 0;
        margin-bottom: 32px;
    }

    h1 {
        font-size: 28px;
    }

    .status-card {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }

    .timeline-days {
        height: 48px;
        gap: 3px;
    }

    .timeline-day {
        border-radius: 3px;
    }

    .timeline-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    /* Show mobile timeline (30 days) */
    .timeline-days-desktop,
    .timeline-label-desktop,
    .timeline-days-tablet,
    .timeline-label-tablet {
        display: none;
    }

    .timeline-days-mobile,
    .timeline-label-mobile {
        display: flex;
    }

    .timeline-legend {
        gap: 12px;
        font-size: 12px;
    }

    .timeline-legend-item {
        gap: 6px;
    }

    .timeline-legend-color {
        width: 10px;
        height: 10px;
    }

    .overall-status {
        padding: 24px;
    }

    .overall-status h2 {
        font-size: 20px;
    }

    .service-name {
        font-size: 18px;
    }

    .status-description {
        font-size: 14px;
    }
}

/* Responsive Design - Small Mobile */
@media (max-width: 480px) {
    h1 {
        font-size: 24px;
    }

    .status-card {
        padding: 16px;
    }

    .overall-status {
        padding: 20px;
    }

    .timeline-days {
        gap: 2px;
        height: 40px;
    }

    .timeline-day {
        border-radius: 2px;
    }

    .timeline-tooltip {
        font-size: 11px;
        padding: 6px 10px;
    }
}

/* Accessibility - Focus States */
.refresh-btn:focus-visible,
.timeline-day:focus-visible {
    outline: 3px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* About Page */
.about-content {
    background: var(--bg-surface);
    border-radius: 16px;
    padding: 40px;
    margin: 0 auto 32px auto;
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-md);
    line-height: 1.8;
    max-width: 800px;
}

.about-content p {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 20px;
}

.about-content p:last-child {
    margin-bottom: 0;
}

.about-content a {
    color: var(--accent-secondary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.about-content a:hover {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.about-back-link {
    margin-top: 32px;
    text-align: center;
}

.about-back-link a {
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.about-back-link a:hover {
    color: var(--accent-secondary);
    transform: translateX(-4px);
}

/* Header Navigation Link */
.header-nav {
    position: absolute;
    top: 0;
    right: 24px;
}

.header-nav a {
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.header-nav a:hover {
    color: var(--accent-primary);
}
