.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner-container {
    text-align: center;
    color: white;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #ffffff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner-container p {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

.loading-overlay.active ~ .content {
    pointer-events: none;
    opacity: 0.5;
}

.bsi-image-upload-section {
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fafafa;
}

.upload-area {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    background-color: #fff;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover, .upload-area.dragover {
    border-color: #007cba;
    background-color: #f0f8ff;
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.upload-area p {
    margin: 0;
    font-size: 16px;
    color: #666;
}

.browse-link {
    color: #007cba;
    text-decoration: underline;
    cursor: pointer;
}

.image-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.image-preview-item {
    position: relative;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.image-preview-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.image-preview-item .image-info {
    padding: 8px;
    font-size: 12px;
    color: #666;
    background-color: #f9f9f9;
}

.image-preview-item .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview-item .remove-btn:hover {
    background: rgba(255, 0, 0, 1);
}

.upload-progress {
    margin-top: 10px;
    padding: 10px;
    background-color: #e8f4f8;
    border-radius: 4px;
    display: none;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #ddd;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #007cba;
    width: 0%;
    transition: width 0.3s ease;
}

/* Autocomplete Styles */
.autocomplete-container {
    position: relative;
    width: 100%;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 0 0 4px 4px;
}

.autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background-color: #f0f0f0;
}

.autocomplete-item.selected {
    background-color: #007cba;
    color: white;
}

.autocomplete-buttons {
    display: flex;
    gap: 5px;
    margin-top: 5px;
}

.autocomplete-buttons .btn {
    font-size: 0.8em;
    padding: 4px 8px;
}

.loading-indicator {
    margin-top: 5px;
    color: #666;
}

.loading-indicator i {
    margin-right: 5px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .autocomplete-buttons {
        flex-direction: column;
    }
    
    .autocomplete-buttons .btn {
        width: 100%;
    }
}
