﻿/* --- CHAT WITH SELLER BUTTON & WINDOW STYLES (UPGRADED) --- */
.chat-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: var(--gold-main);
    width: 100%;
    padding: 16px;
    border-radius: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}
.chat-btn::before {
    content: ''; position: absolute; top:0; left:-100%; width:100%; height:100%;
    background: linear-gradient(90deg, transparent, rgba(255,215,0,0.2), transparent);
    transition: 0.5s;
}
.chat-btn:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: var(--gold-main);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.15);
    transform: translateY(-2px);
}
.chat-btn:hover::before { left: 100%; }

/* Floating Chat Window */
.chat-window {
    position: fixed;
    bottom: 30px; right: 30px;
    width: 380px; height: 550px;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 24px;
    display: none;
    flex-direction: column;
    z-index: 2000;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8), 0 0 15px rgba(255, 215, 0, 0.1);
    animation: chatPopIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}
@keyframes chatPopIn { 
    from { transform: translateY(100px) scale(0.9); opacity: 0; } 
    to { transform: translateY(0) scale(1); opacity: 1; } 
}

.chat-header {
    padding: 18px 20px;
    background: linear-gradient(135deg, rgba(255,215,0,0.1), rgba(0,0,0,0));
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex; justify-content: space-between; align-items: center;
}
.chat-header-info { display: flex; align-items: center; gap: 10px; }
.chat-status-dot { width: 8px; height: 8px; background: #2ecc71; border-radius: 50%; box-shadow: 0 0 8px #2ecc71; animation: pulse-green 2s infinite; }
@keyframes pulse-green { 0% { opacity: 1; } 50% { opacity: 0.5; } 100% { opacity: 1; } }

.chat-title { font-weight: 700; color: #fff; font-size: 0.95rem; }
.chat-subtitle { font-size: 0.75rem; color: var(--gold-main); opacity: 0.8; }

.chat-close { 
    width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,0.05);
    display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s; color: #fff;
}
.chat-close:hover { background: rgba(255,0,50,0.2); color: #ff0055; transform: rotate(90deg); }

.chat-messages {
    flex: 1;
    min-height: 0;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: radial-gradient(circle at center, rgba(30,30,30,0.3) 0%, transparent 70%);
    scrollbar-width: thin;
}

.chat-date-separator {
    text-align: center; font-size: 0.7rem; color: #555; margin: 10px 0; text-transform: uppercase; letter-spacing: 1px;
}

.chat-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    animation: msgSlide 0.3s ease;
}
@keyframes msgSlide { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.chat-bubble.sent {
    align-self: flex-end;
    background: var(--gold-gradient);
    color: #000;
    border-bottom-right-radius: 4px;
    font-weight: 500;
}
.chat-bubble.received {
    align-self: flex-start;
    background: rgba(255,255,255,0.08);
    color: #fff;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(255,255,255,0.05);
}
.chat-bubble-meta { font-size: 0.65rem; opacity: 0.6; margin-top: 4px; text-align: right; display: block;}

/* --- QUICK REPLIES --- */
.quick-replies-container {
    padding: 10px 15px 0 15px;
    display: flex; gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.quick-replies-container::-webkit-scrollbar { display: none; }

.quick-chip {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #ccc;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    white-space: nowrap;
    cursor: pointer;
    transition: 0.2s;
}
.quick-chip:hover {
    background: var(--gold-main);
    color: #000;
    border-color: var(--gold-main);
}

/* --- INPUT AREA --- */
.chat-input-area {
    padding: 15px;
    border-top: 1px solid rgba(255,255,255,0.05);
    display: flex; gap: 10px;
    background: rgba(0,0,0,0.2);
    align-items: center;
}
.chat-input {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.05);
    color: #fff;
    padding: 12px 15px;
    border-radius: 25px;
    outline: none;
    transition: 0.3s;
    font-family: 'Poppins', sans-serif;
}
.chat-input:focus { border-color: var(--gold-main); background: rgba(0,0,0,0.5); }

.chat-send {
    background: var(--gold-gradient);
    border: none;
    border-radius: 50%;
    width: 42px; height: 42px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    color: #000;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
    transition: 0.2s;
}
.chat-send:hover { transform: scale(1.1); box-shadow: 0 0 25px rgba(255, 215, 0, 0.4); }

/* Typing Indicator */
.typing-indicator {
    padding: 10px 20px; font-size: 0.75rem; color: #888; font-style: italic; display: none;
}
.typing-indicator span { animation: blink 1.4s infinite both; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0% { opacity: 0.2; } 20% { opacity: 1; } 100% { opacity: 0.2; } }

/* --- FIXED MOBILE CHAT LAYOUT (NO GHOSTING) --- */
@media (max-width: 768px) {
    /* Standardmäßig das Nachrichtenfenster auf Mobile verstecken */
    #chat-conversation-area {
        display: none !important;
    }

    /* Nur wenn ein Chat aktiv ist, das Fenster VOLLSTÄNDIG anzeigen */
    .mobile-chat-active #chat-conversation-area {
        display: flex !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        z-index: 1000000 !important; 
        background: #080808 !important;
        flex-direction: column !important;
    }

    .mobile-chat-active #user-chat-list {
        display: none !important;
    }

    .chat-mobile-header {
        display: flex !important;
        padding: 15px !important;
        background: #111 !important;
        border-bottom: 1px solid var(--gold-main) !important;
        align-items: center !important;
    }

    #full-chat-messages {
        flex: 1 !important;
        overflow-y: auto !important;
        padding: 15px !important;
        padding-bottom: 90px !important;
    }

    /* Eingabebereich Fix */
    #full-chat-input-area {
        display: none !important; /* Standard aus */
    }

    .mobile-chat-active #full-chat-input-area {
        display: flex !important;
        position: sticky !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        background: #0a0a0a !important;
        padding: 15px 15px 30px 15px !important; /* Extra Platz unten für Home-Bar */
        border-top: 1px solid var(--gold-main) !important;
        z-index: 1000001 !important;
    }

    #full-chat-input {
        flex: 1 !important;
        background: rgba(255,255,255,0.1) !important;
        border: 1px solid var(--gold-main) !important;
        color: white !important;
        padding: 12px !important;
        border-radius: 20px !important;
        font-size: 16px !important;
    }
    
    .mobile-chat-active ~ .mobile-bottom-nav {
        display: none !important;
    }
}

