/* =========================
   Estilos base y de fondo
   ========================= */
body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background-color: #f9fafb;
  color: #111827;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
}

/* Fondo futurista más visible */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: var(--fondo-evento);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.15;
  z-index: -2;
  pointer-events: none;
  transition: background-image 1s ease-in-out;
}

.fondo-evento-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-image: var(--fondo-evento);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.5;
  z-index: -1;
}

.video-fondo {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  max-width: 100%;
  height: 100vh;
  object-fit: cover;
  z-index: -1;
}

/* =========================
   Contenido y Grillas
   ========================= */
.contenido {
  position: relative;
  z-index: 1;
  padding: 40px 5px;
  max-width: 1500px;
  margin: 0 auto;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  justify-items: center;
  padding: 24px 8px;
  margin-bottom: 20px;
}
 

/* =========================
   Tarjetas de eventos
   ========================= */
.card {
  width: 250px;        /* antes 280px */
  height: 180px;       /* antes 200px */
  padding: 16px;       /* un poco más compacto */
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  background-color: white;
  position: relative;
}

.card:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.card h3,
.card p {
  margin: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.card h3 {
  margin: 0 0 8px;
  font-size: 28px; /* más grande */
  font-weight: 600;
  font-family: 'Segoe UI', sans-serif;
}

.card p {
  margin: 0;
  color: #333; /* más oscuro para contraste */
  font-size: 22px;
  font-family: 'Segoe UI', sans-serif;
}

/* Botón de crear evento */
.card.crear {
  font-size: 48px;
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  color: white;
  font-weight: bold;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
}

.card.crear:hover {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
}

/* Tarjetas con fondo personalizado */
.card.foto-fondo {
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}

.card.foto-fondo::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  z-index: 0;
}

.card.foto-fondo * {
  position: relative;
  z-index: 1;
}

/* =========================
   Galería de archivos
   ========================= */
.galeria {
  display: grid;
  grid-template-columns: repeat(7, 1fr);  /* 👈 Fuerza 7 columnas */
  gap: 12px;
  padding: 12px;
  justify-items: center;
}

.preview-item {
  position: relative;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 0 6px rgba(0,0,0,0.1);
  text-align: center;
  margin: 6px;
  width: 100%;
   max-width: 100%;
  overflow: hidden;
    display: flex;
  flex-direction: column;
  align-items: center;
}

.media-full {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.media-full:hover {
  transform: scale(1.05);
}

.video-duration {
  position: absolute;
  bottom: 56px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 12px;
  font-weight: bold;
  padding: 3px 8px;
  border-radius: 6px;
  pointer-events: none;
  z-index: 2;
}

/* =========================
   Overlays y Previsualización Ampliada
   ========================= */
.imagen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.imagen-ampliada {
  position: relative;
  max-width: 90%;
  max-height: 90%;
}

.imagen-ampliada img,
.imagen-ampliada video {
  width: 100%;
  height: auto;
  max-height: 90vh;
  border-radius: 12px;
}

/* Botón de cierre en la previsualización */
.imagen-ampliada .cerrar {
  position: absolute;
  top: -16px;
  right: -16px;
  background: #ef4444;
  color: white;
  font-size: 20px;
  border-radius: 50%;
  padding: 6px 10px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* =========================
   Navegación en la vista ampliada
   ========================= */
.navegar {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
  color: #fff;
  cursor: pointer;
  user-select: none;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 12px;
  border-radius: 6px;
  z-index: 10000; /* Se asegura de que se sitúe sobre el contenido */
}

.navegar:hover {
  background: rgba(0, 0, 0, 0.6);
}

.navegar.anterior {
  left: 20px;
}

.navegar.siguiente {
  right: 20px;
}

/* =========================
   Botones de descarga y eliminación
   ========================= */
.download-btn,
.eliminar-btn {
  display: inline-block;
  margin: 5px 6px 0;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  border: none;
}

.download-btn {
  background-color: #f97316;
  color: white;
}

.download-btn:hover {
  background-color: #ea580c;
}

.eliminar-btn {
  background-color: #ef4444;
  color: white;
}

.eliminar-btn:hover {
  background-color: #dc2626;
}

.eliminar-evento {
  margin-top: 10px;
  background-color: #b91c1c;
  padding: 8px 14px;
  font-size: 15px;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
  transition: background-color 0.3s ease;
}
.eliminar-evento:hover {
  background-color: #991b1b;
}

/* =========================
   Formulario de subida
   ========================= */
.formulario-subida-box {
  background: #fff;
  padding: 20px;
  margin: 40px auto;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.05);
  max-width: 960px;
  text-align: center;
}

.formulario-subida-box .info-evento {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
  font-size: 15px;
  color: #374151;
}

.subida-botones {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 24px;
}

.boton-icono.grande {
  background: white;
  border: 2px solid #d1d5db;
  border-radius: 16px;
  padding: 18px;
  height: 120px;
  width: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  cursor: pointer;
}

.boton-icono.grande:hover {
  background: #f3f4f6;
}

.icono-boton-grande {
  height: 56px;
  width: auto;
  object-fit: contain;
}

.boton-imagen {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.icono-imagen-boton {
  height: auto;
  max-height: 56px;
  border: 2px solid #d1d5db;
  border-radius: 12px;
  display: block;
}

/* =========================
   Paginación
   ========================= */
#paginacion {
  text-align: center;
  margin-top: 30px;
}

#paginacion button {
  background: white;
  border: 1px solid #d1d5db;
  color: #374151;
  padding: 6px 12px;
  margin: 4px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s ease;
}

