/**
 * HuddleChat Styles - Neues Kachel & Modal Design 
 * Basiert auf Nicole's Screenshots - Brand-konforme HuddleSociety Design
 * Brand-Farben: #F0E1D0 (Beige), #672A2B (Braun), #8B4A47 (Heller Braun)
 */

/* === HAUPTCONTAINER === */
.huddle-chat-wrapper {
    max-width: none;    /* ✅ Nicole's Fix: Volle Elementor-Container-Breite wie Forum */
    margin: 20px 0;     /* ✅ Nur vertikaler Abstand, kein Auto-Zentrieren */
}

/* Sicherheit: Kacheln nicht über den Container hinausragen lassen */
.huddle-chat-wrapper * {
    box-sizing: border-box;
}

/* === CHAT-KACHELN CONTAINER === */
.huddle-chat-tiles-container {
    background: #F0E1D0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(103,42,43,0.15);
    padding: 0;              /* ✅ Nicole's Fix: Kein Padding - Kacheln bis zum Rand */
    margin-bottom: 20px;
}

/* === EINSTELLUNGEN WRAPPER === */
.huddle-chat-settings-wrapper {
    max-width: none;    /* ✅ Nicole's Fix: Volle Elementor-Container-Breite wie Forum */
    margin: 0;          /* ✅ Kein Auto-Zentrieren */
    background: #F0E1D0; /* NICOLE'S KORREKTUR */
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(103,42,43,0.15);
}

/* === CHAT-KACHELN GRID === */
.huddle-chat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
    padding: 15px;           /* ✅ Nicole's Fix: Weniger Padding für größere Kacheln */
}

/* Eigene Reihe für Aktions-Kacheln und Trennlinie darüber */
.huddle-chat-actions-row {
    grid-column: 1 / -1; /* volle Breite */
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px; /* größerer Abstand zur Linie */
    position: relative;
}
.huddle-chat-actions-row::before {
    content: "";
    position: absolute;
    top: -30px; /* symmetrisch nach oben */
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(0,0,0,0.2);
}

/* === CHAT-KACHELN === */
.huddle-chat-tile {
    background: #DBA6A5; /* Default Farbe (tile-color-0) */
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    position: relative;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.huddle-chat-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.25);
}

