/* ========= RESET ========= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0b1e27;
    font-family: Arial, Helvetica, sans-serif;
    color: #e5e7eb;
}

/* ========= NAV ========= */
.navbar {
    background: #000;
    padding: 15px 20px;
}

.navbar a {
    color: #fff;
    text-decoration: none;
    margin-right: 15px;
}

/* ========= CONTENEDOR ========= */
.container {
    max-width: 1200px;
    margin: auto;
    padding: 30px 20px;
}

/* ========= GALERÍAS ========= */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.gallery-item {
    background: #111827;
    padding: 10px;
    border-radius: 6px;
    text-align: center;
}

/* IMAGEN – SIEMPRE VISIBLE */
.gallery-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    background: #000;
}

/* NOMBRE – SIEMPRE VISIBLE */
.gallery-item .info {
    margin-top: 8px;
    font-size: 14px;
    font-weight: bold;
    color: #ffffff;
}

/* BOTÓN – SIEMPRE VISIBLE */
.gallery-item a.btn {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 14px;
    background: #2563eb;
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    border-radius: 4px;
}

/* ========= FOTOS INTERNAS ========= */
.gallery-item .img-thumb {
    width: 100%;
    height: 180px;
    object-fit: cover;
    cursor: pointer;
}

/* ========= LIGHTBOX ========= */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
}

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

/* ========= RESPONSIVE ========= */
@media (max-width: 768px) {
    .gallery-item img,
    .gallery-item .img-thumb {
        height: 150px;
    }
}



/* =====================================================
   FIX NAVBAR GALERÍA (TÍTULO + BOTONES)
===================================================== */

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.navbar h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
}

/* contenedor de links */
.navbar a {
    white-space: nowrap;
    font-size: 14px;
}

/* agrupar botones a la derecha */
.navbar .nav-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .navbar .nav-actions {
        margin-top: 10px;
    }
}


/* =====================================================
   FIX ESTÉTICO LOGIN
===================================================== */

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
}

.login-box {
    background: #0b1e27;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    border-radius: 14px;
    box-shadow: 0 25px 70px rgba(0,0,0,.55);
}

.login-box h1 {
    color: #ffffff;
    text-align: center;
    margin-bottom: 25px;
    font-size: 22px;
}

.login-box input {
    width: 100%;
    padding: 14px;
    margin-bottom: 15px;
    border-radius: 8px;
    border: none;
    background: #111827;
    color: #ffffff;
    font-size: 14px;
}

.login-box input::placeholder {
    color: #9ca3af;
}

.login-box button,
.login-box .btn {
    width: 100%;
    padding: 12px;
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.login-box button:hover,
.login-box .btn:hover {
    background: #1d4ed8;
}


.photo-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 6px;
}


.photo-caption {
    margin-top: 6px;
    font-size: 13px;
    color: #e5e7eb;
    text-align: center;
    line-height: 1.4;
}


.lightbox-content {
    text-align: center;
}

.lightbox-caption {
    margin-top: 14px;
    color: #e5e7eb;
    font-size: 14px;
    line-height: 1.5;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}


.lightbox-content {
    text-align: center;
}

.lightbox-caption {
    margin-top: 14px;
    color: #e5e7eb;
    font-size: 14px;
    line-height: 1.5;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}


/* =====================================================
   LIGHTBOX – FOTO IZQUIERDA / TEXTO DERECHA
===================================================== */

.lightbox-content {
    display: flex;
    align-items: flex-start;   /* 🔑 CLAVE: alinear arriba */
    justify-content: center;
    gap: 30px;
    max-width: 1200px;
    padding: 40px;
}


/* FOTO */
.lightbox-content img {
    max-width: 65%;
    max-height: 80vh;
    object-fit: contain;
}

/* CAPTION */
.lightbox-caption {
    max-width: 35%;
    text-align: left;
    color: #e5e7eb;
    font-size: 15px;
    line-height: 1.6;
}

