/* Estilos para el plugin Country Projects */

/* Añadir estilos para el botón de depuración */
#debug-country-projects {
  background-color: #0073aa;
  color: white;
  padding: 10px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

#debug-country-projects:hover {
  background-color: #005177;
}

#debug-output {
  padding: 15px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  margin-bottom: 20px;
  max-height: 400px;
  overflow-y: auto;
  border-radius: 4px;
}

/* Mejorar la visibilidad de los países */
.country-selector {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 20px;
  background-color: #f9f9f9;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.country-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 15px;
  cursor: pointer;
  border-radius: 5px;
  transition: all 0.3s ease;
  background-color: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  min-width: 120px;
  border: 2px solid transparent;
  position: relative;
}

.country-item.active {
  background-color: #f0f8ff;
  border: 2px solid #0066cc;
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.country-item.active::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid #0066cc;
}

.country-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.country-flag {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 10px;
  border: 2px solid #eee;
}

.country-flag-placeholder {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: bold;
  color: #666;
  margin-bottom: 10px;
  border: 2px solid #eee;
}

.country-name {
  font-weight: bold;
  text-align: center;
  text-transform: capitalize;
}

/* Mejorar la visibilidad de los proyectos */
.country-projects {
  display: none;
}

.country-projects.active {
  display: block;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.projects-container {
  max-width: 1200px;
  margin: 0 auto;
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.projects-section-title {
  margin: 30px 0 20px;
  font-size: 24px;
  color: #333;
  border-bottom: 2px solid #eee;
  padding-bottom: 10px;
}

.no-projects {
  text-align: center;
  padding: 30px;
  background-color: #f9f9f9;
  border-radius: 8px;
  color: #666;
}

/* Mensaje de error */
.country-projects-error {
  padding: 20px;
  background-color: #fff3f3;
  border-left: 4px solid #ff5252;
  margin-bottom: 20px;
}

/* Grid de proyectos */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

/* Tarjeta de proyecto */
.project-card {
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.project-card:hover {
  transform: translateY(-5px);
}

.project-image {
  height: 180px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.project-image.no-image {
  background-color: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-info {
  padding: 15px;
}

.project-title {
  margin: 0 0 10px;
  font-size: 18px;
  color: #333;
}

.project-address {
  margin: 0 0 15px;
  font-size: 14px;
  color: #666;
}

.view-project,
.view-map {
  display: inline-block;
  color: #0066cc;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: color 0.3s ease;
}

.view-project:hover,
.view-map:hover {
  color: #004499;
}

.arrow {
  display: inline-block;
  transition: transform 0.3s ease;
}

.view-project:hover .arrow,
.view-map:hover .arrow {
  transform: translateX(3px);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
  position: relative;
  background-color: #fff;
  margin: 5% auto;
  padding: 20px;
  border-radius: 8px;
  width: 80%;
  max-width: 800px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.close-modal {
  position: absolute;
  top: 10px;
  right: 15px;
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease;
}

.close-modal:hover {
  color: #333;
}

/* Galería en el modal */
.project-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin: 20px 0;
}

.gallery-image img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.gallery-image img:hover {
  transform: scale(1.05);
}

/* Responsive */
@media (max-width: 768px) {
  .country-selector {
    flex-direction: row;
    overflow-x: auto;
    padding: 10px 0;
    justify-content: flex-start;
  }

  .country-item {
    min-width: 100px;
    margin: 0 10px;
  }

  .projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }

  .modal-content {
    width: 95%;
    margin: 10% auto;
  }

  .project-gallery {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}

/* Estilos para la vista de imagen ampliada */
.fullscreen-image {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
}

.fullscreen-image img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.close-fullscreen {
  position: absolute;
  top: 20px;
  right: 20px;
  color: #fff;
  font-size: 30px;
  cursor: pointer;
}
