/* File Upload Preview Styles */

.file-preview-item {
    background-color: #f8f9fa;
    transition: all 0.2s;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.file-preview-item:hover {
    background-color: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.file-preview-item img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Verbesserter Lösch-Button */
.btn-remove-file {
    opacity: 0;
    transition: all 0.2s;
    background-color: rgba(220, 53, 69, 0.9);
    border: 2px solid #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    cursor: pointer;
    padding: 0;
    font-size: 18px;
    line-height: 1;
    color: #fff;
    font-weight: bold;
}

.file-preview-item:hover .btn-remove-file {
    opacity: 1;
}

.btn-remove-file:hover {
    background-color: #dc3545;
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
}

.btn-remove-file:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25);
}

/* File Preview Container mit schöner Scrollbar */
#filePreview {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 1rem;
    padding-right: 5px;
}

/* Moderne Scrollbar Styles */
#filePreview::-webkit-scrollbar {
    width: 8px;
}

#filePreview::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#filePreview::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
    transition: background 0.2s;
}

#filePreview::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Firefox Scrollbar */
#filePreview {
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

/* File Info Styles */
.file-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.file-name {
    word-break: break-all;
    margin-right: 10px;
}

/* Responsive Anpassungen */
@media (max-width: 576px) {
    .file-preview-item {
        min-height: 150px;
    }
    
    .btn-remove-file {
        width: 25px;
        height: 25px;
    }
    
    .btn-remove-file i {
        font-size: 12px;
    }
}

/* Loading Animation für Upload */
.file-uploading {
    position: relative;
    opacity: 0.8;
}

.file-uploading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Fehler-Status */
.file-error {
    background-color: rgba(220, 53, 69, 0.1);
    border-color: #dc3545;
}

.file-error:hover {
    background-color: rgba(220, 53, 69, 0.15);
}

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