/* --- VARIABLES Y RESET --- */
:root {
  --primary: #0087a8;
  --primary-dark: #005f76;
  --accent: #20c997;
  --dark: #1a202c;
  --light: #f7fafc;
  --white: #ffffff;
  --danger: #e53e3e;
  --warning: #d69e2e;
  --success: #38a169;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Poppins", sans-serif;
  background-color: var(--light);
  color: var(--dark);
  scroll-behavior: smooth;
}

/* --- COMPONENTES GLOBALES --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.btn {
  padding: 12px 25px;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: white;
}

/* --- NAVBAR --- */
nav {
  position: sticky;
  top: 0;
  width: 100%;
  padding: 20px 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}
.logo span {
  color: var(--accent);
}

/* --- MANEJO DE VISTAS --- */
.view-section {
  display: none;
  opacity: 0;
  min-height: 80vh;
}

.view-section.active {
  display: block;
  animation: fadeIn 0.5s forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- HERO --- */
.hero {
  background:
    linear-gradient(135deg, rgba(0, 135, 168, 0.9), rgba(26, 32, 44, 0.8)),
    url("https://images.unsplash.com/photo-1606811841689-23dfddce3e95?auto=format&fit=crop&w=1920&q=80")
      center/cover;
  color: white;
  text-align: center;
  padding: 100px 20px;
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 20px;
}
.hero p {
  font-size: 1.2rem;
  max-width: 800px;
  margin: 0 auto 40px;
}

/* --- GRIDS DE TARJETAS --- */
.main-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.card {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 4px solid transparent;
}

.card:hover {
  transform: translateY(-10px);
  border-color: var(--primary);
}

.card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card-body {
  padding: 25px;
}
.card-body h3 {
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-body p {
  color: #666;
  font-size: 0.9rem;
}

/* --- DETALLE DE PATOLOGÍA --- */
.pathology-header {
  margin-bottom: 40px;
}
.severity-badge {
  display: inline-block;
  padding: 8px 20px;
  border-radius: 50px;
  font-weight: 700;
  margin-bottom: 20px;
}
.sev-red {
  background: #fed7d7;
  color: var(--danger);
}
.sev-yellow {
  background: #fefcbf;
  color: var(--warning);
}
.sev-green {
  background: #c6f6d5;
  color: var(--success);
}

.content-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: start;
}

.info-block {
  background: white;
  padding: 30px;
  border-radius: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 30px;
}

.info-block h3 {
  color: var(--primary-dark);
  margin-bottom: 15px;
  border-bottom: 2px solid #f0f4f8;
  padding-bottom: 10px;
}
.medical-img {
  width: 100%;
  border-radius: 15px;
  box-shadow: var(--shadow);
}

/* --- FILTROS DIRECTORIO --- */
.filter-container {
  display: flex;
  gap: 15px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 20px;
  border-radius: 50px;
  background: #e2e8f0;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
}

.filter-btn.active {
  background: var(--primary);
  color: white;
}

.specialist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
}

.doc-card {
  background: white;
  padding: 20px;
  border-radius: 16px;
  display: flex;
  gap: 20px;
  border: 1px solid #edf2f7;
  transition: var(--transition);
}

.doc-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--primary);
}
.doc-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
}

.doc-tag {
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
  display: inline-block;
  margin-top: 5px;
}
.tag-publico {
  background: #ebf8ff;
  color: #3182ce;
}
.tag-privado {
  background: #faf5ff;
  color: #805ad5;
}
.tag-universidad {
  background: #e6fffa;
  color: #38b2ac;
}

@media (max-width: 900px) {
  .content-layout {
    grid-template-columns: 1fr;
  }
  .hero h1 {
    font-size: 2.5rem;
  }
}

/* =========================
   RESPONSIVE CELULAR
========================= */

html, body {
  width: 100%;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
}

@media (max-width: 768px) {

  nav {
    width: 100%;
    padding: 15px;
  }

  .container {
    width: 80%;
    padding: 0 15px;
  }

  .hero {
    width: 100%;
    padding: 70px 15px;
  }

  .hero h1 {
    font-size: 2rem;
    line-height: 1.2;
  }

  .hero p {
    font-size: 1rem;
  }

  .main-grid,
  .specialist-grid,
  .content-layout {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .card,
  .info-block,
  .doc-card {
    width: 100%;
  }

  .doc-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .btn {
    width: 90%;
    justify-content: center;
    margin-bottom: 10px;
  }

}