/* setGallery - Gallery Styles */

.sg-controls {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.sg-search-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 12px;
}

.sg-search-group {
    flex: 1;
    min-width: 280px;
    position: relative;
}

.sg-search-group input[type="search"] {
    width: 100%;
    padding: 10px 14px;
    background: #222;
    color: #fff;
    border: 1px solid #444;
    border-radius: 6px;
    font-size: 1rem;
}

.sg-filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-end;
}

.sg-filter-group label {
    font-size: 0.8rem;
    color: #aaa;
    margin-bottom: 4px;
    display: block;
}

.sg-filter-group select,
.sg-filter-group input[type="date"],
.sg-filter-group input[type="text"] {
    padding: 8px 12px;
    background: #222;
    color: #fff;
    border: 1px solid #444;
    border-radius: 6px;
    font-size: 0.9rem;
    min-width: 140px;
}

.sg-advanced-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
    padding-top: 12px;
    border-top: 1px solid #333;
}

.sg-tag-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 32px;
    padding: 4px;
    background: #222;
    border: 1px solid #444;
    border-radius: 6px;
    flex: 1;
    min-width: 200px;
}

.sg-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #4da3ff;
    color: #05080d;
    border-radius: 16px;
    font-size: 0.8rem;
}

.sg-tag-chip button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
    font-size: 1.1em;
    line-height: 1;
    opacity: 0.7;
}
.sg-tag-chip button:hover { opacity: 1; }

#sg-tag-input, #sg-exclude-input {
    flex: 1;
    min-width: 140px;
    padding: 8px 12px;
    background: #222;
    color: #fff;
    border: 1px solid #444;
    border-radius: 6px;
}

.sg-results-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    color: #aaa;
    font-size: 0.9rem;
}

.sg-badge {
    background: #4da3ff;
    color: #05080d;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
}

.sg-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.sg-set-card {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.sg-set-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    border-color: #4da3ff;
}

.sg-set-thumb {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #222;
    position: relative;
}

.sg-set-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.sg-set-card:hover .sg-set-thumb img {
    transform: scale(1.05);
}

.sg-set-info {
    padding: 12px;
}

.sg-set-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin: 0 0 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sg-set-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.75rem;
    color: #888;
}

.sg-set-category {
    background: #2a2a2a;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    text-transform: capitalize;
}

.sg-set-count {
    color: #aaa;
}

.sg-set-status {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}
.sg-set-status.status-published { background: #1a3a2a; color: #2ecc71; }
.sg-set-status.status-draft { background: #3a2a1a; color: #f39c12; }
.sg-set-status.status-hidden { background: #3a1a1a; color: #e74c3c; }

.sg-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    padding: 16px;
}

.sg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0,0,0,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}
.sg-lightbox.open {
    opacity: 1;
    visibility: visible;
}

.sg-lightbox-content {
    position: relative;
    max-width: 95vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sg-lightbox-content img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}

.sg-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 100%;
    max-height: 80vh;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 3rem;
    opacity: 0;
    transition: opacity 0.2s;
    user-select: none;
}
.sg-lightbox:hover .sg-lightbox-nav { opacity: 0.5; }
.sg-lightbox-nav:hover { opacity: 1 !important; background: rgba(77,163,255,0.2); }
.sg-lightbox-prev-img { left: 0; }
.sg-lightbox-next-img { right: 0; }
.sg-lightbox-prev-set { left: 0; background: linear-gradient(90deg, rgba(255,0,0,0.1), transparent); }
.sg-lightbox-next-set { right: 0; background: linear-gradient(270deg, rgba(255,0,0,0.1), transparent); }
.sg-lightbox-prev-set::before { content: "\226A"; }
.sg-lightbox-next-set::after { content: "\226B"; }

.sg-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    background: rgba(0,0,0,0.6);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}
.sg-lightbox-close:hover { background: rgba(231,76,60,0.8); }

.sg-lightbox-info {
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    padding: 8px 16px;
    border-radius: 20px;
    color: #fff;
    font-size: 0.9rem;
    white-space: nowrap;
    pointer-events: none;
}

.sg-lightbox-filmstrip {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0,0,0,0.6);
    border-radius: 12px;
    max-width: 90vw;
    overflow-x: auto;
}

.sg-filmstrip-thumb {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s, transform 0.2s;
}
.sg-filmstrip-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.sg-filmstrip-thumb.active { border-color: #4da3ff; transform: scale(1.1); }
.sg-filmstrip-thumb.hidden-img { opacity: 0.4; filter: grayscale(1); }

.sg-lightbox-controls {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    padding: 8px 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-size: 0.85rem;
}

.sg-mode-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.sg-mode-toggle input { accent-color: #4da3ff; }

@media (max-width: 768px) {
    .sg-gallery {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .sg-search-row {
        flex-direction: column;
        align-items: stretch;
    }

    .sg-filter-group {
        width: 100%;
    }
    .sg-filter-group select { width: 100%; }

    .sg-advanced-row {
        flex-direction: column;
    }

    .sg-tag-chips { width: 100%; }

    .sg-lightbox-nav { width: 40px; font-size: 2rem; }
    .sg-lightbox-content img { max-width: 95vw; max-height: 70vh; }
    .sg-filmstrip-thumb { width: 56px; height: 56px; }
}