/* =========================
   RESPONSIVE (MÓVIL)
========================= */
@media (max-width: 768px) {
    .lightbox-content {
        flex-direction: column;
        padding: 20px;
    }

    .lightbox-content img {
        max-width: 100%;
        max-height: 60vh;
    }

    .lightbox-caption {
        max-width: 100%;
        text-align: center;
        margin-top: 14px;
    }
}


/* ===============================
   LIGHTBOX AVANZADO
================================ */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 60px;
    color: #fff;
    cursor: pointer;
    user-select: none;
    padding: 10px;
    z-index: 10001;
    opacity: .7;
}

.lightbox-nav:hover {
    opacity: 1;
}

.lightbox-nav.prev {
    left: 20px;
}

.lightbox-nav.next {
    right: 20px;
}

@media (max-width: 768px) {
    .lightbox-nav {
        font-size: 40px;
    }
}


.gallery-item {
    cursor: grab;
}

.gallery-item:active {
    cursor: grabbing;
}

.gallery-item img {
    pointer-events: none;
}


.gallery-item {
    cursor: grab;
}

.gallery-item:active {
    cursor: grabbing;
}

.gallery-item img {
    pointer-events: none;
    user-select: none;
}


.progress-bar {
    width: 100%;
    height: 10px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #2563eb, #1d4ed8);
    transition: width .2s;
}


.gallery-item .btn-danger {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 6px;
}


.gallery-item .actions {
    margin-top: 6px;
}

.gallery-item .btn-danger {
    display: inline-block;
    padding: 4px 12px;
    font-size: 12px;
    background: #dc2626;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
}


/* ===============================
   FIX DEFINITIVO CLICK GALERÍAS
   (IMAGEN + BOTONES FUNCIONAN)
================================ */

/* Base segura */
.gallery-grid,
.gallery-item {
    position: relative;
    z-index: 5;
}

/* IMAGEN: clickeable */
.gallery-item img {
    pointer-events: auto !important;
    cursor: zoom-in;
    position: relative;
    z-index: 6;
}

/* BOTONES: clickeables */
.gallery-item a,
.gallery-item button {
    pointer-events: auto !important;
    position: relative;
    z-index: 7;
}

/* Eliminar overlays invisibles */
.gallery-item::before,
.gallery-item::after,
.gallery-item .overlay {
    content: none !important;
    display: none !important;
    pointer-events: none !important;
}


/* ===============================
   FIX FINAL FORMULARIOS + BOTONES
================================ */

/* Habilitar botones y formularios */
button,
.btn,
input[type="submit"] {
    pointer-events: auto !important;
    position: relative;
    z-index: 20;
}

/* Inputs file y formularios */
input,
form {
    pointer-events: auto !important;
    position: relative;
    z-index: 20;
}


/* ===============================
   ADMIN - BOTÓN ELIMINAR FOTO
   VISIBLE FORZADO
================================ */

.admin-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.admin-item {
    background: #111;
    padding: 10px;
    border-radius: 12px;
    overflow: visible !important;
}

.admin-image img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    cursor: zoom-in;
    display: block;
}

.admin-actions {
    margin-top: 10px;
    text-align: center;
    display: block !important;
}

.admin-actions .btn {
    display: inline-block !important;
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 6px;
    background: #dc2626;
    color: #fff;
    text-decoration: none;
}


/* ===============================
   LIGHTBOX – FLECHAS GRANDES
================================ */

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.45);
    border: none;
    color: #fff;
    font-size: 72px;       /* tamaño de las flechas */
    cursor: pointer;
    padding: 18px 22px;
    border-radius: 14px;
    z-index: 10000;
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(0,0,0,0.7);
}


/* ===============================
   LIGHTBOX – CAPTION LATERAL
================================ */

.lightbox-content {
    display: flex;
    gap: 30px;
    max-width: 90vw;
    max-height: 85vh;
    align-items: flex-start; /* ⬅️ texto arriba */
}

