/* CSS Variables for Professional Design */
:root {
  --primary-color: #1e3a5f;
  --secondary-color: #2563eb;
  --accent-color: #f59e0b;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  --background-secondary: #f1f5f9;
  --white: #ffffff;
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --gradient-primary: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  --gradient-accent: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --gradient-background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 20%, #f1f5f9 40%, #f8fafc 60%, #e5e7eb 100%);
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
  --border-radius-xl: 20px;
}

/* Modern Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Remover subrayado de todos los enlaces */
a {
  text-decoration: none;
  color: inherit;
}

html {
  background: #e2e8f0 !important;
  min-height: 100vh;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #e5e7eb !important;
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  position: relative;
}

/* Sutil patrón de fondo para más elegancia */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 25% 25%, rgba(37, 99, 235, 0.02) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(245, 158, 11, 0.02) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
  position: relative;
  z-index: 1;
}

/* Professional Header */
.hero {
  background: 
    linear-gradient(135deg, rgba(30, 58, 95, 0.85) 0%, rgba(37, 99, 235, 0.75) 100%),
    url('images/moquegua-banner.png') center/cover no-repeat;
  height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-xl);
  position: relative;
  margin: 2rem 0 4rem 0;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(1px);
}

.hero .overlay {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 3rem 2rem;
  text-align: center;
  color: #ffffff;
  border-radius: var(--border-radius-lg);
  max-width: 700px;
  position: relative;
  z-index: 2;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.hero h1 {
  font-size: clamp(2.25rem, 4vw, 3.5rem);
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  letter-spacing: -0.025em;
}

.hero p {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 400;
  opacity: 0.95;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  line-height: 1.6;
}

/* Professional Grid Layout */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin: 3rem 0 4rem 0;
}

/* Premium Card Design */
.card {
  position: relative;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--border-radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.3);
  height: fit-content;
}

.card a {
  display: block;
  text-decoration: none;
  color: inherit;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover::before {
  opacity: 1;
}

.card:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: var(--shadow-xl);
  border-color: rgba(37, 99, 235, 0.2);
  background: rgba(255, 255, 255, 0.98);
}

.card:hover::after {
  opacity: 1;
}

.card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.03) 0%, rgba(245, 158, 11, 0.02) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.card:hover img {
  transform: scale(1.05);
}

.card-content {
  padding: 2rem;
  position: relative;
  z-index: 1;
}

.card-content h3 {
  color: var(--primary-color);
  font-size: 1.375rem;
  font-weight: 600;
  margin-bottom: 1rem;
  letter-spacing: -0.025em;
  line-height: 1.3;
}

.card-content p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

/* Add subtle hover effect for card content */
.card:hover .card-content h3 {
  color: var(--secondary-color);
}

/* Professional Map Container */
.map-container {
  position: relative;
  margin: 4rem 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-radius: var(--border-radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}

.map-container:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(37, 99, 235, 0.05);
}

.map-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
  border-radius: var(--border-radius-xl) var(--border-radius-xl) 0 0;
}

.map-title {
  color: var(--primary-color);
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 1.5rem;
  letter-spacing: -0.025em;
  position: relative;
}

.map-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--gradient-accent);
  border-radius: 2px;
}

#mapa {
  height: 550px;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 2px solid rgba(37, 99, 235, 0.1);
  transition: all 0.3s ease;
  position: relative;
}

#mapa:hover {
  border-color: rgba(37, 99, 235, 0.2);
  box-shadow: var(--shadow-lg);
}

/* Estilo para controles del mapa */
#mapa .leaflet-control-container {
  font-family: inherit;
}

#mapa .leaflet-control-zoom {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(37, 99, 235, 0.1) !important;
  border-radius: var(--border-radius-md) !important;
  box-shadow: var(--shadow-md) !important;
}

#mapa .leaflet-control-zoom a {
  background: transparent !important;
  border: none !important;
  color: var(--primary-color) !important;
  font-weight: 600 !important;
  transition: all 0.2s ease !important;
}

#mapa .leaflet-control-zoom a:hover {
  background: var(--secondary-color) !important;
  color: white !important;
  transform: scale(1.05) !important;
}

/* Popup personalizado del mapa */
#mapa .leaflet-popup-content-wrapper {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(15px) !important;
  -webkit-backdrop-filter: blur(15px) !important;
  border-radius: var(--border-radius-md) !important;
  box-shadow: var(--shadow-lg) !important;
  border: 1px solid rgba(37, 99, 235, 0.1) !important;
}

#mapa .leaflet-popup-content {
  font-family: inherit !important;
  color: var(--text-primary) !important;
  font-size: 0.95rem !important;
  line-height: 1.6 !important;
}

#mapa .leaflet-popup-tip {
  background: rgba(255, 255, 255, 0.95) !important;
  border: 1px solid rgba(37, 99, 235, 0.1) !important;
}

/* Modern Footer */
footer {
  background: var(--gradient-primary);
  color: white;
  text-align: center;
  padding: 3rem 2rem;
  border-radius: var(--border-radius-xl);
  margin: 4rem 0 2rem 0;
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

/* Professional Responsive Design */
@media (max-width: 768px) {
  main {
    padding: 0 0.75rem;
  }

  .hero {
    height: 350px;
    margin: 1rem 0 3rem 0;
    border-radius: var(--border-radius-lg);
  }

  .hero .overlay {
    padding: 2rem 1.5rem;
    border-radius: var(--border-radius-md);
  }

  .hero h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 2rem 0 3rem 0;
  }

  .card {
    border-radius: var(--border-radius-lg);
  }

  .card-content {
    padding: 1.5rem;
  }

  .card-content h3 {
    font-size: 1.25rem;
  }

  .card-content p {
    font-size: 0.9rem;
  }

  .map-container {
    margin: 3rem 0;
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
  }
  
  .map-title {
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
  }

  #mapa {
    height: 350px;
    border-radius: var(--border-radius-md);
  }

  footer {
    padding: 2rem 1.5rem;
    border-radius: var(--border-radius-lg);
    margin: 3rem 0 1rem 0;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .grid {
    gap: 1.25rem;
  }
  
  .card img {
    height: 180px;
  }
  
  .card-content {
    padding: 1.25rem;
  }
  
  .map-container {
    padding: 1.25rem;
  }
  
  #mapa {
    height: 280px;
  }
}

/* Improved focus states for accessibility */
.card:focus-visible {
  outline: 2px solid var(--secondary-color);
  outline-offset: 4px;
}

/* Subtle animations for better UX */
.card-content h3,
.card-content p {
  transition: color 0.3s ease;
}

/* Enhanced shadow for better depth perception */
@media (hover: hover) {
  .card:hover {
    box-shadow: 
      0 25px 50px -12px rgba(0, 0, 0, 0.15),
      0 0 0 1px rgba(37, 99, 235, 0.05);
  }
}

/* Estilo general para los logos */
.hero {
  position: relative; /* Necesario para que los logos se posicionen dentro del header */
}

.logo {
  position: absolute;
  top: 2%;
  width: 12vw; /* ancho relativo al ancho de la ventana */
  max-width: 180px; /* evita que crezca demasiado en pantallas grandes */
  height: auto;
  z-index: 10;
}

/* Logo izquierdo */
.logo-left {
  left: 20px; 
}

/* Logo derecho */
.logo-right {
  right: 20px; 
  border-radius: 40%;
  overflow: hidden;
  border: 2px solid white; 
}
