/* Chat-specific styles for the HUP platform chats page */

/* Chat Container */
.chat-container {
    display: flex;
    min-height: calc(100dvh - 110px);
    background: rgba(15, 17, 26, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    overflow: hidden;
    margin: 1rem;
}

.chat-sidebar {
    width: min(350px, 100%);
    border-right: 1px solid var(--glass-border);
    overflow-y: auto;
    padding: 1rem;
}

.chat-empty-state {
    margin: auto;
    text-align: center;
    color: var(--text-muted);
    padding: 1rem;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.chat-header {
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.chat-input-area {
    padding: 1rem;
    border-top: 1px solid var(--glass-border);
}

.chat-input-area .input-group {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    overflow: hidden;
}

.chat-input {
    background: transparent;
    border: none;
    color: var(--light);
    min-height: 38px;
    max-height: 150px;
    overflow-y: auto;
    padding: 0.5rem 1rem;
    line-height: 1.5;
}

.chat-input:focus {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 10px rgba(110, 69, 226, 0.3);
}

.chat-input-area .btn-glow {
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.chat-search-area {
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.chat-search-input {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--light);
}

.chat-search-input:focus {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 10px rgba(110, 69, 226, 0.3);
}

.chat-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.chat-item.active,
.chat-item:hover {
    background: rgba(110, 69, 226, 0.15);
}

.chat-item:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: -2px;
}

.chat-item.unread {
    font-weight: 600;
}

.chat-item img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.chat-item .flex-grow-1 {
    min-width: 0;
    overflow: hidden;
}

.chat-item h6 {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item .chat-preview {
    font-size: 0.85rem;
    color: #ccc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    margin-bottom: 0.25rem;
}

.chat-item .chat-time {
    font-size: 0.7rem;
    color: #999;
    display: block;
}

.message {
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-end;
}

.message.sent {
    justify-content: flex-end;
}

.message.received {
    justify-content: flex-start;
}

.message-bubble {
    max-width: 70%;
    padding: 0.5rem 1rem;
    border-radius: 1rem;
    font-size: 0.9rem;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    word-break: break-all;
}

.message.sent .message-bubble {
    background: var(--page-primary);
    color: #fff;
    border-bottom-right-radius: 0.2rem;
}

.message.received .message-bubble {
    background: rgba(255, 255, 255, 0.15);
    color: var(--light);
    border-bottom-left-radius: 0.2rem;
}

.message-time {
    font-size: 0.7rem;
    color: #999;
    margin-top: 0.2rem;
}

.delete-confirmation {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 17, 26, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 0.5rem;
    padding: 1rem;
    z-index: 1003;
    width: 80%;
    text-align: center;
    display: none;
}

.delete-confirmation p {
    color: var(--light);
    margin-bottom: 1rem;
}

.confirmation-buttons {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .chat-container {
        flex-direction: column;
        min-height: calc(100vh - 100px);
    }

    .chat-sidebar {
        width: 100%;
        max-height: 30vh;
    }

    .chat-main { min-height: 55vh; }
}

@media (max-width: 576px) {
    .chat-sidebar {
        max-height: 25vh;
    }
}