/* ========================================
   GALLERY MODULE - VILLAGE PROFILE
   ======================================== */

/* Gallery grid - Mobile 2 columns */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Photo card */
.photo-card {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.photo-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.photo-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background: var(--bg-secondary);
}

.photo-info {
    padding: 0.75rem;
    background: var(--bg-primary);
    flex: 1;
}

.photo-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.photo-description {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.photo-meta {
    font-size: 0.7rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.photo-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.photo-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.photo-actions .btn {
    flex: 1;
    padding: 0.4rem;
    font-size: 0.75rem;
    border: 1px solid var(--border-color);
}

/* Featured badge for gallery */
.photo-featured-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #212529;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    z-index: 2;
}

/* Filter section */
.filter-section {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.filter-section .form-group {
    margin-bottom: 0;
}

/* Stats cards for gallery */
.stats-card {
    padding: 1rem;
    border-radius: var(--radius-md);
    text-align: center;
    color: white;
    margin-bottom: 1rem;
}

.stats-card h4 {
    margin-bottom: 0.25rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.stats-card small {
    font-size: 0.75rem;
    opacity: 0.9;
}

.stats-total { background: linear-gradient(135deg, #007bff, #0056b3); }
.stats-featured { background: linear-gradient(135deg, #ffc107, #e0a800); }
.stats-active { background: linear-gradient(135deg, #28a745, #218838); }
.stats-inactive { background: linear-gradient(135deg, #6c757d, #5a6268); }

/* Image upload area */
.image-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
    background: var(--bg-secondary);
    transition: var(--transition-base);
    cursor: pointer;
}

.image-upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(0, 123, 255, 0.05);
}

.image-upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(0, 123, 255, 0.1);
    transform: scale(1.02);
}

.image-upload-area i {
    font-size: 2rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* Preview images */
.preview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
}

@media (min-width: 768px) {
    .preview-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-remove {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
}

.preview-remove:hover {
    background: #dc3545;
}

/* Mobile responsive */
@media (max-width: 767px) {
    .photo-image {
        height: 120px;
    }
    
    .photo-info {
        padding: 0.5rem;
    }
    
    .photo-title {
        font-size: 0.75rem;
    }
    
    .photo-description {
        font-size: 0.7rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .photo-meta {
        font-size: 0.65rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .photo-actions {
        gap: 0.25rem;
        padding: 0.4rem;
    }
    
    .photo-actions .btn {
        padding: 0.3rem;
        font-size: 0.7rem;
    }
    
    .filter-section {
        padding: 0.75rem;
    }
    
    .stats-card h4 {
        font-size: 1.25rem;
    }
}


