:root {
    /* Precise Landing Page Color Palette */
    --primary: #818cf8; /* indigo-400 */
    --primary-glow: rgba(129, 140, 248, 0.3);
    --secondary: #a78bfa; /* violet-400 */
    --accent: #f472b6; /* pink-400 */
    
    --success: #34d399; /* emerald-400 */
    --success-glow: rgba(52, 211, 153, 0.2);
    --warning: #fbbf24; /* amber-400 */
    --warning-glow: rgba(251, 191, 36, 0.2);
    --error: #f87171; /* red-400 */
    --error-glow: rgba(248, 113, 113, 0.2);
    
    /* Backgrounds matching landing page #0d1117 */
    --bg-dark: #0d1117;
    --bg-card: rgba(22, 27, 34, 0.7); /* Slightly lighter than bg for glass effect */
    --border-card: #21262d; /* Exact border color from landing page */
    
    --text-main: #c9d1d9; /* GitHub/Landing page light gray */
    --text-muted: #8b949e; /* GitHub/Landing page muted gray */
    
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --font-display: 'Outfit', sans-serif;
    
    --transition: cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-main);
    overflow-x: hidden;
    min-height: 100vh;
    line-height: 1.5;
}

/* --- Refined Animated Background (Matching Landing Page feel) --- */
.bg-canvas {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1; overflow: hidden; background: #0d1117;
}

.blur-blob {
    position: absolute; border-radius: 50%; filter: blur(120px); opacity: 0.2;
    animation: float 25s infinite alternate ease-in-out;
}
.blob-1 { width: 700px; height: 700px; background: var(--primary); top: -250px; right: -150px; }
.blob-2 { width: 600px; height: 600px; background: var(--secondary); bottom: -200px; left: -150px; animation-delay: -7s; }
.blob-3 { width: 500px; height: 500px; background: #1f2937; top: 20%; left: 10%; opacity: 0.1; }

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(80px, 40px) scale(1.05); }
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 2rem; }

/* --- Header --- */
.header { padding: 4rem 0 3rem; }
.header-content { display: flex; justify-content: space-between; align-items: center; }

.logo { display: flex; align-items: center; gap: 1.5rem; }
.logo-icon { 
    width: 68px; height: 68px; background: #161b22;
    border-radius: 20px; display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-card);
    position: relative; overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.logo-text h1 { font-family: var(--font-display); font-size: 2.25rem; font-weight: 800; letter-spacing: -0.04em; color: #f0f6fc; }
.logo-text p { color: var(--text-muted); font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.15em; }

.overall-status {
    padding: 0.6rem 1.25rem; border-radius: 12px; background: #161b22;
    border: 1px solid var(--border-card);
    display: flex; align-items: center; gap: 0.75rem; font-weight: 700; font-size: 0.9rem; color: #f0f6fc;
}
.status-dot { width: 10px; height: 10px; border-radius: 50%; position: relative; }
.overall-status.operational .status-dot { background: var(--success); box-shadow: 0 0 12px var(--success-glow); }
.overall-status.operational .status-dot::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--success); opacity: 0.3; animation: pulse 2.5s infinite; }
.overall-status.maintenance { background: rgba(129, 140, 248, 0.1); color: var(--primary); border: 1px solid rgba(129, 140, 248, 0.2); }
.overall-status.maintenance .status-dot { background: var(--primary); box-shadow: 0 0 12px var(--primary-glow); }

@keyframes pulse { 0% { transform: scale(1); opacity: 0.3; } 100% { transform: scale(2.5); opacity: 0; } }

/* --- Service Cards --- */
.services-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; margin-bottom: 4rem; }

.service-card {
    background: var(--bg-card); border: 1px solid var(--border-card);
    border-radius: 20px; padding: 2.25rem; transition: all 0.3s var(--transition);
}
.service-card:hover { border-color: var(--primary); box-shadow: 0 12px 32px rgba(0,0,0,0.3); }

