:root {
    --primary: #E91E63;
    --primary-light: #FF80AB;
    --accent: #D4AF37;
    --bg-color: #FFF5F5;
    --text-main: #2D3436;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.6;
}

body.locked {
    overflow: hidden !important;
}

#privacy-gate {
    background: rgba(255, 245, 245, 0.98);
    /* Fondo casi opaco */
    backdrop-filter: blur(20px);
    z-index: 10001;
    /* Higher than loader */
}

h1,
h2,
h3 {
    font-family: 'Cormorant Garamond', serif;
}

/* Loader */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.heart-loader {
    width: 100px;
    height: 100px;
    background: var(--primary);
    position: relative;
    transform: rotate(45deg);
    animation: heartBeat 1.2s infinite;
}

.heart-loader:before,
.heart-loader:after {
    content: "";
    width: 100px;
    height: 100px;
    background: var(--primary);
    border-radius: 50%;
    position: absolute;
}

.heart-loader:before {
    top: -50px;
    left: 0;
}

.heart-loader:after {
    left: -50px;
    top: 0;
}

@keyframes heartBeat {
    0% {
        transform: scale(0.8) rotate(45deg);
    }

    20% {
        transform: scale(1) rotate(45deg);
    }

    40% {
        transform: scale(0.8) rotate(45deg);
    }

    60% {
        transform: scale(1) rotate(45deg);
    }

    100% {
        transform: scale(0.8) rotate(45deg);
    }
}

/* Glassmorphism Card */
.glass {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(233, 30, 99, 0.12), 0 2px 8px rgba(255, 255, 255, 0.2) inset;
}

#top-nav {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.glass-btn {
    background: var(--glass-bg);
    backdrop-filter: blur(5px);
    border: 1px solid var(--glass-border);
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    color: var(--primary);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.glass-btn:hover {
    background: var(--primary);
    color: white;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: flex-start;
    /* iOS: align top so bottom buttons are reachable */
    overflow-y: auto;
    /* Scroll if content taller than screen */
    padding: 20px 0 40px 0;
    z-index: 2000;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    box-sizing: border-box;
}

.modal-content {
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    /* No más alto que la pantalla */
    overflow-y: auto;
    /* Scroll dentro del modal */
    text-align: center;
    animation: modalIn 0.4s ease-out;
    margin: auto;
    -webkit-overflow-scrolling: touch;
    /* Smooth scroll en iOS */
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content h3 {
    margin-bottom: 1rem;
    color: var(--primary);
    font-size: 2rem;
}

.modal-content input[type="password"],
.modal-content input[type="date"],
.modal-content textarea {
    width: 100%;
    padding: 0.8rem;
    margin: 1rem 0;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-family: inherit;
}

.modal-content textarea {
    height: 100px;
    resize: none;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.primary-btn,
.secondary-btn {
    padding: 0.8rem 2rem;
    border-radius: 25px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}

.primary-btn {
    background: var(--primary);
    color: white;
}

.secondary-btn {
    background: #ecf0f1;
    color: #636e72;
}

.primary-btn:hover {
    background: #d81b60;
}

/* Upload Form Special */
.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.file-input-wrapper input[type=file] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

#image-preview,
.preview-box {
    width: 100%;
    height: 200px;
    max-height: 200px;
    /* No bloquear los botones */
    border: 2px dashed #ddd;
    border-radius: 15px;
    margin: 10px 0;
    background-size: cover;
    background-position: center;
    display: none;
}

/* Video preview en modal de subida */
#video-preview video {
    max-height: 200px;
    width: 100%;
    object-fit: contain;
    background: #000;
    border-radius: 15px;
}

.preview-box {
    display: block;
    /* Siempre visible en el modal de edición */
}

.edit-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    color: var(--primary);
    display: none;
    /* Se activa vía JS cuando el user está logueado */
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    transition: 0.3s;
}

.edit-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

.is-admin .edit-btn {
    display: flex;
}

#hero {
    min-height: 100vh;
    min-height: -webkit-fill-available;
    /* Fix iOS Safari 100vh bug */
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #F48FB1 0%, #FFF5F5 50%, #F8BBD0 100%);
    text-align: center;
    position: relative;
    overflow: hidden;
}

#hero::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(233, 30, 99, 0.08) 0%, transparent 70%);
    top: -200px;
    right: -150px;
    animation: floatBg 8s ease-in-out infinite;
}

@keyframes floatBg {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(-20px, 20px) scale(1.05);
    }
}

#hero h1 {
    font-size: 5.5rem;
    color: var(--primary);
    margin-bottom: 0.3rem;
    font-weight: 600;
    text-shadow: 0 2px 20px rgba(233, 30, 99, 0.2);
}

#hero .subtitle {
    font-size: 1rem;
    letter-spacing: 6px;
    text-transform: uppercase;
    margin-bottom: 2.5rem;
    color: #b2697f;
}

/* Counter Card */
#counter-card {
    padding: 2rem 3rem;
    margin: 0 auto 3rem auto;
    display: inline-block;
}

#counter-card h2 {
    font-size: 1rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #b2697f;
    margin-bottom: 1.5rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
}

/* Timer */
#timer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1.5rem 0;
    flex-wrap: wrap;
}

.time-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 64px;
}

.time-block span {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    font-family: 'Cormorant Garamond', serif;
    text-shadow: 0 2px 10px rgba(233, 30, 99, 0.2);
}

