/* Buttons */
.btn-primary {
    background: var(--white);
    color: var(--black);
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.2);
}

.btn-secondary {
    background: var(--gray-800);
    color: var(--white);
    border: 1px solid var(--gray-700);
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--gray-700);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background: #dc2626;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--gray-400);
    font-size: 20px;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: var(--gray-800);
    color: var(--white);
}


/* Chat Item */
.chat-item {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--gray-800);
}

.chat-item:hover {
    background: var(--gray-800);
}

.chat-item.active {
    background: var(--gray-800);
}

.chat-item-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--white);
    color: var(--black);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    flex-shrink: 0;
}

.chat-item-info {
    flex: 1;
    min-width: 0;
}

.chat-item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.chat-item-name {
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item-time {
    font-size: 12px;
    color: var(--gray-500);
}

.chat-item-preview {
    font-size: 13px;
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item-badge {
    background: var(--white);
    color: var(--black);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

/* Messages */
.message {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    animation: slideInLeft 0.3s ease;
}

.message.sent {
    flex-direction: row-reverse;
    animation: slideInRight 0.3s ease;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gray-800);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.message-bubble {
    max-width: 60%;
    padding: 12px 16px;
    border-radius: 16px;
    position: relative;
}

.message.received .message-bubble {
    background: var(--gray-900);
    border-bottom-left-radius: 4px;
}

.message.sent .message-bubble {
    background: var(--white);
    color: var(--black);
    border-bottom-right-radius: 4px;
}

.message-sender {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--gray-400);
}

.message-text {
    font-size: 15px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message-time {
    font-size: 11px;
    color: var(--gray-500);
    margin-top: 4px;
}

.message.sent .message-time {
    color: var(--gray-600);
}

.message-status {
    font-size: 14px;
    margin-left: 4px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease;
}

.typing-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gray-800);
    flex-shrink: 0;
}

.typing-bubble {
    background: var(--gray-900);
    border-radius: 16px;
    padding: 12px 16px;
    display: flex;
    gap: 4px;
}

.typing-bubble span {
    width: 8px;
    height: 8px;
    background: var(--gray-500);
    border-radius: 50%;
    animation: bounce 1.4s infinite;
}

.typing-bubble span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-bubble span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-6px);
    }
}

/* Emoji Picker */
.emoji-picker {
    position: fixed;
    bottom: 90px;
    left: 400px;
    background: var(--gray-900);
    border: 1px solid var(--gray-800);
    border-radius: 16px;
    width: 350px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 100;
    display: none;
    animation: scaleIn 0.2s ease;
}

.emoji-picker.active {
    display: block;
}

.emoji-header {
    padding: 12px;
    border-bottom: 1px solid var(--gray-800);
}

.emoji-tabs {
    display: flex;
    gap: 4px;
}

.emoji-tab {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.emoji-tab:hover {
    background: var(--gray-800);
}

.emoji-tab.active {
    background: var(--gray-800);
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    padding: 12px;
    max-height: 300px;
    overflow-y: auto;
}

.emoji-grid button {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.emoji-grid button:hover {
    background: var(--gray-800);
    transform: scale(1.2);
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: var(--gray-900);
    border: 1px solid var(--gray-800);
    border-radius: 12px;
    padding: 8px;
    min-width: 200px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 100;
    display: none;
    animation: scaleIn 0.2s ease;
}

.context-menu.active {
    display: block;
}

.context-item {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--white);
    padding: 12px 16px;
    text-align: left;
    font-size: 14px;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.context-item:hover {
    background: var(--gray-800);
}

.context-item.danger {
    color: var(--danger);
}

.context-divider {
    height: 1px;
    background: var(--gray-800);
    margin: 4px 0;
}

/* Reaction Picker */
.reaction-picker {
    position: fixed;
    background: var(--gray-900);
    border: 1px solid var(--gray-800);
    border-radius: 24px;
    padding: 8px 12px;
    display: none;
    gap: 4px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 100;
    animation: scaleIn 0.2s ease;
}

.reaction-picker.active {
    display: flex;
}

.reaction-btn {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.reaction-btn:hover {
    background: var(--gray-800);
    transform: scale(1.3);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-800);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-700);
}
