/* ================================
   Gayadeed Status Page - Modern Design
   ================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #003366;
  --primary-dark: #00234D;
  --primary-light: #0073CE;
  --accent: #4F9EE8;

  --success: #10B981;
  --success-light: #D1FAE5;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --danger: #EF4444;
  --danger-light: #FEE2E2;

  --text-primary: #1A1A1A;
  --text-secondary: #5A6C7D;
  --text-tertiary: #8B95A1;

  --bg-white: #FFFFFF;
  --bg-gray: #F8F9FB;
  --border-light: #E5E8EB;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);

  --gradient-primary: linear-gradient(135deg, #00234D 0%, #003366 50%, #0073CE 100%);
  --gradient-hero: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(79, 158, 232, 0.3), transparent),
                    linear-gradient(180deg, #00234D 0%, #003366 100%);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-gray);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ================================
   Header
   ================================ */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px) saturate(180%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.3s ease;
}

.header.scrolled {
  box-shadow: var(--shadow-md);
}

.header-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-img {
  height: 32px;
  width: auto;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.last-update {
  font-size: 13px;
  color: var(--text-tertiary);
  font-weight: 500;
}

.nav-link {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
}

.nav-link:hover {
  background: var(--bg-gray);
  color: var(--text-primary);
}

/* ================================
   Hero Section
   ================================ */

.hero-section {
  position: relative;
  padding: 80px 32px 60px;
  background: var(--gradient-hero);
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120%;
  height: 100%;
  background: radial-gradient(circle at 50% 0%, rgba(79, 158, 232, 0.15), transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
  color: white;
  animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 10px 20px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 24px;
  transition: all 0.3s ease;
}

.status-badge.status-up {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.4);
}

.status-badge.status-degraded {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.4);
}

.status-badge.status-down {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s ease-in-out infinite;
}

.status-badge.status-up .badge-dot {
  background: #4ADE80;
}

.status-badge.status-degraded .badge-dot {
  background: #FBBF24;
}

.status-badge.status-down .badge-dot {
  background: #F87171;
}

.status-badge.status-loading .badge-dot {
  background: rgba(255, 255, 255, 0.6);
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.9); }
}

.hero-title {
  font-size: 52px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 16px;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #FFFFFF 0%, rgba(255, 255, 255, 0.85) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 18px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  max-width: 600px;
  margin: 0 auto;
}

/* ================================
   Sections Common
   ================================ */

.environments-section,
.history-section {
  padding: 64px 32px;
}

.environments-section {
  background: white;
  margin-top: -32px;
  border-radius: 32px 32px 0 0;
  position: relative;
}

.history-section {
  background: var(--bg-gray);
}

.environments-container,
.history-container {
  max-width: 1280px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary-light);
  margin-bottom: 12px;
}

.section-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ================================
   Environment Cards
   ================================ */

.environments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 24px;
}

.loading-placeholder {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 64px;
  color: var(--text-tertiary);
  font-size: 15px;
}

.spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.env-card {
  position: relative;
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 28px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.env-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--border-light);
  transition: background 0.3s ease;
}

.env-card.status-up::before {
  background: var(--success);
}

.env-card.status-degraded::before {
  background: var(--warning);
}

.env-card.status-down::before {
  background: var(--danger);
}

.env-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(0, 51, 102, 0.12);
}

.env-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.env-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.env-status-badge {
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.env-status-badge.status-up {
  background: var(--success-light);
  color: #059669;
}

.env-status-badge.status-degraded {
  background: var(--warning-light);
  color: #D97706;
}

.env-status-badge.status-down {
  background: var(--danger-light);
  color: #DC2626;
}

.env-domain {
  margin-bottom: 20px;
}

.env-domain a {
  color: var(--primary-light);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.env-domain a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.services {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-gray);
  border-radius: 12px;
  padding: 16px;
}

.service-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.service-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.service-status-icon {
  font-size: 16px;
  display: flex;
  align-items: center;
}

.service-status-text {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--success);
}

/* ================================
   History Section
   ================================ */

.history-grid {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.loading-text {
  text-align: center;
  color: var(--text-tertiary);
  padding: 40px;
}

.history-row {
  background: white;
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--border-light);
}

.history-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.history-row-name {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
}

.history-row-uptime {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 600;
}

.history-row-uptime span {
  color: var(--success);
}

.history-timeline {
  display: flex;
  gap: 2px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
}

.history-day {
  flex: 1;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  min-width: 3px;
}

.history-day:hover {
  transform: scaleY(1.15);
  z-index: 1;
}

.history-day.day-up {
  background: var(--success);
}

.history-day.day-degraded {
  background: var(--warning);
}

.history-day.day-down {
  background: var(--danger);
}

.history-day.day-unknown {
  background: #E5E7EB;
}

.history-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 500;
}

/* ================================
   Footer
   ================================ */

.footer {
  background: var(--primary-dark);
  color: white;
  padding: 32px;
}

.footer-content {
  max-width: 1280px;
  margin: 0 auto;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-copyright {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.footer-version {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
}

/* ================================
   Responsive
   ================================ */

@media (max-width: 768px) {
  .header-content {
    padding: 12px 20px;
  }

  .header-nav {
    gap: 12px;
  }

  .last-update {
    display: none;
  }

  .hero-section {
    padding: 60px 20px 40px;
  }

  .hero-title {
    font-size: 36px;
  }

  .hero-subtitle {
    font-size: 16px;
  }

  .environments-section,
  .history-section {
    padding: 40px 20px;
  }

  .section-title {
    font-size: 26px;
  }

  .environments-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 28px;
  }

  .status-badge {
    font-size: 12px;
    padding: 8px 14px;
  }

  .env-card {
    padding: 20px;
  }

  .history-timeline {
    height: 32px;
  }
}
