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

img {
    max-width: 100%;
    display: block;
}

a {
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

/* =====================================================
   BASE
===================================================== */
:root {
    --bg: #0b1e27;
    --bg-soft: #0f172a;
    --panel: #111827;
    --panel-2: #0b1220;
    --text: #e5e7eb;
    --text-strong: #ffffff;
    --muted: #9ca3af;
    --line: rgba(255,255,255,0.06);

    --primary: #2563eb;
    --primary-hover: #1d4ed8;

    --success: #16a34a;
    --success-hover: #15803d;

    --danger: #dc2626;
    --danger-hover: #b91c1c;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;

    --shadow-sm: 0 4px 12px rgba(0,0,0,.22);
    --shadow-md: 0 8px 24px rgba(0,0,0,.30);
    --shadow-lg: 0 18px 40px rgba(0,0,0,.40);

    --container: 1200px;
    --transition: .18s ease;
}

html,
body {
    min-height: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.45;
}

/* =====================================================
   ACCESIBILIDAD
===================================================== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}

/* =====================================================
   LAYOUT
===================================================== */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 30px 20px;
}

/* =====================================================
   NAVBAR / TOPBAR
===================================================== */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 16px 22px;
    background: #000;
}

.navbar h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-strong);
}

.navbar a {
    color: var(--text-strong);
    white-space: nowrap;
}

.topbar {
    background: #020617;
    border-bottom: 1px solid var(--line);
}

.topbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.nav-left {
    justify-self: start;
}

.nav-center {
    justify-self: center;
}

.nav-right {
    justify-self: end;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* =====================================================
   BOTONES
===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 16px;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.015em;
    text-decoration: none;
    line-height: 1;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition), filter var(--transition);
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.2);
    backdrop-filter: blur(8px);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(2, 6, 23, 0.24);
    filter: saturate(1.02);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(180deg, #355985, #273d5b);
    border-color: rgba(147, 197, 253, 0.18);
}