/* Chat-Kachel Farben (FINALE KORREKTE FARBEN aus Screenshot) */
.huddle-chat-tile.tile-color-0 { background: #DBA6A5; }
.huddle-chat-tile.tile-color-1 { background: #BEDAB6; }
.huddle-chat-tile.tile-color-2 { background: #ADD4E1; }
.huddle-chat-tile.tile-color-3 { background: #C6BAD0; }
.huddle-chat-tile.tile-color-4 { background: #A1B4A7; }
.huddle-chat-tile.tile-color-5 { background: #A2A9C1; }
.huddle-chat-tile.tile-color-6 { background: #C2AAAA; }
.huddle-chat-tile.tile-color-7 { background: #28414C; color: #ffffff; }
.huddle-chat-tile.tile-color-8 { background: #672B2B; color: #ffffff; }

/* Chat-Kachel Name */
.huddle-chat-tile-name {
    font-size: 24px;
    font-weight: bold;
    color: #000000; /* Standard: Schwarz für Einzelchats */
    margin-bottom: 8px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* Chat-Kachel Status */
.huddle-chat-tile-status {
    font-size: 14px;
    color: #333333; /* Standard: dunkel für Einzelchats */
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

/* Gruppen-Kacheln: weiße Schrift */
.huddle-group-tile .huddle-chat-tile-name,
.huddle-group-tile .huddle-chat-tile-status {
    color: #ffffff;
}

/* Unterzeile auf der Kachel (z. B. "Gruppe") */
.huddle-chat-tile-subtitle {
    font-size: 14px;
    color: #bfbfbf;
    margin-top: -4px;
    margin-bottom: 6px;
}

.huddle-chat-unread-indicator {
    color: #ff4444;
    font-weight: bold;
    font-size: 16px;
}

/* Löschen-Button (versteckt, nur bei Hover sichtbar) */
.huddle-chat-delete-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    z-index: 10;
}

.huddle-chat-tile:hover .huddle-chat-delete-btn {
    opacity: 1;
    pointer-events: auto;
}

.huddle-chat-delete-btn:hover {
    background: rgba(220, 53, 69, 1);
    transform: scale(1.1);
}

/* + Button entfernt – Funktion wandert ins Overflow-Menü */

/* === SPEZIAL-KACHELN === */

/* + Neuer Chat Kachel */
.huddle-new-chat-tile {
    background: #ffffff !important;
    border: none;
    text-align: center;
    color: #000000; /* Schwarze Schrift */
    /* Identische Größe wie normale Kacheln */
    min-height: 70px; /* 30% reduziert */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.huddle-new-chat-text {
    font-size: 24px; /* Gleiche Größe wie Chat-Namen */
    font-weight: bold;
    margin-bottom: 8px;
    color: #000000;
}

.huddle-new-chat-subtitle {
    font-size: 14px; /* Gleiche Größe wie Chat-Status */
    color: #333333;
}

/* + Neue Gruppe Kachel */
.huddle-new-group-tile {
    background: #000000 !important;
    border: none; /* Keine gepunktete Linie */
    text-align: center;
    color: #ffffff;
    /* Identische Größe wie normale Kacheln */
    min-height: 70px; /* 30% reduziert */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Gruppen-Kacheln: Subtile Kennzeichnung */
.huddle-group-tile {
    position: relative;
}

.huddle-new-group-text {
    font-size: 24px; /* Gleiche Größe wie Chat-Namen */
    font-weight: bold;
    margin-bottom: 8px;
    color: #ffffff;
}

.huddle-new-group-subtitle {
    font-size: 14px; /* Gleiche Größe wie Chat-Status */
    color: #cccccc;
}

/* === EINSTELLUNGEN CONTAINER === */
.huddle-chat-settings-container {
    /* Kein separater Hintergrund - erbt #F0E1D0 vom Wrapper */
}

.huddle-chat-settings-container h3 {
    margin: 0 0 20px 0;
    font-size: 24px;
    color: #000000; /* SCHWARZ wie "Über mich" */
    font-weight: bold;
    text-align: left; /* LINKSBÜNDIG */
}

.huddle-chat-settings-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Einstellungen Items (ohne graue Linien) */
.huddle-chat-setting-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    /* border-bottom entfernt */
}

.huddle-chat-setting-content {
    flex: 1;
}

.huddle-chat-setting-content small {
    display: block;
    margin-top: 4px;
    font-size: 14px;
    color: #666;
    text-align: left; /* Linksbündig */
}

.huddle-chat-setting-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    flex-shrink: 0;
    margin-top: 2px; /* Checkbox leicht nach unten für bessere Ausrichtung */
    accent-color: #000000; /* aktive Kästchen schwarz */
}

.huddle-chat-setting-item label {
    flex: 1;
    font-weight: 500;
    color: #333;
    font-size: 16px;
    cursor: pointer;
    line-height: 1.4;
}

.huddle-chat-setting-item small {
    display: block;
    color: #666;
    font-size: 14px;
    margin-top: 2px; /* enger zum Label */
    font-weight: normal;
}

/* Blockierte Benutzer Button */
.huddle-chat-blocked-btn {
    background: #F0E1D0;
    border: 1px solid #672A2B;
    color: #672A2B;
    padding: 15px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    text-align: center;
    margin-bottom: 15px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.huddle-chat-blocked-btn:hover {
    background: #672A2B;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.huddle-blocked-arrow {
    font-size: 12px;
}

/* Blockierte Benutzer Tabelle (Mobile-optimiert mit größerer Schrift) */
.huddle-blocked-table {
    background: #F0E1D0;
    border: 1px solid #D4C2A7;
    border-radius: 4px;
    max-height: 250px;
    overflow-x: auto;
    overflow-y: auto;
    text-align: left;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

.huddle-blocked-users-table {
    background: #F0E1D0 !important;
    border-radius: 4px;
    overflow: hidden;
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.huddle-blocked-users-table th {
    background: #F0E1D0 !important;
    font-weight: bold !important;
    color: #333 !important;
    border-bottom: 2px solid #D4C2A7 !important;
    padding: 8px 10px !important;
    font-size: 14px;
    white-space: nowrap;
}

.huddle-blocked-users-table td {
    background: #F0E1D0 !important;
    border-bottom: 1px solid #E5D1B8 !important;
    padding: 8px 10px !important;
    vertical-align: middle;
    font-size: 14px;
}

.huddle-blocked-users-table tr:hover td {
    background: #EBD7C0 !important;
}

/* Entsperren als roter Text-Link (kein Button) */
.huddle-unblock-btn {
    background: none !important;
    border: none !important;
    color: #d32f2f !important;
    text-decoration: underline !important;
    cursor: pointer !important;
    font-size: 13px !important;
    font-weight: bold !important;
    padding: 2px 4px !important;
}

.huddle-unblock-btn:hover {
    color: #b71c1c !important;
    text-decoration: none !important;
}

/* Mobile Responsive - Container-Breite voll ausnutzen */
@media (max-width: 768px) {
    .huddle-chat-setting-item {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .huddle-blocked-table {
        max-height: 200px;
        width: 100% !important;
        margin: 0 !important;
        font-size: 14px;
    }
    
    .huddle-blocked-users-table {
        width: 100% !important;
        font-size: 13px;
    }
    
    .huddle-blocked-users-table th,
    .huddle-blocked-users-table td {
        padding: 6px 8px !important;
        font-size: 13px;
    }
    
    .huddle-unblock-btn {
        font-size: 12px !important;
    }
}

/* Speichern Button */
.huddle-chat-save-btn {
    background: #000000;
    color: white;
    border: none;
    padding: 18px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    width: 100%;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.huddle-chat-save-btn:hover {
    background: #333333;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.huddle-chat-save-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* === ANTI-BLINK GLOBAL === */
.huddle-no-transitions,
.huddle-no-transitions * {
    transition: none !important;
    animation: none !important;
    -webkit-transition: none !important;
    -moz-transition: none !important;
    -ms-transition: none !important;
    -o-transition: none !important;
}

/* === CHAT-MODAL - ANTI-BLINK VERSION === */
.huddle-chat-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 999999;
    display: none; /* STARTET VERSTECKT */
    visibility: hidden; /* STARTET UNSICHTBAR */
    opacity: 0; /* STARTET TRANSPARENT */
    align-items: center;
    justify-content: center;
    padding: 20px;
    /* KEINE TRANSITIONS - VERHINDERT BLINKING */
    transition: none !important;
    animation: none !important;
}

/* Erzwinge sichtbares Modal (überlagert fremde Styles/Overlays) */
.huddle-chat-modal.forced-open {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    position: fixed !important;
    z-index: 2147483647 !important;
}

.huddle-chat-modal-content {
    background: #ffffff;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    height: 80vh;
    max-height: 700px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
}

/* Modal Header */
.huddle-chat-modal-header {
    background: #000000; /* IMMER SCHWARZ */
    color: #ffffff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0;
}

/* Modal Header - IMMER SCHWARZ (Nicole's Korrektur) */
.huddle-chat-modal-header.chat-color-0,
.huddle-chat-modal-header.chat-color-1,
.huddle-chat-modal-header.chat-color-2,
.huddle-chat-modal-header.chat-color-3,
.huddle-chat-modal-header.chat-color-4,
.huddle-chat-modal-header.chat-color-5,
.huddle-chat-modal-header.chat-color-6,
.huddle-chat-modal-header.chat-color-7 { 
    background: #000000 !important; 
    color: #ffffff !important;
}

.huddle-chat-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* Titel + Mitglieder in eigener Spalte, Mitglieder heller und unter dem Namen */
.huddle-chat-modal-titlewrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Teilnehmerliste im Modal-Header: einzeilig mit Ellipsis */
#huddle-chat-modal-participants {
    font-size: 12px;
    color: #BFBFBF; /* heller auf schwarzem Header */
    /* für mehrzeilige Anzeige */
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    max-width: 100%;
}

.huddle-chat-modal-close {
    background: none; /* Kein Hintergrund */
    border: none;
    color: #ffffff; /* Nur weiß auf schwarz */
    font-size: 28px; /* Größer */
    cursor: pointer;
    width: 40px; /* Größerer Klick-Bereich */
    height: 40px; /* Größerer Klick-Bereich */
    display: flex;
    align-items: center;
    justify-content: center;
}

.huddle-chat-modal-close:hover {
    background: none; /* Kein Hintergrund auch bei Hover */
    transform: scale(1.1);
    opacity: 0.8;
}

/* Modal Messages */
.huddle-chat-modal-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #F0E1D0; /* Feste, helle Hintergrundfarbe gewünscht */
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Modal Messages - Chat-Hintergrund in Kachel-Farbe (FINALE FARBEN) */
/* Nicole: Modal-Nachrichtenbereich IMMER #F0E1D0 – daher keine farbige Überschreibung mehr */
/* .huddle-chat-modal.chat-bg-color-X .huddle-chat-modal-messages { background: ... } entfernt */

.huddle-chat-modal-loading,
.huddle-chat-empty,
.huddle-chat-error {
    text-align: center;
    color: #666;
    padding: 40px 20px;
    font-size: 16px;
}

/* Chat Messages im Modal - KORRIGIERT */
.huddle-chat-message {
    max-width: 70%;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
}

/* MEINE Nachrichten = RECHTS */
.huddle-chat-message.own {
    align-self: flex-end;
    align-items: flex-end;
}

/* ANDERE Nachrichten = LINKS */
.huddle-chat-message.other {
    align-self: flex-start;
    align-items: flex-start;
}

/* Sprechblasen-Design */
.huddle-chat-message-content {
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-size: 14px;
    line-height: 1.4;
    position: relative;
}

/* MEINE Nachrichten - Rechts, blaue Sprechblase */
.huddle-chat-message.own .huddle-chat-message-content {
    background: #28414C; /* Wunschfarbe eigene Nachrichten */
    color: white;
    border-radius: 18px 18px 4px 18px; /* Rechts-Spitze */
}

/* ANDERE Nachrichten - Links, weiße Sprechblase */
.huddle-chat-message.other .huddle-chat-message-content {
    background: rgba(255,255,255,0.95);
    color: #000; /* Schwarz wie gewünscht */
    border: 1px solid #e0e0e0;
    border-radius: 18px 18px 18px 4px; /* Links-Spitze */
}

/* Option A: helle, farbige Hintergründe je Autor (pale tones) */
.huddle-chat-message.other.author-color-0 .huddle-chat-message-content { background: #F4DEDD; }
.huddle-chat-message.other.author-color-1 .huddle-chat-message-content { background: #E5F1E1; }
.huddle-chat-message.other.author-color-2 .huddle-chat-message-content { background: #E3F3F8; }
.huddle-chat-message.other.author-color-3 .huddle-chat-message-content { background: #EFE9F4; }
.huddle-chat-message.other.author-color-4 .huddle-chat-message-content { background: #E1E8E3; }
.huddle-chat-message.other.author-color-5 .huddle-chat-message-content { background: #E6E9F1; }
.huddle-chat-message.other.author-color-6 .huddle-chat-message-content { background: #EFE3E3; }
.huddle-chat-message.other.author-color-7 .huddle-chat-message-content { background: #E0E6EA; }

.huddle-chat-message-time {
    font-size: 11px;
    color: #28414C; /* dunkles Grau-Blau statt Schwarz */
    margin-top: 4px;
    text-align: right;
}

/* Dezente Absender-Zeile über fremden Nachrichten */
.huddle-chat-message-sender {
    font-size: 12px;
    line-height: 1.2;
    color: #28414C; /* dunkles Grau-Blau für Namen */
    margin-bottom: 2px;
}

.huddle-chat-message.other .huddle-chat-message-time {
    text-align: left;
}

/* Modal Input - SCHWARZER HINTERGRUND (Nicole's Korrektur) */
.huddle-chat-modal-input {
    padding: 15px 20px;
    background: #000000; /* SCHWARZ statt beige */
    border-top: 1px solid #333333;
    border-radius: 0 0 12px 12px;
}

/* Fix: Weißer blinder Fleck/Überdeckung im unteren Drittel entfernen */
.huddle-chat-modal .huddle-chat-modal-input,
.huddle-chat-modal .huddle-chat-modal-messages {
    background-clip: padding-box;
}

.huddle-chat-modal {
    pointer-events: auto;
}

/* === Add-to-Group Modal – Optionen als Buttons/Cards === */
.huddle-group-list {
    display: flex;
    flex-direction: column;
    gap: 12px; /* etwas mehr Abstand zwischen den Gruppen */
    margin-top: 10px;
}

.huddle-group-option {
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: rgba(255,255,255,0.98);
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, transform 0.05s ease;
    user-select: none;
}

.huddle-group-option:hover,
.huddle-group-option:focus {
    border-color: #672A2B; /* Brand Primary */
    box-shadow: 0 2px 10px rgba(103,42,43,0.15);
    outline: none;
}

.huddle-group-option:active {
    transform: translateY(1px);
}

.huddle-group-name {
    font-weight: 600;
    color: #333;
}

.huddle-chat-modal-input form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.huddle-chat-modal-input input[type="text"] {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #555555; /* Dunklerer Border für schwarzen Hintergrund */
    border-radius: 25px;
    outline: none;
    font-size: 14px;
    background: white;
}

.huddle-chat-modal-input input[type="text"]:focus {
    border-color: #672A2B;
    box-shadow: 0 0 0 2px rgba(103,42,43,0.2);
}

.huddle-chat-modal-send {
    background: #000000;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
}

.huddle-chat-modal-send:hover {
    background: #333333;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* === NEUE CHAT/GRUPPE MODALS === */

.huddle-chat-modal-body {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
    flex: 1; /* ✅ Nicole: Nutze verfügbaren Platz ohne Leerraum */
    display: flex;
    flex-direction: column;
}

/* Suchfeld für Benutzer */
.huddle-chat-search-container {
    margin: 15px 0;
}

.huddle-chat-search-container input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
}

.huddle-chat-search-container input:focus {
    border-color: #672A2B;
    box-shadow: 0 0 0 2px rgba(103,42,43,0.2);
}

.huddle-chat-user-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
    flex: 1; /* ✅ Nicole: Nutze verfügbaren Platz ohne Leerraum */
    overflow-y: auto;
    max-height: none; /* Entferne Höhenbegrenzung */
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.huddle-chat-user-option {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    background: white;
}

.huddle-chat-user-option:hover {
    background: #F0E1D0;
    border-color: #672A2B;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.huddle-chat-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #672A2B;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 12px;
}

.huddle-chat-user-name {
    font-weight: 500;
    color: #333;
    font-size: 16px;
}

/* Gruppen-Form */
.huddle-group-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.huddle-form-group {
    display: flex;
        flex-direction: column;
    gap: 8px;
}

.huddle-form-group label {
    font-weight: bold;
    color: #672A2B;
    font-size: 16px;
}

.huddle-form-group input[type="text"] {
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
}

.huddle-group-members-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
        border-radius: 8px;
    padding: 10px;
    background: white;
}

.huddle-group-member-option {
        display: flex;
        align-items: center;
    padding: 8px;
    cursor: pointer;
    border-radius: 4px;
}

.huddle-group-member-option:hover {
    background: #F0E1D0;
}

.huddle-group-member-option input[type="checkbox"] {
    margin-right: 8px;
}

.huddle-group-count {
        font-size: 12px;
    color: #666;
    text-align: right;
    margin-top: 5px;
}

.huddle-create-group-btn {
    background: #000000;
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 8px;
        cursor: pointer;
    font-size: 16px;
        font-weight: bold;
}

.huddle-create-group-btn:hover {
    background: #333333;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* === RESPONSIVE DESIGN === */

/* Tablet */
@media (max-width: 968px) {
    .huddle-chat-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
    
    .huddle-chat-tile {
        padding: 18px;
    }
    
    .huddle-chat-tile-name {
        font-size: 22px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .huddle-chat-wrapper {
        margin: 10px 0 !important; /* ✅ Nicole's Fix: Kein auto-zentrieren auch auf Mobile */
        /* Breite auf Viewport begrenzen, Innenabstand separat setzen */
        max-width: 100vw !important;
        width: 100% !important;
        padding: 0 !important;      /* ✅ Nicole's Fix: Kein äußeres Wrapper-Padding */
        box-sizing: border-box;
    }
    
    /* Chat-Kacheln Container bündig innerhalb des Wrappers halten */
    .huddle-chat-tiles-container {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 auto 24px !important; /* Abstand nach unten */
        box-sizing: border-box;
        overflow: hidden; /* Schlagschatten/Ecken nicht überstehen lassen */
    }
    
    .huddle-chat-settings-wrapper {
        max-width: 100% !important;
        width: 100% !important; 
        margin: 24px auto 0 !important; /* größerer Abstand zum Chat-Container */
        box-sizing: border-box;
    }
    
    .huddle-chat-header h2 {
        font-size: 28px;
    }
    
    .huddle-chat-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .huddle-chat-tile {
        padding: 20px;
        min-height: 90px;
    }
    
    .huddle-chat-tile-name {
        font-size: 24px;
    }
    
    .huddle-chat-tile-status {
        font-size: 16px;
    }
    
    /* Modal angepasst für Mobile */
    .huddle-chat-modal {
        padding: 10px;
    }
    
    .huddle-chat-modal-content {
        width: 100%;
        height: auto; /* dynamisch */
        max-height: 80vh; /* nicht über den Screen hinausragen */
    }
    
    .huddle-chat-modal-header {
        padding: 12px 15px;
    }
    
    .huddle-chat-modal-header h3 {
        font-size: 16px;
    }
    
    .huddle-chat-modal-messages {
        padding: 15px;
    }
    
    .huddle-chat-modal-input {
        padding: 12px 15px;
    }
    
    .huddle-chat-modal-input input[type="text"] {
        font-size: 16px; /* Verhindert Zoom auf iOS */
    }
    
    /* Einstellungen Mobile */
    .huddle-chat-settings-container {
        padding: 2px; /* radikal */
        margin-top: 12px;
    }

    .huddle-chat-setting-item {
        padding: 2px; /* radikal */
    }

    /* Abstand zwischen den Blöcken auf 6px begrenzen */
    .huddle-chat-setting-item + .huddle-chat-setting-item {
        margin-top: 3px; /* radikal */
    }

.huddle-chat-setting-text {
        font-size: 18px;
}

.huddle-chat-setting-item small {
        font-size: 16px;
        margin-left: 26px;
    }
    
    .huddle-chat-blocked-btn,
    .huddle-chat-save-btn {
        padding: 20px;
        font-size: 18px;
    }
}

/* Mobile – sehr kleine Geräte */
@media (max-width: 480px) {
	.huddle-chat-tiles-container {
		padding: 12px;
	}
	.huddle-chat-grid {
		gap: 12px;
	}
}

/* === SCROLLBAR STYLING === */
.huddle-chat-modal-messages::-webkit-scrollbar,
.huddle-chat-modal-body::-webkit-scrollbar,
.huddle-group-members-list::-webkit-scrollbar {
    width: 6px;
}

.huddle-chat-modal-messages::-webkit-scrollbar-track,
.huddle-chat-modal-body::-webkit-scrollbar-track,
.huddle-group-members-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.huddle-chat-modal-messages::-webkit-scrollbar-thumb,
.huddle-chat-modal-body::-webkit-scrollbar-thumb,
.huddle-group-members-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.huddle-chat-modal-messages::-webkit-scrollbar-thumb:hover,
.huddle-chat-modal-body::-webkit-scrollbar-thumb:hover,
.huddle-group-members-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* === EMPTY STATE === */
.huddle-chat-empty {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.huddle-chat-empty h3 {
    color: #672A2B;
    margin-bottom: 15px;
    font-size: 24px;
}

.huddle-chat-empty p {
    font-size: 16px;
    margin: 0;
}