/* Общие стили */
*, *::before, *::after {
    box-sizing: border-box;      /* Глобально: padding и border не увеличивают размеры */
}

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    min-height: 100vh;
    min-height: -webkit-fill-available; /* iOS Safari fix */
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    overflow: hidden; /* Запрещаем скролл за пределы */
    color: #5F6368;
    /* Desktop/Tablet: тёмный фон за "телефоном" */
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.phone-frame {
    /* Desktop/Tablet: фиксированный размер телефона */
    width: 375px;                  /* Ширина iPhone-подобная */
    height: 740px;                 /* Высота телефона */
    max-width: 375px;
    max-height: 740px;
    
    /* Визуальные стили рамки устройства */
    border: 8px solid #1a1a1a;     /* Чёрная рамка */
    border-radius: 44px;           /* Скруглённые углы под смартфон */
    
    /* Тень для эффекта объёма */
    box-shadow: 
        0 0 0 2px #333,            /* Тонкая внутренняя обводка */
        0 20px 60px rgba(0,0,0,0.4), /* Глубокая тень */
        0 0 40px rgba(93, 214, 245, 0.1); /* Лёгкое свечение */
    
    /* Внутренний отступ и расчёт размеров */
    padding: 10px;                 /* Внутренний отступ */
    box-sizing: border-box;
    
    /* Цвет фона устройства */
    background-color: #fff;
    
    /* Настройка сетки */
    display: grid;
    grid-template-columns: 1fr;
    justify-items: stretch;
    
    /* Строки сетки */
    grid-template-rows: 
        auto                      /* Баннер */
        auto                      /* Горизонтальная линия */
        auto                      /* Имя собеседника */
        auto                      /* Описание */
        auto                      /* Кнопка вызова */
        1fr                       /* Нижний блок */
        auto;                     /* Подвал */
    
    gap: 2px;
    position: relative;
    overflow: hidden;
}



/* Общий контейнер для всех элементов */
.container {
/*
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
*/
}



/* Контейнер 1: Генеральный хедер */
.header-general {
    width: 94%;                  /* Ширина 94% */
    height: 50px;               /* Высота  */
    background-color: #fbfbfb;  /* Цвет #FBFBFB */
    display: flex;              /* Flexbox для расположения элементов */
    align-items: center;        /* Вертикальное центрирование */
    justify-content: space-between; /* Распределение по сторонам */
    margin: 0 auto;             /* Центрирование в родителе */
    margin-top: 10px;           /* Отступ сверху */
    margin-bottom: 10px;        /* Отступ снизу */
    border-radius: 12px;        /* Скругленные углы */
    box-sizing: border-box;
    padding: 0 10px;            /* Внутренние отступы */
}

/* Левая секция с логотипом */
.header-logo-section {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Логотип в хедере */
.header-logo {
    width: 49px;
    height: 49px;
    border-radius: 8px;
    border: none;
        width: 34px; /* увеличен размер динамика */
        height: 34px;
        /* Сдвиг вправо: подберите значение при визуальной проверке */
        transform: translateX(6px);
    box-shadow: none;
}

/* Центральный пустой div */
.header-center {
    flex: 1;                    /* Занимает оставшееся место */
}

/* Правая секция с иконкой пользователя */
.header-user-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #F3F3F3;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-decoration: none;
}

.header-user-icon:hover {
    background-color: #E8E8E8;
}

.header-user-icon svg {
    width: 24px;
    height: 24px;
}

/* Правая секция с иконками (user + share) */
.header-right-icons {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Кнопка Поделиться */
.header-share-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #F3F3F3;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.header-share-btn:hover {
    background-color: #E8E8E8;
}

.header-share-btn svg {
    width: 22px;
    height: 22px;
}

/* ========================================
   Share Modal
   ======================================== */
.share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.share-modal-overlay.active {
    display: flex;
}

.share-modal {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 340px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: shareModalIn 0.25s ease-out;
}

@keyframes shareModalIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.share-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.share-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.share-modal-close:hover {
    color: #333;
}

.share-modal-body {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 20px;
}

.share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #333;
    font-size: 12px;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.share-option:hover {
    transform: scale(1.05);
}

.share-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-icon svg {
    width: 26px;
    height: 26px;
}

.share-icon-custom {
    color: #fff;
    font-weight: 700;
}

.share-icon-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 14px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.share-icon.whatsapp {
    background: #25D366;
}

.share-icon.telegram {
    background: #0088cc;
}

.share-icon.viber {
    background: #7360f2;
}

