:root {
  /* --- NUEVA PALETA DE COLORES (AZULES Y CELESTES) --- */
  --primary-color: #3674b5; /* Azul principal (para botones, header, etc.) */
  --primary-hover: #578fca; /* Azul más claro/dinámico (para el hover) */
  --accent-soft: #d1f8ef; /* Tono pastel claro (para badges y fondos ligeros) */
  --accent-soft-2: #93cdfd; /* Tono pastel claro (para badges y fondos ligeros) */
  --accent-text: #3674b5; /* Texto sobre fondo accent-soft */

  /* --- FONDOS Y SUPERFICIES --- */
  --bg-main: #f8fafc; /* Gris/Azul ultra claro para el fondo de la página */
  --bg-card: #ffffff; /* Blanco puro para tarjetas y headers */

  /* --- TIPOGRAFÍA Y TEXTOS --- */
  --font-main: "Poppins", sans-serif;
  --font-main2: "Quicksand", sans-serif;
  --font-main3: "Alata", sans-serif;
  --text-dark: #1e293b; /* Gris muy oscuro para títulos principales */
  --text-muted: #64748b; /* Gris medio para subtítulos y textos secundarios */

  /* --- BORDES Y SOMBRAS --- */
  --border-color: #e2e8f0; /* Líneas de división sutiles */
  --radius-sm: 8px; /* Redondeado para botones e inputs */
  --radius-md: 12px; /* Redondeado para tarjetas */
  --radius-full: 9999px; /* Redondeado tipo píldora (para badges) */

  /* --- ELEVACIÓN (SOMBRAS) --- */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-card:
    0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-hover:
    0 10px 15px -3px rgba(54, 116, 181, 0.15),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
  min-height: 100vh;
  width: 100%;
  margin: 0;
  display: flex;
  align-items: center;
  flex-direction: column;
  background-color: var(--bg-main);
  font-family: var(--font-main);
}

/** Estilos del Header*/

.header {
  background-color: var(--primary-color);
  width: 100%;
  height: 6rem;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 0 4rem;
}

.logo img {
  height: 80px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav-links a {
  font-size: 1.1rem; /* Ajustado para mejor proporción visual */
  color: white;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.nav-links a:hover {
  opacity: 0.8;
}

.btn-login {
  font-size: 1rem;
  padding: 0.6rem 1.4rem;
  border-radius: 8px;
  border: none;
  background-color: white;
  color: var(--primary-color);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-login:hover {
  background-color: #f1f5f9;
}

/**Hero*/

.hero {
  width: 100%;
  min-height: 55vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem 1rem;

  /*background-image:
    linear-gradient(rgba(15, 23, 42, 0.65), rgba(15, 23, 42, 0.65)),
    url("images/Gemini_Generated_Image_t4943vt4943vt494.jpeg");
*/
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.8), rgba(15, 23, 42, 0.65)),
    url("images/Gemini_Generated_Image_t4943vt4943vt494.jpeg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero h1 {
  color: white;
  font-size: 2.5rem;
  margin: 1rem;
  max-width: 800px;
  font-family: var(--font-main);
  font-weight: 400;
}

.hero h1 span {
  color: var(--primary-color);
  font-family: var(--font-main2);
  font-weight: bold;
}

.hero p {
  color: #e2e8f0;
  font-size: 1.4rem;
  margin-bottom: 2rem;
  font-family: var(--font-main1);
  letter-spacing: 0.5px;
}

/**Search bar **/

.search-bar {
  width: 90%;
  max-width: 750px;
  background-color: #ffffff;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-around;
  padding: 0.5rem 0.8rem;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

#search-form {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 0.5rem;
}

.input-group {
  flex: 1;
  height: 3rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 0.8rem;
}

.input-icon {
  font-size: 1.3rem;
  user-select: none;
}

.input-group input {
  width: 100%;
  height: 100%;
  font-size: 1rem;
  color: var(--text-dark);
  border: none;
  outline: none;
  background: transparent;
}

.input-group input::placeholder {
  color: #94a3b8;
}

.search-divider {
  width: 2px;
  height: 55%;
  background-color: var(--border-color);
}

.btn-search {
  height: 3rem;
  background-color: var(--primary-color);
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0 1.8rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

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

/** Main **/

.main-container {
  width: 90%;
  max-width: 1200px;
  margin: 2rem auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.main-container h2 {
  width: 100%;
  margin-bottom: 2rem;
  text-align: left;
  font-size: 1.8rem;
  color: var(--text-dark);
}

#doctores-container {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.doctor-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-radius: var(--radius-md);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.doctor-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.avatar-sm {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  margin-bottom: 1rem;
}

.info-sm {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.badge {
  background-color: var(--accent-soft);
  color: var(--accent-text);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
}

.info-sm h3 {
  font-size: 1.2rem;
  color: var(--text-dark);
  margin-top: 0.2rem;
}

.info-sm p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.btn-agendar {
  width: 100%;
  margin-top: 1rem;
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

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

footer {
  width: 100%;
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

/* ==========================================
   📱 ESTILOS RESPONSIVOS PARA CELULARES
   ========================================== */

@media (max-width: 768px) {
  /* 1. Header en celular */
  .header {
    height: auto;
    padding: 1rem;
    flex-direction: column;
    gap: 1rem;
  }

  .logo img {
    height: 45px;
  }

  .nav-links {
    width: 100%;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
  }

  .nav-links a {
    font-size: 0.95rem;
  }

  .btn-login {
    width: 100%;
    max-width: 200px;
    font-size: 0.9rem;
    padding: 0.5rem;
  }

  /* 2. Sección Hero en celular */
  .hero {
    min-height: auto;
    padding: 2.5rem 1rem;
  }

  .hero h1 {
    font-size: 1.6rem;
    margin: 0.5rem 0;
  }

  .hero p {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
  }

  /* 3. Barra de búsqueda apilada verticalmente de forma fluida */
  .search-bar {
    width: 95%;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.8rem;
    border-radius: 12px;
  }

  #search-form {
    flex-direction: column;
    width: 100%;
    gap: 0.6rem;
  }

  .input-group {
    width: 100%;
    height: 3rem;
    padding: 0 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #fafafa;
  }

  .search-divider {
    display: none; /* Ocultamos la línea divisoria vertical en móviles */
  }

  .btn-search {
    width: 100%;
    height: 3rem;
    padding: 0;
  }

  /* 4. Contenedor Principal y Tarjetas */
  .main-container {
    width: 95%;
    margin: 1.5rem auto;
  }

  .main-container h2 {
    font-size: 1.4rem;
    text-align: center;
    margin-bottom: 1.2rem;
  }

  #doctores-container {
    grid-template-columns: 1fr; /* Una sola columna para celulares */
    gap: 1.2rem;
  }

  .doctor-card {
    padding: 1.2rem;
  }
}