/* --- PREMIUM ADMIN CHAT SYSTEM --- */
.admin-panel-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 0;
    height: 100%;
    min-height: 500px;
    position: relative;
}

/* --- SIDEBAR (LISTE) --- */
.admin-sidebar {
    background: rgba(6, 8, 20, 0.8);
    border-right: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 0 0 320px;
    min-height: 0;
}

.admin-sidebar-header {
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-weight: 700;
    color: #888;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.admin-chat-list-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

/* Chat Item in der Liste */
.chat-list-item {
    padding: 12px 15px;
    margin-bottom: 5px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    background: transparent;
}

.chat-list-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.chat-list-item.active {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.1), transparent);
    border-left: 3px solid var(--gold-main);
}

.chat-item-name {
    font-weight: 700;
    color: #fff;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

/* --- CHAT FENSTER (RECHTS) --- */
.admin-chat-area {
    background: #060a18;
    border: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    flex: 1;
    min-width: 0;
    min-height: 0;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.admin-chat-header {
    padding: 15px 25px;
    background: rgba(20, 20, 20, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    min-height: 60px;
    display: flex;
    align-items: center;
    z-index: 10;
    flex-shrink: 0;
}

.placeholder-header { color: #555; font-style: italic; font-size: 0.9rem; }

/* Nachrichten Hintergrund */
.admin-messages-bg {
    flex: 1;
    min-height: 0;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-image:
        radial-gradient(circle at top left, rgba(0,255,255,0.03), transparent 40%),
        radial-gradient(circle at bottom right, rgba(255,215,0,0.03), transparent 40%);
}

/* Admin Input Bar */
.admin-input-bar {
    padding: 15px 20px;
    background: #111;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

.admin-input-bar input {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 50px !important;
    padding: 12px 20px !important;
}
.admin-input-bar input:focus {
    border-color: var(--gold-main) !important;
    background: #000 !important;
}

.admin-send-btn {
    background: var(--gold-gradient);
    color: #000;
    width: 45px; height: 45px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: none; cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}
.admin-send-btn:hover { transform: scale(1.1); box-shadow: 0 0 25px rgba(255, 215, 0, 0.4); }

/* --- BACK BUTTON (NUR MOBILE) --- */
.admin-back-btn {
    display: none; /* Desktop unsichtbar */
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 10px;
    border: 1px solid rgba(255,255,255,0.2);
}
.admin-back-btn span { font-size: 1.2rem; }

/* --- MOBILE ANSICHT (APP STYLE) --- */
@media (max-width: 900px) {
    /* Chat tab panel layout on 900px */
    #admin-tab-chats.admin-panel-layout {
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: 80vh;
    }

    /* 1. Chat Sidebar: full width stack */
    #admin-tab-chats .admin-sidebar {
        width: 100%;
        height: 60vh;
        margin-bottom: 0;
    }

    /* 2. Chat Fenster ist standardmäßig versteckt */
    #admin-tab-chats .admin-chat-area {
        display: none;
        position: fixed;
        top: 0; left: 0;
        width: 100% !important;
        height: 100% !important; /* fallback */
        height: 100dvh !important;
        z-index: 99999;
        border-radius: 0;
        background: #000;
    }

    /* 3. WENN CHAT AKTIV (Klasse wird per JS gesetzt) */
    #admin-tab-chats.admin-chat-active .admin-chat-area {
        display: flex;
        animation: slideInRightMobile 0.3s ease-out;
    }

    #admin-tab-chats.admin-chat-active .admin-sidebar {
        display: none;
    }

    @keyframes slideInRightMobile {
        from { transform: translateX(100%); }
        to { transform: translateX(0); }
    }

    /* Mobile Header im Chat */
    .admin-chat-header {
        padding-top: max(15px, env(safe-area-inset-top)); /* Notch Support */
        flex-direction: column;
        align-items: flex-start;
        height: auto;
        gap: 10px;
        background: #111;
    }

    /* Back Button sichtbar machen */
    .admin-back-btn { display: inline-flex; }

    /* Input Bereich Mobile */
    .admin-input-bar {
        padding-bottom: max(20px, env(safe-area-inset-bottom));
        position: sticky;
        bottom: 0;
        background: #111;
        border-top: 1px solid var(--gold-main);
    }
}

