/* BlockFundX User Interface Styles - Adaptive Telegram Theme */

:root {
    /* Fallbacks for testing in browser without Telegram */
    --tg-theme-bg-color: #1a1a2e;
    --tg-theme-text-color: #ffffff;
    --tg-theme-hint-color: #a0a0a0;
    --tg-theme-link-color: #00cec9;
    --tg-theme-button-color: #00b894;
    --tg-theme-button-text-color: #ffffff;
    --tg-theme-secondary-bg-color: #24243e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Глобальное скрытие скроллбаров */
html::-webkit-scrollbar,
body::-webkit-scrollbar,
.container::-webkit-scrollbar {
display: none;
}

html,
body {
    height: 100%;
    overflow: hidden; /* Запобігає прокрутці сторінки під чатом */
    position: fixed; /* Фіксуємо body для iOS */
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Шапка с ботом */
.hero {
    text-align: center;
    padding: 40px 24px 32px;
    background: var(--tg-theme-secondary-bg-color);
    color: var(--tg-theme-text-color);
    position: relative;
    overflow: hidden;
    border-radius: 0 0 32px 32px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* Subtle gradient overlay for depth, respecting theme */
.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 184, 148, 0.05) 0%, rgba(0, 206, 201, 0.05) 100%);
    pointer-events: none;
}

.bot-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #00b894 0%, #00cec9 50%, #0984e3 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 52px;
    box-shadow: 0 12px 40px rgba(0, 184, 148, 0.3);
    position: relative;
    z-index: 1;
    animation: float 3s ease-in-out infinite;
    color: #fff; /* Always white icon inside avatar */
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.bot-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.hero h1 {
    font-size: 28px;
    margin-bottom: 12px;
    font-weight: 700;
    position: relative;
    z-index: 1;
    color: var(--tg-theme-text-color);
}

.hero p {
    font-size: 15px;
    opacity: 0.9;
    line-height: 1.6;
    max-width: 400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    color: var(--tg-theme-hint-color);
}

