:root {
  --primary: #1D4ED8;
  --primary-dark: #1E40AF;
  --secondary: #0EA5E9;
  --accent: #22C55E;
  --text: #0B1220;
  --surface: #F8FAFC;
  --muted: #E2E8F0;
  --white: #FFFFFF;
  --danger: #EF4444;
  --warning: #F59E0B;
  --success: #10B981;

  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-2xl: 4rem;

  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;

  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1);

  --transition: all 0.3s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: clamp(0.875rem, 0.8rem + 0.25vw, 1rem);
  line-height: 1.5;
  color: var(--text);
  background: var(--surface);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
}

h1 { font-size: clamp(1.875rem, 1.5rem + 1.5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 1.25rem + 1vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 1.1rem + 0.75vw, 1.875rem); }
h4 { font-size: clamp(1.125rem, 1rem + 0.5vw, 1.5rem); }

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--secondary);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.skip-link {
  position: absolute;
  top: -999px;
  left: -999px;
  background: var(--primary);
  color: var(--white);
  padding: var(--spacing-sm) var(--spacing-md);
  z-index: 9999;
}

.skip-link:focus {
  top: 0;
  left: 0;
}

.topbar {
  background: var(--primary-dark);
  color: var(--white);
  padding: var(--spacing-xs) 0;
  font-size: 0.875rem;
}

.topbar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

.topbar-links {
  display: flex;
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

.topbar a {
  color: var(--white);
  font-weight: 500;
}

.topbar a:hover {
  color: var(--accent);
}

.header {
  background: var(--white);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-sm) 0;
  gap: var(--spacing-md);
}

.logo-section {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.logo {
  width: 60px;
  height: 60px;
}

.brand-text h1 {
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.5rem);
  margin: 0;
  color: var(--primary);
}

.brand-text p {
  font-size: clamp(0.75rem, 0.7rem + 0.15vw, 0.875rem);
  color: var(--text);
  margin: 0;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--spacing-xs);
}

.nav-toggle span {
  display: block;
  width: 28px;
  height: 3px;
  background: var(--primary);
  margin: 5px 0;
  transition: var(--transition);
}

.navbar {
  border-top: 1px solid var(--muted);
}

.nav-list {
  list-style: none;
  display: flex;
  gap: 0;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: block;
  padding: var(--spacing-sm) var(--spacing-md);
  color: var(--text);
  font-weight: 500;
  transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
  background: var(--primary);
  color: var(--white);
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--white);
  box-shadow: var(--shadow-lg);
  min-width: 250px;
  z-index: 100;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.nav-item:hover .dropdown-content {
  display: block;
}

.dropdown-content a {
  display: block;
  padding: var(--spacing-sm) var(--spacing-md);
  color: var(--text);
  border-bottom: 1px solid var(--muted);
}

.dropdown-content a:hover {
  background: var(--surface);
  color: var(--primary);
}

