/* =====================================
   UTOPIA X - Chat Styles
   1:1 Real-time Chat System
   ===================================== */

/* Badge Notification */
.badge-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--accent-red, #E91E63);
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Chat List Container */
.chat-list-container {
    max-height: 500px;
    overflow-y: auto;
}

.chat-list-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}

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

.chat-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 28px;
    color: white;
}

.chat-info {
    flex: 1;
}

.chat-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.chat-preview {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

.chat-meta {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.chat-time {
    font-size: 12px;
    color: var(--text-muted);
}

/* Chat Modal */
.chat-modal {
    display: flex;
    flex-direction: column;
    height: 600px;
    max-height: 80vh;
}

.chat-header {
    background: var(--primary-gradient);
    color: white;
    padding: 20px;
    border-radius: 25px 25px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-partner-info {
    display: flex;
    align-items: center;
}

.chat-partner-info h3 {
    font-size: 18px;
    margin: 0 0 5px 0;
}

.chat-status {
    font-size: 12px;
    opacity: 0.9;
}

.chat-status i {
    font-size: 8px;
    color: #4CAF50;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-message {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    animation: messageSlideIn 0.2s ease;
}

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

.chat-message.sent {
    align-self: flex-end;
    background: var(--primary-gradient);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.received {
    align-self: flex-start;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.message-content {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 5px;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    text-align: right;
}

.chat-message.sent .message-time {
    color: rgba(255, 255, 255, 0.8);
}

.chat-message.received .message-time {
    color: var(--text-muted);
}

/* Chat Input */
.chat-input-container {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 25px 25px;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: var(--primary-purple);
}

.btn-send {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-send:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(157, 78, 221, 0.4);
}

.btn-send:active {
    transform: scale(0.95);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    display: block;
    margin-bottom: 20px;
}

/* Scrollbar */
.chat-messages::-webkit-scrollbar,
.chat-list-container::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track,
.chat-list-container::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb,
.chat-list-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover,
.chat-list-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-purple);
}

/* Responsive */
@media (max-width: 768px) {
    .chat-modal {
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .chat-header {
        border-radius: 0;
    }
    
    .chat-input-container {
        border-radius: 0;
    }
    
    .chat-message {
        max-width: 85%;
    }
}
