@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --primary-light: #EEF2FF;
    --secondary: #3B82F6;
    --bg: #F8FAFC;
    --surface: #FFFFFF;
    --surface-hover: #F1F5F9;
    --border: #E2E8F0;
    --text: #0F172A;
    --muted: #64748B;
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 24px;
    --shadow-sm: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    --shadow-md: 0 10px 25px -5px rgba(0,0,0,0.05), 0 8px 10px -6px rgba(0,0,0,0.01);
    --shadow-lg: 0 20px 40px -5px rgba(0,0,0,0.08);
}

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

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    background-image:
        radial-gradient(circle at 10% 0%, rgba(79,70,229,0.04) 0%, transparent 50%),
        radial-gradient(circle at 90% 100%, rgba(59,130,246,0.04) 0%, transparent 50%);
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.anim { opacity: 0; animation: fadeInUp 0.6s cubic-bezier(0.16,1,0.3,1) forwards; }
.d1 { animation-delay: 0.1s; }
.d2 { animation-delay: 0.2s; }
.d3 { animation-delay: 0.3s; }
.d4 { animation-delay: 0.4s; }

/* Layout */
.status-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px 80px;
}

/* Header */
.sp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
}
.sp-logo {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.03em;
}
.sp-logo svg { color: var(--primary); }
.sp-nav { display: flex; align-items: center; gap: 12px; }
.sp-nav a {
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--muted);
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.2s;
}
.sp-nav a:hover { color: var(--text); background: var(--surface); }
.sp-nav .lang-sel {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 0.85rem;
    padding: 6px 14px;
    background: var(--surface);
    border-radius: 20px;
    border: 1px solid var(--border);
}
.sp-nav .lang-sel a { padding: 0; font-size: 0.85rem; }
.sp-nav .lang-sel a.active { color: var(--primary); font-weight: 700; }

/* Hero banner */
.sp-hero {
    text-align: center;
    padding: 40px 0 48px;
}
.sp-hero h1 {
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #0F172A, #4F46E5);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.sp-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 24px;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 600;
    margin-top: 16px;
    transition: all 0.3s;
}
.sp-status-badge.online {
    background: rgba(16,185,129,0.08);
    border: 1px solid rgba(16,185,129,0.25);
    color: #059669;
}
.sp-status-badge.degraded {
    background: rgba(245,158,11,0.08);
    border: 1px solid rgba(245,158,11,0.25);
    color: #D97706;
}
.sp-status-badge.offline {
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.25);
    color: #DC2626;
}
.sp-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    position: relative;
}
.sp-status-badge.online .sp-dot { background: var(--success); }
.sp-status-badge.degraded .sp-dot { background: var(--warning); }
.sp-status-badge.offline .sp-dot { background: var(--error); }
.sp-dot::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid currentColor;
    opacity: 0.4;
    animation: dotPulse 2s ease-in-out infinite;
}
@keyframes dotPulse {
    0%,100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0; transform: scale(1.8); }
}

/* Stat cards row */
.sp-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}
.sp-stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.16,1,0.3,1);
}
.sp-stat:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(79,70,229,0.2);
}
.sp-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}
.sp-stat-val {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
    margin-bottom: 4px;
    line-height: 1.2;
}
.sp-stat-lbl {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--muted);
}

/* Period selector */
.sp-period {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 28px;
}
.sp-period button {
    padding: 8px 20px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    color: var(--muted);
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.sp-period button:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.sp-period button.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(79,70,229,0.3);
}

/* Chart cards */
.sp-charts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}
.sp-chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}
.sp-chart-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sp-chart-card h3 svg { color: var(--primary); }
.sp-chart-wrap {
    position: relative;
    height: 200px;
}

/* Incidents */
.sp-incidents-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
}
.sp-incidents-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sp-incidents-card h3 svg { color: var(--error); }

.sp-inc-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.sp-inc-badge.ongoing {
    background: rgba(239,68,68,0.1);
    color: var(--error);
}
.sp-inc-badge.resolved {
    background: rgba(16,185,129,0.1);
    color: var(--success);
}
.sp-inc-badge.investigating {
    background: rgba(59,130,246,0.1);
    color: #3B82F6;
}

/* Incident Dropdown */
.sp-incident-wrap {
    border-bottom: 1px solid var(--border);
}
.sp-incident-wrap:last-child {
    border-bottom: none;
}
.sp-incident {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    cursor: pointer;
    transition: background 0.15s;
}
.sp-incident:hover {
    background: var(--surface-hover);
    border-radius: 8px;
    padding: 16px 12px;
    margin: 0 -12px;
}
.sp-inc-body {
    display: none;
    padding: 0 16px 16px 42px;
    border-left: 2px solid transparent;
}
.sp-incident-wrap.open .sp-inc-body {
    display: block;
}
.sp-inc-timeline {
    margin-top: 12px;
    border-left: 1px dashed var(--border);
    padding-left: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.sp-timeline-item {
    position: relative;
    font-size: 0.85rem;
}
.sp-timeline-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 6px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary);
}
.sp-timeline-time {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 2px;
}
.sp-timeline-msg {
    color: var(--text);
}
.sp-duration {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 500;
    margin-top: 4px;
}

.sp-no-incidents {
    text-align: center;
    padding: 32px;
    color: var(--muted);
    font-size: 0.95rem;
}
.sp-no-incidents svg {
    display: block;
    margin: 0 auto 12px;
    color: var(--success);
}
.sp-inc-dot.maintenance { background: var(--warning); box-shadow: 0 0 6px rgba(245,158,11,0.4); }
.sp-inc-badge.maintenance {
    background: rgba(245,158,11,0.1);
    color: var(--warning);
}

/* Uptime Pillars */
.sp-uptime-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 28px;
}
.sp-uptime-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}
.sp-uptime-header h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}
.sp-uptime-legend {
    display: flex;
    gap: 16px;
    font-size: 0.78rem;
    color: var(--muted);
}
.sp-leg {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}
.sp-leg-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}

.up-pillars {
    display: flex;
    gap: 2px;
    height: 36px;
    align-items: stretch;
}
.up-pillar {
    flex: 1;
    border-radius: 3px;
    min-width: 2px;
    transition: all 0.15s;
    cursor: pointer;
    position: relative;
}
.up-pillar:hover {
    transform: scaleY(1.3);
    z-index: 2;
}
.pillar-operational { background: var(--success); }
.pillar-maintenance { background: var(--warning); }
.pillar-degraded { background: #FBBF24; }
.pillar-down { background: var(--error); }

.sp-uptime-dates {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.72rem;
    color: var(--muted);
    font-weight: 500;
}

/* Footer */
.sp-footer {
    text-align: center;
    padding: 40px 0;
    color: var(--muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

/* Responsive */
@media (max-width: 768px) {
    .sp-stats { grid-template-columns: repeat(2, 1fr); }
    .sp-charts { grid-template-columns: 1fr; }
    .sp-header { flex-direction: column; gap: 12px; }
    .sp-hero h1 { font-size: 1.8rem; }
    .sp-stat-val { font-size: 1.4rem; }
}
@media (max-width: 480px) {
    .status-page { padding: 0 16px 60px; }
    .sp-stat { padding: 16px 14px; }
    .sp-period button { padding: 6px 14px; font-size: 0.8rem; }
    .sp-chart-wrap { height: 160px; }
    .up-pillars { gap: 1px; }
    .up-pillar { min-width: 1px; }
}
