/* ===== СТИЛИ КОНТАКТА С ПЕРВЫМ СООБЩЕНИЕМ ===== */

.contact-first-message {
    /* === ИЗМЕНЕНО: Убираем border, делаем относительным для псевдоэлемента === */
    border: none !important;
    border-radius: 12px;
    margin: 8px 0;
    background: linear-gradient(135deg, rgba(0, 255, 0, 0.05) 0%, rgba(0, 255, 128, 0.08) 100%);
    animation: pulse-first-message 2.5s infinite ease-in-out;
    position: relative; /* Важно! */
    order: -9999 !important;
    z-index: 100;
    isolation: isolate; /* Создаём новый stacking context */
}

/* Псевдоэлемент для градиентного бордера контейнера */
.contact-first-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    padding: 1px;
    background: linear-gradient(135deg, #D612D3, #00A2F8); /* Фиолетово-бирюзовый */
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: -1;
}

@keyframes pulse-first-message {
    0% {
        box-shadow: 0 0 5px rgba(214, 18, 211, 0.3); /* Фиолетовый */
    }
    50% {
        box-shadow: 0 0 15px rgba(0, 162, 248, 0.5); /* Бирюзовый */
    }
    100% {
        box-shadow: 0 0 5px rgba(214, 18, 211, 0.3); /* Фиолетовый */
    }
}

.contact-first-message::after {
    content: "NEW";
    position: absolute;
    top: -10px;
    right: 10px;
    /* === ИЗМЕНЕНО: Просто бирюзовый цвет === */
    background: #00A2F8; /* Бирюзовый цвет */
    color: #000;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    z-index: 101;
}

/* ===== МОДАЛЬНОЕ ОКНО FIRST-MESSAGE ===== */

.first-message-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    backdrop-filter: blur(3px);
}

.first-message-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    background: linear-gradient(180deg, rgba(20, 20, 30, 0.55), rgba(10, 10, 15, 0.65));
    backdrop-filter: blur(14px) saturate(120%);
    -webkit-backdrop-filter: blur(14px) saturate(120%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04) inset, 0 12px 40px rgba(0, 0, 0, 0.6);

    padding: 30px;
    width: 90%;
    max-width: 400px;
    z-index: 10000;
    animation: modal-appear 0.3s ease-out;
}

@keyframes modal-appear {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* === ИСПРАВЛЕНО: Заголовок просто бирюзовый === */
.first-message-modal h3 {
    color: #40E0D0 !important; /* Бирюзовый цвет */
    letter-spacing: 0.04em;
    text-transform: uppercase;
    
    margin: 0 0 20px 0;
    text-align: center;
    font-size: 1.4em;
}

.first-message-modal .message-preview {
    position: relative;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: rgba(220, 225, 235, 0.9);
    
    padding: 15px;
    margin: 15px 0;
    border-radius: 8px;
    font-style: italic;
    isolation: isolate; /* Новый stacking context */
}

/* === ИСПРАВЛЕНО: Градиент бордера для таблички === */
.first-message-modal .message-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 8px;
    padding: 1px;
    background: linear-gradient(135deg, #D612D3, #00A2F8); /* Фиолетово-бирюзовый */
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: -1;
}

.first-message-modal .choice-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 25px;
}

/* === ОСНОВНОЙ СТИЛЬ КНОПКИ === */
.first-message-choice-btn {
    position: relative;
    padding: 14px 20px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: rgba(230, 235, 245, 0.9);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1em;
    text-align: center;
    z-index: 1;
    isolation: isolate; /* Новый stacking context */
}

/* === ПСЕВДОЭЛЕМЕНТ ДЛЯ ГРАДИЕНТНОГО БОРДЕРА === */
.first-message-choice-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 10px;
    padding: 1px;
    background: transparent;
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: -1;
}

/* === КНОПКИ С НОВЫМИ ГРАДИЕНТАМИ === */

/* Accept - ЗЕЛЁНЫЙ градиент */
.choice-accept::before {
    background: linear-gradient(135deg, #00cc00, #00ff88); /* Зелёный градиент */
}

/* Ignore - СИНИЙ/ГОЛУБОЙ градиент */
.choice-ignore::before {
    background: linear-gradient(135deg, #a13fb1, #00aaff); /* Сине-голубой градиент */
}

.choice-ignore {
    border-color: transparent;
    color: rgba(200, 220, 240, 0.9);
}

/* Block - красный градиент */
.choice-block::before {
    background: linear-gradient(135deg, #C0184A, #B00020);
}

/* === HOVER ЭФФЕКТЫ === */
.first-message-choice-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
}

.choice-block {
    color: rgba(240, 200, 205, 0.9);
}

/* === TIME-STATUS ОПЦИИ === */
.time-status-options {
    display: none;
    margin-top: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(0, 255, 0, 0.2);
}

.time-status-options.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.time-status-option {
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.time-status-option:hover {
    background: rgba(255, 255, 255, 0.05);
}

.time-status-option input[type="radio"] {
    accent-color: #00ff00;
}

@media (max-width: 480px) {
    .first-message-modal {
        width: 95%;
        padding: 20px;
    }

    .first-message-choice-btn {
        padding: 16px 20px;
        font-size: 1.1em;
    }
    
    .first-message-choice-btn::before {
        border-radius: 10px;
    }
    
    .contact-first-message::before {
        border-radius: 12px;
    }
}