/* --- ULTRAMODERN CHAT SYSTEM (APP STYLE) --- */

/* Chat sidebar header */
.chat-sidebar-header {
    padding: 18px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.chat-sidebar-title {
    color: #fff;
    font-weight: 800;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.3px;
}
.chat-sidebar-badge {
    font-size: 0.65rem;
    font-weight: 700;
    background: rgba(0,150,255,0.15);
    border: 1px solid rgba(0,150,255,0.3);
    color: #4db8ff;
    padding: 3px 9px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Chat empty state */
.chat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 18px;
    padding: 40px 32px;
    text-align: center;
}
.chat-empty-icon-wrap {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, rgba(139,92,246,0.25), rgba(99,102,241,0.15));
    border: 1px solid rgba(139,92,246,0.35);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a78bfa;
    margin-bottom: 4px;
    box-shadow: 0 0 40px rgba(139,92,246,0.15);
}
.chat-empty-title {
    color: #fff;
    font-weight: 800;
    font-size: 1.15rem;
    line-height: 1.35;
}
.chat-empty-sub {
    color: rgba(255,255,255,0.4);
    font-size: 0.82rem;
    margin-top: -6px;
}
.chat-features-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 480px;
}
.chat-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 12px 14px;
    text-align: left;
}
.chat-feature-icon {
    width: 32px;
    height: 32px;
    background: rgba(139,92,246,0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a78bfa;
    flex-shrink: 0;
}
.chat-feature-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.chat-feature-text b {
    font-size: 0.82rem;
    color: #e0e0e0;
    font-weight: 700;
}
.chat-feature-text span {
    font-size: 0.74rem;
    color: rgba(255,255,255,0.4);
    line-height: 1.4;
}
.chat-new-start-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #7c3aed, #6366f1);
    border: none;
    border-radius: 50px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 800;
    padding: 14px 32px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 6px 24px rgba(124,58,237,0.35);
    margin-top: 6px;
}
.chat-new-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(124,58,237,0.5);
}

/* --- SIDEBAR INFO SECTIONS --- */
.chat-sidebar-info {
    padding: 14px 14px 10px;
    border-top: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}
.chat-support-times-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    padding: 12px 14px;
}
.chat-support-times-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.chat-support-times-label {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
}
.chat-online-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.68rem;
    font-weight: 700;
    color: #00e676;
}
.chat-online-dot {
    width: 7px;
    height: 7px;
    background: #00e676;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 6px rgba(0,230,118,0.6);
    animation: pulse-green 2s infinite;
}
.chat-support-schedule {
    font-size: 0.76rem;
    color: rgba(255,255,255,0.7);
    font-weight: 600;
}
.chat-support-note {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.35);
    margin-top: 4px;
    line-height: 1.4;
}
.chat-faq-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    overflow: hidden;
}
.chat-faq-title {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    padding: 10px 14px 6px;
}
.chat-faq-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.65);
    cursor: pointer;
    border-top: 1px solid rgba(255,255,255,0.04);
    transition: background 0.2s;
    gap: 8px;
}
.chat-faq-item > span:first-child {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.6);
}
.chat-faq-item > span:last-child {
    color: rgba(255,255,255,0.3);
    font-size: 1rem;
}
.chat-faq-item:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}

