/* 
 * Bottle-Trade Chat Modul
 * Neues, modernes CSS für den Chat-Bereich
 */

/* Layout für den Chat-Bereich */
.bt-chat-container {
    display: flex;
    min-height: 80vh;
    background-color: var(--bt-background);
    border-radius: var(--bt-radius);
    box-shadow: var(--bt-shadow);
    overflow: hidden;
    margin: 2rem 0;
}

/* Linke Sidebar mit Chat-Liste */
.bt-chat-sidebar {
    width: 320px;
    background-color: var(--bt-card-bg);
    border-right: 1px solid var(--bt-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Chat-Liste */
.bt-chat-list {
    overflow-y: auto;
    flex-grow: 1;
}

.bt-chat-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--bt-border);
    text-decoration: none;
    color: var(--bt-text);
    transition: background-color 0.2s ease;
    position: relative;
}

.bt-chat-item:hover {
    background-color: var(--bt-background-alt);
}

.bt-chat-item.active {
    background-color: var(--bt-primary-light);
    border-left: 3px solid var(--bt-primary);
}

.bt-chat-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--bt-background-alt);
    margin-right: 0.75rem;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.bt-chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bt-chat-avatar i {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    color: var(--bt-text-muted);
}

.bt-chat-item-content {
    flex-grow: 1;
    min-width: 0;
}

.bt-chat-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.bt-chat-item-name {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bt-chat-item-time {
    font-size: 0.75rem;
    color: var(--bt-text-muted);
    flex-shrink: 0;
}

.bt-chat-item-preview {
    font-size: 0.85rem;
    color: var(--bt-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bt-chat-unread-badge {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 20px;
    height: 20px;
    background-color: var(--bt-primary);
    color: white;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-left: 0.5rem;
    padding: 0 0.4rem;
}

/* Chat-Anfragen Sektion */
.bt-chat-requests {
    border-bottom: 1px solid var(--bt-border);
    background-color: var(--bt-background-alt);
}

.bt-chat-requests-header {
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--bt-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bt-chat-request-item {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--bt-border);
    display: flex;
    flex-direction: column;
}

.bt-chat-request-user {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.bt-chat-request-username {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.bt-chat-request-time {
    font-size: 0.75rem;
    color: var(--bt-text-muted);
}

.bt-chat-request-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* Chat-Hauptbereich */
.bt-chat-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bt-background);
}

.bt-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background-color: var(--bt-primary);
    color: white;
    border-bottom: 1px solid var(--bt-border);
}

.bt-chat-header-user {
    display: flex;
    align-items: center;
}

.bt-chat-header-username {
    font-weight: 600;
    margin-left: 0.75rem;
}

.bt-chat-header-actions {
    display: flex;
    gap: 0.5rem;
}

.bt-chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background-color: var(--bt-background);
    background-image: linear-gradient(rgba(var(--bt-primary-rgb), 0.03) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(var(--bt-primary-rgb), 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
}

.bt-chat-message {
    display: flex;
    flex-direction: column;
    max-width: 70%;
    align-self: flex-start;
    position: relative;
}

.bt-chat-message.outgoing {
    align-self: flex-end;
}

.bt-chat-message-bubble {
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    background-color: var(--bt-card-bg);
    border: 1px solid var(--bt-border);
    box-shadow: var(--bt-shadow-sm);
    position: relative;
}

.bt-chat-message.outgoing .bt-chat-message-bubble {
    background-color: var(--bt-primary-light);
    border-color: var(--bt-primary);
    border-bottom-right-radius: 0.25rem;
}

.bt-chat-message:not(.outgoing) .bt-chat-message-bubble {
    border-bottom-left-radius: 0.25rem;
}

.bt-chat-message-content {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}

.bt-chat-message-time {
    font-size: 0.75rem;
    color: var(--bt-text-muted);
    margin-top: 0.25rem;
    align-self: flex-end;
}

.bt-chat-message.outgoing .bt-chat-message-time {
    align-self: flex-end;
}

.bt-chat-message:not(.outgoing) .bt-chat-message-time {
    align-self: flex-start;
}

.bt-chat-input-container {
    padding: 0.75rem 1rem;
    background-color: var(--bt-card-bg);
    border-top: 1px solid var(--bt-border);
}

.bt-chat-input-form {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
}

.bt-chat-input {
    flex-grow: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--bt-border);
    border-radius: var(--bt-radius);
    resize: none;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.4;
    max-height: 150px;
    background-color: var(--bt-background);
    color: var(--bt-text);
    transition: border-color 0.2s ease;
}

.bt-chat-input:focus {
    outline: none;
    border-color: var(--bt-primary);
}

.bt-chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--bt-text-muted);
    text-align: center;
    padding: 2rem;
}

.bt-chat-empty-icon {
    font-size: 4rem;
    color: var(--bt-primary);
    opacity: 0.2;
    margin-bottom: 1.5rem;
}

.bt-chat-empty-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.bt-chat-empty-text {
    font-size: 1rem;
    max-width: 350px;
}

/* Buttons */
.bt-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: var(--bt-radius);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    text-decoration: none;
}

.bt-button-primary {
    background-color: var(--bt-primary);
    color: white;
}

.bt-button-primary:hover {
    background-color: var(--bt-primary-hover);
    transform: translateY(-1px);
}

.bt-button-success {
    background-color: #1a8d3f;
    color: white;
}

.bt-button-success:hover {
    background-color: #146e31;
    transform: translateY(-1px);
}

.bt-button-danger {
    background-color: #dc3545;
    color: white;
}

.bt-button-danger:hover {
    background-color: #c82333;
    transform: translateY(-1px);
}

.bt-button-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bt-button-small {
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
}

/* Datums-Trennlinie */
.bt-date-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bt-text-muted);
    font-size: 0.8rem;
    margin: 1rem 0;
}

.bt-date-divider-text {
    background-color: var(--bt-background);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    border: 1px solid var(--bt-border);
}

.bt-date-divider::before,
.bt-date-divider::after {
    content: '';
    height: 1px;
    background-color: var(--bt-border);
    flex-grow: 1;
}

.bt-date-divider::before {
    margin-right: 1rem;
}

.bt-date-divider::after {
    margin-left: 1rem;
}

/* Für responsive Design */
@media (max-width: 992px) {
    .bt-chat-container {
        flex-direction: column;
    }
    
    .bt-chat-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--bt-border);
        max-height: 300px;
    }
    
    .bt-chat-main {
        height: calc(80vh - 300px);
    }
}

@media (max-width: 768px) {
    .bt-chat-container {
        margin: 1rem 0;
    }
    
    .bt-chat-message {
        max-width: 85%;
    }
} 