.time-block label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #b2697f;
    margin-top: 0.4rem;
    font-weight: 500;
}

.time-sep {
    font-size: 2.5rem;
    color: rgba(233, 30, 99, 0.3);
    font-weight: 300;
    margin-bottom: 1.2rem;
    animation: blink 1s step-end infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.2;
    }
}

.anniversary-date {
    font-style: italic;
    color: #b2697f;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--primary);
    opacity: 0.8;
}

/* Gallery */
#gallery {
    padding: 5rem 2rem;
    background-color: #fff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 2rem;
    color: var(--text-main);
}

/* Category Filters */
.filters-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 3.5rem;
    flex-wrap: wrap;
    padding: 1.2rem 1.5rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    border: 1px solid rgba(233, 30, 99, 0.1);
    box-shadow: 0 4px 20px rgba(233, 30, 99, 0.05);
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.6rem 1.3rem;
    border-radius: 50px;
    border: 1.5px solid transparent;
    background: transparent;
    color: var(--text-main);
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    white-space: nowrap;
    position: relative;
}

.filter-btn::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

.filter-btn:hover {
    color: var(--primary);
    transform: translateY(-2px);
    border-color: rgba(233, 30, 99, 0.2);
    background: rgba(233, 30, 99, 0.05);
}

.filter-btn:hover::after {
    width: 60%;
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.35);
    transform: translateY(-2px);
}

.filter-btn.active::after {
    display: none;
}

.filter-btn .emoji {
    font-size: 1.1rem;
}

/* Advanced Filters Bar */
.advanced-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 2rem;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(233, 30, 99, 0.08);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    border: 1px solid rgba(233, 30, 99, 0.15);
    border-radius: 10px;
    padding: 0.5rem 0.8rem;
    color: var(--primary);
}

.filter-group input[type="text"],
.filter-group select {
    border: none;
    outline: none;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    color: var(--text-main);
    background: transparent;
    cursor: pointer;
}

.filter-group input[type="text"] {
    width: 200px;
}

.clear-btn {
    background: rgba(233, 30, 99, 0.08);
    border: 1px solid rgba(233, 30, 99, 0.2);
    border-radius: 10px;
    color: var(--primary);
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.clear-btn:hover {
    background: var(--primary);
    color: white;
}

/* Bulk Toolbar */
.bulk-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    background: linear-gradient(135deg, #fff0f5, #fff);
    border: 2px solid var(--primary);
    border-radius: 16px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#selected-count {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.9rem;
    white-space: nowrap;
}

.bulk-toolbar select {
    border: 1.5px solid rgba(233, 30, 99, 0.3);
    border-radius: 10px;
    padding: 0.5rem 0.8rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    outline: none;
    color: var(--text-main);
    background: white;
    cursor: pointer;
}

/* Selected gallery item state */
.gallery-item.selected::after {
    content: '✓';
    position: absolute;
    top: 10px;
    left: 10px;
    width: 30px;
    height: 30px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
    font-weight: 700;
    z-index: 10;
}

.gallery-item.selected {
    outline: 3px solid var(--primary);
    box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.2);
}

.is-admin .gallery-item {
    cursor: pointer;
}

.masonry-grid {
    column-count: 3;
    column-gap: 1.5rem;
}

@media (max-width: 992px) {
    .masonry-grid {
        column-count: 2;
    }
}

@media (max-width: 600px) {
    .masonry-grid {
        column-count: 1;
    }

    #hero h1 {
        font-size: 3.5rem;
    }

    #timer {
        gap: 0.5rem;
    }

    .time-block span {
        font-size: 1.5rem;
    }
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.gallery-item:hover {
    transform: scale(1.03);
}

.gallery-item img,
.gallery-video {
    width: 100%;
    display: block;
    filter: brightness(0.9);
}

.gallery-video {
    cursor: pointer;
    background: #000;
    max-height: 400px;
    object-fit: cover;
}

.gallery-item .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .overlay {
    opacity: 1;
}


/* ===================== LIGHTBOX ===================== */
.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    animation: fadeIn 0.25s ease;
}

.lightbox-overlay.open {
    display: flex;
}

.lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 92vw;
    max-height: 92vh;
    width: 100%;
}

#lightbox-media {
    display: flex;
    justify-content: center;
    align-items: center;
    max-height: 72vh;
    width: 100%;
}

#lightbox-media img {
    max-height: 72vh;
    max-width: 100%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

#lightbox-media video {
    max-height: 72vh;
    max-width: 100%;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-info {
    margin-top: 1.2rem;
    text-align: center;
    color: white;
    width: 100%;
    padding: 0 1rem;
}

.lightbox-caption {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    font-style: italic;
    margin-bottom: 0.6rem;
    color: #fce4ec;
}

.lightbox-meta {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.lightbox-meta span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.lightbox-meta i {
    color: var(--primary-light);
}

/* Close button */
.lightbox-close {
    position: fixed;
    top: 18px;
    right: 22px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.3rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10001;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    background: var(--primary);
    border-color: var(--primary);
}

/* Nav arrows */
.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10001;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-prev {
    left: 14px;
}

.lightbox-next {
    right: 14px;
}

.lightbox-nav:hover {
    background: var(--primary);
    border-color: var(--primary);
}

/* Footer */
#footer {
    padding: 5rem 2rem;
    text-align: center;
    background: var(--bg-color);
}

#footer p {
    font-size: 1.5rem;
    font-family: 'Cormorant Garamond', serif;
    color: var(--primary);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}