.container-flex {
    height: 100%;
    display: flex;
}

.chat-container {
    top: 0;
    max-width: 23rem;
    min-width: 23rem;
    background: var(--card);
    display: flex;
    flex-direction: column;
    height: 100vh;
    border-radius: 12px;
    position: sticky;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    padding: 16px 20px;
    color: white;
    border-bottom: 2px solid var(--transparent-5-w);
    align-items: center;
}

.chat-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.chat-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #95a5a6;
    position: relative;
    transition: all 0.3s ease;
}

.status-indicator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    animation: pulse-indicator-status-connect 2s ease-in-out infinite;
    opacity: 0;
}

.status-indicator.connecting {
    background: #f39c12;
}

.status-indicator.connected {
    background: #2ecc71;
}

.status-indicator.connected::before {
    animation: pulse-indicator-status-connect 2s ease-in-out infinite;
}

.status-indicator.disconnected {
    background: #e74c3c;
}

@keyframes pulse-indicator-status-connect {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0.3;
    }
}





/* Chat */
.chat-messages {
    -ms-overflow-style: none;
    scrollbar-width: none;
    padding-bottom: 1rem;
    padding-inline: 1rem;
    width: 100%;
    height: 100%;
    position: relative;
    gap: 1.5rem;
    display: flex;
    overflow-y: auto;
    scroll-behavior: smooth;
    flex-direction: column-reverse; /* Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¾ Ð½Ð° reverse */
}

.chat-message {
    width: 100%;
    position: relative;
    display: flex;
    gap: 12px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.chat-message.visible {
    opacity: 1;
    transform: translateY(0);
}

.chat-message.new-message {
    animation: slideInFromBottom 0.3s ease forwards;
}

@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.removing {
    animation: messageRemove 0.3s ease forwards;
}

@keyframes messageRemove {
    to {
        opacity: 0;
        transform: translateX(-20px);
        height: 0;
        margin: 0;
    }
}

.message-highlight-before {
    position: absolute;
    top: -0.5rem;
    left: 0;
    right: -0.5rem;
    bottom: -0.5rem;
    background: var(--transparent-3-w);
    border-radius: var(--br-8);
    z-index: -1;
    pointer-events: none;
    opacity: 1;
    animation: highlightFadeOut 3s ease forwards;
}

@keyframes highlightFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
  }


.chat-content {
    gap: .2rem;
    display: flex;
    width: 100%;
    flex-direction: column;
}

.chat-avatar img {
    width: 2.5rem;
    height: 2.5rem;
    object-fit: cover;
    border-radius: 50%;
    margin-left: .5rem;
}

.chat-head {
    height: 1.3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: row;
}

.chat-menu {
    display: none;
    height: 100%;
    padding-inline: 0;
    background: unset;
    outline: unset;
    border: unset;
}

.chat-menu svg {
    width: 1.5rem;
    height: 1.5rem;
}

.chat-menu:hover {
    background: unset;
    color: unset;
}

.chat-menu:focus {
    border: unset;
}

.chat-username {
    min-width: 0;
    max-width: 8rem;
    display: block;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    font-weight: var(--font-weight-6);
    font-size: var(--font-size-default);
    color: var(--text-secondary);
    transition: color 0.2s;
}


.chat-time {
    color: var(--text-secondary);
}

.chat-message:hover .chat-time {
    display: none;
}

.chat-message:hover .chat-menu {
    display: block;
}

.chat-username:hover {
    color: var(--text-default);
    cursor: pointer;
}

