/* Dangpanan/assets/css/landing.css - FINAL RESPONSIVE & THEME FIX */

:root {
  --primary: #ef4444;
  --red-alert: #ef4444;
  --green-safe: #22c55e;
  --warning: #eab308;

  --bg-dark: #09090b;
  --surface: rgba(24, 24, 27, 0.8);
  --border: rgba(63, 63, 70, 0.5);

  --text-main: #ffffff;
  --text-muted: #a1a1aa;

  --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  background-color: var(--bg-dark); /* Fallback color */

  /* --- CINEMATIC BACKGROUND SETUP --- */
  background-image: 
    /* 1. The Dark Overlay: 
       - Top is 92% dark (almost black) to make the header text pop.
       - Bottom is 85% dark to let the Earth glow show through slightly. */
    linear-gradient(
      to bottom,
      rgba(9, 9, 11, 0.85) 0%,
      rgba(9, 9, 11, 0.85) 100%
    ),
    /* 2. Your Earth Image */ url("../img/EARTH.jpg");

  background-size: cover; /* Stretches image to fill screen */
  background-position: center bottom; /* Aligns the earth glow to the bottom */
  background-attachment: fixed; /* Keeps background still while scrolling */
  background-repeat: no-repeat;
  /* ----------------------------------- */

  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

main {
  flex: 1;
}

/* ================= HEADER & NAVIGATION ================= */

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 5%;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1000;
  width: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  font-size: 1.5rem;
  text-decoration: none;
  color: var(--text-main);
  z-index: 1001;
}

.nav-menu {
  display: flex;
  align-items: center;
}

.user-session-info {
  display: flex;
  align-items: center;
  gap: 20px;
  color: white;
}

.btn-secure {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border);
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-secure:hover {
  border-color: var(--primary);
  background: rgba(239, 68, 68, 0.1);
}

.hamburger {
  display: none;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  z-index: 1001;
}

/* ================= HERO ================= */

.hero {
  text-align: center;
  padding: 80px 20px;
  max-width: 900px;
  margin: 0 auto;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 2rem;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

h1 {
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 900;
  line-height: 0.9;
  margin-bottom: 1.5rem;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 3rem;
}

/* ================= GRID & CARDS ================= */

.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto 80px;
  padding: 0 2rem;
}

.card {
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  padding: 3rem 2rem;
  border-radius: 20px;
  text-align: center;
  transition: transform 0.3s;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card:hover {
  transform: translateY(-8px);
  border-color: rgba(255, 255, 255, 0.2);
}

.icon-wrapper {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  display: inline-flex;
  justify-content: center;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.card-text {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.btn-action {
  width: 100%;
  padding: 1rem;
  border-radius: 10px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  margin-top: 1.5rem;
  transition: transform 0.2s;
}

.btn-action:hover {
  transform: scale(1.02);
}

.evacuee-card .btn-action {
  background: var(--red-alert);
  color: white;
}
.host-card .btn-action {
  background: var(--warning);
  color: #422006;
}

/* ================= MODAL ================= */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: #18181b;
  padding: 3rem;
  border-radius: 20px;
  text-align: center;
  max-width: 450px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* --- NEW: Modal Button Styles (Merged) --- */

.modal-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  justify-content: center;
}

.btn-modal-login,
.btn-modal-reg {
  flex: 1;
  padding: 1rem;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-modal-login {
  background: var(--surface);
  color: var(--text-main);
  border: 1px solid var(--border);
}

.btn-modal-login:hover {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.05);
}

.btn-modal-reg {
  background: var(--primary);
  color: white;
}

.btn-modal-reg:hover {
  background: #dc2626; /* Darker red */
  transform: translateY(-2px);
}

.btn-cancel {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  margin-top: 1rem;
  text-decoration: underline;
}

.btn-cancel:hover {
  color: var(--text-main);
}

/* ================= ANIMATIONS ================= */

.pulse-dot {
  width: 8px;
  height: 8px;
  background: #f87171;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================= RESPONSIVE RULES ================= */

.mobile-tablet-only {
  display: none !important;
}

@media screen and (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }
  .mobile-tablet-only {
    display: flex !important;
    align-items: center;
  }

  header {
    padding: 1rem 4%;
    gap: 12px;
  }

  .logo span {
    font-size: 1.2rem;
  }

  .user-profile-wrapper {
    position: relative;
    z-index: 1100;
  }

  .user-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 14px 6px 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    transition: all 0.2s ease;
    cursor: pointer;
  }

  .user-pill:hover {
    border-color: var(--primary);
  }

  .user-avatar {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--primary), #f97316);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 0.9rem;
  }

  .user-name-pill {
    color: var(--text-main);
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
  }

  /* THEME SYNC: Dark Dropdown matching the landing page cards */
  .dropdown-content {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    background: #18181b; /* Solid dark theme color */
    backdrop-filter: blur(12px); /* Glassmorphism effect */
    min-width: 170px;
    border-radius: 12px;
    border: 1px solid var(--border); /* Standardized border */
    box-shadow: var(--shadow);
    padding: 8px;
    z-index: 2000;
  }

  .dropdown-content.active {
    display: block;
    animation: slideDown 0.2s ease-out;
  }

  .logout-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 700;
    border-radius: 10px;
    font-size: 0.9rem;
    transition: all 0.2s;
  }

  .logout-link i {
    color: var(--red-alert);
  }

  .logout-link:hover {
    background: rgba(239, 68, 68, 0.1); /* Subtle theme tint */
    color: var(--red-alert);
  }

  .hero {
    padding: 40px 20px;
  }
  .hero h1 {
    font-size: 2.5rem;
  }
  .grid-container {
    grid-template-columns: 1fr 1fr;
    gap: 15px;
  }
}

@media screen and (max-width: 600px) {
  header {
    padding: 0.8rem 3%;
  }
  .grid-container {
    grid-template-columns: 1fr;
  }
  .user-name-pill {
    max-width: 90px;
  }
}

/* ====== Enhanced Responsiveness ====== */
@media screen and (max-width: 480px) {
  .hero h1 {
    font-size: 1.75rem;
    line-height: 1.2;
  }
  .hero p, .hero-description {
    font-size: 0.9rem;
  }
  .hero-buttons, .cta-group {
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
  }
  .hero-buttons a, .cta-group a, .cta-btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
  .partner-logos {
    gap: 1rem;
    flex-wrap: wrap;
  }
  .partner-logos img {
    height: 28px;
  }
  .section-title {
    font-size: 1.25rem;
  }
  .feature-card, .info-card {
    padding: 1rem;
  }
}

@media screen and (max-width: 360px) {
  .hero h1 {
    font-size: 1.4rem;
  }
  .grid-container {
    grid-template-columns: 1fr;
  }
}
