/* ===== GALLERY HERO ===== */
.gallery-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, #fdf6f8 0%, #f5edf0 60%, #eedde3 100%);
}

.gallery-hero__bg {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(139, 90, 110, 0.08) 0%, transparent 60%),
        radial-gradient(circle at 80% 20%, rgba(196, 132, 154, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.gallery-hero__label {
    display: inline-block;
    background: rgba(139, 90, 110, 0.1);
    color: #8B5A6E;
    border-radius: 2rem;
    padding: 0.25rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ===== HOW IT WORKS STEPS ===== */
.gallery-steps {
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.gallery-step-card {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.07);
    border-radius: 1.25rem;
    padding: 2rem 1.5rem;
    height: 100%;
    position: relative;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.gallery-step-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(139, 90, 110, 0.1);
}

.gallery-step-card--accent {
    background: linear-gradient(160deg, #fdf6f8, #f5edf0);
    border-color: rgba(139, 90, 110, 0.2);
}

.gallery-step-card__num {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    font-size: 2.5rem;
    font-weight: 800;
    color: rgba(139, 90, 110, 0.12);
    line-height: 1;
    font-family: "Playfair Display", Georgia, serif;
}

.gallery-step-card__icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    background: rgba(139, 90, 110, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #8B5A6E;
}

/* ===== DEMO NOTICE ===== */
.gallery-demo-notice {
    background: rgba(139, 90, 110, 0.06);
    border: 1px solid rgba(139, 90, 110, 0.15);
    border-radius: 0.6rem;
    padding: 0.6rem 1rem;
    font-size: 0.875rem;
    color: #6d3f54;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.gallery-demo-notice__link {
    color: #8B5A6E;
    text-decoration: none;
}

.gallery-demo-notice__link:hover {
    text-decoration: underline;
}

/* ===== GALLERY TOOLBAR ===== */
.gallery-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 0.75rem;
    padding: 0.65rem 1rem;
}

.gallery-toolbar__left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.gallery-toolbar__right {
    display: flex;
    align-items: center;
}

/* Stat badge */
.gallery-stat-badge {
    font-size: 0.8rem;
    font-weight: 600;
    color: #8B5A6E;
    background: rgba(139, 90, 110, 0.08);
    padding: 0.2rem 0.65rem;
    border-radius: 2rem;
    white-space: nowrap;
}

/* Sort pills */
.gallery-sort-pills {
    display: flex;
    gap: 0.35rem;
}

.gallery-sort-pill {
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    border: 1.5px solid rgba(139, 90, 110, 0.3);
    background: transparent;
    color: #8B5A6E;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.gallery-sort-pill:hover {
    background: rgba(139, 90, 110, 0.07);
    border-color: #8B5A6E;
}

.gallery-sort-pill.active {
    background: #8B5A6E;
    border-color: #8B5A6E;
    color: #fff;
}

/* Face filter */
.face-filter-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gallery-filter-label {
    font-size: 0.8rem;
    color: #718096;
    white-space: nowrap;
}

.face-thumbnails {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.face-thumbnail {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 2.5px solid transparent;
    transition: all 0.2s ease;
    outline: 2px solid rgba(139, 90, 110, 0.15);
    outline-offset: 1px;
}

.face-thumbnail:hover {
    outline-color: rgba(139, 90, 110, 0.4);
    transform: scale(1.08);
}

.face-thumbnail.active {
    border-color: #8B5A6E;
    outline-color: rgba(139, 90, 110, 0.4);
    box-shadow: 0 0 0 2px rgba(139, 90, 110, 0.2);
}

.face-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.all-faces-icon {
    width: 100%;
    height: 100%;
    background: #718096;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.02em;
    border-radius: 50%;
}

.face-thumbnail.active .all-faces-icon {
    background: #8B5A6E;
}

/* ===== GALLERY GRID ===== */
.gallery-grid-wrap {
    padding: 0 1rem;
}

.thumbnail-container {
    margin: 0 auto;
    padding: 0.5rem 0;
}

.gallery-item {
    width: 220px;
    margin-bottom: 6px;
    display: block;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

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

/* Video overlay indicator */
.video-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    pointer-events: none;
    transition: background 0.2s ease;
}

.gallery-item:hover .video-overlay {
    background: rgba(139, 90, 110, 0.75);
}

/* ===== LOADING STATE ===== */
#loading-spinner {
    display: none;
}

.gallery-loading {
    display: none;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.gallery-loading__dots {
    display: flex;
    gap: 0.5rem;
}

.gallery-loading__dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #c4849a;
    animation: gallery-dot-pulse 1.2s ease-in-out infinite;
}

.gallery-loading__dots span:nth-child(2) { animation-delay: 0.2s; }
.gallery-loading__dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes gallery-dot-pulse {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* ===== SKELETON LOADERS ===== */
@keyframes gallery-shimmer {
    to { background-position: -200% 0; }
}

.gallery-skeleton {
    background: linear-gradient(90deg, #f5eff2 25%, #ede4e8 50%, #f5eff2 75%);
    background-size: 200% 100%;
    animation: gallery-shimmer 1.4s ease-in-out infinite;
    height: 180px;
    border-radius: 8px;
    cursor: default;
    pointer-events: none;
}

/* ===== PROGRESS INDICATOR ===== */
.gallery-progress-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: #9b7384;
    white-space: nowrap;
}

#gallery-progress {
    font-weight: 600;
}

/* ===== LOAD MORE BUTTON ===== */
#load-more-btn {
    display: none;
    margin: 1.5rem auto 0;
    padding: 0.55rem 2rem;
    border-radius: 2rem;
    border: 1.5px solid rgba(139,90,110,0.35);
    background: transparent;
    color: #8B5A6E;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

#load-more-btn:hover:not(:disabled) {
    background: rgba(139,90,110,0.08);
    border-color: #8B5A6E;
}

#load-more-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

/* ===== ERROR BANNER ===== */
#gallery-error {
    display: none;
    align-items: center;
    gap: 0.75rem;
    background: #fff3f5;
    border: 1px solid rgba(220,53,69,0.25);
    border-radius: 0.75rem;
    padding: 0.9rem 1.25rem;
    margin-top: 1rem;
    font-size: 0.88rem;
    color: #842029;
}

#gallery-retry-btn {
    margin-left: auto;
    background: transparent;
    border: 1.5px solid rgba(220,53,69,0.4);
    color: #842029;
    border-radius: 2rem;
    padding: 0.3rem 1rem;
    font-size: 0.82rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

#gallery-retry-btn:hover {
    background: rgba(220,53,69,0.08);
}

/* ===== JUMP TO TOP ===== */
#jump-top-btn {
    display: none;
    position: fixed;
    bottom: 1.75rem;
    right: 1.75rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(139,90,110,0.88);
    color: #fff;
    border: none;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 4px 16px rgba(139,90,110,0.3);
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 900;
    backdrop-filter: blur(4px);
}

#jump-top-btn:hover {
    background: rgba(109,63,84,0.95);
    transform: translateY(-2px);
}

/* ===== DELETE BUTTON (event gallery) ===== */
.delete-btn {
    position: absolute;
    top: 7px;
    right: 7px;
    background: rgba(220, 53, 69, 0.85);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
    font-size: 0.8rem;
    backdrop-filter: blur(2px);
}

.gallery-item:hover .delete-btn {
    opacity: 1;
}

.delete-btn:hover {
    background: rgba(185, 28, 28, 0.95);
}

/* ===== CONFIRMATION DIALOG ===== */
.dialog-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1050;
    backdrop-filter: blur(2px);
}

.confirmation-dialog {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 1.75rem;
    border-radius: 1rem;
    box-shadow: 0 16px 48px rgba(0,0,0,0.18);
    z-index: 1051;
    text-align: center;
    max-width: 380px;
    width: calc(100% - 2rem);
}

.confirmation-dialog h3 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    color: #121519;
}

.confirmation-dialog p {
    color: #718096;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.confirmation-dialog .btn-group {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

.confirmation-dialog button {
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: opacity 0.15s ease;
}

.confirmation-dialog .btn-cancel {
    background: #f0f0f0;
    color: #576071;
}

.confirmation-dialog .btn-cancel:hover { background: #e0e0e0; }

.confirmation-dialog .btn-delete {
    background: #dc3545;
    color: #fff;
}

.confirmation-dialog .btn-delete:hover { background: #b91c2c; }

/* ===== GALLERY CTA ===== */
.gallery-cta {
    background: linear-gradient(135deg, #8B5A6E 0%, #6d3f54 100%);
    color: #fff;
}

.gallery-cta .opacity-75 { opacity: 0.8; }
.gallery-cta .opacity-60 { opacity: 0.65; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .gallery-item { width: 160px; }

    .gallery-toolbar {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.75rem;
    }

    .gallery-toolbar__left {
        width: 100%;
    }

    .gallery-toolbar__right {
        width: 100%;
    }

    .face-filter-container {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .gallery-item { width: 140px; }
}