.share-icon.messenger {
    background: linear-gradient(180deg, #00B2FF 0%, #006AFF 100%);
}

.share-icon.sms {
    background: #34C759;
}

.share-icon.email {
    background: #EA4335;
}

.share-icon.copy {
    background: #666;
}

/* === Стили для дополнительных соцсетей (раскомментируйте нужные) === */
/* .share-icon.twitter { background: #1DA1F2; } */
/* .share-icon.linkedin { background: #0A66C2; } */
/* .share-icon.vk { background: #4376A6; } */
/* .share-icon.ok { background: #EE8208; } */
/* .share-icon.pinterest { background: #BD081C; } */
/* .share-icon.reddit { background: #FF4500; } */
/* .share-icon.tumblr { background: #35465C; } */
/* .share-icon.line { background: #00B900; } */
/* .share-icon.facebook { background: #1877F2; } */


/* Контейнер 2, 4, 3: Горизонтальная линия с выравниванием */
.top-bar {
    width: 100%;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: space-between;
    align-items: center;
    min-height: 50px;
    padding: 5px 0;
    margin-bottom: 0;
    box-sizing: border-box;
    gap: 8px;
}

.top-bar > * {
    flex-shrink: 0;
    flex-grow: 0;
}

/* Контейнер 3: Телефонный номер */
.phone-number {
    height: 60px;
    font-size: 20px;
    line-height: 60px;
    text-align: center;
    flex-grow: 1;
    text-align: center;
    font-style: italic;
    color: gray;
}

/* Контейнер 4: Переключатель языка */















/* Контейнер 5: Имя собеседника */
.contact-name {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    height: 40px;
    line-height: 70px;
    margin-top: 0; /* Убираем отступ сверху */
    padding-top: 0; /* Убираем внутренний отступ сверху */
}


/* Контейнер 6: Описание собеседника */
.contact-description {
    font-size: 12px;
    color: gray;
    text-align: left;
    padding: 10px;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.2;
/*    width: 60%;*/
}

/* Контейнер 7: Кнопка вызова */
.call-button {
    display: flex;
    flex-direction: column; /* Элементы располагаются вертикально */
    justify-content: center;
    align-items: center;
    margin-bottom: 0;
}

.call-button button {
    width: 60%;
    height: 60px;
    font-size: 16px;
    font-weight: 500;
    background-color: #1F2937;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    transition: all 0.2s ease;
}

.call-button button:hover {
    background-color: #111827;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
}

/* Контейнер 8: Нижний блок */
.extra-info {
    width: 50%; /* Та же ширина, что и у кнопки ВЫЗОВ */
    height: auto;
    border: 0px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto; /* Центрирование */
    margin-top: 8px; /* Отступ от кнопки */
    font-size: 13px;
    color: #80868B;
}


/* Контейнер 9: Подвал */
/* Основной контейнер футера */
.footer {
    text-align: center;
    height: 360px; 
    display: flex;
    flex-direction: column;
    position: relative;  /* Для абсолютного позиционирования индикатора */
    width: 94%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 0;
    position: absolute;
    bottom: -230px;
    background-color: #FFFFFF;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1), 0 -4px 12px rgba(0, 0, 0, 0.08);
    transition: bottom 0.3s ease;
    padding: 12px;
    box-sizing: border-box;
    border-top: 1px solid #DADCE0;
}

/* Верхняя полоска (неактивная) - draggable для подъёма футера */
.inactive-bar {
    width: 90%;
    height: 8px;
    background-color: #DADCE0;
    border-radius: 4px;
    margin: 0 auto 20px;
    cursor: grab;
    position: relative;
    z-index: 100;
    /* Увеличиваем кликабельную область через псевдоэлемент */
}

.inactive-bar::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    bottom: -10px;
}

.inactive-bar:active {
    cursor: grabbing;
}

/* Блок с кнопкой вызова и микрофоном */
.button-container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;  /* Равномерное распределение: края прижаты, центр посередине */
    align-items: center;
    margin-bottom: 20px;
    min-height: 70px;
    padding: 0 8%;                   /* Отступы от краев footer */
}

