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

:root {
  --bg-primary: #121411;
  --bg-secondary: #1a1d18;
  --bg-surface: rgba(26, 29, 24, 0.7);
  --bg-card: rgba(35, 40, 32, 0.6);
  --bg-card-hover: rgba(41, 48, 38, 0.8);

  --border-color: #293026;
  --border-glow: rgba(139, 162, 130, 0.3);

  --text-primary: #f0f2ee;
  --text-secondary: #b3b8b0;
  --text-muted: #7d8479;

  --color-primary: #8ba282;
  --color-primary-light: #a9bfa0;
  --color-primary-dark: #32392d;
  --color-secondary: #495443;
  --color-success: #709467;
  --color-danger: #d46a6a;
  --color-warning: #c29d67;

  --gradient-primary: linear-gradient(135deg, #8ba282, #32392d);
  --gradient-text: linear-gradient(135deg, #a9bfa0, #8ba282);
  --gradient-glow: linear-gradient(135deg, rgba(139, 162, 130, 0.4), rgba(50, 57, 45, 0.4));

  --font-body: 'Inter', -apple-system, sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --font-mono: 'Fira Code', monospace;

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

/* Three.js Canvas */
#three-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* Cursor Glow */
.cursor-glow {
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 162, 130, 0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease-out;
}

/* Scrollbar styles */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* Container */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
  position: relative;
  z-index: 2;
}

/* ============================================
   NAVIGATION
   ============================================ */
.navbar {
  width: 100%;
  background: rgba(18, 20, 17, 0.7);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 1.25rem 0;
  position: relative;
  z-index: 2;
}
.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.45rem;
  color: var(--text-primary);
  text-decoration: none;
}
.nav-logo i {
  color: var(--color-primary);
  font-size: 1.3rem;
}
.status-badge-inline {
  background: rgba(112, 148, 103, 0.1);
  border: 1px solid rgba(112, 148, 103, 0.2);
  color: var(--color-success);
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-weight: 500;
  text-transform: uppercase;
  margin-left: 0.25rem;
}
.nav-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-body);
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--color-primary);
  color: #121411;
  border-color: var(--color-primary);
}
.btn-primary:hover {
  background: var(--color-primary-light);
  border-color: var(--color-primary-light);
  transform: translateY(-2px);
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--border-color);
  color: var(--text-primary);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}
.btn-glow {
  box-shadow: 0 0 20px rgba(139, 162, 130, 0.2), 0 0 40px rgba(139, 162, 130, 0.05);
}

/* ============================================
   OVERALL STATUS PANEL
   ============================================ */
.overall-status-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 3rem 2rem;
  margin-top: 2rem;
  margin-bottom: 3rem;
  text-align: center;
  backdrop-filter: blur(12px);
  box-shadow: var(--card-shadow);
}
.status-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.status-header h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.5px;
}
.pulse-ring {
  width: 28px;
  height: 28px;
  background: rgba(112, 148, 103, 0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.pulse-ring::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(112, 148, 103, 0.2);
  animation: pulse-ring-anim 1.5s infinite ease-out;
}
.pulse-dot {
  width: 12px;
  height: 12px;
  background: var(--color-success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--color-success);
}
@keyframes pulse-ring-anim {
  0% { transform: scale(0.9); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}
.status-sub {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}
.overall-uptime-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3rem;
}
.uptime-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.uptime-stat .stat-value {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-success);
}
.uptime-stat .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}
.uptime-divider {
  width: 1px;
  height: 40px;
  background: var(--border-color);
}

/* ============================================
   SECTION HEADERS
   ============================================ */
.section-title-wrap {
  margin-bottom: 2rem;
}
.section-title-wrap h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 0.35rem;
}
.section-title-wrap p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ============================================
   ACTIVE SERVICES GRID
   ============================================ */
.components-section {
  margin-bottom: 4rem;
}
.components-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
.component-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.75rem;
  transition: var(--transition);
  transform-style: preserve-3d;
  perspective: 800px;
}
.component-card:hover {
  border-color: var(--border-glow);
  background: var(--bg-card-hover);
  box-shadow: 0 10px 30px rgba(139, 162, 130, 0.04);
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.card-header h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
}
.status-indicator {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 500;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}
.status-indicator.operational {
  background: rgba(112, 148, 103, 0.1);
  color: var(--color-success);
}
.card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}
.latency-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
}
.latency-label {
  color: var(--text-muted);
}
.latency-val {
  font-family: var(--font-mono);
  color: var(--color-primary-light);
}

/* History Uptime Bar */
.history-bar {
  display: flex;
  gap: 3px;
  height: 24px;
  margin-bottom: 0.5rem;
}
.bar-tick {
  flex: 1;
  height: 100%;
  border-radius: 2px;
  background: var(--color-success);
  opacity: 0.85;
  transition: var(--transition);
  position: relative;
  cursor: pointer;
}
.bar-tick:hover {
  transform: scaleY(1.15);
  opacity: 1;
}
.bar-tick.outage {
  background: var(--color-danger);
}
.bar-tick.warning {
  background: var(--color-warning);
}
.history-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Custom Tooltip */
.bar-tick::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translate(-50%, -8px) scale(0.9);
  background: #1e221b;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: transform 0.15s ease, opacity 0.15s ease;
  z-index: 10;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.bar-tick:hover::after {
  opacity: 1;
  transform: translate(-50%, -8px) scale(1);
}

/* ============================================
   INCIDENT TIMELINE
   ============================================ */
.incident-section {
  margin-bottom: 4rem;
}
.timeline {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: relative;
  padding-left: 2rem;
}
.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 10px;
  width: 2px;
  background: var(--border-color);
}
.timeline-item {
  position: relative;
}
.timeline-badge {
  position: absolute;
  left: -38px;
  top: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  z-index: 1;
}
.timeline-badge.resolved {
  background: var(--color-success);
  color: #121411;
}
.timeline-badge.maintenance {
  background: var(--color-warning);
  color: #121411;
}
.timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
}
.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.timeline-header h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
}
.timeline-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.timeline-body {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}
.timeline-footer {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.75rem;
}
.severity {
  font-family: var(--font-mono);
  font-weight: 600;
}
.severity.resolved {
  color: var(--color-success);
}
.severity.maintenance {
  color: var(--color-warning);
}
.duration {
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  position: relative;
  z-index: 2;
  margin-top: auto;
}
.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer p {
  color: var(--text-muted);
  font-size: 0.8rem;
}
.footer-socials {
  display: flex;
  gap: 1rem;
}
.footer-socials a {
  color: var(--text-muted);
  font-size: 1rem;
  transition: var(--transition);
}
.footer-socials a:hover {
  color: var(--text-primary);
  transform: translateY(-2px);
}

/* ============================================
   ANIMATIONS
   ============================================ */
.animate-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.animate-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .components-grid { grid-template-columns: 1fr; }
  .nav-container, .footer-content { padding: 0 1rem; }
  .container { padding: 1rem; }
  .overall-status-card { padding: 2rem 1rem; }
  .overall-uptime-stats { gap: 1.5rem; }
  .uptime-divider { height: 30px; }
  .timeline-header { flex-direction: column; align-items: flex-start; }
}
