/* chat.css */

.chat-container {
    position: relative;
    width: 100%;
}

.chat-slider {
    position: fixed;
    top: 50%;
    left: -120%;
    /* Hidden by default off screen */
    transform: translate(0, -50%);
    width: 95%;
    max-width: 500px;
    height: 80vh;
    max-height: 600px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    transition: left 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 4000;
    /* over everything */
    overflow: hidden;
}

.chat-slider.open {
    left: 50%;
    transform: translate(-50%, -50%);
}

.chat-header {
    background: var(--secondary-bg);
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-family: 'Inter', sans-serif;
}

.close-chat {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.close-chat:hover {
    color: var(--accent-red);
}

.chat-messages {
    flex: 1;
    padding: var(--spacing-md);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    background: var(--primary-bg);
}

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

.chat-messages::-webkit-scrollbar-track {
    background: var(--primary-bg);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

/* Message styling */
.chat-msg-wrapper {
    display: flex;
    margin-bottom: 10px;
    align-items: flex-end;
}

.chat-msg-wrapper.mine {
    justify-content: flex-end;
}

.chat-msg-wrapper.others {
    justify-content: flex-start;
}

.chat-team-logo-small {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    object-fit: cover;
    background-color: white;
}

.chat-msg-content {
    max-width: 85%;
}

.chat-msg-author {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.mine .chat-msg-author {
    justify-content: flex-end;
}

.others .chat-msg-author {
    justify-content: flex-start;
}

.chat-bubble {
    padding: 8px 12px;
    border-radius: 15px;
    text-align: left;
    font-size: 0.9rem;
    line-height: 1.4;
    word-break: break-word;
}

.mine .chat-bubble {
    background: var(--accent-blue);
    color: white;
    border-bottom-right-radius: 5px;
    border-bottom-left-radius: 15px;
}

.others .chat-bubble {
    background: var(--tertiary-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 15px;
}

.chat-input-area {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--secondary-bg);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
}

#chat-input-msg {
    flex: 1;
    background: var(--primary-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 10px 15px;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    resize: none;
    max-height: 120px;
    line-height: 1.4;
    transition: border-color var(--transition-fast);
    font-family: inherit;
    overflow-y: auto;
}

textarea {
    resize: none;
    /* remove resize handle */
    overflow-y: hidden;
    /* hide vertical scrollbar */
}

/* Chrome, Safari */
textarea::-webkit-scrollbar {
    display: none;
}

/* Firefox */
textarea {
    scrollbar-width: none;
}

#chat-input-msg:focus {
    border-color: var(--accent-blue);
}

.chat-send-btn {
    background: var(--accent-blue);
    color: white;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.chat-send-btn:hover:not(:disabled) {
    transform: scale(1.05);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: default;
    transform: none;
}

.chat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-family: inherit;
    gap: 15px;
    opacity: 0.8;
}

.chat-empty-state i {
    font-size: 3rem;
}

.chat-empty-state p {
    font-size: 1rem;
    margin: 0;
}