.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: var(--white);
  padding: var(--spacing-2xl) 0;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.3;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.hero h1 {
  margin-bottom: var(--spacing-md);
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hero p {
  font-size: clamp(1rem, 0.9rem + 0.4vw, 1.25rem);
  margin-bottom: var(--spacing-lg);
  opacity: 0.95;
}

.btn {
  display: inline-block;
  padding: var(--spacing-sm) var(--spacing-lg);
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.btn:hover {
  background: #16A34A;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-primary {
  background: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--secondary);
}

.btn-secondary:hover {
  background: #0284C7;
}

.section {
  padding: var(--spacing-2xl) 0;
}

.section-title {
  text-align: center;
  margin-bottom: var(--spacing-xl);
  color: var(--primary);
}

.section-title h2 {
  margin-bottom: var(--spacing-sm);
}

.section-title p {
  color: #64748B;
  font-size: 1.125rem;
}

.grid {
  display: grid;
  gap: var(--spacing-lg);
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.card-header {
  margin-bottom: var(--spacing-md);
}

.card-title {
  font-size: 1.25rem;
  color: var(--primary);
  margin-bottom: var(--spacing-xs);
}

.card-meta {
  font-size: 0.875rem;
  color: #64748B;
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
}

.card-body p {
  color: #475569;
  line-height: 1.6;
}

.weather-card {
  text-align: center;
  background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
  color: var(--white);
}

.weather-icon {
  font-size: 3rem;
  margin-bottom: var(--spacing-sm);
}

.weather-temp {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: var(--spacing-xs);
}

.weather-desc {
  opacity: 0.9;
}

.alert-card {
  border-left: 4px solid var(--warning);
  background: #FEF3C7;
}

.alert-card.danger {
  border-left-color: var(--danger);
  background: #FEE2E2;
}

.alert-card.success {
  border-left-color: var(--success);
  background: #D1FAE5;
}

.gempa-card {
  background: linear-gradient(135deg, #DC2626 0%, #991B1B 100%);
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.gempa-card::before {
  content: '⚠';
  position: absolute;
  top: -20px;
  right: -20px;
  font-size: 8rem;
  opacity: 0.1;
}

.gempa-magnitude {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
}

.aqi-card {
  text-align: center;
}

.aqi-value {
  font-size: 3rem;
  font-weight: 700;
  margin: var(--spacing-md) 0;
  padding: var(--spacing-lg);
  border-radius: var(--radius-lg);
}

.aqi-baik { background: #D1FAE5; color: #065F46; }
.aqi-sedang { background: #FEF3C7; color: #92400E; }
.aqi-tidak-sehat { background: #FED7AA; color: #9A3412; }
.aqi-sangat-tidak-sehat { background: #FEE2E2; color: #991B1B; }
.aqi-berbahaya { background: #E0E7FF; color: #3730A3; }

.breadcrumb {
  padding: var(--spacing-sm) 0;
  background: var(--surface);
  border-bottom: 1px solid var(--muted);
}

.breadcrumb-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
  font-size: 0.875rem;
}

.breadcrumb-item::after {
  content: '/';
  margin-left: var(--spacing-xs);
  color: var(--muted);
}

.breadcrumb-item:last-child::after {
  content: '';
}

.breadcrumb-item.active {
  color: #64748B;
}

.table-responsive {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

th, td {
  padding: var(--spacing-sm) var(--spacing-md);
  text-align: left;
  border-bottom: 1px solid var(--muted);
}

th {
  background: var(--primary);
  color: var(--white);
  font-weight: 600;
}

tr:hover {
  background: var(--surface);
}

.form-group {
  margin-bottom: var(--spacing-md);
}

label {
  display: block;
  margin-bottom: var(--spacing-xs);
  font-weight: 500;
  color: var(--text);
}

input, select, textarea {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  border: 2px solid var(--muted);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

.form-error {
  color: var(--danger);
  font-size: 0.875rem;
  margin-top: var(--spacing-xs);
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.checkbox-group input {
  width: auto;
}

.toast {
  position: fixed;
  bottom: var(--spacing-lg);
  right: var(--spacing-lg);
  background: var(--success);
  color: var(--white);
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 9999;
  animation: slideIn 0.3s ease;
}

.toast.error {
  background: var(--danger);
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.back-to-top {
  position: fixed;
  bottom: var(--spacing-lg);
  right: var(--spacing-lg);
  background: var(--primary);
  color: var(--white);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 999;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-4px);
}

.footer {
  background: var(--text);
  color: var(--white);
  padding: var(--spacing-xl) 0 var(--spacing-md);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
}

.footer-section h3 {
  margin-bottom: var(--spacing-md);
  color: var(--accent);
}

.footer-section p, .footer-section li {
  color: #CBD5E1;
  line-height: 1.8;
}

.footer-section ul {
  list-style: none;
}

.footer-section a {
  color: #CBD5E1;
}

.footer-section a:hover {
  color: var(--accent);
}

.social-links {
  display: flex;
  gap: var(--spacing-md);
  margin-top: var(--spacing-md);
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  transition: var(--transition);
}

.social-links a:hover {
  background: var(--accent);
  transform: translateY(-4px);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: var(--spacing-md);
  text-align: center;
  color: #94A3B8;
}

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .navbar {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    max-height: 0;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
  }

  .navbar.active {
    max-height: 500px;
  }

  .nav-list {
    flex-direction: column;
  }

  .nav-item {
    border-bottom: 1px solid var(--muted);
  }

  .dropdown-content {
    position: static;
    box-shadow: none;
    background: var(--surface);
    display: none;
  }

  .nav-item.active .dropdown-content {
    display: block;
  }

  .topbar-content {
    font-size: 0.75rem;
  }

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .logo {
    width: 50px;
    height: 50px;
  }

  .brand-text h1 {
    font-size: 1rem;
  }

  .brand-text p {
    font-size: 0.7rem;
  }
}

.honeypot {
  position: absolute;
  left: -9999px;
}