/* Левый блок: индикатор речи бота — стиль как у микрофона */
.side-box-left {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: #9CA3AF; /* Тот же серый что и micIcon.inactive */
    border: none;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Тонкое радужное кольцо (конусный градиент) вокруг круга, соответствует цветам логотипа */
.side-box-left::before {
    /* Отключено: убираем радужные дуги сверху/снизу */
    display: none;
}

/* Ensure inner content (icon, meter) sits above the ring */
.side-box-left > .voice-indicator { position: relative; z-index: 2; }

.voice-indicator {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.voice-indicator.active .voice-idle {
    opacity: 0;
    transform: scale(0.85);
}

.voice-indicator.active .voice-wave {
    opacity: 1;
    transform: scale(1);
}

/* Сделать фон круга белым, когда индикатор активен (бот говорит) */
.voice-indicator.active {
    background: #ffffff;
    border-radius: 50%;
    transition: background 0.25s ease;
}

.voice-idle {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white; /* Белая иконка на сером фоне, как микрофон */
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.speaker-icon {
    width: 28px;
    height: 28px;
    display: block;
}

.speaker-slash {
    /* не используется, слэш задан inline */
}

/* Mic SVG styling */
.mic-svg {
    width: 28px;
    height: 28px;
    display: block;
    color: white;
}

/* Active mic: пульсация сохраняется через родительский #micIcon */
#micIcon.inactive .mic-svg { color: white; }
#micIcon.active .mic-svg { color: white; }

.voice-wave {
    position: absolute;
    /* inset: 8px; Убираем, чтобы использовать всё пространство 55px блока (минус паддинг родителя) */
    width: 100%;
    height: 100%;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

/* Круговой бар-метр */

.circle-meter {
    position: relative;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
}

/* Параметры метра: --bar-w (ширина палочки), --radius (радиус от центра) */
.circle-meter .circle-bar {
    --s: 0.12; /* scaleY */
    --rot: 0deg; /* rotation */
    position: absolute;
    
    /* Центрирование: размещаем в центре контейнера */
    left: 50%;
    top: 50%;
    width: var(--bar-w, 2px);
    height: var(--bar-h, 14px);
    
    /* Сдвиг на половину ширины влево для точного центра */
    margin-left: calc(var(--bar-w, 2px) / -2);
    /* Сдвиг вверх на половину высоты, чтобы центр вращения был по центру палочки (перед сдвигом) */
    margin-top: calc(var(--bar-h, 14px) / -2);

    border-radius: 2px;
    
    /* Логика трансформации: 
       1. rotate: поворачиваем на угол
       2. translate Y: сдвигаем "вверх" от центра (отдаляем от центра круга)
       3. scaleY: масштабируем
    */
    transform: rotate(var(--rot)) translateY(calc(-1 * var(--radius, 16px))) scaleY(var(--s));
    
    transform-origin: center center; /* Вращаем вокруг собственного центра, остальное делает translate */
    
    transition: transform 200ms cubic-bezier(.2,.8,.2,1);
    will-change: transform;
    opacity: 0.9;
}

/* При активном состоянии делаем цвета ярче */
.voice-indicator.active .circle-bar { box-shadow: 0 2px 6px rgba(241, 245, 255, 0.12) inset; }

.voice-indicator.active .voice-idle { opacity: 0; transform: scale(0.85); }
.voice-indicator.active .voice-wave { opacity: 1; transform: scale(1); }

/* Небольшое затемнение в idle состоянии */
.voice-indicator .circle-bar { background: linear-gradient(180deg, #cfe9ff, #aacfff); }
.voice-indicator.active .circle-bar { background: linear-gradient(180deg, #6fb3ff, #2f6efb); }
.wave-bar:nth-child(12)  { height: 28px; background: #34d399; animation-delay: 0.36s; }
.wave-bar:nth-child(13)  { height: 32px; background: #34d399; animation-delay: 0.44s; }
.wave-bar:nth-child(14)  { height: 28px; background: #34d399; animation-delay: 0.36s; }
.wave-bar:nth-child(15)  { height: 8px;  background: #2f6efb; animation-delay: 0s; }
.wave-bar:nth-child(16)  { height: 12px; background: #2f6efb; animation-delay: 0.12s; }
.wave-bar:nth-child(17)  { height: 16px; background: #24c6f7; animation-delay: 0.2s; }
.wave-bar:nth-child(18)  { height: 22px; background: #24c6f7; animation-delay: 0.28s; }
.wave-bar:nth-child(19)  { height: 28px; background: #34d399; animation-delay: 0.36s; }
.wave-bar:nth-child(20)  { height: 32px; background: #34d399; animation-delay: 0.44s; }
.wave-bar:nth-child(21)  { height: 28px; background: #34d399; animation-delay: 0.36s; }
.wave-bar:nth-child(22)  { height: 8px;  background: #2f6efb; animation-delay: 0s; }
.wave-bar:nth-child(23)  { height: 12px; background: #2f6efb; animation-delay: 0.12s; }
.wave-bar:nth-child(24)  { height: 16px; background: #24c6f7; animation-delay: 0.2s; }
.wave-bar:nth-child(25)  { height: 22px; background: #24c6f7; animation-delay: 0.28s; }
.wave-bar:nth-child(26)  { height: 28px; background: #34d399; animation-delay: 0.36s; }
.wave-bar:nth-child(27)  { height: 32px; background: #34d399; animation-delay: 0.44s; }
.wave-bar:nth-child(28)  { height: 28px; background: #34d399; animation-delay: 0.36s; }

@keyframes wavePulse {
    0%, 100% { transform: scaleY(0.65); opacity: 0.5; }
    50% { transform: scaleY(1.2); opacity: 1; }
}

/* Квадратные кнопки */
.square-button {
    width: 60px;
    height: 60px;
    border-radius: 20px;
    background-color: #c3ffc3;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    font-weight: bold;
    /* border: 1px solid black; */
    cursor: pointer;
    color: gray;
}

.round-button {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: #ff8e8e; /*red;*/
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.round-button svg {
    width: 32px;
    height: 32px;
    transform: rotate(135deg); /* Перевёрнутая трубка */
}

/* === КНОПКА ВЫЗОВА С ТРЕМЯ СОСТОЯНИЯМИ === */
.call-action-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: background-color 0.3s, transform 0.2s, box-shadow 0.3s;
}

.call-action-btn:hover {
    transform: scale(1.05);
}

.call-action-btn:active {
    transform: scale(0.95);
}

.call-action-btn svg {
    width: 32px;
    height: 32px;
    display: none;
}

/* Картинка для вращающейся анимации состояния "ожидание вызова" */
.calling-spinner-img {
    width: 49px;
    height: 49px;
    display: none;
    animation: spin 3s linear infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

/* Состояние 1: Готов к звонку (голубая) */
.call-action-btn.state-ready {
    background: #1A73E8;
    box-shadow: 0 2px 6px rgba(26, 115, 232, 0.3), 0 1px 3px rgba(26, 115, 232, 0.2);
}

.call-action-btn.state-ready .icon-call {
    display: block;
}

.call-action-btn.state-ready:hover {
    background: #0D47A1;
    box-shadow: 0 3px 8px rgba(26, 115, 232, 0.4), 0 2px 4px rgba(26, 115, 232, 0.3);
}

/* Состояние 2: Идёт вызов (светлый фон с тенью) */
.call-action-btn.state-calling {
    background: #FFFFFF;
    cursor: pointer;
}

.call-action-btn.state-calling .icon-waiting {
    display: block;
}

.call-action-btn.state-calling .calling-spinner-img {
    display: block;
}

/* Состояние 3: Разговор (красная) */
.call-action-btn.state-active {
    background: #E85D75;
    box-shadow: 0 2px 6px rgba(232, 93, 117, 0.3), 0 1px 3px rgba(232, 93, 117, 0.2);
}

.call-action-btn.state-active:hover {
    background: #DC4C62;
}

.call-action-btn.state-active .icon-hangup {
    display: block;
    transform: rotate(135deg); /* Перевёрнутая трубка = отбой */
}








/* Контейнер с активными ссылками */
.link-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start; 
    gap: 10px; 
    padding: 12px 16px;
    width: 100%;
    box-sizing: border-box;
    flex-wrap: nowrap;
    color: #80868B;
    font-size: 13px;
}

/* Левый блок с текстом: текст выровнен по левому краю */
.fut_l {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Выровнять текст по левому краю */
    gap: 6px;
    font-size: 11px;
    color: gray;
    flex: 1;
    min-width: 0;
    text-align: left;
}

/* Правый блок с текстом: текст выровнен по правому краю */
.fut_p {
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* Выровнять текст по правому краю */
    gap: 6px;
    font-size: 11px;
    color: gray;
    flex: 1;
    min-width: 0;
    text-align: right;
}

/* Вертикальная полоса */
.fut_line {
    width: 2px;
    height: 100%;
    background-color: gray;
    flex-shrink: 0;
}

/* Стили для ссылок */
.link-button {
    text-decoration: underline;
    color: gray;
    font-weight: bold;
}

/* Стили для баланса */
.balance {
    font-weight: bold;
    color: #2a7d2a;
    font-size: 13px;
}


.milaf {
    text-decoration: underline;
    color: black;
    font-weight: bold;
    font-size: 10px;
    color: gray;
}





/* Нижний блок с пятью иконками */
.bottom-icons {
    display: flex;
    justify-content: center; /* Центрирование иконок */
    gap: 15px; /* Равномерные отступы между иконками */
    padding-top: 10px;
    border-top: 2px solid black;
    margin-top: 10px;
    flex-wrap: nowrap;
    width: 100%;
    box-sizing: border-box;
}

.icon-box {
    width: 50px;
    height: 50px;
    border: 1px solid black;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-sizing: border-box;
    flex: 1 1 40px;   /* тянется, но не меньше 40px */
    max-width: 60px;  /* не растягивается слишком широко */
    min-width: 36px;
    aspect-ratio: 1;  /* всегда квадрат */
}

.icon-box-img {
    width: calc(100% - 4px);
    height: calc(100% - 4px);
    object-fit: contain;
    display: block;
    border-radius: 10px;
    padding: 0 2px;
}

/* Активный класс: футер полностью выехал */
.footer.active {
    bottom: 0;
}

/* Добавим стиль, когда футер возвращается */
.footer.returning {
    transition: bottom 0.5s ease-in; /* Плавный возврат */
}







.green {
    background-color: #28a745 !important;
    color: white !important;
}

.yellow {
    background-color: #ffc107 !important;
    color: black !important;
}

.red {
    background-color: #dc3545 !important;
    color: white !important;
}




#micContainer {
    /* Правый элемент в flex space-between */
    width: 55px;
    height: 55px;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
}

#micContainer.fade-out {
    opacity: 0.3;
}

#micIcon {
    width: 55px;              /* Немного меньше для вписывания */
    height: 55px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

#micIcon.inactive {
    background-color: #9CA3AF;
}

#micIcon.active {
    background-color: #1A73E8;
    animation: pulse-mic 1.5s infinite;
}

#micIcon.disabled {
    background-color: #9CA3AF;
}

/* Анимация пульсации для активного микрофона */
@keyframes pulse-mic {
    0% {
        box-shadow: 0 0 0 0 rgba(26, 115, 232, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(26, 115, 232, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(26, 115, 232, 0);
    }
}

/* Общие стили для круглых кнопок - GOOGLE STYLE */
.button-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #DADCE0;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s ease;
    background: #FFFFFF;
    box-shadow: none;
    flex-shrink: 0;
}

.button-circle:hover {
    background: #F1F3F4;
}

.button-circle:active {
    background: #E8EAED;
}

/* Кнопка Домой - GOOGLE STYLE */
.back-button {
    background: #FFFFFF;
    border: 1px solid #DADCE0;
}

.back-button svg {
    width: 18px;
    height: 18px;
    fill: #5F6368;
}

.back-button:hover {
    background: #F1F3F4;
}

/* === ИНФО О БОТЕ (ХЕДЕР) === */
.bot-info-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    max-width: 60%;
    position: relative; /* Для позиционирования */
    background: transparent;
    z-index: 50;
    padding: 4px;
    border-radius: 8px;
}

/* Состояние при клике: расширяется и перекрывает */
.bot-info-block.expanded {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 90%;
    background: #ffffff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    border: 1px solid #e0e0e0;
    z-index: 100;
}

.bot-public-name {
    font-size: 15px; 
    font-weight: 500;
    line-height: 1.4;
    color: #202124; /* Google тёмный текст */
    
    /* Ограничение в 2 строки с многоточием */
    display: -webkit-box;
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bot-info-block.expanded .bot-public-name {
    -webkit-line-clamp: unset; /* Показываем полностью при раскрытии */
    font-size: 18px;
    margin-bottom: 5px;
}

.bot-internal-name {
    font-size: 11px;
    font-style: italic;
    color: #888;
    margin-top: 2px;
    text-align: right;
    align-self: flex-end;
    
    /* Ограничение в 1 строку */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.bot-info-block.expanded .bot-internal-name {
    white-space: normal;
    font-size: 12px;
}

/* === ИНФО О КЛИЕНТЕ (ХЕДЕР) - СТАРЫЙ КОД УДАЛИТЬ ПОТОМ === */
.user-info-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 8px;
    min-width: 0;
}

.user-info-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.user-info-id {
    font-size: 9px;
    color: #999;
    font-weight: 400;
    align-self: flex-end;
    margin-top: 1px;
}

/* === КНОПКА ЯЗЫКА - GOOGLE STYLE === */
.button-circle.language-switch {
    position: relative;
    background: #FFFFFF;
    border: 1px solid #DADCE0;
    font-size: 11px;
    font-weight: 500;
    color: #5F6368;
    padding: 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.button-circle.language-switch:hover {
    background: #F1F3F4;
}

.lang-code {
    font-size: 11px;
    font-weight: 500;
    color: #5F6368;
    text-transform: uppercase;
}

/* === ВЫПАДАЮЩЕЕ МЕНЮ ЯЗЫКОВ - PREMIUM === */
#language-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    max-height: 300px;
    overflow-y: auto;
    background: white;
    border: none;
    border-radius: 12px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    display: none;
    padding: 6px 0;
}

#language-dropdown.active {
    display: block;
    animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Элемент языка в списке */
.language-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    text-decoration: none;
    color: #333;
    transition: background 0.15s ease;
    cursor: pointer;
}

.language-item:hover {
    background: linear-gradient(90deg, #f0f9ff, #e8f4fd);
}

.language-item .lang-code-item {
    font-size: 11px;
    font-weight: 700;
    color: #555;
    min-width: 45px;
    flex-shrink: 0;
}

.language-item .lang-name-item {
    font-size: 12px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* === КНОПКА ЯЗЫКА ЗАБЛОКИРОВАНА (во время звонка) === */
.button-circle.language-switch.disabled {
    opacity: 0.4;
    pointer-events: none;
    cursor: not-allowed;
}









.container_m_kontakt {
    width: 100%;                 /* Занимает всю ширину родителя */
    max-width: 100%;             /* Не выходит за границы */
    overflow: hidden;            /* Отключаем общий скролл */
    margin: 0;                   /* Убираем margin - пусть grid управляет */
    padding: 10px;
    border: 1px solid #DADCE0;
    border-radius: 8px;
    background-color: #FFFFFF;
    display: flex;
    flex-direction: column;
    height: 46vh;                /* Высота в процентах от родителя */
    overflow-y: auto;            /* Скролл внутри */
    box-sizing: border-box;      /* padding включён в ширину */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.16);
}



/* Основной контейнер */
.container_kontakt {
    margin: 0 0 8px 0;
    padding: 12px 14px;
    border: 1px solid #DADCE0;
    border-radius: 8px;
    background-color: #FFFFFF;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.public-name-item {
    display: flex;
    justify-content: space-between;
}
.public-name-item > a {
    text-decoration: none;
}
.public-name-item-title {
    font-size: 18px;
    font-weight: bold;
}

/* Контейнер для описания контактов */
.contact-descr {
    /* overflow-y: auto;  Вертикальный скролл */
    overflow-wrap: break-word; /* Перенос длинных слов */
}

/* Название контактов */
.name_contact{
    font-size: 18px;
    font-weight: bold;
    background-color: #e9e9e9;
    padding: 8px;
    border-radius: 5px;
}

/* Стили для ссылок */
.link_name {
    color: #1A73E8;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid #1A73E8;
    transition: all 0.2s ease;
}

.link_name:hover {
    color: #0D47A1;
    border-bottom-color: #0D47A1;
    text-decoration: underline;
}



/* Контейнер со списком контактов */
.contacts-wrapper {
    height: 60%; /* Высота в процентах от родителя */
    overflow-y: auto; /* Скролл внутри */
    padding: 8px;
    border: 1px solid #DADCE0;
    background: #FFFFFF;
    border-radius: 8px;
}









/* ═══════════════════════════════════════════════════════════════
   МОБИЛЬНЫЕ УСТРОЙСТВА: телефон на весь экран, без "рамки"
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
    body, html {
        /* На мобильных — белый фон, телефон на весь экран */
        background: #FFFFFF;
    }

    .bottom-icons {
        gap: 8px;
        padding-left: 4px;
        padding-right: 4px;
    }

    .icon-box {
        min-width: 32px;
        max-width: 52px;
    }
    
    .phone-frame {
        width: 100vw;
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height — учитывает адресную строку */
        max-width: 100vw;
        max-height: 100dvh;
        margin: 0;
        padding: 8px;
        border: none;              /* Без рамки на мобильных */
        border-radius: 0;          /* Без скруглений */
        box-shadow: none;          /* Без теней */
        box-sizing: border-box;
        position: relative;
        overflow: hidden;
        
        /* Адаптивная сетка для мобильных */
        grid-template-rows: 
            auto    /* Баннер */
            auto    /* Горизонтальная линия */
            auto    /* Имя собеседника */
            auto    /* Описание */
            auto    /* Кнопка вызова */
            1fr     /* Нижний блок */
            auto;   /* Подвал */
    }
    
    .banner {
        height: auto;
        min-height: 60px;
        line-height: normal;
        padding-top: 10px;
        padding-bottom: 10px;
    }
    
    .top-bar {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        height: auto;
        min-height: 50px;
        padding-top: 0;
        margin-top: 5px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   ПЛАНШЕТЫ: телефон-рамка, чуть больше
   ═══════════════════════════════════════════════════════════════ */
@media (min-width: 481px) and (max-width: 1024px) {
    .phone-frame {
        width: 390px;
        height: min(780px, calc(100vh - 40px));
        max-width: 390px;
        max-height: 780px;
    }
}

/* === NEW MAIN WRAPPER === */
.main-interface-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-top: 5px; /* небольшой отступ от top-bar */
    position: relative;
    /* Убираем высоту, пусть контент сам регулирует, но ограничиваем максимумом */
    height: auto; 
    flex-grow: 1; /* чтобы занимал свободное место, если родитель позволяет */
}

/* Переопределяем стили для элементов внутри враппера */

/* 1. ИНФО (contact-description) */
.contact-description {
    /* Сброс старых стилей позиционирования если были conflicting */
    width: 90%;
    margin-bottom: 20px; /* Отступ до статус зоны */
    text-align: left;
    align-self: center; /* Центрируем контейнер */
    margin-left: auto; /* Добавляем auto для центрирования */
    margin-right: auto; /* Добавляем auto для центрирования */
    display: flex;
    flex-direction: column;
    gap: 10px;
    /* transition для плавного скрытия если нужно, но в JS используется display:none */
}

/* Логотип бота */
.contact-description-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.bot-logo-img {
    display: block;
    max-width: 100%;
    height: auto;
    max-height: 50px;
    width: auto;
}

/* Описание бота */
.contact-description-text {
    font-size: 14px;
    color: #3C4043;
    line-height: 1.6;
    white-space: normal;
    word-wrap: break-word;
    border: 1px solid #DADCE0;
    background-color: #FFFFFF;
    padding: 14px 16px;
    /* margin: 0; */
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.16);
}

/* 2. AREA (status-area) */
.status-area {
    /* Теперь это просто блок в потоке main-interface-wrapper */
    position: relative; 
    width: 66%;
    max-width: 320px;
    height: 80px; 
    min-height: 80px;
    margin: 0 auto 20px auto; /* 20px отступ снизу до окна "Вы сказали" */
    
    /* display: flex не нужен, так как внутри absolutes, но для порядка */
}

/* 3. USER MESSAGE (user-message-container) */
.user-message-container {
    /* Теперь это не absolute относительно всего экрана, а относительно потока или враппера */
    position: relative !important; /* Важно перебить старый absolute */
    top: auto !important;
    left: auto !important;
    transform: none !important;
    
    width: 90%;
    max-width: 350px;
    margin: 0 auto; /* Центрирование */
    
    /* Остальные стили (background, shadow) остаются */
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border: 1px solid rgba(200,200,200,0.3);
    backdrop-filter: blur(8px);
    
    display: none; /* JS сам включит flex */
    flex-direction: column;
    animation: slideUpFlow 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Веб-сайт бота (внутри текста описания) */
.bot-website-container {
    width: 100%;
    display: none;
    justify-content: flex-start;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #DADCE0;
}

.bot-website-link {
    font-size: 13px;
    color: #1A73E8;
    text-decoration: none;
    transition: all 0.2s ease;
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-bottom: 1px solid #1A73E8;
}

.bot-website-link::after {
    content: "↗";
    font-size: 10px;
    font-weight: normal;
    opacity: 0.8;
}

.bot-website-link:hover {
    color: #0D47A1;
    border-bottom-color: #0D47A1;
    background-color: transparent;
}

/* ... old code ... */
@keyframes slideUpFlow {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === BLOCKED STATE FOR TOP BAR === */
/* Класс, который будет добавляться к top-bar во время звонка */
.top-bar.blocked {
    opacity: 0.5; /* Полупрозрачность */
    pointer-events: none; /* Отключаем клики */
    filter: grayscale(100%); /* Ч/б для наглядности (опционально) */
    transition: all 0.3s ease;
}

/* #micContainer — НЕ абсолютное позиционирование! Он живёт в flex-потоке .button-container */

/* --- User Message Container --- */
/* (Старые стили удаляются/перезаписываются блоком выше, но удалим дубликат для чистоты) */
/* .user-message-container {...} удален, т.к. переопределен в .main-interface-wrapper секции */

.user-message-label {
    background: #FFFFFF;
    color: #80868B;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    text-align: left;
    border-bottom: 1px solid #DADCE0;
}

.user-message-textarea {
    width: 100%;
    padding: 16px;
    font-size: 14px;
    color: #202124;
    line-height: 1.6;
    font-weight: 400;
    border: none;
    outline: none;
    resize: none;
    background: transparent;
    font-family: inherit;
    text-align: left; /* Текст слева */
    min-height: 60px; 
    max-height: 250px;
    overflow-y: auto;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Dialing Progress Bar - накладывается поверх inactive-bar */
.dialing-progress-container {
    position: absolute;
    top: 12px;  /* Совпадает с padding footer для точного наложения на inactive-bar */
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    height: 8px;  /* Такой же размер как inactive-bar */
    background-color: transparent;  /* Прозрачный фон - серая полоска видна под ним */
    border: none;
    border-radius: 4px;
    overflow: hidden;
    z-index: 150;
    cursor: grab;
}
.dialing-progress-container::before {
    /* Увеличенная область для захвата drag */
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    bottom: -10px;
}
.dialing-progress-container:active {
    cursor: grabbing;
}
.dialing-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #1A73E8 0%, #1A73E8 100%);
    border-radius: 4px;
}

/* ========================================
   Translation Loader Overlay
   ======================================== */
.translation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.translation-overlay.active {
    display: flex;
}

.translation-loader {
    text-align: center;
    color: white;
}

.translation-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #1A73E8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.translation-loader h3 {
    margin: 0 0 10px;
    font-size: 18px;
}

.translation-loader p {
    margin: 5px 0;
    font-size: 14px;
    opacity: 0.8;
}

.transl-progress-wrap {
    width: 220px;
    height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
    margin: 14px auto 6px;
    overflow: hidden;
}

.transl-progress-bar {
    height: 100%;
    width: 0%;
    background: #1A73E8;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.transl-progress-text {
    font-size: 12px;
    opacity: 0.55;
    margin-top: 4px;
    letter-spacing: 0.3px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   🎛️ SETTINGS PAGES (settings_klients_mf.php, settings_klients_admin.php)
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Phone-frame для страниц настроек — переопределяем grid на flex */
.phone-frame.settings-page {
    display: flex;
    flex-direction: column;
}

/* Контейнеры настроек */
.settings-container {
    padding: 15px;
    max-width: 600px;
    margin: 0 auto;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

.admin-settings-container {
    padding: 15px;
    max-width: 700px;
    margin: 0 auto;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

/* Бейдж админа */
.admin-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 15px;
}

/* Секции настроек */
.settings-section {
    background: #1a1a2e;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    border: 1px solid #333;
}

.settings-section h3 {
    color: #00ff88;
    margin: 0 0 15px 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-section h3 .badge {
    font-size: 10px;
    background: #333;
    padding: 2px 8px;
    border-radius: 10px;
    color: #aaa;
}

.settings-section.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.settings-section.disabled::after {
    content: '🔒 Недоступно';
    display: block;
    color: #ff6b6b;
    font-size: 12px;
    margin-top: 10px;
}

/* Селекторы настроек */
.settings-select {
    width: 100%;
    padding: 12px;
    background: #0f0f1a;
    border: 1px solid #444;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

.settings-select:focus {
    outline: none;
    border-color: #00ff88;
}

.settings-select option {
    background: #1a1a2e;
    color: #fff;
}

/* Информация о модели */
.model-info {
    margin-top: 10px;
    padding: 10px;
    background: #0f0f1a;
    border-radius: 8px;
    font-size: 12px;
    color: #aaa;
}

.model-info .price {
    color: #ffcc00;
}

.model-info .feature {
    display: inline-block;
    background: #333;
    padding: 2px 6px;
    border-radius: 4px;
    margin: 2px;
    font-size: 10px;
}

.model-info .feature.yes {
    background: #00ff8833;
    color: #00ff88;
}

.model-info .feature.no {
    background: #ff6b6b33;
    color: #ff6b6b;
}

/* Переключатели toggle */
.toggle-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #333;
}

.toggle-row:last-child {
    border-bottom: none;
}

.toggle-row .label {
    color: #fff;
    font-size: 14px;
}

.toggle-row .hint {
    color: #666;
    font-size: 11px;
    margin-top: 2px;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    transition: .3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #00ff88;
}

input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* Секция прав клиентов (админ) */
.permissions-section {
    background: #1a1a2e;
    border: 1px solid #ff6b6b44;
}

.permissions-section h3 {
    color: #ff6b6b;
}

/* Кнопка сохранения */
.save-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #00ff88, #00cc6a);
    border: none;
    border-radius: 8px;
    color: #000;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.3);
}

.save-btn:disabled {
    background: #444;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Уведомления */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: #fff;
    font-weight: bold;
    z-index: 1000;
    animation: notifSlideIn 0.3s ease;
}

.notification.success {
    background: #00ff88;
    color: #000;
}

.notification.error {
    background: #ff6b6b;
}

@keyframes notifSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Ссылка "назад" */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #00ff88;
    text-decoration: none;
    margin-bottom: 20px;
    font-size: 14px;
}

.back-link:hover {
    text-decoration: underline;
}