.service-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2.5rem; }
.service-name { font-family: var(--font-display); font-size: 1.65rem; font-weight: 800; color: #f0f6fc; letter-spacing: -0.02em; }

.service-status-badge {
    padding: 0.5rem 1rem; border-radius: 10px; font-size: 0.75rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: 0.05em; display: flex; align-items: center; gap: 0.5rem;
}
.service-status-badge.up { background: rgba(52, 211, 153, 0.1); color: var(--success); border: 1px solid rgba(52, 211, 153, 0.2); }
.service-status-badge.down { background: rgba(248, 113, 113, 0.1); color: var(--error); border: 1px solid rgba(248, 113, 113, 0.2); }
.service-status-badge.maintenance { background: rgba(129, 140, 248, 0.1); color: var(--primary); border: 1px solid rgba(129, 140, 248, 0.2); }

.service-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-bottom: 3rem; }
.metric-item { background: #0d1117; border-radius: 16px; padding: 1.25rem; text-align: center; border: 1px solid var(--border-card); transition: 0.3s; }
.metric-item:hover { border-color: rgba(129, 140, 248, 0.3); }
.metric-label { font-size: 0.7rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.5rem; display: block; }
.metric-value { font-family: var(--font-display); font-size: 1.35rem; font-weight: 800; color: #f0f6fc; display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.metric-icon { font-size: 1.1rem; }

/* --- Uptime Bars --- */
.service-history-visual { margin-top: 1rem; }
.history-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 1rem; }
.history-title { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; }
.history-uptime { font-weight: 800; color: var(--success); font-size: 1.25rem; font-family: var(--font-display); }

.bars-container { 
    display: flex; gap: 4px; height: 38px; margin-bottom: 1rem;
    padding: 6px; background: #0d1117; border-radius: 12px; border: 1px solid var(--border-card);
}
.bar-segment {
    flex: 1; border-radius: 4px; transition: all 0.3s var(--transition); cursor: pointer;
    position: relative;
}
.bar-segment.up { background: var(--success); opacity: 0.35; }
.bar-segment.degraded { background: var(--warning); opacity: 0.6; }
.bar-segment.down { background: var(--error); opacity: 0.8; }
.bar-segment.maintenance { background: var(--primary); opacity: 0.6; }
.bar-segment:hover { opacity: 1; transform: scaleY(1.3); z-index: 10; box-shadow: 0 0 15px currentColor; }

.bar-labels { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; padding: 0 4px; }

/* --- Details Box --- */
.details-wrapper { margin-top: 2rem; animation: slideDown 0.4s var(--transition); }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

.history-details-box {
    padding: 2rem; background: #0d1117; border: 1px solid var(--border-card);
    border-radius: 16px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem;
}
.detail-lbl { display: block; font-size: 0.75rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.5rem; }
.detail-val { font-size: 1.125rem; font-weight: 800; color: #f0f6fc; font-family: var(--font-display); }

.protocol-section { grid-column: span 2; padding-top: 2rem; border-top: 1px solid var(--border-card); }
.protocol-entry { background: #161b22; padding: 1.25rem; border-radius: 12px; margin-top: 1rem; border: 1px solid var(--border-card); }
.protocol-time { font-weight: 800; font-size: 0.9rem; margin-bottom: 0.5rem; color: var(--primary); }
.protocol-desc { font-size: 0.95rem; color: var(--text-main); font-weight: 500; }

/* --- Loading & Error --- */
.loading { display: flex; flex-direction: column; align-items: center; gap: 1.5rem; padding: 6rem 0; }
.spinner { width: 44px; height: 44px; border: 3px solid rgba(129, 140, 248, 0.1); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Footer --- */
.footer { padding: 5rem 0 3rem; border-top: 1px solid var(--border-card); margin-top: 6rem; background: #0d1117; }
.footer-content { display: flex; justify-content: space-between; align-items: center; }
.footer-links { display: flex; gap: 3rem; }
.footer-links a { color: var(--text-muted); text-decoration: none; font-weight: 600; font-size: 0.9rem; transition: 0.3s; }
.footer-links a:hover { color: var(--primary); }
.footer-info { text-align: right; }
.last-updated { font-size: 0.75rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.5rem; }
.copyright { font-size: 0.9rem; color: var(--text-muted); font-weight: 500; }

@media (max-width: 768px) {
    .header-content { flex-direction: column; gap: 2.5rem; text-align: center; }
    .logo { flex-direction: column; }
    .service-metrics { grid-template-columns: 1fr; }
    .history-details-box { grid-template-columns: 1fr; }
    .footer-content { flex-direction: column; gap: 3rem; text-align: center; }
    .footer-info { text-align: center; }
    .logo-text h1 { font-size: 1.75rem; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
