/* Image Picker Component Styles */

.image-picker-wrapper {
    margin-bottom: 1rem;
}

.image-picker-preview {
    min-height: 100px;
}

.no-image-placeholder {
    background-color: #f8f9fa;
    border: 2px dashed #dee2e6;
    transition: all 0.2s;
}

.no-image-placeholder:hover {
    border-color: #adb5bd;
    background-color: #e9ecef;
}

.selected-image-container {
    display: inline-block;
}

.selected-image-container img {
    border: 2px solid #dee2e6;
    border-radius: 0.375rem;
}

.selected-image-container .btn-danger {
    opacity: 0.9;
    transition: opacity 0.2s;
}

.selected-image-container:hover .btn-danger {
    opacity: 1;
}

/* Modal Gallery Styles */

.image-picker-gallery {
    min-height: 400px;
}

.image-picker-item {
    transition: all 0.2s;
    border: 2px solid transparent;
}

.image-picker-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-color: var(--bs-primary);
}

.image-picker-item .card-img-top {
    transition: opacity 0.2s;
}

.image-picker-item:hover .card-img-top {
    opacity: 0.9;
}

.image-picker-item .card-body {
    background-color: #f8f9fa;
}

/* Loading and Error States */

.image-picker-loading {
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.image-picker-error {
    margin: 2rem 0;
}

.image-picker-no-results {
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Search Bar */

.image-picker-search {
    border-radius: 0.375rem;
}

.image-picker-search:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Pagination */

.image-picker-pagination {
    margin-top: 1.5rem;
}

.image-picker-pagination .page-link {
    color: var(--bs-primary);
}

.image-picker-pagination .page-item.active .page-link {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

/* Responsive */

@media (max-width: 768px) {
    .image-picker-item .card-img-top {
        height: 150px !important;
    }
    
    .selected-image-container img {
        max-width: 200px !important;
        max-height: 150px !important;
    }
}

@media (max-width: 576px) {
    .image-picker-item .card-img-top {
        height: 120px !important;
    }
    
    .modal-xl {
        margin: 0.5rem;
    }
}

/* Image Loading */

.image-picker-item img[loading="lazy"] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Badge Styles */

.image-picker-item .badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
}

/* Accessibility */

.image-picker-item:focus-within {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

/* Animation */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.image-picker-gallery .col-md-3 {
    animation: fadeIn 0.3s ease-out;
}