/* Wrapper für den gesamten Bereich */
.modern-chat-wrapper {
    display: flex;
    height: 75vh;
    max-height: 800px;
    background: rgba(15, 15, 15, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    position: relative;
}

/* --- SIDEBAR (LISTE) --- */
.chat-sidebar-panel {
    width: 340px;
    background: rgba(0, 0, 0, 0.3);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
}

.sidebar-search {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #666;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

/* Einzelnes Chat Item in der Liste */
.modern-chat-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 5px;
    border: 1px solid transparent;
}

.modern-chat-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.modern-chat-item.active {
    background: rgba(0, 255, 255, 0.05);
    border-color: rgba(0, 255, 255, 0.1);
}

.chat-avatar-large {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid transparent;
}

.modern-chat-item.active .chat-avatar-large {
    border-color: var(--gold-main);
}

.chat-list-info {
    flex: 1;
    overflow: hidden;
}

.chat-list-name {
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 3px;
}

.chat-list-preview {
    color: #888;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modern-chat-item.active .chat-list-preview {
    color: var(--gold-main);
}

/* --- RECHTE SEITE (KONVERSATION) --- */
.chat-conversation-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at top right, rgba(0, 255, 255, 0.02), transparent 60%);
    position: relative;
}

/* Header im Chat */
.active-chat-header {
    height: 66px;
    padding: 0 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(0, 5, 20, 0.5);
    flex-shrink: 0;
}

.header-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-avatar-status {
    position: relative;
}

.header-avatar-status img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.1);
}

.status-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #1a1a1a;
}
.status-indicator.online { background: #00ff88; box-shadow: 0 0 5px #00ff88; }

.header-username {
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
}

.header-status-text {
    font-size: 0.7rem;
    color: var(--gold-main);
    opacity: 0.8;
}

.chat-back-mobile {
    display: none; /* Desktop aus */
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding-right: 10px;
}

/* Nachrichten Bereich */
.chat-messages-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scrollbar-width: thin;
}

/* Chat Bubbles Modern */
.chat-bubble {
    max-width: 75%;
    padding: 12px 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
    animation: slideInBubble 0.3s ease;
}

