/* Verbesserungen für die Positionsanzeige in der Taktikansicht */

/* Erhöhte Mindestbreite für die Positionsspalte - DEUTLICH BREITER */
.spieler-tabelle th:nth-child(4), 
.spieler-tabelle td:nth-child(4) {
    width: 230px !important;
    min-width: 230px !important;
    max-width: none !important;
    white-space: normal !important; /* Erlaubt Umbruch bei längeren Positionslisten */
    overflow: visible !important; /* Verhindert abgeschnittenen Text */
}

/* Position-Text besser lesbar machen - OPTIMIERT */
.spieler-tabelle td:nth-child(4) {
    padding: 6px 4px !important; /* Reduziertes Padding für mehr Platz */
    line-height: 1.8 !important; /* Optimierter Zeilenabstand für Badges */
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
    position: relative !important; /* Für bessere Z-Index-Steuerung */
    vertical-align: middle !important; /* Zentriert die Badges vertikal */
    text-align: left !important; /* Ausrichtung links */
    height: auto !important; /* Höhe passt sich Inhalt an */
    min-height: 40px !important; /* Mindesthöhe für bessere Lesbarkeit */
    display: table-cell !important; /* Tabellarische Darstellung beibehalten */
}

/* Verbesserungen für die Positionsbadges - KOMPAKTERE VERSION */
.badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 3px 6px !important; /* Noch kompakteres Padding */
    margin: 2px !important; /* Reduzierter Abstand zwischen Badges */
    border-radius: 4px !important; /* Weniger abgerundet für mehr Platz */
    min-width: 28px !important; /* Reduzierte Mindestbreite */
    height: auto !important; /* Höhe passt sich Inhalt an */
    overflow: visible !important; /* Text nicht abschneiden */
    text-overflow: clip !important; /* Kein Abschneiden mit Pünktchen */
    white-space: nowrap !important; /* Kein Umbruch innerhalb des Badges */
    font-weight: 600 !important; /* Fett für bessere Lesbarkeit */
    font-size: 10px !important; /* Kleinere Schrift für mehr Platz */
    line-height: 1 !important; /* Minimaler Zeilenabstand innerhalb des Badges */
}

/* Responsive Design für verschiedene Bildschirmgrößen */
@media (min-width: 1280px) {
    .spieler-tabelle th:nth-child(4),
    .spieler-tabelle td:nth-child(4) {
        width: 220px !important; /* Noch breiter auf größeren Bildschirmen */
        min-width: 220px !important;
    }
    
    .spieler-liste {
        max-width: 420px !important; /* Breite der Spielerliste erhöhen */
    }
}

/* Anpassungen für Schattenkader-Positionen */
.scouted-player-draggable small {
    color: #64748b !important; /* Dunklere Farbe für bessere Lesbarkeit */
    font-size: 14px !important; /* Größere Schrift für Positionen */
    font-weight: 500 !important;
    margin-top: 0 !important; /* Kein zusätzlicher Abstand */
    display: block !important;
    overflow: visible !important; /* Text nicht abschneiden */
    white-space: normal !important; /* Umbruch erlauben */
    line-height: 1.4 !important; /* Besserer Zeilenabstand */
    word-wrap: break-word !important; /* Wortumbruch für lange Positionen */
}

/* Verbesserte Darstellung für Spieler-Zeilen */
.spieler-draggable {
    height: auto !important; /* Höhe passt sich Inhalt an */
}

/* Fixe Tabellenkopfzeile */
.spieler-tabelle thead {
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    background: #f8fafc !important;
}

/* Tooltip-Funktion für Positionen bei Bedarf */
.position-cell {
    position: relative;
    cursor: help;
}

/* Standard Tooltip beim Hover */
.position-tooltip {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    width: 250px;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.5;
}

.position-cell:hover .position-tooltip {
    display: block;
}

/* Erweitertes Modal-Tooltip bei Klick */
.custom-position-tooltip {
    position: fixed;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    width: 280px;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.6;
    animation: fadeIn 0.2s ease;
    overflow: hidden;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.tooltip-header {
    padding: 10px 15px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    color: #374151;
    font-size: 15px;
}

.tooltip-content {
    padding: 12px 15px;
    max-height: 300px;
    overflow-y: auto;
    color: #4b5563;
}

/* "Mehr" Badge ist klickbar */
.badge-more {
    cursor: pointer !important;
}

/* Leere Positionsanzeige */
.position-empty {
    color: #94a3b8;
    font-style: italic;
    display: inline-block;
    padding: 4px;
}

/* Verbesserte Hover-Effekte für Badges */
.badge:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    z-index: 5;
    position: relative;
}

/* Styling für das "+mehr" Badge */
.badge-more {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
    color: white !important;
    cursor: help !important;
    position: relative !important;
}

.badge-more:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4) !important;
}

/* Spezielle Klasse für die Positionszelle */
.positions-cell {
    position: relative !important;
    padding: 4px 3px !important;
    line-height: 1.5 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 2px !important;
    min-height: 38px !important;
}

/* Optimierte Breite für die Spielerliste im Taktik-Bereich */
@media (min-width: 1024px) {
    .spieler-liste {
        max-width: 480px !important;
        min-width: 450px !important;
    }

    .main-content {
        max-width: calc(100% - 490px) !important;
    }
}

/* Spezielle Optimierung für extra große Bildschirme */
@media (min-width: 1440px) {
    .spieler-liste {
        max-width: 520px !important;
        min-width: 480px !important;
    }

    .main-content {
        max-width: calc(100% - 530px) !important;
    }
}

/* Extra Styling für die Tabelle für mehr Lesbarkeit */
.spieler-tabelle {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border: 1px solid #e2e8f0 !important;
}

.spieler-tabelle th {
    position: sticky !important;
    top: 0 !important;
    z-index: 5 !important;
    background: #f8fafc !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}