#paginacion button:hover {
  background: #f3f4f6;
}

#paginacion button.activo {
  background: #3b82f6;
  color: white;
  border-color: #2563eb;
}

/* =========================
   Media Queries
   ========================= */
@media (max-width: 1024px) {
  .galeria {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
}

@media (max-width: 600px) {
  .galeria {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .formulario-subida-box {
    padding: 16px;
    margin: 20px auto;
  }

  .download-btn,
  .eliminar-btn {
    font-size: 13px;
    padding: 4px 10px;
    margin: 4px 3px 0;
  }

  .media-full {
    height: 200px;
  }
}

@media (max-width: 480px) {
  .contenido {
    padding: 20px 10px;
  }

  .card {
    width: 100%;
    height: auto;
    min-height: 180px;
  }

  .formulario-subida-box .info-evento {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    font-size: 14px;
  }

  .boton-icono {
    width: 64px;
    height: 64px;
  }

  .icono-boton-grande {
    height: 32px;
  }

  .grid {
    grid-template-columns: repeat(1, 1fr);
  }

  .galeria {
    grid-template-columns: repeat(1, 1fr);
  }

  .media-full {
    height: auto;
  }

  .preview-item {
    padding: 4px;
  }

  .eliminar-btn,
  .download-btn {
    font-size: 12px;
    padding: 4px 8px;
  }
}

@media (max-width: 480px) {
  .boton-icono {
    padding: 8px;
    border-radius: 12px;
  }
}

.logs-link {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 10000;
  background: rgba(0,0,0,0.6);
  color: white;
  padding: 6px 12px;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
}

.logs-link:hover {
  background: rgba(0,0,0,0.8);
}

/* —————————————————————————————————————————————
   Contenedor unificado de los 4 botones
   ————————————————————————————————————————————— */
.subida-botones {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 32px;
  margin: 16px 0 24px;
}

/* —————————————————————————————————————————————
   Estilo común para todos los botones
   ————————————————————————————————————————————— */
.subida-botones .boton-icono,
.subida-botones .admin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 80px;
  width: auto;
  padding: 0 24px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* —————————————————————————————————————————————
   Icon‑buttons (MEGA, “Sube tu contenido”)
   ————————————————————————————————————————————— */
.subida-botones .boton-icono {
  background: #fff;
  border: 2px solid #d1d5db;
}
.subida-botones .boton-icono:hover {
  background: #f3f4f6;
}

/* Imagen dentro de icon‑button */
.subida-botones .icono-boton-grande {
  height: 56px;
  width: auto;
  object-fit: contain;
}

/* —————————————————————————————————————————————
   Admin‑buttons (Elegir imagen como fondo, Regenerar fondos IA)
   ————————————————————————————————————————————— */
.subida-botones .admin-btn {
  background: #ef4444;
  border: none;
  color: #fff;
}
.subida-botones .admin-btn:hover {
  background: #dc2626;
}

/* Ajuste para que en pantallas muy estrechas se apilen */
@media (max-width: 600px) {
  .subida-botones {
    flex-direction: column;
    align-items: stretch;
  }
  .subida-botones .boton-icono,
  .subida-botones .admin-btn {
    width: 100%;
    height: auto;
  }
}
.preview-item .botones {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 8px;
}
.zona-drop {
  border: 2px dashed #3b82f6;
  padding: 30px;
  text-align: center;
  color: #3b82f6;
  background: #f0f8ff;
  border-radius: 12px;
  font-weight: bold;
  margin-bottom: 20px;
  transition: background 0.3s ease;
}

.zona-drop.dragover {
  background: #e0f0ff;
  border-color: #2563eb;
}

.zona-superior-flex {
  display: flex;
  gap: 24px;
  justify-content: space-between;
  align-items: flex-start;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.05);
  padding: 24px;
  margin: 24px auto;
  max-width: 1200px;
}

.info-evento-box {
  flex: 2;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#dropzone {
  flex: 1;
  min-width: 240px;
  height: 160px;
  border: 2px dashed #3b82f6;
  border-radius: 12px;
  background: #f0f9ff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2563eb;
  font-weight: bold;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

#dropzone.dragover {
  background: #e0f2fe;
  border-color: #2563eb;
}
.nombre-archivo {
  text-align: center;
  font-size: 0.8em;
  margin-top: 6px;
  color: #333;
  word-break: break-word;
  padding: 0 5px;
  max-height: 40px;
  overflow: hidden;
}

.icono-mega,
.icono-pdf {
  width: 90%;
  max-width: 100px;
  display: block;
  margin: 0 auto;
  cursor: pointer;
}