.hero .subtitle {
    font-size: 13px;
    opacity: 0.8;
    margin-top: 12px;
    color: var(--tg-theme-link-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Основной контент */
.main-content {
    padding: 24px 20px;
}

/* Кнопка поддержки */
.support-button {
    background: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
    border: none;
    padding: 20px 24px;
    border-radius: 20px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.support-button:active {
    transform: scale(0.96);
    opacity: 0.9;
}

.support-button.active-chat {
    background: linear-gradient(135deg, #0984e3 0%, #74b9ff 100%); /* Keep distinct color for active chat */
    color: white;
}

.support-button-icon {
    font-size: 22px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Быстрые вопросы */
.quick-questions {
    margin-bottom: 28px;
}

.quick-questions-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--tg-theme-text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-question-btn {
    background: var(--tg-theme-secondary-bg-color);
    border: 1px solid rgba(128, 128, 128, 0.1);
    border-radius: 16px;
    padding: 16px 18px;
    width: 100%;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
    font-size: 15px;
    color: var(--tg-theme-text-color);
    font-weight: 500;
}

.quick-question-btn .emoji {
    font-size: 24px;
    flex-shrink: 0;
}

.quick-question-btn:hover {
    filter: brightness(1.05);
    transform: translateY(-2px);
}

.quick-question-btn:active {
    transform: translateY(0) scale(0.98);
}

/* FAQ секция */
.faq-section {
    margin-top: 32px;
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 24px;
    padding: 24px 20px;
    border: 1px solid rgba(128, 128, 128, 0.1);
}

.faq-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.faq-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--tg-theme-text-color);
}

.faq-toggle {
    background: rgba(0, 206, 201, 0.1);
    border: 1px solid rgba(0, 206, 201, 0.3);
    color: var(--tg-theme-link-color);
    font-size: 13px;
    cursor: pointer;
    padding: 8px 16px;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s;
}

.faq-toggle:active {
    transform: scale(0.95);
}

.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-content.expanded {
    max-height: 4000px;
}

.faq-item {
    background: var(--tg-theme-bg-color); /* Contrast against secondary bg */
    border: 1px solid rgba(128, 128, 128, 0.1);
    border-radius: 16px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.3s;
}

.faq-question {
    padding: 16px 18px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--tg-theme-text-color);
    font-size: 15px;
}

.faq-arrow {
    transition: transform 0.3s;
    font-size: 14px;
    color: var(--tg-theme-hint-color);
    font-weight: bold;
}

.faq-item.active .faq-arrow {
    transform: rotate(180deg);
    color: var(--tg-theme-link-color);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--tg-theme-hint-color);
}

.faq-answer-content {
    padding: 0 18px 18px 18px;
    line-height: 1.7;
    font-size: 14px;
}

.faq-item.active .faq-answer {
    max-height: 600px;
}

/* Загрузка и ошибка */
.error-message {
    background: #ff3b30;
    color: white;
    padding: 20px;
    border-radius: 20px;
    text-align: center;
    margin: 20px;
    box-shadow: 0 8px 24px rgba(255, 59, 48, 0.3);
}

.error-message h2 {
    margin-bottom: 12px;
    font-size: 20px;
}

.loading {
    text-align: center;
    padding: 60px 20px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(128, 128, 128, 0.2);
    border-top: 4px solid var(--tg-theme-button-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: var(--tg-theme-hint-color);
    font-size: 15px;
}

.content {
    display: none;
    animation: fadeIn 0.5s ease;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

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

.content.visible {
    display: block;
}

/* Экран чата поддержки */
.support-chat {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--tg-theme-bg-color);
    z-index: 1000;
}

.support-chat.visible {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100%;
    z-index: 2000;
    background: var(--tg-theme-bg-color);
    overflow: hidden;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.chat-header {
    background: var(--tg-theme-secondary-bg-color);
    color: var(--tg-theme-text-color);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border-bottom: 1px solid rgba(128, 128, 128, 0.1);
}

.chat-header .back-btn {
    background: rgba(128, 128, 128, 0.1);
    border: 1px solid rgba(128, 128, 128, 0.15);
    color: var(--tg-theme-text-color);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    transition: all 0.3s;
}

.chat-header .back-btn:active {
    background: rgba(128, 128, 128, 0.2);
    transform: scale(0.9);
}

.chat-title {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-title-icon {
    font-size: 22px;
}

.chat-title-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-title-text {
    font-size: 17px;
    font-weight: 600;
}

.typing-status {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--tg-theme-link-color);
}

.typing-status span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--tg-theme-link-color);
    animation: typing 1.4s infinite;
}

.typing-status span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-status span:nth-child(3) {
    animation-delay: 0.4s;
}

.typing-status .typing-text {
    width: auto !important;
    height: auto !important;
    background: none !important;
    animation: none !important;
    font-style: italic;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* Быстрые вопросы в чате */
.chat-quick-questions {
    padding: 16px 20px;
    background: var(--tg-theme-secondary-bg-color);
    border-bottom: 1px solid rgba(128, 128, 128, 0.1);
}

.chat-quick-questions-title {
    font-size: 13px;
    color: var(--tg-theme-hint-color);
    margin-bottom: 12px;
    font-weight: 600;
}

.chat-quick-btn {
    background: var(--tg-theme-bg-color);
    border: 1px solid rgba(128, 128, 128, 0.2);
    border-radius: 20px;
    padding: 10px 16px;
    margin: 0 8px 10px 0;
    display: inline-block;
    cursor: pointer;
    font-size: 13px;
    color: var(--tg-theme-text-color);
    transition: all 0.3s;
    font-weight: 500;
}

.chat-quick-btn:active {
    transform: scale(0.95);
    background: var(--tg-theme-secondary-bg-color);
}

.chat-messages {
flex: 1;
overflow-y: auto;
overflow-x: hidden;
padding: 20px;
display: flex;
flex-direction: column;
gap: 14px;
background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
background-attachment: fixed;
outline: none; /* Убираем обводку при фокусе */
}

/* Скрываем скроллбар в сообщениях чата */
.chat-messages::-webkit-scrollbar {
display: none;
}

.chat-messages {
-ms-overflow-style: none;
scrollbar-width: none;
}

/* Список истории чатов */
.chat-history-list {
flex: 1;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
touch-action: pan-y;
overscroll-behavior: contain;
padding: 16px;
display: flex;
flex-direction: column;
gap: 12px;
}

.chat-history-list::-webkit-scrollbar {
display: none;
}

.chat-history-list {
-ms-overflow-style: none;
scrollbar-width: none;
}

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

.message {
    max-width: 80%;
    min-width: 140px;
    padding: 14px 18px;
    border-radius: 18px;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    animation: messageSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    transition: transform 0.2s ease;
}

.message.user {
    align-self: flex-end;
    background: #e4e6eb;
    color: #1c1e21;
    border-bottom-right-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message.user:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.message.support {
    align-self: flex-start;
    background: linear-gradient(135deg, #0084ff, #00c6ff);
    color: #ffffff;
    border-bottom-left-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 132, 255, 0.25);
}

.message.support:hover {
    box-shadow: 0 4px 12px rgba(0, 132, 255, 0.35);
}

.message-time {
    font-size: 11px;
    opacity: 0.65;
    margin-top: 6px;
    font-weight: 500;
}

.message-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    gap: 8px;
}

.message-status {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
    transition: color 0.3s;
}

.message.user .message-status {
    color: rgba(255, 255, 255, 0.8);
}

/* Adjust status color if button text is dark (e.g. light theme button) */
/* This is tricky with pure CSS vars, but usually button text is white on primary buttons */

.chat-input-container {
background: var(--tg-theme-secondary-bg-color);
border-top: 1px solid rgba(128, 128, 128, 0.1);
padding: 16px 20px;
display: flex;
gap: 12px;
position: relative; /* Added for absolute positioning of reply bar */
}

.chat-input-row {
display: flex;
gap: 12px;
width: 100%;
}

.chat-input {
    flex: 1;
    padding: 14px 20px;
    border: 1px solid rgba(128, 128, 128, 0.2);
    border-radius: 26px;
    font-size: 15px;
    outline: none;
    background: rgba(128, 128, 128, 0.1); /* More transparent as requested */
    color: var(--tg-theme-text-color);
    transition: all 0.3s;
}

.chat-input:focus {
    border-color: var(--tg-theme-link-color);
}

.chat-input::placeholder {
    color: var(--tg-theme-hint-color);
}

.chat-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-send-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

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

.chat-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

/* Непрочитанное сообщение - Индикатор */
.unread-badge {
    background: #ff4757;
    color: white;
    border-radius: 50%;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: bold;
    margin-left: 8px;
    box-shadow: 0 2px 5px rgba(255, 71, 87, 0.4);
    animation: pulse-red 2s infinite;
    min-width: 20px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(255, 71, 87, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0); }
}

/* Элемент истории чатов */
.chat-history-item {
    background: var(--tg-theme-secondary-bg-color);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(128, 128, 128, 0.1);
}

.chat-history-item:active {
    transform: scale(0.98);
    background: var(--tg-theme-bg-color);
}

.chat-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.chat-history-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--tg-theme-text-color);
}

