/**
 * Bildergalerie CSS
 * Styling für Upload-Bereich, Vorschau und Bilder
 */

/* Upload-Bereich */
.image-upload-section {
    margin-top: 15px;
}

.upload-area {
    border: 2px dashed #0066cc;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 20px;
}

.upload-area:hover {
    background-color: #e9ecef;
    border-color: #0052a3;
}

.upload-area.dragover {
    background-color: #d1ecf1;
    border-color: #0c5460;
}

.upload-placeholder {
    color: #666;
}

.upload-placeholder p {
    margin: 10px 0 5px 0;
    font-size: 16px;
    font-weight: 500;
}

.upload-placeholder small {
    color: #999;
    font-size: 13px;
}

/* Bildvorschau */
.image-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.image-item {
    position: relative;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: move;
}

.image-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.image-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
}

.image-item-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 6px;
    z-index: 10;
}

.image-item-actions button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    color: white;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-delete {
    background-color: #dc3545;
}

.btn-delete:hover {
    background-color: #c82333;
    transform: scale(1.1);
}

.image-item-info {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.image-item-info small {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Loading-Zustand */
.image-item.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    cursor: default;
}

.image-item.loading:hover {
    transform: none;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0066cc;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Sortierung */
.sortable-ghost {
    opacity: 0.4;
    background: #c8ebfb;
}

/* Responsive */
@media (max-width: 768px) {
    .image-preview {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .upload-area {
        padding: 30px 20px;
    }
    
    .upload-placeholder i {
        font-size: 36px !important;
    }
}

@media (max-width: 480px) {
    .image-preview {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
}
