/* Resource Icon Styles */
.resource-icon {
    width: 24px;
    height: 24px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    flex-shrink: 0; /* Icon soll nicht schrumpfen */
}

/* Container für Resource-Items */
.resource-item-container {
    display: flex !important;
    align-items: center !important;
    gap: 8px;
    white-space: nowrap;
    flex-wrap: nowrap !important;
    width: 100%;
}

.resource-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 24px; /* Gleiche Höhe wie Icon */
    display: inline-block;
    vertical-align: middle;
}

/* Stelle sicher dass in Tabellen alles passt */
td .resource-item-container {
    display: inline-flex !important;
    width: auto;
    max-width: 100%;
}

.resource-icon-small {
    width: 20px;
    height: 20px;
}

.resource-icon-large {
    width: 32px;
    height: 32px;
}

/* Fallback wenn kein Icon vorhanden */
.resource-icon-placeholder {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
}

/* Mobile Anpassungen */
@media (max-width: 768px) {
    .resource-item-container {
        display: inline-flex !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        max-width: 100%;
        width: 100%;
        min-height: 24px;
    }
    
    .resource-icon {
        position: relative !important;
        display: inline-block !important;
        flex-shrink: 0 !important;
        margin-right: 6px;
        width: 20px;
        height: 20px;
        vertical-align: middle !important;
        float: none !important;
    }
    
    .resource-text {
        flex: 1;
        min-width: 0; /* Erlaubt text-overflow zu funktionieren */
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: inline-block !important;
        line-height: 20px;
        max-width: calc(100% - 30px); /* Icon width + margin */
    }
    
    /* NEUE LÖSUNG: Ressourcen-Namen in Inventar vollständig anzeigen */
    .resource-name {
        display: inline-block !important;
        white-space: normal !important; /* Erlaube Zeilenumbruch */
        word-break: break-word !important; /* Breche lange Wörter um */
        line-height: 1.2 !important;
        max-width: 100% !important;
        overflow-wrap: break-word !important; /* Alternative für word-break */
        hyphens: auto !important; /* Automatische Silbentrennung wenn möglich */
    }
    
    /* Spezielle Behandlung für Tabellenzellen mit Ressourcen */
    .table td:first-child {
        white-space: normal !important; /* Erlaube Umbruch */
        overflow: visible !important; /* Zeige kompletten Text */
        min-width: 100px !important; /* Mindestbreite für Ressourcen-Spalte */
        max-width: 150px !important; /* Maximale Breite beschränken */
        padding: 8px 6px !important; /* Reduziertes Padding für mehr Platz */
    }
    
    /* Tabellenzellen auf Mobile */
    td .resource-item-container {
        display: inline-flex !important;
        align-items: center !important;
        width: 100%;
        flex-wrap: wrap !important; /* Erlaube Umbruch bei Bedarf */
    }
    
    /* Tabelle auf Mobile anpassen */
    .table-responsive {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    /* Kleinere Schrift für lange Namen */
    .table td:first-child .resource-name {
        font-size: 0.9rem !important; /* Etwas kleinere Schrift */
    }
    
    /* Für sehr kleine Bildschirme (unter 400px) */
    @media (max-width: 400px) {
        .table td:first-child {
            font-size: 0.85rem !important;
            max-width: 120px !important;
        }
        
        .resource-name {
            font-size: 0.85rem !important;
        }
    }
}