/**
 * Delete Button Override CSS
 * Pfad: /pages/station-detail/assets/delete-button-override.css
 * 
 * KRITISCHES CSS: Stellt sicher dass Lösch-Icons über Bildern sichtbar sind
 * Muss NACH Tailwind CSS geladen werden!
 */

/* KRITISCH: Delete Button muss über allem liegen */
.image-delete-button {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    width: 32px !important;
    height: 32px !important;
    background-color: rgba(220, 38, 38, 0.95) !important;
    color: white !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 2px solid white !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6) !important;
    transition: all 0.2s ease !important;
    opacity: 1 !important;
    z-index: 9999 !important; /* Extrem hoher z-index */
    cursor: pointer !important;
    
    /* Webkit spezifisch */
    -webkit-backdrop-filter: blur(2px) !important;
    backdrop-filter: blur(2px) !important;
    
    /* Verhindert Überlagerung durch andere Elemente */
    pointer-events: auto !important;
}

.image-delete-button:hover {
    opacity: 1 !important;
    background-color: rgba(185, 28, 28, 1) !important;
    transform: scale(1.1) !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.7) !important;
}

.image-delete-button:active {
    transform: scale(0.95) !important;
}

.image-delete-button:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    background-color: rgba(107, 114, 128, 0.8) !important;
}

.image-delete-button svg {
    width: 16px !important;
    height: 16px !important;
    stroke-width: 2.5px !important;
    pointer-events: none !important;
}

/* Container Styling - Stellt sicher dass relative Positionierung funktioniert */
#image-grid [data-image-id] {
    position: relative !important;
}

#image-grid .aspect-w-3,
#image-grid .aspect-h-2 {
    position: relative !important;
}

/* Bilder haben niedrigeren z-index */
#image-grid img {
    z-index: 1 !important;
    position: relative !important;
}

/* Alle anderen absolut positionierten Elemente außer Delete Button */
#image-grid .absolute:not(.image-delete-button) {
    z-index: 5 !important;
}

/* Mobile Anpassungen */
@media (max-width: 768px) {
    .image-delete-button {
        width: 36px !important;
        height: 36px !important;
        top: 6px !important;
        right: 6px !important;
    }
    
    .image-delete-button svg {
        width: 18px !important;
        height: 18px !important;
    }
}

/* Debug-Modus (nur für Tests) */
.debug-delete-buttons .image-delete-button {
    background-color: lime !important;
    border: 3px solid red !important;
    opacity: 1 !important;
}

/* Loading State */
.image-delete-button.loading {
    pointer-events: none !important;
    opacity: 0.8 !important;
}

.image-delete-button.loading svg {
    animation: spin 1s linear infinite !important;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Deleting Overlay */
.deleting-overlay {
    position: absolute !important;
    inset: 0 !important;
    background: rgba(0, 0, 0, 0.5) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 100 !important;
    backdrop-filter: blur(2px) !important;
    animation: pulse 1.5s ease-in-out infinite !important;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 0.8;
    }
}

/* NOTFALL: Falls immer noch nicht sichtbar */
.force-visible-delete-button {
    background: red !important;
    border: 3px solid yellow !important;
    z-index: 99999 !important;
    width: 40px !important;
    height: 40px !important;
    opacity: 1 !important;
    display: block !important;
    position: fixed !important;
    top: 50px !important;
    right: 50px !important;
}