.btn-primary:hover {
    background: linear-gradient(180deg, #406696, #2d486b);
}

.btn-success {
    background: linear-gradient(180deg, #2d7b5d, #205641);
    border-color: rgba(134, 239, 172, 0.18);
}

.btn-success:hover {
    background: linear-gradient(180deg, #348b69, #25634b);
}

.btn-danger {
    background: linear-gradient(180deg, #73383d, #54252a);
    border-color: rgba(252, 165, 165, 0.14);
}

.btn-danger:hover {
    background: linear-gradient(180deg, #824247, #602b30);
}

.btn-secondary {
    background: linear-gradient(180deg, #314867, #23354d);
    color: #fff;
    border-color: rgba(191, 219, 254, 0.13);
}

.btn-secondary:hover {
    background: linear-gradient(180deg, #3a567a, #29415d);
}

.btn-ghost {
    background: rgba(255,255,255,0.06);
    color: #fff;
    box-shadow: none;
}

.btn-ghost:hover {
    background: rgba(255,255,255,0.12);
}

.btn-back {
    background: linear-gradient(180deg, #355985, #273d5b);
    color: #fff;
    font-weight: 600;
    padding: 9px 16px;
    border-radius: 12px;
    border: 1px solid rgba(147, 197, 253, 0.18);
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.2);
    font-size: 14px;
}

.btn-back:hover {
    background: linear-gradient(180deg, #406696, #2d486b);
}

.btn-logout {
    background: linear-gradient(180deg, #73383d, #54252a);
    color: #fff;
    font-weight: 600;
    padding: 9px 16px;
    border-radius: 12px;
    border: 1px solid rgba(252, 165, 165, 0.14);
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.2);
    font-size: 14px;
}

.btn-logout:hover {
    background: linear-gradient(180deg, #824247, #602b30);
    box-shadow: 0 14px 30px rgba(2, 6, 23, 0.24);
}

.btn-create {
    display: inline-flex;
    margin: 25px auto 40px;
    padding: 12px 22px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 12px;
}

/* BotÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â³n buscar */
.btn-search {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 16px !important;
    font-size: 14px !important;
    font-weight: 600;
    background: linear-gradient(180deg, #2d7b5d, #205641) !important;
    color: #fff !important;
    border: 1px solid rgba(134, 239, 172, 0.18);
    border-radius: 12px !important;
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.2);
}

.btn-search:hover {
    background: linear-gradient(180deg, #348b69, #25634b) !important;
    box-shadow: 0 14px 30px rgba(2, 6, 23, 0.24);
}

.btn-search:active {
    transform: translateY(0);
}

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

/* forzado para botones peligrosos */
a.btn.btn-danger,
button.btn.btn-danger {
    background: linear-gradient(180deg, #73383d, #54252a);
    border-color: rgba(252, 165, 165, 0.14);
}

a.btn.btn-danger:hover,
button.btn.btn-danger:hover {
    background: linear-gradient(180deg, #824247, #602b30);
}

/* =====================================================
   GRID GALERÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚ÂAS
===================================================== */
.gallery-grid {
    position: relative;
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
}

.gallery-item {
    position: relative;
    z-index: 5;
    background: #101827;
    border-radius: 12px;
    overflow: hidden;
    text-align: center;
    box-shadow: 0 10px 24px rgba(0,0,0,.18);
    transition: transform var(--transition), box-shadow var(--transition);
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 36px rgba(0,0,0,.28);
}

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

.gallery-item img {
    width: 100%;
    aspect-ratio: 16 / 11;   /* ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â°ÃƒÆ’Ã¢â‚¬Â¦Ãƒâ€šÃ‚Â¸ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚ÂÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¥ clave: formato rectangular horizontal */
    object-fit: cover;

    background: #000;
    pointer-events: auto !important;
    position: relative;
    z-index: 6;
    user-select: none;
    transition: transform .28s ease;
}

.gallery-item:hover img {
    transform: scale(1.02);
}

.gallery-item .info {
    padding: 12px 14px 16px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    color: #fff;
}

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

.gallery-item .actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.gallery-item .actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 16px;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.015em;
    text-decoration: none;
    line-height: 1;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition), filter var(--transition);
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.2);
    backdrop-filter: blur(8px);
}
.gallery-item .actions {
    margin-top: 6px;
}

.gallery-item .btn-danger {
    background: linear-gradient(180deg, #73383d, #54252a);
    border-color: rgba(252, 165, 165, 0.14);
}

.gallery-item::before,
.gallery-item::after,
.gallery-item .overlay {
    content: none !important;
    display: none !important;
    pointer-events: none !important;
}

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

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

.photo-caption {
    margin-top: 6px;
    padding: 0 10px;
    font-size: 13px;
    color: var(--text);
    text-align: center;
    line-height: 1.4;
}

.photo-tag-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 10px 0;
}

.photo-tag-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    color: var(--text);
    font-size: 13px;
}

.photo-tag-input::placeholder {
    color: var(--muted);
}

.photo-tag-save {
    align-self: center;
    min-width: 120px;
    min-height: 34px;
    font-size: 12px;
    padding: 0 12px;
}

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

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

.login-box h1,
.selector-box h1 {
    margin-top: 0 !important;
    margin-bottom: 6px !important;
    text-align: center;
    color: #fff;
    font-size: 22px;
}

.login-box p,
.selector-box p {
    margin-top: 6px !important;
    margin-bottom: 12px !important;
    text-align: center;
    color: var(--muted);
}

.login-box input,
.selector-box input {
    width: 100%;
    padding: 14px;
    margin-bottom: 15px;
    border: none;
    border-radius: 8px;
    background: var(--panel);
    color: #fff;
    font-size: 14px;
}

.login-box input::placeholder,
.selector-box input::placeholder {
    color: var(--muted);
}

.login-box form,
.selector-box form {
    text-align: center;
}

.login-box form .btn,
.login-box form button,
.selector-box form .btn,
.selector-box form button {
    display: inline-flex;
    margin: 6px auto 0;
}
.login-box button,
.login-box .btn,
.selector-box button,
.selector-box .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 16px;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.015em;
    text-decoration: none;
    line-height: 1;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition), filter var(--transition);
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.2);
    backdrop-filter: blur(8px);
}

.login-box button:hover,
.login-box .btn:hover,
.selector-box button:hover,
.selector-box .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(2, 6, 23, 0.24);
    filter: saturate(1.02);
}

.login-logo {
    display: block;
    max-width: 190px;
    height: auto;
    margin: 2px auto !important;
}

/* =====================================================
   ADMIN
===================================================== */
.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;
}

.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: 8px;
    background: linear-gradient(180deg, #73383d, #54252a);
    color: #fff;
    border: 1px solid rgba(252, 165, 165, 0.14);
    box-shadow: 0 8px 18px rgba(17,24,39,.2);
}

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

.progress {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-hover));
    transition: width .2s ease;
}

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

.lightbox.active {
    display: flex;
}

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

.lightbox-content {
    display: flex;
    align-items: flex-start;
    gap: 40px;
    max-width: 90vw;
    max-height: 85vh;
    padding: 40px;
    text-align: center;
}

.lightbox-content img,
#lightbox-img {
    width: auto;
    height: auto;
    max-width: 62vw;
    max-height: 80vh;
    object-fit: contain;
    flex-shrink: 0;
}