@keyframes slideInBubble {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-bubble.sent {
    align-self: flex-end;
    background: linear-gradient(135deg, #0096ff, #0050cc);
    color: #fff;
    font-weight: 600;
    border-radius: 18px 18px 4px 18px;
    box-shadow: 0 4px 16px rgba(0, 100, 255, 0.3);
}

.chat-bubble.received {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e8e8e8;
    border-radius: 18px 18px 18px 4px;
}

/* ── Broadcast / Wichtige Mitteilung Popup ─────────────────── */
@keyframes bcSlideIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px) scale(0.96); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
.bc-popup {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    width: calc(100% - 32px);
    max-width: 480px;
    animation: bcSlideIn 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.bc-inner {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: #12141f;
    border: 1px solid rgba(255, 200, 0, 0.3);
    border-radius: 18px;
    padding: 16px 16px 16px 16px;
    box-shadow: 0 8px 48px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,200,0,0.08), inset 0 0 40px rgba(255,200,0,0.03);
    position: relative;
    overflow: hidden;
}
.bc-inner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ffd700, #ffaa00, transparent);
}
.bc-icon-wrap {
    flex-shrink: 0;
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255, 200, 0, 0.12);
    border: 1px solid rgba(255, 200, 0, 0.2);
    border-radius: 12px;
    color: #ffd700;
    margin-top: 1px;
}
.bc-icon-wrap svg { width: 22px; height: 22px; }
.bc-body { flex: 1; min-width: 0; }
.bc-tag {
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: #ffd700;
    margin-bottom: 5px;
    opacity: 0.85;
}
.bc-msg {
    font-size: 0.9rem;
    font-weight: 600;
    color: #e8e8f0;
    line-height: 1.5;
}
.bc-close {
    flex-shrink: 0;
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    cursor: pointer;
    color: rgba(255,255,255,0.5);
    transition: background 0.15s, color 0.15s;
    margin-top: 2px;
}
.bc-close:hover { background: rgba(255,255,255,0.12); color: #fff; }
.bc-close svg { width: 14px; height: 14px; }
@media (max-width: 480px) {
    .bc-popup { top: 72px; }
    .bc-msg { font-size: 0.85rem; }
}

/* Push Banner animations */
@keyframes slideUpBanner {
    from { opacity: 0; transform: translateX(-50%) translateY(30px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes slideDownBanner {
    from { opacity: 1; transform: translateX(-50%) translateY(0); }
    to   { opacity: 0; transform: translateX(-50%) translateY(30px); }
}

.chat-bubble-wrap {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    max-width: 84%;
    gap: 7px;
}
.chat-bubble-wrap.sent { align-self: flex-end; flex-direction: row-reverse; }
.chat-bubble-wrap.received { align-self: flex-start; }
.chat-bubble-wrap .chat-bubble { max-width: 100%; align-self: unset; }
.chat-bubble-inner {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}
.chat-bubble-wrap.sent .chat-bubble-inner { align-items: flex-end; }
.chat-bubble-wrap.received .chat-bubble-inner { align-items: flex-start; }
.chat-msg-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
    align-self: flex-end;
    margin-bottom: 2px;
}

.bubble-meta {
    font-size: 0.65rem;
    color: #666;
    padding: 0 4px;
}
.chat-bubble-wrap.sent .bubble-meta { text-align: right; }
.chat-bubble-wrap.received .bubble-meta { text-align: left; }

.chat-date-sep {
    text-align: center;
    font-size: 0.7rem;
    color: #555;
    margin: 12px auto;
    padding: 4px 14px;
    background: rgba(255,255,255,0.04);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.06);
    letter-spacing: 0.5px;
    align-self: center;
}

/* Input Bar Modern */
.chat-input-bar {
    padding: 14px 20px;
    background: rgba(5, 5, 15, 0.7);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.input-field-wrapper {
    flex: 1;
    position: relative;
}

.chat-input-bar input[type="text"] {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    padding: 13px 20px;
    border-radius: 50px;
    color: #fff;
    font-size: 0.93rem;
    outline: none;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.chat-input-bar input[type="text"]:focus {
    background: rgba(0, 96, 255, 0.05);
    border-color: rgba(0, 150, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(0, 100, 255, 0.1);
}

.chat-input-bar input[type="text"]::placeholder { color: rgba(255,255,255,0.3); }

.upload-btn-chat {
    font-size: 1.4rem;
    cursor: pointer;
    color: #888;
    transition: 0.3s;
    display: flex;
    align-items: center;
}
.upload-btn-chat:hover { color: #fff; transform: scale(1.1); }

.send-btn-chat {
    background: linear-gradient(135deg, #0096ff, #0050cc);
    color: #fff;
    border: none;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(0, 100, 255, 0.4);
    flex-shrink: 0;
}
.send-btn-chat:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(0, 100, 255, 0.55); }

/* Mobile Navigation Top (nur für Chat Übersicht) */
.mobile-chat-nav-top {
    display: none;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.back-icon-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    width: 35px; height: 35px;
    border-radius: 10px;
    font-size: 1.2rem;
}
.desktop-only-btn { display: block; }

/* --- MOBILE OPTIMIERUNG (APP FEELING) --- */
@media (max-width: 768px) {
    .modern-chat-wrapper {
        height: 78vh; /* Platz für Bottom Nav lassen */
        border: none;
        background: transparent;
        box-shadow: none;
        border-radius: 0;
    }
    
    .desktop-only-btn { display: none !important; }
    .mobile-chat-nav-top { display: flex; }
    
    .chat-sidebar-panel {
        width: 100%;
        background: transparent;
        border-right: none;
    }

    /* Das Chat-Fenster ist standardmäßig ausgeblendet auf Mobile */
    .chat-conversation-panel {
        display: none;
        position: fixed;
        top: 0; left: 0;
        width: 100%; height: 100%;
        background: #080808;
        z-index: 10000;
        padding-bottom: 0;
    }

    /* WENN AKTIV (durch JS Klasse): Vollbild */
    .mobile-chat-active .chat-conversation-panel {
        display: flex !important;
        animation: slideInRightMobile 0.3s ease-out;
    }
    
    @keyframes slideInRightMobile {
        from { transform: translateX(100%); }
        to { transform: translateX(0); }
    }

    .chat-back-mobile { display: block; }
    
    .active-chat-header {
        background: #111;
        padding-top: env(safe-area-inset-top); /* Notch Support */
        height: auto;
        padding: 15px;
    }

    .chat-input-bar {
        background: #111;
        padding-bottom: max(15px, env(safe-area-inset-bottom));
        border-top: 1px solid var(--gold-main);
    }
}
