/* Page-specific styles for Gallery */
/* Extracted from style.css */

/* ═══════════════════════════════════════
   Art Exchange Gallery
   ═══════════════════════════════════════ */

/* ─── Gallery Grid ─── */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 8px;
}

.gallery-item {
    background: var(--color-bg-elevated);
    border-radius: 8px;
    border: 1px solid var(--color-border-light);
    overflow: hidden;
    transition: all 0.15s ease;
}

.gallery-item:hover {
    border-color: var(--color-border-medium);
    box-shadow: 0 4px 16px var(--shadow-card-hover);
}

.gallery-item a {
    display: block;
    aspect-ratio: 1;
    overflow: hidden;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}

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

.gallery-item-info {
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    border-top: 1px solid var(--color-border-light);
}

.gallery-item-name {
    font-size: 0.8em;
    color: var(--color-text-hint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.gallery-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--color-bg-page);
    color: var(--color-text-soft);
    text-decoration: none;
    font-size: 1.1em;
    font-weight: 700;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.gallery-download:hover {
    background: var(--color-primary);
    color: var(--color-text-white);
}

/* ─── Gallery Empty State ─── */
.gallery-empty {
    text-align: center;
    padding: 80px 28px;
    color: var(--color-text-disabled);
}

.gallery-empty p {
    font-size: 1.1em;
    margin-bottom: 24px;
}

/* ─── Gallery Stats ─── */
.gallery-stats {
    text-align: center;
    font-size: 0.85em;
    color: var(--color-text-faint);
    margin-top: 24px;
    padding-bottom: 8px;
}

/* ─── Pagination ─── */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 500;
    text-decoration: none;
    color: var(--color-text-soft);
    background: var(--color-bg-page);
    border: 1px solid var(--color-border-light);
    transition: all 0.15s ease;
}

.pagination-link:hover {
    background: var(--color-border-light);
    color: var(--color-text-heading);
}

.pagination-link.current {
    background: var(--color-primary);
    color: var(--color-text-white);
    border-color: var(--color-primary);
}

.pagination-link.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.pagination-ellipsis {
    color: var(--color-text-faint);
    padding: 0 4px;
}

/* ─── Upload Section ─── */
.upload-section {
    max-width: 560px;
    margin: 0 auto;
}

.upload-section h2 {
    margin-bottom: 28px;
}

/* ─── Drop Zone ─── */
.drop-zone {
    position: relative;
    border: 2px dashed var(--color-border-medium);
    border-radius: 10px;
    padding: 48px 28px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--color-bg-drop-zone);
}

.drop-zone:hover,
.drop-zone-active {
    border-color: var(--color-primary);
    background: var(--color-bg-drop-zone-hover);
}

.drop-zone-has-file {
    border-color: var(--color-primary);
    border-style: solid;
    background: var(--color-bg-drop-zone-hover);
}

.drop-zone-icon {
    font-size: 2.5em;
    color: var(--color-border-icon);
    line-height: 1;
    margin-bottom: 12px;
    font-weight: 300;
}

.drop-zone:hover .drop-zone-icon,
.drop-zone-active .drop-zone-icon {
    color: var(--color-primary);
}

.drop-zone-text {
    font-size: 1em;
    color: var(--color-text-soft);
    margin-bottom: 8px;
}

.drop-zone-hint {
    font-size: 0.85em;
    color: var(--color-text-faint);
}

.drop-zone-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* ─── File Info ─── */
.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    margin-top: 12px;
    background: var(--color-bg-page);
    border-radius: 8px;
    font-size: 0.9em;
    color: var(--color-text-muted);
}

#fileName {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

#fileSize {
    color: var(--color-text-disabled);
    flex-shrink: 0;
    margin-left: 12px;
}

/* ─── Upload Button ─── */
.upload-btn {
    display: block;
    width: 100%;
    margin-top: 16px;
}

/* ─── Upload Preview ─── */
.upload-preview {
    margin: 24px 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--color-border-light);
}

.upload-preview img {
    display: block;
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    background: var(--color-bg-page);
}

.upload-preview-actions {
    display: flex;
    gap: 10px;
    padding: 14px 16px;
    background: var(--color-bg-elevated);
    border-top: 1px solid var(--color-border-light);
}


/* ─── Gallery Responsive ─── */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }

    .drop-zone {
        padding: 36px 20px;
    }

    .upload-preview-actions {
        flex-wrap: wrap;
    }

    .upload-preview-actions .btn {
        flex: 1;
        min-width: 100px;
    }

    .pagination {
        gap: 4px;
    }

    .pagination-link {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        font-size: 0.85em;
    }

}