.chat-history-date {
    font-size: 12px;
    color: var(--tg-theme-hint-color);
}

.chat-history-preview {
    font-size: 13px;
    color: var(--tg-theme-hint-color);
    margin-bottom: 8px;
    opacity: 0.9;
}

.chat-history-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-history-count {
    font-size: 12px;
    color: var(--tg-theme-hint-color);
    opacity: 0.7;
}

/* Стиль для кнопки видаления в истории */
.delete-chat-btn {
    background: rgba(255, 71, 87, 0.1);
    border: none;
    color: #ff4757;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 10px;
    transition: all 0.2s;
}

.delete-chat-btn:active {
    background: rgba(255, 71, 87, 0.3);
    transform: scale(0.95);
}

.chat-history-item {
    position: relative; /* Для позиціонування */
}

.chat-history-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

/* Модальное окно подтверждения */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--tg-theme-secondary-bg-color);
    width: 85%;
    max-width: 320px;
    padding: 24px;
    border-radius: 20px;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border: 1px solid rgba(128, 128, 128, 0.1);
}

.modal-overlay.visible .modal-content {
    transform: scale(1);
}

.modal-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--tg-theme-text-color);
}

.modal-text {
    font-size: 14px;
    color: var(--tg-theme-hint-color);
    margin-bottom: 24px;
    line-height: 1.5;
}

.modal-buttons {
    display: flex;
    gap: 12px;
}

.modal-btn {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
}

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

