body {
    font-family: Arial, sans-serif;
    background: #f4f4f4;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    min-height: 400px; /* Evita saltos al cambiar de página */
}

.gallery-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    transition: transform .2s;
}

.gallery-img:hover {
    transform: scale(1.05);
}

/* Contenedor del botón de volver */
.back-container {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    margin-bottom: 20px;
}

/* Botón de volver al inicio */
#back-button {
    display: inline-block;
    padding: 14px 32px;
    font-size: 18px;
    background:  rgba(255, 0, 200, 0.35);
    color: white;
    border: none;
    border-radius: 50px;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(33, 33, 33, 0.35);
    transition: all 0.3s ease;
    font-weight: 500;
    letter-spacing: 0.5px;
    border: 1px solid #555;
}

#back-button:hover {
    background: #da02a0;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(63, 63, 63, 0.35);
    border-color: #777;
}

/* Fondo del visor */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}

/* Imagen ampliada */
.lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 12px;
    box-shadow: 0 0 25px rgba(0,0,0,0.5);
    transform: scale(0.85);
    transition: transform .25s ease;
}

/* Estado visible */
.lightbox.show {
    opacity: 1;
    pointer-events: auto;
}

.lightbox.show img {
    transform: scale(1);
}

/* Oculto */
.lightbox.hidden {
    display: none;
}

.background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: url('background.webp') no-repeat center center fixed;
  background-size: cover;
  z-index: -1;
}

/* Estilos para la paginación */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 30px 0 20px 0;
    padding: 15px;
}

.pagination-btn {
    padding: 12px 24px;
    font-size: 16px;
    background:  rgba(255, 0, 200, 0.35);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    min-width: 120px;
}

.pagination-btn:hover:not(:disabled) {
    background: #da02a0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.pagination-btn:disabled {
    background: #e0cbdd;
    cursor: not-allowed;
    opacity: 0.6;
}

#page-info {
    font-size: 18px;
    color: #333;
    font-weight: 500;
    padding: 0 10px;
}

#current-page, #total-pages {
    font-weight: bold;
    color: #4a5568;
    background: #edf2f7;
    padding: 4px 8px;
    border-radius: 6px;
    margin: 0 2px;
}

/* Ajuste del grid */


/* Responsive para móviles */
@media (max-width: 600px) {
    .pagination-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .pagination-btn {
        width: 100%;
        max-width: 200px;
    }
    
    #page-info {
        order: -1; /* La info de página arriba en móvil */
        margin-bottom: 10px;
    }
}

    #header-bubble {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);

  padding: 10px 18px;
  font-size: 30px;
  color: white;
  white-space: nowrap; /* fuerza una sola línea */

  background: rgba(255, 0, 200, 0.35); /* rosa translúcido */
  backdrop-filter: blur(6px);
  border-radius: 14px;

  z-index: 2000; /* por encima de todo */
  pointer-events: none; /* no bloquea clics */
}

/* Controles del lightbox */
.lightbox-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 1002;
}

.lightbox-btn {
    padding: 12px 24px;
    font-size: 16px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.lightbox-btn.delete-btn:hover {
    background: rgba(255, 80, 80, 0.6);
    border-color: rgba(255, 150, 150, 0.8);
}

.lightbox-btn.close-btn:hover {
    background: rgba(100, 100, 100, 0.6);
}

/* Modal de confirmación */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 1;
    transition: opacity 0.25s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 16px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
    margin-top: 0;
    color: #333;
    font-size: 24px;
}

.modal-content p {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.5;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.modal-btn {
    padding: 12px 30px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.modal-btn.delete-btn {
    background: #dc3545;
    color: white;
}

.modal-btn.delete-btn:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.modal-btn:not(.delete-btn) {
    background: #6c757d;
    color: white;
}

.modal-btn:not(.delete-btn):hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 600px) {
    .lightbox-controls {
        flex-direction: column;
        bottom: 20px;
        width: 90%;
    }
    
    .lightbox-btn {
        justify-content: center;
    }
    
    .modal-buttons {
        flex-direction: column;
    }
}