.chat-reply {
    border-left: 2px solid var(--span);
    width: 100%;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-reply {
    background: rgba(255, 255, 255, 0.06);
}

.chat-reply-username {
    font-weight: var(--font-weight-6);
    font-size: var(--font-size-s);
    gap: .3rem;
    display: flex;
    color: var(--money);
    align-items: center;
}

.chat-reply-username svg {
    fill: var(--text-custom);
    height: .8rem;
    width: .8rem;
}

.chat-reply-text-chat {
    color: var(--text-custom);
    font-size: var(--font-size-m);
    font-weight: var(--font-weight-6);
}

.chat-text {
    color: var(--text-custom);
    font-size: var(--font-size-default);
    font-weight: var(--font-weight-6);
}

/* Chat Reply */

.chat-reply-ui {
    left: 0;
    width: 100%;
    bottom: 4rem;
    position: absolute;
    padding-inline: 1rem;
    transition: all 0.3s ease;
    z-index: 5;
}

.chat-reply-ui.visible {
    opacity: 1;
    transform: translateY(0);
}

.chat-reply-ui.hidden {
    opacity: 0;
    transform: translateY(20px);
}

.chat-reply-info {
    width: 100%;
    position: relative;
    gap: .2rem;
    display: flex;
    border-radius: var(--br-12);
    padding: .7rem;
    background: rgb(35 35 35);
    flex-direction: column;
}

.chat-reply-head {
    gap: .2rem;
    width: 100%;
    position: relative;
    height: 1.6rem;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.chat-reply-head-text {
    overflow: hidden;
    position: relative;
    white-space: nowrap;
    gap: .2rem;
    display: flex;
    flex-direction: row;
}

.chat-reply-head-name {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 100%;
    min-width: 0;
    font-weight: var(--font-weight-6);
    color: var(--money);
}

.chat-reply-close {
    height: 100%;
    padding-inline: 0;
    background: unset;
    outline: unset;
    border: unset;
}

.chat-reply-close:hover {
    background: unset;
    color: unset;
}

.chat-reply-close:focus {
    border: unset;
}

.chat-reply-text {
    font-weight: var(--font-weight-6);
    color: var(--text-custom);
    font-size: var(--font-size-m);
    padding: 0.5rem;
    background: var(--transparent-5-w);
    border-radius: var(--br-7);
    border-left: 2px solid var(--span);
}


/* Footer send input */

.chat-input-container {
    height: 3.5rem;
    border-top: 2px solid var(--transparent-5-w);
    display: flex;
}

.chat-send-btn {
    border: unset;
    height: unset;
    background: unset;
}

.chat-send-btn svg{
    width: 1.5rem;
    height: 1.5rem;
}

.chat-send-btn:hover {
    background: unset;
}

.chat-send-btn:focus {
    border: unset;
}

.chat-input {
    height: unset;
    font-size: var(--font-size-default);
    outline: unset;
    border: unset !important;
    background: unset;
}

.chat-input:focus {
    border: unset;
    outline: unset !important;
}

.chat-input-container-no-auth {
    display: flex;
    padding: .5rem;
    font-weight: var(--font-weight-6);
    font-size: var(--font-size-default);
    width: 100%;
    text-align: center;
    align-items: center;
}


/* Contex Menu */

.chat-context-menu {
    gap: .25rem;
    display: flex;
    border: 2px solid var(--transparent-10-w);
    width: 10rem;
    padding: .8rem;
    background: #1a1a1a;
    border-radius: var(--br-12);
    transition: all 0.3s ease;
    flex-direction: column;
}

.chat-context-menu.visible {
    opacity: 1;
    transform: translateY(0);
}

.chat-context-menu.hidden {
    opacity: 0;
    transform: translateY(20px);
}


.chat-menu-item {
    height: 2rem;
}









































/* .chat-main {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-messages {
    padding-right: .5rem;
    width: 100%;
    height: 67rem;
    position: relative;
    gap: 1.5rem;
    display: flex;
    overflow-y: auto;
    scroll-behavior: smooth;
    flex-direction: column;
}

.chat-message.system .chat-message-text {
    text-align: center;
    padding: .6rem;
    border-radius: var(--br-7);
    background: var(--transparent-5-w);
    color: var(--red);
}

.chat-message-avatar {
    margin-left: .5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
    overflow: hidden;
}

.chat-message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.chat-message-content {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.chat-message-header {
    height: 1.2rem;
    display: flex;
    gap: 8px;
    font-size: 13px;
    align-items: center;
    justify-content: space-between;
}

.chat-message-username:hover {
    color: var(--text-default);
}

.chat-message-time {
    color: var(--text-secondary);
}

.chat-message-text {
    font-weight: 600;
    color: var(--text-custom);
}

.chat-message-text a {
    color: #667eea;
    text-decoration: underline;
}

.chat-message-text a:hover {
    color: #764ba2;
}

.chat-message-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.chat-message:hover .chat-message-actions {
    opacity: 1;
}

.chat-message-action {
    border: 1px solid #e2e8f0;
    height: 22px;
}

.chat-message-action:hover {
    background: #fee;
    border-color: #fcc;
    color: #e53e3e;
}

.chat-message-action svg {
    width: 14px;
    height: 14px;
}

.chat-typing {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e2e8f0;
    color: #718096;
    font-size: 13px;
    font-style: italic;
}

.typing-indicator {
    display: flex;
    gap: 4px;
}

.typing-indicator::before,
.typing-indicator::after {
    content: '';
    width: 6px;
    height: 6px;
    background: #cbd5e0;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-indicator::before {
    animation-delay: 0s;
}

.typing-indicator::after {
    animation-delay: 0.2s;
}

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-6px);
    }
}


.chat-login-prompt {
    padding: 20px;
    text-align: center;
    background: #fff3cd;
    border-top: 1px solid #ffeaa7;
    color: #856404;
}

.chat-login-prompt p {
    margin: 0;
    font-size: 14px;
}

.chat-reply-ui-info {
    width: 100%;
    background: rgb(35 35 35);
    border-radius: var(--br-7);
    padding: 0.75rem 1rem;
}

.chat-reply-ui-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--font-size-m);
}

.chat-reply-ui-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.chat-reply-ui-username {
    color: var(--text-default);
    font-weight: 600;
}

.chat-reply-ui-close {background: unset;padding-inline: 0;margin-left: auto;height: max-content;}

.chat-reply-ui-close:hover {
    background: unset;
    color: #ff5252;
}

.chat-reply-ui-message {
    color: var(--text-custom);
    font-size: var(--font-size-s);
    padding: 0.5rem;
    background: var(--transparent-5-w);
    border-radius: var(--br-7);
    border-left: 3px solid var(--blue);
}



.chat-message-menu-btn {
    padding-inline: unset;
    border: unset;
    background: unset;
    height: max-content;
    display: none;
    cursor: pointer;
}

.chat-message-menu-btn svg {
    width: 2rem;
    height: 2rem;
}

.chat-message-menu-btn:hover {
    color: var(--text-custom);
    background: unset;
}

.chat-message-menu-btn:focus {
    outline: unset;
    border: unset;
}

.chat-message:hover .chat-message-time {
    display: none;
}

.chat-message:hover .chat-message-menu-btn {
    display: flex;
}

.chat-context-menu {
    position: fixed;
    background: var(--transparent-10-w);
    border-radius: 8px;
    z-index: 10;
    min-width: 200px;
    padding: 4px;
    display: none;
}

.chat-context-menu-item {
    background: var(--button);
    padding: 10px 16px;
    cursor: pointer;
    border-radius: var(--br-10);
    font-size: 14px;
    color: var(--text-default);
    transition: background 0.2s;
    user-select: none;
}

.chat-context-menu-item:hover {
    opacity: 0.8;
}

.chat-context-menu-item.danger {
    color: #e53e3e;
}

.chat-context-menu-item.danger:hover {
    background: #fee;
    color: #c53030;
}

.chat-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.chat-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.chat-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.chat-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
}

.chat-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #718096;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.chat-modal-close:hover {
    background: #f7fafc;
    color: #2d3748;
}

.chat-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.chat-modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 20px;
    border-top: 1px solid #e2e8f0;
}

.chat-modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-modal-btn-primary {
    background: #667eea;
    color: white;
}

.chat-modal-btn-primary:hover {
    background: #5568d3;
}

.chat-modal-btn-secondary {
    background: #e2e8f0;
    color: #2d3748;
}

.chat-modal-btn-secondary:hover {
    background: #cbd5e0;
}

.chat-roles-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-role-item {
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    transition: all 0.2s;
}

.chat-role-item:hover {
    border-color: #cbd5e0;
    background: #f7fafc;
}

.chat-role-item label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
}

.chat-role-item input[type="checkbox"] {
    margin-top: 2px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.chat-role-item span {
    flex: 1;
    font-weight: 500;
    color: #2d3748;
}

.chat-role-item small {
    display: block;
    margin-top: 4px;
    color: #718096;
    font-size: 12px;
}

.chat-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10002;
    max-width: 400px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.chat-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.chat-notification.success {
    background: #c6f6d5;
    color: #22543d;
    border-left: 4px solid #2f855a;
}

.chat-notification.error {
    background: #fed7d7;
    color: #742a2a;
    border-left: 4px solid #c53030;
}

.mentioned  {
    background: var();
}

.chat-message-reply {
    border-left: 2px solid var(--span);
    width: 100%;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-message-reply:hover {
    background: rgba(255, 255, 255, 0.06);
}


@media (max-width: 768px) {
    .chat-container {
        height: 100vh;
        max-width: 100%;
        border-radius: 0;
    }
    
    .chat-header {
        padding: 12px 16px;
    }
    
    .chat-header h2 {
        font-size: 18px;
    }
    
    .chat-messages {
        padding: 12px;
    }
    
    .chat-message-content {
        max-width: 80%;
    }
    
    .chat-input-container {
        padding: 12px 16px;
    }
    
    .chat-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .chat-modal {
        width: 95%;
        max-height: 90vh;
    }
    
    .chat-context-menu {
        min-width: 180px;
    }
}

@media (max-width: 480px) {
    .chat-message-avatar {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .chat-message-content {
        max-width: 85%;
    }
    
    .chat-message-username {
        font-size: 12px;
    }
    
    .chat-message-time {
        font-size: 11px;
    }
    
    .chat-message-text {
        font-size: 13px;
        padding: 8px 12px;
    }
} */