/* Close-Button im Popup-Header immer klein und einheitlich */
.popup-header .close {
    font-size: 20px;
    width: 28px;
    height: 28px;
    padding: 0;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}
.popup-header .close img {
    width: 20px;
    height: 20px;
    display: block;
}
/* Popup-Inhalt und Formelemente an die Popup-Breite anpassen */
.popup-content, .popup-body {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: auto;
}
.popup input, .popup select, .popup button {
    max-width: 100%;
    box-sizing: border-box;
}
#moderationModal,
#banModal,
#penaltyModal {
    /* Erbt alle Styles der .popup-Klasse */
    max-width: 90vw;
    max-height: 90vh;
    width: 400px;
    background: #fff;
    overflow: auto;
    border-radius: 8px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.2);
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    min-width: 320px;
    box-sizing: border-box;
    touch-action: manipulation;
}
/* Verlaufspopup auf Desktop extra breit */
@media (min-width: 900px) {
  .history-popup.popup {
    width: 90vw !important;
    max-width: 1600px !important;
    min-width: 900px !important;
    border: none !important;
    box-shadow: 0 2px 16px rgba(0,0,0,0.2) !important;
  }
}
/* z.B. in assets/css/popups.css */
.popup {
    max-width: 90vw;
    max-height: 90vh;
    width: 400px;
    background: #fff;
    overflow: auto;
    border-radius: 8px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.2);
    position: fixed;
    /* left, top und transform entfernt, damit Drag funktioniert! */
    /* Hinweis: Keine weiteren CSS-Dateien oder Inline-Styles sollten left, top oder transform für .popup setzen! */
    /* z-index entfernt, wird dynamisch vom PopupManager gesetzt */
    min-width: 320px;
    box-sizing: border-box;
    touch-action: manipulation;
}

.popup-header {
    cursor: move;
    user-select: none;
}

.popup-content {
    cursor: move;
    user-select: none;
    pointer-events: auto;
}

@media (max-width: 600px) {
    .popup {
        width: 98vw;
        max-width: 100vw;
        min-width: unset;
        max-height: 95vh;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        border-radius: 8px;
        padding: 0;
        box-sizing: border-box;
        font-size: 15px;
        /* Sicherstellen, dass Popups auf Mobile über Header/Eingabeleiste liegen */
        z-index: 50010 !important;
    }
    .popup-header {
        font-size: 1.1em;
        padding: 10px 8px;
    }
}

@media (max-width: 700px) {
    .popup {
        width: 98vw;
        max-width: 100vw;
        min-width: unset;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        font-size: 1.05em;
        padding: 0 2vw;
    }
    .popup-content, .popup-header {
        font-size: 1.1em;
        padding: 10px 8px;
        min-height: 44px;
    }
    .btn, button, input[type="button"], input[type="submit"] {
        min-height: 44px;
        font-size: 1.05em;
    }
}

/* Tabellen in Popups scrollbar machen */
.popup table {
    display: block;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
}

.moderation-modal {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 40000; /* über Mobile-Bar und Header, ähnlich anderen Popups */
    max-width: 95vw;
    max-height: 90vh;
    min-width: 320px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.2);
    overflow: auto;
    padding: 0;
    box-sizing: border-box;
}

/* Verlauf-Popup: sicheres, eigenständiges Scrolling der Nachrichtenliste */
.history-popup.popup {
    /* Breite ist oben bereits geregelt; Höhe über das Eltern-Overflow begrenzt */
    max-height: 90vh;
    overflow: auto; /* stellt Hauptscroll sicher */
}

.history-popup .settings-body {
    /* Innenbereich darf unabhängig scrollen, wenn Filterzeile viel Platz einnimmt */
    max-height: 80vh;
    overflow: hidden; /* die Liste übernimmt das Scrollen */
    display: flex;
    flex-direction: column;
}

.history-popup .history-messages-list {
    /* Liste füllt den verbleibenden Platz und ist vertikal scrollbar */
    flex: 1 1 auto;
    min-height: 0; /* wichtig für Flex-Layouts, damit scrollen möglich ist */
    overflow-y: auto;
}

/* Moderne Moderationstool-Button-Styles */
.mod-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    filter: brightness(1.1);
}

.mod-action-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Strafbank-Button spezielle Hover-Effekte */
#strafbank-button:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%) !important;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}