@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&family=Poppins:wght@300;400;600;700&display=swap');

:root {
  --bg: #ffffff;
  --surface: #f6fbff;
  --surface-2: #eef7ff;
  --text: #0f172a;
  --muted: #475569;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-50: #eff6ff;
  --green-500: #22c55e;
  --green-50: #f0fdf4;
  --red-600: #dc2626;
  --border: #e2e8f0;
  --radius: 14px;
  --shadow: 0 4px 15px rgba(2, 132, 199, 0.08);
  --transition: 200ms ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Poppins', 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* Header */
header {
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.95);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 20px rgba(0,0,0,0.08);
  z-index: 50;
}

.nav {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--blue-600);
  font-size: 1.4rem;
  cursor: pointer;
}

.brand span {
  color: var(--green-500);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 12px;
  font-weight: 500;
}

.nav a:hover {
  color: var(--blue-600);
  background: var(--blue-50);
}

.nav a.active {
  color: var(--blue-600);
  background: var(--blue-50);
  font-weight: 600;
}

/* Mobile Menu */
.menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.menu-toggle.active {
  background: var(--blue-600);
}

.menu-toggle.active span {
  background-color: white;
}

.menu-toggle span {
  width: 24px;
  height: 2px;
  background-color: var(--text);
  margin: 3px 0;
  border-radius: 1px;
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links.mobile-hidden {
  display: none;
}

/* Desktop specific styles */
@media (min-width: 769px) {
  .nav-links a.active {
    background: var(--blue-50);
    border: 1px solid var(--blue-200);
  }
}

/* Emergency button removed */

/* Hero */
.hero {
   max-width: 1100px;
  margin: 40px auto 24px;
  padding: 36px 24px;
  background: var(--blue-50);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  text-align: center;
}
.hero h1 { font-size: 2.2rem; font-weight: 700; margin-bottom: 10px; }
.hero p { color: var(--muted); margin-bottom: 18px; }
.hero .cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn { background: var(--blue-600); color: #fff; padding: 12px 18px; border-radius: 12px; text-decoration: none; box-shadow: var(--shadow); }
.btn.alt { background: #fff; color: var(--blue-600); border: 1px solid var(--border); }

/* Sections */
.section { max-width: 1100px; margin: 0 auto; padding: 28px 24px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 16px; }
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 0.95rem; }

/* Forms */
.form { max-width: 400px; margin: 0 auto; background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.field input { width: 100%; padding: 12px 12px; border: 1px solid var(--border); border-radius: 10px; outline: none; }
.field input:focus { border-color: var(--blue-600); box-shadow: 0 0 0 4px var(--blue-50); }
.submit { width: 100%; }

/* Chat */
.chat-container {
  width: 100%;
  max-width: 500px;
  background: white;
  padding: 24px;
  border-radius: 20px;
  box-shadow: var(--shadow);
  margin: 0 auto;
  border: 1px solid var(--border);
}

.chat-messages {
  height: 350px;
  overflow-y: auto;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 16px;
  background: var(--surface);
}

.message {
  display: flex;
  margin-bottom: 16px;
  align-items: flex-start;
  gap: 12px;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.usuario {
  flex-direction: row-reverse;
}

.usuario .message-avatar {
  background: var(--blue-100);
}

.ia .message-avatar {
  background: var(--green-100);
}

.message-content {
  background: white;
  padding: 12px 16px;
  border-radius: 16px;
  max-width: 70%;
  word-wrap: break-word;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border: 1px solid var(--border);
}

.usuario .message-content {
  background: var(--blue-600);
  color: white;
  text-align: right;
}

.welcome-message {
  background: linear-gradient(135deg, var(--green-50), var(--blue-50));
  border: 1px solid var(--green-200);
}

.input-area {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

#input-mensaje {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 24px;
  outline: none;
  font-size: 16px;
  transition: border-color var(--transition);
}

#input-mensaje:focus {
  border-color: var(--blue-600);
}

.send-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: 24px;
  background: var(--blue-600);
  color: white;
  cursor: pointer;
  font-weight: 600;
  box-shadow: var(--shadow);
}

.send-btn:hover {
  background: var(--blue-700);
}

.send-btn:hover {
  background: var(--blue-700);
}

.chat-suggestions {
  text-align: center;
}

.suggestion-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.suggestion-btn {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: white;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
}

.suggestion-btn:hover {
  background: var(--blue-50);
  border-color: var(--blue-300);
  color: var(--blue-700);
}

/* Emergency Cards */
.emergency-card,
.support-card,
.general-card,
.global-card,
.chat-card,
.resource-card,
.info-card {
  border-left: 4px solid;
  background: #ffffff;
  padding: 16px;
  margin-bottom: 12px;
  border-radius: 8px;
}

.emergency-card {
  border-left-color: #dc2626;
}

.support-card {
  border-left-color: #22c55e;
}

.general-card {
  border-left-color: #3b82f6;
}

.global-card {
  border-left-color: #8b5cf6;
}

.chat-card {
  border-left-color: #06b6d4;
}

.resource-card {
  border-left-color: #f59e0b;
}

.info-card {
  border-left-color: #8b5cf6;
}

.card-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
  text-align: center;
  display: block;
}

.contact-info {
  background: rgba(59, 130, 246, 0.1);
  padding: 10px 14px;
  border-radius: 8px;
  margin: 16px 0;
  font-weight: 600;
  color: var(--blue-600);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.btn {
  display: inline-block;
  padding: 12px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
  border: none;
  cursor: pointer;
  margin: 20px 0 8px 0;
}

.emergency-btn {
  background: #dc2626;
  color: white;
  width: 100%;
  display: block;
}

.emergency-btn:hover {
  background: #b91c1c;
  
}

.support-btn {
  background: #22c55e;
  color: white;
  width: 100%;
  display: block;
}

.support-btn:hover {
  background: #16a34a;
  
}

.general-btn {
  background: #3b82f6;
  color: white;
  width: 100%;
  display: block;
}

.general-btn:hover {
  background: #2563eb;
  
}

.chat-btn {
  background: #06b6d4;
  color: white;
  width: 100%;
  display: block;
}

.chat-btn:hover {
  background: #0891b2;
  
}

.resource-btn {
  background: #f59e0b;
  color: white;
  width: 100%;
  display: block;
}

.resource-btn:hover {
  background: #d97706;
  
}

.info-btn {
  background: #8b5cf6;
  color: white;
  width: 100%;
  display: block;
}

.info-btn:hover {
  background: #7c3aed;
  
}

.link-secondary {
  color: var(--blue-600);
  text-decoration: none;
  font-size: 0.9rem;
  display: inline-block;
  margin-top: 12px;
  padding: 6px 12px;
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.link-secondary:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: var(--blue-400);
  text-decoration: none;
}

.link-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.link-global {
  color: var(--blue-600);
  text-decoration: none;
  padding: 10px 16px;
  border: 1px solid var(--blue-200);
  border-radius: 8px;
  text-align: center;
  transition: all 0.2s ease;
  font-weight: 500;
}

.link-global:hover {
  background: var(--blue-50);
  border-color: var(--blue-400);
  text-decoration: none;
  
}

/* Remove duplicate styles - already defined above */

/* Footer */
footer { border-top: 1px solid var(--border); margin-top: 24px; }
.footer-inner { max-width: 1100px; margin: 0 auto; padding: 20px 24px; color: var(--muted); font-size: 0.95rem; text-align: center; }

/* Desktop Enhancements */
@media (min-width: 769px) {
  .nav-links {
    gap: 12px;
  }

  .nav a {
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 600;
  }

  .nav a:hover {
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.2);
  }

  .brand {
    font-size: 1.6rem;
  }

  .emergency-btn {
    padding: 12px 20px;
    font-weight: 600;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.7rem; }
  .nav { padding: 14px 16px; }

  .menu-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    flex-direction: column;
    align-items: stretch;
    padding: 20px 16px;
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
    gap: 0;
  }
  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  .nav-links a {
    margin: 4px 0;
    padding: 12px 16px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    transition: all var(--transition);
  }
  .nav-links a:hover {
    background: var(--blue-50);
    color: var(--blue-600);
  }
  .emergency-btn {
    margin-top: 12px;
    align-self: center;
  }

  .chat-container {
    width: 95%;
    padding: 16px;
  }
  .chat-messages { height: 250px; }
}