.lightbox-caption {
    width: 320px;
    max-width: 28vw;
    max-height: 80vh;
    overflow-y: auto;
    padding: 18px 20px 18px 0;
    color: #f5f5f5;
    text-align: left;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    background: rgba(0,0,0,0.35);
    border-radius: 12px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
    padding-left: 20px;
}

.lightbox-caption::-webkit-scrollbar {
    width: 6px;
}

.lightbox-caption::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 12px;
}

/* flechas */
.lightbox-nav,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    cursor: pointer;
    user-select: none;
    z-index: 10001;
}

.lightbox-nav {
    font-size: 60px;
    padding: 10px;
    opacity: .7;
}

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

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

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

.lightbox-prev,
.lightbox-next {
    background: rgba(0,0,0,0.45);
    border: none;
    font-size: 72px;
    padding: 18px 22px;
    border-radius: 14px;
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

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

/* =====================================================
   FORMULARIOS / CLICK FIX
===================================================== */
button,
.btn,
input[type="submit"],
input,
form {
    pointer-events: auto !important;
    position: relative;
    z-index: 20;
}

/* =====================================================
   RESPONSIVE
===================================================== */
@media (max-width: 900px) {
    .topbar {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .nav-left,
    .nav-center,
    .nav-right {
        justify-self: start;
    }

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

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

    .lightbox-caption {
        width: 100%;
        max-width: 92vw;
        max-height: none;
        text-align: left;
        padding-right: 20px;
    }
}

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

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

    .gallery-item img,
    .gallery-item .img-thumb,
    .admin-image img {
        height: 150px;
    }

    .lightbox-nav {
        font-size: 40px;
    }

    .lightbox-prev,
    .lightbox-next {
        font-size: 40px;
        padding: 10px 14px;
    }
}





.titulo-con-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    height: 36px;          /* altura fija del bloque */
    overflow: visible;
    white-space: nowrap;
}

.logo-navbar {
    height: 140px;          /* agranda el logo */
    width: auto;
    display: block;
    flex-shrink: 0;
    object-fit: contain;
    margin-top: -22px;     /* lo sube */
    margin-bottom: -22px;  /* compensa sin crecer la barra */
}




/* BOTONES HEADER */
.nav-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* BOTÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã¢â‚¬Å“N VOLVER (AZUL estilo descargar) ANTES COLOR 2563eb*/
.btn-volver {
    background: linear-gradient(180deg, #314867, #23354d);
    color: #fff;
    padding: 9px 16px;
    border-radius: 12px;
    border: 1px solid rgba(191, 219, 254, 0.13);
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.2);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.btn-volver:hover {
    background: linear-gradient(180deg, #3a567a, #29415d);
    box-shadow: 0 14px 30px rgba(2, 6, 23, 0.24);
}

/* BOTÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã¢â‚¬Å“N CERRAR SESIÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã¢â‚¬Å“N (ROJO) ANTES COLOR #dc2626 */
.btn-logout {
    background: linear-gradient(180deg, #73383d, #54252a);
    color: #fff;
    font-weight: 600;
    padding: 9px 16px;
    border-radius: 12px;
    border: 1px solid rgba(252, 165, 165, 0.14);
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.2);
    font-size: 14px;
}

.btn-logout:hover {
    background: linear-gradient(180deg, #824247, #602b30);
    box-shadow: 0 14px 30px rgba(2, 6, 23, 0.24);
}
