/* ============================================
   GALLERY CSS
   Galería de imágenes
   ============================================ */

.gallery-container {
    height: calc(100% - 60px);
    display: flex;
    flex-direction: column;
}

.gallery-container-full {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.gallery-filters {
    display: flex;
    gap: 3px;
    margin-bottom: 8px;
}

.filter-btn {
    flex: 1;
    padding: 5px 4px;
    border: 1px solid var(--border);
    background: var(--white);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7em;
    transition: var(--transition);
}

.filter-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    overflow-y: auto;
    padding: 2px;
}

.gallery-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}

.gallery-item:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.gallery-item.active {
    border-color: var(--success);
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.2);
}

.gallery-item.no-annotations {
    border-color: var(--warning);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-timeseries-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.gallery-timeseries-placeholder i {
    font-size: 3em;
    opacity: 0.9;
}

.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 6px;
    color: var(--white);
    font-size: 0.7em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gallery-item-actions {
    position: absolute;
    top: 4px;
    right: 4px;
    display: none;
    flex-direction: column;
    gap: 4px;
}

.gallery-item:hover .gallery-item-actions {
    display: flex;
}

.gallery-item-delete,
.gallery-item-augment,
.gallery-item-inference {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85em;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.gallery-item-delete {
    background: var(--danger);
}

.gallery-item-delete:hover {
    background: var(--danger-dark);
    transform: scale(1.1);
}

.gallery-item-augment {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gallery-item-augment:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6a3f8f 100%);
    transform: scale(1.1);
}

.gallery-item-inference {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.gallery-item-inference:hover {
    background: linear-gradient(135deg, #0f8a7f 0%, #2dd86b 100%);
    transform: scale(1.1);
}

.gallery-item-inference.has-predictions {
    background: linear-gradient(135deg, #00ff00 0%, #00cc00 100%);
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.5);
}

.empty-gallery {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: var(--gray);
    font-style: italic;
}

/* Classification badges in gallery */
.gallery-class-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.gallery-class-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.65em;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
}