.modal-btn.cancel {
    background: rgba(128, 128, 128, 0.1);
    color: var(--tg-theme-text-color);
}

.modal-btn.delete {
    background: #ff4757;
    color: white;
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.3);
}

.chat-status-container {
    min-height: 18px;
    display: flex;
    align-items: center;
}

.chat-status-text {
    font-size: 13px;
    color: var(--tg-theme-link-color);
    opacity: 0.8;
    animation: fadeIn 0.3s ease;
}

        #notification-container {
            position: fixed;
            top: 20px;
            right: 20px;
            z-index: 9999;
            display: flex;
            flex-direction: column;
            gap: 10px;
            pointer-events: none;
        }
        
        .notification-card {
            background: var(--tg-theme-secondary-bg-color, rgba(45, 52, 54, 0.95));
            backdrop-filter: blur(10px);
            color: var(--tg-theme-text-color, white);
            padding: 14px 18px;
            border-radius: 14px;
            box-shadow: 0 8px 24px rgba(0,0,0,0.2);
            display: flex;
            align-items: flex-start;
            min-width: 280px;
            max-width: min(400px, 90vw);
            width: fit-content;
            pointer-events: auto;
            cursor: pointer;
            border-left: 4px solid var(--tg-theme-button-color, #00b894);
            animation: slideInRight 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            transition: transform 0.3s ease, opacity 0.3s ease;
        }
        
        .notification-card.hiding {
            transform: translateX(120%);
            opacity: 0;
        }
        
        .notif-content {
            flex: 1;
            margin-right: 12px;
            overflow: hidden;
        }
        
        .notif-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 4px;
        }
        
        .notif-title {
            font-weight: 600;
            font-size: 14px;
            color: #00b894;
        }
        
        .notif-time {
            font-size: 11px;
            opacity: 0.6;
        }
        
        .notif-text {
            font-size: 13px;
            line-height: 1.4;
            color: rgba(255,255,255,0.9);
            display: -webkit-box;
            -webkit-line-clamp: 2;
            line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        
        .notif-close {
            padding: 4px;
            margin: -4px -4px 0 0;
            opacity: 0.6;
            transition: opacity 0.2s;
            font-size: 18px;
            line-height: 1;
        }
        
        .notif-close:hover {
            opacity: 1;
        }

        @keyframes slideInRight {
            from { transform: translateX(100%); opacity: 0; }
            to { transform: translateX(0); opacity: 1; }
        }
        
        @media (max-width: 480px) {
            #notification-container {
                top: 10px;
                left: 10px;
                right: 10px;
                width: auto;
            }
            .notification-card {
                width: 100%;
            }
        }

        /* Reply UI */
        .reply-preview-bar {
            display: none;
            background: rgba(45, 52, 54, 0.95);
            backdrop-filter: blur(10px);
            border-left: 3px solid #00b894;
            padding: 10px 14px;
            border-radius: 8px 8px 0 0;
            position: absolute;
            bottom: 100%;
            left: 0;
            right: 0;
            z-index: 10;
            animation: slideUp 0.2s ease;
            box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
        }
        
        .reply-preview-bar.visible {
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        
        .reply-info {
            flex: 1;
            overflow: hidden;
        }
        
        .reply-name {
            font-size: 12px;
            color: #00b894;
            font-weight: 600;
            margin-bottom: 2px;
        }
        
        .reply-text {
            font-size: 12px;
            color: rgba(255,255,255,0.7);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        
        .reply-close {
            padding: 8px;
            color: rgba(255,255,255,0.5);
            cursor: pointer;
        }
        
        /* Message with reply */
        .message-reply-context {
            background: rgba(0, 184, 148, 0.15);
            border-left: 3px solid #00b894;
            padding: 8px 10px;
            border-radius: 8px;
            margin-bottom: 8px;
            font-size: 12px;
            cursor: pointer;
            display: block;
            width: 100%;
            box-sizing: border-box;
            transition: all 0.2s ease;
            backdrop-filter: blur(10px);
        }
        
        .message-reply-context:hover {
            background: rgba(0, 184, 148, 0.25);
            transform: translateX(2px);
        }
        
        .message-reply-context:active {
            transform: scale(0.98);
        }
        
        .message.user .message-reply-context {
            background: rgba(0, 0, 0, 0.1);
        }
        
        .message.support .message-reply-context {
            background: rgba(255, 255, 255, 0.2);
        }
        
        .message-reply-name {
            color: #00b894;
            font-weight: 700;
            margin-bottom: 3px;
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        
        .message.user .message-reply-name {
            color: #0084ff;
        }
        
        .message.support .message-reply-name {
            color: rgba(255, 255, 255, 0.95);
        }
        
        .message-reply-text {
            color: rgba(255,255,255,0.85);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            line-height: 1.4;
        }
        
        .message.user .message-reply-text {
            color: rgba(0, 0, 0, 0.6);
        }
        
        .message.support .message-reply-text {
            color: rgba(255, 255, 255, 0.85);
        }

        /* Context Menu for messages */
        @keyframes menuSlideIn {
            from {
                opacity: 0;
                transform: scale(0.9) translateY(-10px);
            }
            to {
                opacity: 1;
                transform: scale(1) translateY(0);
            }
        }
        
        .message-context-menu {
            position: fixed;
            background: rgba(45, 52, 54, 0.98);
            backdrop-filter: blur(20px);
            border-radius: 16px;
            box-shadow: 0 12px 40px rgba(0,0,0,0.6);
            z-index: 10000;
            overflow: hidden;
            min-width: 180px;
            display: none;
            animation: menuSlideIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            border: 1px solid rgba(255,255,255,0.1);
        }
        
        .context-menu-item {
            padding: 14px 18px;
            color: white;
            font-size: 15px;
            font-weight: 500;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 12px;
            transition: all 0.15s ease;
            border-bottom: 1px solid rgba(255,255,255,0.05);
        }
        
        .context-menu-item:last-child {
            border-bottom: none;
        }
        
        .context-menu-item:hover {
            background: rgba(0, 184, 148, 0.2);
        }
        
        .context-menu-item:active {
            background: rgba(0, 184, 148, 0.3);
            transform: scale(0.98);
        }
        
        .context-menu-item span {
            font-size: 18px;
        }

        /* Prevent text selection on long press */
        .message {
            user-select: none;
            -webkit-user-select: none;
            -webkit-touch-callout: none;
        }
        
        /* Swipe to reply animation */
        .message.swiping {
            transition: transform 0.1s linear;
        }
        
        .message.reply-triggered {
            animation: replyPulse 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        }
        
        @keyframes replyPulse {
            0% { transform: scale(1); }
            50% { transform: scale(1.05); box-shadow: 0 0 20px rgba(0, 184, 148, 0.4); }
            100% { transform: scale(1); }
        }
        
        /* Long press visual feedback */
        .message.long-pressing {
            transform: scale(0.98);
            box-shadow: 0 0 0 3px rgba(0, 184, 148, 0.3);
            transition: all 0.1s ease;
            animation: pulse-message 1.5s infinite;
        }
        
        @keyframes pulse-message {
            0%, 100% { 
                box-shadow: 0 0 0 3px rgba(0, 184, 148, 0.3); 
            }
            50% { 
                box-shadow: 0 0 0 6px rgba(0, 184, 148, 0.5); 
            }
        }
        
        /* Swipe reply icon indicator */
        .message::after {
            content: '↩️';
            position: absolute;
            right: -40px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 24px;
            opacity: 0;
            transition: opacity 0.2s ease;
            pointer-events: none;
        }
        
        .message.user::after {
            right: auto;
            left: -40px;
        }
        
        .message.showing-reply-icon::after {
            opacity: 0.6;
        }

        .message.highlight {
            position: relative;
            z-index: 5;
        }

        .message.highlight::before {
            content: '';
            position: absolute;
            top: 0; left: 0; right: 0; bottom: 0;
            border-radius: inherit;
            background-color: rgba(255, 255, 255, 0.1);
            box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.3), 0 0 25px rgba(0, 184, 148, 0.6);
            animation: highlight-overlay 2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
            pointer-events: none;
            z-index: 10;
        }

        @keyframes highlight-overlay {
            0% { opacity: 0; }
            10% { opacity: 1; }
            100% { opacity: 0; }
        }
        
        @keyframes slideUp {
            from {
                opacity: 0;
                transform: translateY(10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }