/* ==========================================================================
   Pixori.Gallery — Public Styles v3.1.0
   ========================================================================== */

/* --- Client Dashboard --- */

.fg-client-dashboard {
    background: #f9f9f9;
    padding: 30px 20px;
    border-radius: 4px;
    margin-bottom: 30px;
    border: 1px solid #eee;
}

.fg-dashboard-welcome {
    text-align: center;
    margin-bottom: 30px;
}

.fg-dashboard-welcome h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 600;
    color: #333;
}

.fg-dashboard-welcome p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.fg-dashboard-progress {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin: 0 0 30px 0;
}

.fg-stat-card {
    background: white;
    padding: 20px 15px;
    border-radius: 4px;
    text-align: center;
    border: 1px solid #eee;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fg-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.fg-stat-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.fg-stat-number {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    line-height: 1;
    margin-bottom: 5px;
}

.fg-stat-label {
    font-size: 12px;
    color: #999;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fg-dashboard-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.fg-dashboard-btn {
    min-width: 160px;
}

.fg-dashboard-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive Dashboard */

@media (max-width: 768px) {
    .fg-dashboard-progress {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .fg-client-dashboard {
        padding: 20px 15px;
        margin-bottom: 20px;
    }

    .fg-dashboard-welcome h2 {
        font-size: 22px;
    }

    .fg-dashboard-progress {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 20px;
    }

    .fg-stat-card {
        padding: 15px 10px;
    }

    .fg-stat-number {
        font-size: 24px;
    }

    .fg-dashboard-actions {
        flex-direction: column;
    }

    .fg-dashboard-btn {
        width: 100%;
    }
}

/* --- Gallery Container --- */

.pixori-gallery {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    list-style: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.pixori-gallery.fg-loaded {
    opacity: 1;
}

/* --- Gallery Items --- */

.fg-item {
    margin: 0;
    padding: 0;
    overflow: hidden;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* ==========================================================================
   Entrance Animations
   ========================================================================== */

.fg-item.fg-visible,
.fg-item.fg-enter-fade-up { opacity: 1; transform: translateY(0); }

.fg-item.fg-enter-scale-in { opacity: 1; transform: scale(1); }
.fg-item:not(.fg-visible) { transform: scale(0.85); }

.fg-item.fg-enter-slide-left { opacity: 1; transform: translateX(0); }
.fg-layout-masonry .fg-item:not(.fg-visible),
.fg-layout-justified .fg-item:not(.fg-visible),
.fg-layout-grid .fg-item:not(.fg-visible) {
    /* Default entrance is fade-up, overridden by specific entrance class */
}

.fg-item.fg-enter-flip { opacity: 1; transform: perspective(600px) rotateY(0); }

/* Filter hide animation */
.fg-item.fg-filter-hide {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.fg-item.fg-hidden {
    display: none;
}

/* --- Links & Images --- */

.fg-link {
    display: block;
    text-decoration: none;
    color: inherit;
    outline: none;
    position: relative;
}

.fg-link:focus-visible {
    outline: 3px solid #2271b1;
    outline-offset: 2px;
    border-radius: inherit;
}

.fg-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                filter 0.45s ease,
                opacity 0.4s ease;
    backface-visibility: hidden;
    will-change: transform;
}

/* --- Overlay & Captions --- */

.fg-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.fg-caption {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 6px;
    max-width: 90%;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Caption style: hover (default) */
.fg-caption-hover .fg-item:hover .fg-caption,
.fg-caption-hover .fg-link:focus-visible .fg-overlay .fg-caption,
.fg-caption-hover .fg-link:focus-visible .fg-caption {
    opacity: 1;
    transform: translateY(0);
}

/* Caption style: bar (always visible overlay) */
.fg-caption-bar .fg-caption {
    opacity: 1;
    transform: translateY(0);
    border-radius: 0;
    max-width: 100%;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.55);
}

.fg-caption-bar .fg-overlay {
    opacity: 1;
}

/* Caption style: below (outside image) */
.fg-caption-below .fg-overlay {
    display: none;
}

.fg-caption-below {
    padding: 8px 4px 0;
    font-size: 13px;
    line-height: 1.4;
    color: #555;
    text-align: center;
}

/* Caption style: hidden */
.fg-caption-hidden .fg-overlay {
    display: none;
}

/* --- Client Proofing Heart --- */

.fg-heart-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.2s, transform 0.2s, background 0.2s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 0;
}

.fg-item:hover .fg-heart-btn,
.fg-heart-btn.fg-heart-active {
    opacity: 1;
    transform: scale(1);
}

.fg-heart-btn.fg-heart-active {
    background: #e74c6f;
}

.fg-heart-btn.fg-heart-active svg {
    fill: #fff;
}

/* --- Client Proofing Panel --- */

.fg-proofing-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 28px;
    color: #fff;
    font-size: 14px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.fg-proofing-panel.fg-proofing-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.fg-proofing-count {
    font-weight: 700;
    font-size: 16px;
}

.fg-proofing-label {
    opacity: 0.7;
}

.fg-proofing-view,
.fg-proofing-export {
    padding: 5px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    background: transparent;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    font-family: inherit;
}

.fg-proofing-view:hover,
.fg-proofing-export:hover {
    background: rgba(255, 255, 255, 0.15);
}

.fg-proofing-view.fg-proofing-filter-active {
    background: #fff;
    color: #000;
}

/* --- Download Protection --- */

.fg-protected .fg-item::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.fg-protected .fg-link {
    -webkit-touch-callout: none;
}

/* --- Watermark Overlay --- */

.fg-watermarked .fg-item::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='200'%3E%3Ctext x='50%25' y='50%25' dominant-baseline='middle' text-anchor='middle' font-family='sans-serif' font-size='18' fill='%23ffffff' opacity='0.3' transform='rotate(-30 150 100)'%3E%C2%A9 Watermark%3C/text%3E%3C/svg%3E");
    background-repeat: repeat;
    opacity: var(--fg-watermark-opacity, 0.25);
}

/* ==========================================================================
   Hover Effects
   ========================================================================== */

.fg-hover-fade .fg-overlay { background: linear-gradient(transparent 40%, rgba(0, 0, 0, 0.5)); opacity: 0; }
.fg-hover-fade .fg-item:hover .fg-overlay,
.fg-hover-fade .fg-link:focus-visible .fg-overlay { opacity: 1; }
.fg-hover-fade .fg-item:hover .fg-caption { opacity: 1; transform: translateY(0); }

.fg-hover-slide-up .fg-overlay { background: linear-gradient(transparent 30%, rgba(0, 0, 0, 0.55)); transform: translateY(100%); opacity: 1; }
.fg-hover-slide-up .fg-item:hover .fg-overlay,
.fg-hover-slide-up .fg-link:focus-visible .fg-overlay { transform: translateY(0); }
.fg-hover-slide-up .fg-item:hover .fg-caption { opacity: 1; transform: translateY(0); transition-delay: 0.1s; }

.fg-hover-zoom .fg-item:hover .fg-img,
.fg-hover-zoom .fg-link:focus-visible .fg-img { transform: scale(1.08); }
.fg-hover-zoom .fg-overlay { background: linear-gradient(transparent 50%, rgba(0, 0, 0, 0.45)); opacity: 0; }
.fg-hover-zoom .fg-item:hover .fg-overlay,
.fg-hover-zoom .fg-link:focus-visible .fg-overlay { opacity: 1; }

.fg-hover-blur .fg-item:hover .fg-img,
.fg-hover-blur .fg-link:focus-visible .fg-img { filter: blur(3px); transform: scale(1.02); }
.fg-hover-blur .fg-overlay { background: rgba(0, 0, 0, 0.25); opacity: 0; }
.fg-hover-blur .fg-item:hover .fg-overlay,
.fg-hover-blur .fg-link:focus-visible .fg-overlay { opacity: 1; }

.fg-hover-grayscale .fg-img { filter: grayscale(100%); }
.fg-hover-grayscale .fg-item:hover .fg-img,
.fg-hover-grayscale .fg-link:focus-visible .fg-img { filter: grayscale(0%); }
.fg-hover-grayscale .fg-overlay { background: linear-gradient(transparent 50%, rgba(0, 0, 0, 0.4)); opacity: 0; }
.fg-hover-grayscale .fg-item:hover .fg-overlay,
.fg-hover-grayscale .fg-link:focus-visible .fg-overlay { opacity: 1; }

.fg-hover-none .fg-overlay { background: linear-gradient(transparent 50%, rgba(0, 0, 0, 0.4)); opacity: 0; }
.fg-hover-none .fg-item:hover .fg-overlay { opacity: 1; }

/* ==========================================================================
   Story Layout
   ========================================================================== */

.fg-layout-story .fg-item {
    scroll-snap-align: start;
}

.fg-layout-story .fg-img {
    object-fit: contain;
}

/* ==========================================================================
   Filter Bar
   ========================================================================== */

.fg-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    justify-content: center;
}

.fg-filter-btn {
    padding: 8px 18px;
    border: 1px solid #ddd;
    border-radius: 24px;
    background: #fff;
    color: #444;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    line-height: 1.3;
}

.fg-filter-btn:hover { border-color: #999; color: #111; }
.fg-filter-btn.fg-filter-active { background: #1a1a1a; border-color: #1a1a1a; color: #fff; }
.fg-filter-btn:focus-visible { outline: 2px solid #2271b1; outline-offset: 2px; }

/* ==========================================================================
   Load More
   ========================================================================== */

.fg-load-more-wrap {
    text-align: center;
    padding: 32px 0 16px;
}

.fg-load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 32px;
    border: 2px solid #1a1a1a;
    border-radius: 30px;
    background: transparent;
    color: #1a1a1a;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    line-height: 1.4;
}

.fg-load-more-btn:hover { background: #1a1a1a; color: #fff; }
.fg-load-more-btn.fg-loading { opacity: 0.6; cursor: wait; }

.fg-load-more-btn.fg-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: fg-spin 0.6s linear infinite;
}

.fg-load-more-count { font-weight: 400; opacity: 0.6; font-size: 13px; }
.fg-load-more-btn:focus-visible { outline: 2px solid #2271b1; outline-offset: 2px; }

/* ==========================================================================
   Lightbox
   ========================================================================== */

.fg-lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, background 0.5s ease;
    -webkit-user-select: none;
    user-select: none;
}

.fg-lightbox-overlay.fg-lb-active { opacity: 1; visibility: visible; }

/* --- Toolbar --- */

.fg-lightbox-toolbar {
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
}

.fg-lightbox-counter {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.fg-lightbox-toolbar-btns { display: flex; gap: 8px; }

.fg-lb-btn {
    width: 40px; height: 40px;
    border: none; border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff; font-size: 18px;
    line-height: 40px; text-align: center;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.fg-lb-btn:hover { background: rgba(255, 255, 255, 0.2); transform: scale(1.08); }
.fg-lb-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.fg-lightbox-close { font-size: 24px; font-weight: 300; }
.fg-lightbox-info-btn { font-style: italic; font-weight: 700; font-family: Georgia, 'Times New Roman', serif; }
.fg-lightbox-info-btn.fg-info-active,
.fg-lightbox-slideshow-btn.fg-slideshow-active,
.fg-lightbox-fullscreen-btn.fg-fullscreen-active { background: rgba(255, 255, 255, 0.25); }

.fg-lightbox-heart-btn.fg-heart-active {
    background: #e74c6f;
}
.fg-lightbox-heart-btn.fg-heart-active svg {
    fill: #fff;
}

/* --- Image container — double buffer for transitions --- */

.fg-lightbox-content {
    position: relative;
    width: 92vw;
    height: calc(100vh - 160px);
    margin: 0 auto;
    overflow: hidden;
}

.fg-lightbox-img {
    position: absolute;
    inset: 0;
    margin: auto;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform-origin: center center;
    will-change: opacity, transform;
    backface-visibility: hidden;
}

.fg-lightbox-img.fg-lb-img-active {
    opacity: 1;
}

.fg-lightbox-img:not(.fg-lb-img-active) {
    pointer-events: none;
}

/* --- Spinner --- */

.fg-lightbox-spinner {
    position: absolute;
    width: 36px; height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: #fff;
    border-radius: 50%;
    animation: fg-spin 0.7s linear infinite;
}

/* --- Navigation --- */

.fg-lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 48px; height: 48px;
    border: none; border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s, opacity 0.2s;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 0;
}

.fg-lightbox-prev { left: 16px; }
.fg-lightbox-next { right: 16px; }
.fg-lb-nav:hover { background: rgba(255, 255, 255, 0.2); transform: translateY(-50%) scale(1.1); }
.fg-lb-nav:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* --- Caption --- */

.fg-lightbox-caption {
    position: absolute;
    bottom: 80px; left: 0; right: 0;
    text-align: center;
    padding: 16px 60px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px; line-height: 1.5;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.5));
    opacity: 0; transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.fg-lightbox-caption.fg-lb-caption-visible { opacity: 1; transform: translateY(0); }

/* --- EXIF --- */

.fg-lightbox-exif {
    position: absolute;
    bottom: 100px; left: 50%;
    transform: translateX(-50%) translateY(8px);
    z-index: 10;
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: 4px 16px; padding: 10px 20px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap;
    opacity: 0; visibility: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    pointer-events: none;
}

.fg-lightbox-exif.fg-exif-visible {
    opacity: 1; visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.fg-exif-item { display: inline-flex; align-items: center; gap: 4px; }
.fg-exif-label { color: rgba(255, 255, 255, 0.5); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }

/* ==========================================================================
   Filmstrip
   ========================================================================== */

.fg-lightbox-filmstrip {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    z-index: 10; height: 72px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    padding: 8px 16px;
}

.fg-filmstrip-track {
    display: flex; gap: 6px;
    overflow-x: auto; overflow-y: hidden;
    height: 100%; align-items: center;
    padding-inline: calc(50% - 26px);
    scroll-behavior: smooth;
    scrollbar-width: none; -ms-overflow-style: none;
}
.fg-filmstrip-track::-webkit-scrollbar { display: none; }

.fg-filmstrip-thumb {
    flex-shrink: 0; width: 52px; height: 52px;
    border-radius: 4px; overflow: hidden; cursor: pointer;
    border: 2px solid transparent; opacity: 0.5;
    transition: opacity 0.2s, border-color 0.2s, transform 0.2s;
}
.fg-filmstrip-thumb:hover { opacity: 0.8; }
.fg-filmstrip-thumb.fg-filmstrip-active { opacity: 1; border-color: #fff; transform: scale(1.08); }
.fg-filmstrip-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }

/* ==========================================================================
   Share Panel
   ========================================================================== */

.fg-lightbox-share-panel {
    position: absolute; top: 60px; right: 16px; z-index: 20;
    display: flex; flex-direction: column; gap: 2px;
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-radius: 10px; padding: 6px; min-width: 180px;
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}
.fg-lightbox-share-panel.fg-share-visible { opacity: 1; visibility: visible; transform: translateY(0); }

.fg-share-option {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; color: rgba(255, 255, 255, 0.9);
    font-size: 14px; text-decoration: none;
    border: none; background: transparent; border-radius: 6px;
    cursor: pointer; transition: background-color 0.15s;
    white-space: nowrap; font-family: inherit;
}
.fg-share-option:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.fg-share-option svg { flex-shrink: 0; }
.fg-share-option.fg-copy-success { color: #4ade80; }

/* ==========================================================================
   Flag UI
   ========================================================================== */

.fg-flag-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: transform 0.2s, box-shadow 0.2s, background 0.15s ease-out, color 0.15s ease-out;
    z-index: 10;
    border: none;
    background: transparent;
    padding: 0;
    animation: fg-badge-fade-in 0.3s ease-in;
}

.fg-flag-badge:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.fg-flag-badge.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Flag colors */
.fg-flag-badge.flag-1 { background: #e74c3c; color: white; }
.fg-flag-badge.flag-2 { background: #f39c12; color: white; }
.fg-flag-badge.flag-3 { background: #f1c40f; color: #333; }
.fg-flag-badge.flag-4 { background: #27ae60; color: white; }
.fg-flag-badge.flag-0 { background: #bdc3c7; color: white; }

.fg-flag-palette {
    display: none;
    position: absolute;
    top: 48px;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    gap: 4px;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    flex-direction: row;
}

.fg-flag-palette.open,
.fg-flag-palette.fg-flag-palette-open {
    display: flex;
}

.fg-flag-palette-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: transform 0.1s;
}

.fg-flag-palette-btn:hover {
    transform: scale(1.1);
}

.fg-flag-clear {
    background: #bdc3c7 !important;
    font-size: 10px;
    color: white;
}

/* Flagged items */

.fg-item.fg-flagged {
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.fg-item.fg-flagged-1 { border-color: #e74c3c; }
.fg-item.fg-flagged-2 { border-color: #f39c12; }
.fg-item.fg-flagged-3 { border-color: #f1c40f; }
.fg-item.fg-flagged-4 { border-color: #27ae60; }

.fg-flag-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: fg-spin 0.6s linear infinite;
    display: none;
    margin: 4px auto;
}

.fg-flag-palette.fg-flag-loading .fg-flag-spinner {
    display: block;
}

.fg-flag-palette.fg-flag-loading .fg-flag-palette-btn {
    opacity: 0.6;
    cursor: wait;
}

/* Toast notifications */

.fg-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99998;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-size: 14px;
    border-radius: 6px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.fg-toast.fg-toast-visible {
    opacity: 1;
    transform: translateY(0);
}

.fg-toast-success {
    background: rgba(39, 174, 96, 0.9);
}

.fg-toast-error {
    background: rgba(231, 76, 60, 0.9);
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes fg-badge-fade-in { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }
@keyframes fg-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ==========================================================================
   Print
   ========================================================================== */

@media print {
    .pixori-gallery { opacity: 1 !important; }
    .fg-item { opacity: 1 !important; transform: none !important; break-inside: avoid; }
    .fg-overlay, .fg-lightbox-overlay, .fg-filter-bar,
    .fg-load-more-wrap, .fg-proofing-panel, .fg-heart-btn { display: none !important; }
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .pixori-gallery, .fg-item, .fg-img, .fg-overlay, .fg-caption,
    .fg-lightbox-overlay, .fg-lightbox-img, .fg-lightbox-caption,
    .fg-lightbox-exif, .fg-filmstrip-thumb, .fg-filter-btn,
    .fg-load-more-btn, .fg-lightbox-share-panel, .fg-heart-btn,
    .fg-proofing-panel {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 640px) {
    .fg-lb-nav { width: 36px; height: 36px; }
    .fg-lb-nav svg { width: 16px; height: 16px; }
    .fg-lightbox-prev { left: 8px; }
    .fg-lightbox-next { right: 8px; }
    .fg-lb-btn { width: 36px; height: 36px; line-height: 36px; }
    .fg-lightbox-filmstrip { height: 56px; padding: 4px 8px; }
    .fg-filmstrip-track { padding-inline: calc(50% - 20px); }
    .fg-filmstrip-thumb { width: 40px; height: 40px; }
    .fg-lightbox-exif { font-size: 11px; padding: 8px 12px; gap: 2px 10px; bottom: 70px; }
    .fg-lightbox-caption { bottom: 56px; font-size: 13px; padding: 10px 16px; }
    .fg-filter-bar { gap: 6px; }
    .fg-filter-btn { padding: 6px 14px; font-size: 13px; }
    .fg-heart-btn { width: 30px; height: 30px; top: 6px; right: 6px; }
    .fg-proofing-panel { bottom: 10px; right: 10px; padding: 8px 12px; font-size: 12px; border-radius: 20px; }
    .fg-palette-dot { width: 10px; height: 10px; }
    .fg-flag-badge { width: 28px; height: 28px; font-size: 14px; top: 4px; right: 4px; }
    .fg-flag-palette { top: 32px; right: 0; gap: 2px; padding: 6px; }
    .fg-flag-palette-btn { width: 24px; height: 24px; }

    /* Comments panel responsive */
    .fg-comments-panel {
        width: 100%;
        right: -100%;
    }
    .fg-comments-panel.fg-comments-visible {
        right: 0;
    }
    .fg-comments-header { padding: 12px; }
    .fg-comments-header h3 { font-size: 16px; }
    .fg-comments-list { padding: 12px; }
    .fg-comment-item { margin-bottom: 16px; padding: 10px; font-size: 12px; }
    .fg-comment-text { margin: 6px 0 8px; }
    .fg-comments-form { padding: 12px; }
}

/* ==========================================================================
   Comments Panel
   ========================================================================== */

.fg-comments-panel {
    position: fixed;
    right: -380px;
    top: 0;
    width: 360px;
    height: 100vh;
    z-index: 1000000;
    background: #fff;
    box-shadow: -2px 0 16px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    overflow: hidden;
}

.fg-comments-panel.fg-comments-visible {
    right: 0;
}

.fg-comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.fg-comments-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.fg-comments-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.fg-comments-close:hover {
    color: #333;
}

.fg-comments-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.fg-no-comments {
    text-align: center;
    color: #999;
    padding: 32px 16px;
    font-size: 14px;
}

.fg-comment-item {
    margin-bottom: 20px;
    padding: 12px;
    background: #f8f8f8;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
}

.fg-comment-item[data-depth="1"] {
    margin-left: 12px;
    background: #f0f0f0;
}

.fg-comment-item[data-depth="2"] {
    margin-left: 24px;
    background: #e8e8e8;
}

.fg-comment-body {
    position: relative;
}

.fg-comment-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}

.fg-comment-author {
    font-weight: 600;
    color: #333;
}

.fg-comment-time {
    font-size: 12px;
    color: #999;
}

.fg-comment-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.fg-comment-edit-btn,
.fg-comment-delete-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 12px;
    padding: 0 4px;
    transition: color 0.2s;
}

.fg-comment-edit-btn:hover,
.fg-comment-delete-btn:hover {
    color: #333;
}

.fg-comment-text {
    margin: 8px 0 10px;
    color: #333;
    word-wrap: break-word;
}

.fg-comment-reply-btn {
    background: none;
    border: none;
    color: #0073aa;
    cursor: pointer;
    font-size: 12px;
    padding: 0;
    transition: color 0.2s;
}

.fg-comment-reply-btn:hover {
    color: #005a87;
    text-decoration: underline;
}

.fg-comment-replies {
    margin-top: 8px;
}

.fg-comments-form,
.fg-reply-form {
    flex-shrink: 0;
    padding: 16px;
    border-top: 1px solid #eee;
    background: #fafafa;
}

.fg-reply-form {
    position: relative;
    margin-top: 10px;
    padding: 10px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    border-top: none;
    margin-left: 0;
}

.fg-form-group {
    margin-bottom: 10px;
}

.fg-form-group:last-child {
    margin-bottom: 0;
}

.fg-author-input,
.fg-comment-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.fg-author-input:focus,
.fg-comment-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.fg-comment-input {
    resize: vertical;
    min-height: 70px;
    max-height: 150px;
}

.fg-char-count {
    display: block;
    font-size: 11px;
    color: #999;
    margin-top: 2px;
    text-align: right;
}

.fg-comment-submit,
.fg-reply-cancel {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.fg-comment-submit {
    background: #0073aa;
    color: #fff;
    width: 100%;
}

.fg-comment-submit:hover {
    background: #005a87;
}

.fg-comment-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.fg-reply-form .fg-comment-submit {
    width: auto;
    margin-right: 8px;
}

.fg-reply-cancel {
    background: #eee;
    color: #333;
}

.fg-reply-cancel:hover {
    background: #ddd;
}

.fg-form-message {
    padding: 8px;
    border-radius: 4px;
    font-size: 12px;
    text-align: center;
}

.fg-form-error {
    background: #fee;
    color: #d63638;
}

.fg-form-success {
    background: #efe;
    color: #228B22;
}

.fg-edit-form {
    position: relative;
    margin-top: 10px;
    padding: 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
}

.fg-edit-form textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
    box-sizing: border-box;
    margin-bottom: 8px;
}

.fg-edit-form button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    margin-right: 6px;
}

.fg-edit-form .fg-comment-submit {
    background: #0073aa;
    color: #fff;
    width: auto;
}

.fg-edit-form .fg-comment-submit:hover {
    background: #005a87;
}

.fg-edit-form .fg-edit-cancel {
    background: #eee;
    color: #333;
}

.fg-edit-form .fg-edit-cancel:hover {
    background: #ddd;
}

.fg-lightbox-comments-btn.fg-comments-active {
    background: rgba(255, 255, 255, 0.25);
}

/* ==========================================================================
   Access Control
   ========================================================================== */

.fg-access-blur { filter: blur(20px); pointer-events: none; user-select: none; }

.fg-password-overlay { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.6); }

.fg-password-modal { background: #fff; padding: 2rem; border-radius: 8px; max-width: 360px; width: 90%; text-align: center; }

.fg-password-modal h3 { margin: 0 0 1rem; font-size: 1.1rem; }

.fg-password-input { width: 100%; padding: 0.6rem; border: 1px solid #ccc; border-radius: 4px; font-size: 1rem; margin-bottom: 0.75rem; }

.fg-password-submit { width: 100%; padding: 0.6rem; background: #1d1d1d; color: #fff; border: none; border-radius: 4px; font-size: 1rem; cursor: pointer; }

.fg-password-submit:hover { background: #333; }

.fg-password-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.fg-password-error { color: #d63638; font-size: 0.85rem; margin: 0.5rem 0 0; }

.fg-access-denied { text-align: center; padding: 3rem 1rem; color: #666; font-size: 1rem; }

/* ==========================================================================
   Selections Panel
   ========================================================================== */

.fg-selections-toggle-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
    margin-left: 8px;
}

.fg-selections-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.fg-selections-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    width: 320px;
    max-height: 80vh;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    transform: translateX(360px);
    transition: transform 0.3s ease;
}

.fg-selections-panel.fg-selections-open {
    transform: translateX(0);
}

.fg-selections-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #eee;
}

.fg-selections-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.fg-selections-toggle {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fg-selections-toggle:hover {
    color: #000;
}

.fg-selections-create {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
}

.fg-selection-form {
    display: flex;
    gap: 8px;
}

.fg-selection-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
}

.fg-selection-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.fg-selection-create-btn {
    padding: 8px 12px;
    background: #1d1d1d;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.fg-selection-create-btn:hover {
    background: #333;
}

.fg-selections-list {
    flex: 1;
    overflow-y: auto;
    list-style: none;
    margin: 0;
    padding: 8px 0;
}

.fg-selection-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    border-left: 3px solid transparent;
}

.fg-selection-item:hover {
    background: #f5f5f5;
}

.fg-selection-item.fg-selection-active {
    background: #f0f6ff;
    border-left-color: #2271b1;
}

.fg-selection-info {
    flex: 1;
    min-width: 0;
}

.fg-selection-name {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fg-selection-count {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

.fg-selection-actions {
    display: flex;
    gap: 8px;
    margin-left: 8px;
}

.fg-selection-export,
.fg-selection-delete {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
}

.fg-selection-item:hover .fg-selection-export,
.fg-selection-item:hover .fg-selection-delete {
    opacity: 1;
}

.fg-selection-delete:hover {
    color: #d63638;
}

.fg-selection-export:hover {
    color: #2271b1;
}

/* Highlight images in selection */
.fg-item.fg-in-selection {
    box-shadow: inset 0 0 0 3px #2271b1;
}

/* Drag-drop visual feedback */
.fg-selection-item.fg-selection-drag-over {
    background: #e8f1ff;
    border-left-color: #2271b1;
}

.fg-item.fg-dragging {
    opacity: 0.5;
}

/* Context menu */
.fg-selection-context-menu {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 4px 0;
    min-width: 200px;
}

.fg-context-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    text-align: left;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
    color: #333;
    transition: background 0.15s;
}

.fg-context-item:hover {
    background: #f5f5f5;
}

.fg-context-item:first-child {
    color: #666;
    cursor: default;
    padding: 8px 16px;
}

.fg-context-item:first-child:hover {
    background: none;
}

/* Toast notifications */
.fg-toast {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 10001;
    padding: 12px 16px;
    background: #1d1d1d;
    color: #fff;
    border-radius: 4px;
    font-size: 14px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.fg-toast.fg-toast-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.fg-toast-success {
    background: #27ae60;
}

.fg-toast-error {
    background: #d63638;
}

.fg-toast-info {
    background: #1d1d1d;
}

/* ==========================================================================
   Gallery Mode Styles
   ========================================================================== */

/* Presentation mode: hide collaboration UI */
.pixori-gallery[data-gallery-mode="presentation"] .fg-flag-badge,
.pixori-gallery[data-gallery-mode="presentation"] .fg-lightbox-comments-btn,
.pixori-gallery[data-gallery-mode="presentation"] .fg-selections-toggle-btn,
.pixori-gallery[data-gallery-mode="presentation"] .fg-selections-panel {
    display: none !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .fg-selections-panel {
        width: 280px;
        right: 10px;
        top: 10px;
        max-height: 70vh;
    }

    .fg-selection-form {
        flex-direction: column;
    }

    .fg-selection-create-btn {
        width: 100%;
    }

    .fg-toast {
        left: 10px;
        right: 10px;
        width: auto;
    }
}

/* ==========================================================================
   Inline photobooth moderation (admin-only, pending preview)
   ========================================================================== */

.fg-item--pending {
    position: relative;
}

.fg-item--pending .fg-img {
    filter: saturate(0.55) brightness(0.92);
    transition: filter 0.25s ease;
}

.fg-item--pending::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 2px dashed rgba(255, 176, 32, 0.85);
    border-radius: inherit;
    pointer-events: none;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15) inset;
    z-index: 2;
}

.fg-pending-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px 5px 8px;
    background: rgba(20, 20, 20, 0.78);
    color: #ffd47a;
    font: 600 11px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border-radius: 999px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    pointer-events: none;
    user-select: none;
}

.fg-pending-badge svg {
    flex: none;
    color: #ffb020;
}

.fg-mod-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
    display: inline-flex;
    gap: 6px;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.fg-item--pending:hover .fg-mod-actions,
.fg-item--pending:focus-within .fg-mod-actions {
    opacity: 1;
    transform: translateY(0);
}

@media (hover: none) {
    /* Touch devices: actions always visible — no hover state to rely on. */
    .fg-mod-actions {
        opacity: 1;
        transform: none;
    }
}

.fg-mod-btn {
    appearance: none;
    border: 0;
    margin: 0;
    padding: 0;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    cursor: pointer;
    color: #fff;
    background: rgba(20, 20, 20, 0.78);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: background 0.15s ease, transform 0.1s ease, color 0.15s ease;
}

.fg-mod-btn:hover {
    transform: scale(1.06);
}

.fg-mod-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.fg-mod-btn:disabled {
    opacity: 0.55;
    cursor: progress;
    transform: none;
}

.fg-mod-approve:hover  { background: #16a34a; }
.fg-mod-reject:hover   { background: #dc2626; }

.fg-item--busy {
    cursor: progress;
}

.fg-item--rejecting {
    transition: opacity 0.25s ease, transform 0.25s ease;
    opacity: 0;
    transform: scale(0.94);
    pointer-events: none;
}

.fg-item--just-approved .fg-img {
    animation: fgApprovedPulse 0.9s ease;
}

@keyframes fgApprovedPulse {
    0%   { filter: saturate(0.55) brightness(0.92); }
    35%  { filter: saturate(1.15) brightness(1.05); }
    100% { filter: none; }
}

.fg-mod-error {
    position: absolute;
    inset: auto 10px 10px 10px;
    z-index: 6;
    padding: 6px 10px;
    background: rgba(220, 38, 38, 0.92);
    color: #fff;
    font: 600 11px/1.3 system-ui, -apple-system, sans-serif;
    border-radius: 6px;
    text-align: center;
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.fg-mod-error--out {
    opacity: 0;
    transform: translateY(4px);
}
