/* KONIAN CRUD Framework - Chat CSS */
/* Von Konian genehmigt am 2025-11-20 */
/* Nur für Chat-Bubble-Styles im UserChat-System */

/* ===== CHAT COMPONENTS ===== */

/* Chat-Container mit Flexbox für Links/Rechts Anordnung */
.chat-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    max-height: 600px;
    overflow-y: auto;
    background: #F5F5F5;
}

.chat-history {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Wrapper für Avatar + Bubble */
.chat-message-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    margin-bottom: 1rem;
    width: 100%;
}

/* Partner-Nachricht: Avatar LINKS */
.chat-message-left {
    justify-content: flex-start;
}

/* Eigene Nachricht: Avatar RECHTS */
.chat-message-right {
    justify-content: flex-end;
}

/* Avatar Container */
.chat-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Avatar Bild */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #CCCCCC;
}

/* Avatar Placeholder Icon */
.avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #F5F5F5;
    color: #999999;
    font-size: 40px !important;
    line-height: 40px;
}

/* Basis-Nachricht */
.chat-bubble {
    display: flex;
    flex-direction: column;
    max-width: calc(70% - 48px);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: #FFFFFF;
    border: 1px solid #CCCCCC;
    word-wrap: break-word;
}

/* Eigene Nachrichten RECHTS */
.chat-bubble.user {
    align-self: flex-end;
    background: #333333;
    color: #FFFFFF;
    border-bottom-right-radius: 4px;
}

/* Partner-Nachrichten LINKS */
.chat-bubble.system {
    align-self: flex-start;
    background: #FFFFFF;
    color: #000000;
    border: 1px solid #CCCCCC;
    border-bottom-left-radius: 4px;
}

/* Absender-Name */
.chat-bubble strong {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

/* Timestamp */
.chat-timestamp {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-left: 0.5rem;
}

/* Anpassung für eigene Nachrichten (helle Schrift) */
.chat-bubble.user strong,
.chat-bubble.user .chat-timestamp {
    color: rgba(255, 255, 255, 0.9);
}

/* Nachrichtentext */
.chat-bubble div {
    font-size: 0.9rem;
    line-height: 1.5;
    word-break: break-word;
    margin-top: 0.25rem;
}

/* Responsive */
@media (max-width: 768px) {
    .chat-avatar {
        width: 32px;
        height: 32px;
    }

    .avatar,
    .avatar-placeholder {
        width: 32px;
        height: 32px;
        font-size: 32px !important;
    }

    .chat-bubble {
        max-width: calc(85% - 40px);
    }
}

@media (max-width: 480px) {
    .chat-container {
        max-height: 400px;
    }

    .chat-bubble {
        max-width: calc(95% - 40px);
    }
}

/* ===== CHAT OVERVIEW LIST ===== */
/* Von Konian genehmigt am 2025-11-20 */
/* Für Chat-Übersichtsliste in UserChat/index */

.chat-overview-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
}

.chat-overview-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid #E0E0E0;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
}

.chat-overview-item:hover {
    background: #F5F5F5;
}

.chat-overview-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
}

.chat-overview-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.chat-overview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-overview-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #000000;
}

.chat-overview-time {
    font-size: 0.75rem;
    color: #666666;
    white-space: nowrap;
}

.chat-overview-preview {
    font-size: 0.85rem;
    color: #666666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 768px) {
    .chat-overview-item {
        padding: 0.75rem;
    }

    .chat-overview-avatar {
        width: 32px;
        height: 32px;
    }
}
