/* === CHAT CONTEXT MENU === */
.chat-context-menu {
    position: fixed;
    background: #1a1a1a;
    border: 1px solid rgba(249, 134, 82, 0.3);
    border-radius: 12px;
    padding: 8px 0;
    min-width: 200px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(10px);
}

.chat-context-menu.active {
    opacity: 1;
    transform: scale(1);
    pointer-events: all;
}

.chat-context-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
    position: relative;
}

.chat-context-menu-item i {
    width: 18px;
    font-size: 16px;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.chat-context-menu-item:hover {
    background: rgba(249, 134, 82, 0.15);
}

.chat-context-menu-item:hover i {
    color: var(--accent-color);
}

.chat-context-menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 4px 0;
}

.chat-context-menu-item.danger {
    color: #ff4444;
}

.chat-context-menu-item.danger i {
    color: #ff4444;
}

.chat-context-menu-item.danger:hover {
    background: rgba(255, 68, 68, 0.15);
}

/* === MESSAGE DELETION ANIMATIONS === */
@keyframes messageDeleteOwn {
    0% {
        opacity: 1;
        transform: translateX(0) scale(1);
        max-height: 200px;
        margin-bottom: 12px;
    }

    50% {
        opacity: 0.3;
        transform: translateX(100px) scale(0.8);
    }

    100% {
        opacity: 0;
        transform: translateX(150px) scale(0.5);
        max-height: 0;
        margin: 0;
        padding: 0;
    }
}

@keyframes messageDeleteOther {
    0% {
        opacity: 1;
        transform: translateX(0) scale(1);
        max-height: 200px;
        margin-bottom: 12px;
    }

    50% {
        opacity: 0.3;
        transform: translateX(-100px) scale(0.8);
    }

    100% {
        opacity: 0;
        transform: translateX(-150px) scale(0.5);
        max-height: 0;
        margin: 0;
        padding: 0;
    }
}

.message.deleting.own {
    animation: messageDeleteOwn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
    pointer-events: none;
}

.message.deleting:not(.own) {
    animation: messageDeleteOther 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
    pointer-events: none;
}

/* === CHAT PINNING === */
.chat-item.pinned {
    position: relative;
    background: rgba(249, 134, 82, 0.08);
}

.chat-pin-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    color: var(--accent-color);
    font-size: 12px;
    animation: pinAppear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 0 4px rgba(249, 134, 82, 0.5));
}

@keyframes pinAppear {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
    }

    50% {
        transform: scale(1.2) rotate(20deg);
    }

    100% {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

/* === UNREAD MESSAGE BADGE - overrides for animation === */
.chat-item-badge {
    animation: badgeAppear 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 8px rgba(var(--accent-color-rgb, 249, 134, 82), 0.45);
}

@keyframes badgeAppear {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    70% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Bold text for unread chats */
.chat-item.unread .chat-item-name {
    font-weight: 700;
    color: var(--text-primary);
}

@keyframes pinDisappear {
    0% {
        opacity: 1;
        transform: scale(1) rotate(0);
    }

    100% {
        opacity: 0;
        transform: scale(0) rotate(180deg);
    }
}

.chat-pin-icon.removing {
    animation: pinDisappear 0.3s ease forwards;
}

/* === CONFIRMATION MODAL === */
.confirmation-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.confirmation-modal.active {
    opacity: 1;
    pointer-events: all;
}

.confirmation-modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.confirmation-modal.active .confirmation-modal-content {
    transform: scale(1) translateY(0);
}

.confirmation-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.confirmation-modal-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 20px;
}

.confirmation-modal-icon.warning {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
}

.confirmation-modal-icon.danger {
    background: rgba(255, 68, 68, 0.15);
    color: #ff4444;
}

.confirmation-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.confirmation-modal-body {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 24px;
}

.confirmation-modal-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.confirmation-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.confirmation-option:hover {
    background: rgba(249, 134, 82, 0.1);
    border-color: rgba(249, 134, 82, 0.3);
}

.confirmation-option input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-color);
}

.confirmation-option label {
    flex: 1;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 14px;
}

.confirmation-modal-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    margin-bottom: 24px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.confirmation-modal-checkbox:hover {
    background: rgba(0, 0, 0, 0.3);
}

.confirmation-modal-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-color);
    cursor: pointer;
}

.confirmation-modal-checkbox label {
    flex: 1;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 13px;
}

.confirmation-modal-actions {
    display: flex;
    gap: 12px;
}

.modal-btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-btn-cancel {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.modal-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.modal-btn-confirm {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(249, 134, 82, 0.3);
}

.modal-btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(249, 134, 82, 0.5);
}

.modal-btn-confirm.danger {
    background: linear-gradient(135deg, #ff4444, #cc0000);
    box-shadow: 0 4px 15px rgba(255, 68, 68, 0.3);
}

.modal-btn-confirm.danger:hover {
    box-shadow: 0 6px 20px rgba(255, 68, 68, 0.5);
}

.modal-btn:active {
    transform: scale(0.95);
}