.lightbox-content img {
    max-width: 65vw;
    max-height: 85vh;
    object-fit: contain;
}

.lightbox-caption {
    width: 320px;
    color: #f1f1f1;
    font-size: 15px;
    line-height: 1.6;
    text-align: left;
    overflow-y: auto;
    max-height: 85vh;
    padding-right: 10px;
}

/* Responsive móvil */
@media (max-width: 900px) {
    .lightbox-content {
        flex-direction: column;
        align-items: center;
    }

    .lightbox-caption {
        width: 100%;
        margin-top: 15px;
        text-align: center;
    }
}


/*Borrar si es necesario - Prueba */

.lightbox-caption {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: #e5e7eb;
}


.lightbox-content {
    gap: 40px;
}

.lightbox-content img {
    max-width: 68vw;
}


.lightbox-caption {
    background: rgba(0,0,0,0.35);
    padding: 18px 20px;
    border-radius: 12px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}


.lightbox-caption {
    background: rgba(0,0,0,0.35);
    padding: 18px 20px;
    border-radius: 12px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}


.gallery-item .btn {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 8px;
}


.gallery-item .btn {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 8px;
}



/* ===============================
   BOTÓN CREAR GALERÍA
================================ */

.btn-success {
    background: #16a34a; /* verde elegante */
    color: #ffffff;
}

.btn-success:hover {
    background: #15803d;
}

.btn-create {
    display: inline-block;
    margin: 25px auto 40px auto;
    padding: 12px 22px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
}



/* ===============================
   BOTÓN ELIMINAR (ROJO)
================================ */

.btn-danger {
    background: #dc2626; /* rojo elegante */
    color: #ffffff;
}

.btn-danger:hover {
    background: #b91c1c;
}


/* ===============================
   BOTÓN ELIMINAR — FORZADO ROJO
================================ */

a.btn.btn-danger,
button.btn.btn-danger {
    background-color: #dc2626 !important;
    color: #ffffff !important;
}

a.btn.btn-danger:hover,
button.btn.btn-danger:hover {
    background-color: #b91c1c !important;
}



/* ===============================
   LIGHTBOX – AJUSTE PROFESIONAL
   Foto más chica + caption fluido
================================ */

/* Contenedor general */
.lightbox-content {
    display: flex;
    align-items: flex-start;   /* alinear arriba */
    gap: 40px;                 /* espacio entre foto y texto */
    max-width: 90vw;
    max-height: 85vh;
}

/* Imagen del lightbox */
#lightbox-img {
    max-width: 62vw;           /* ⬅️ antes ocupaba demasiado */
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    flex-shrink: 0;            /* no se aplasta */
}

/* Caption */
.lightbox-caption {
    max-width: 28vw;           /* ⬅️ más espacio lateral */
    max-height: 80vh;
    overflow-y: auto;          /* scroll automático si es largo */
    padding-right: 10px;

    font-size: 15px;
    line-height: 1.5;
    color: #f5f5f5;

    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

/* Scroll elegante (opcional pero recomendado) */
.lightbox-caption::-webkit-scrollbar {
    width: 6px;
}
.lightbox-caption::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 10px;
}

/* ===============================
   RESPONSIVE (móvil)
================================ */
@media (max-width: 900px) {

    .lightbox-content {
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }

    #lightbox-img {
        max-width: 92vw;
        max-height: 60vh;
    }

    .lightbox-caption {
        max-width: 92vw;
        max-height: none;
        text-align: left;
    }
}


/* ===============================
   BOTÓN BUSCADOR GLOBAL
================================ */
.btn-search {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    padding: 12px 22px;
    font-size: 15px;
    font-weight: 600;

    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    text-decoration: none;

    border-radius: 999px;
    box-shadow: 0 8px 20px rgba(0,0,0,.35);

    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.btn-search:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(0,0,0,.45);
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

.btn-search .icon {
    font-size: 18px;
    line-height: 1;
}
