/* ============================================
   MINI CHAT WIDGET - iOS 26 STYLE
   Версия: 4.0
   ============================================ */

:root {
    --ios-bg-page: #0d0d14;
    --ios-bg-header: #1a1a22;
    --ios-bg-input: #1a1a22;
    --ios-bg-message-incoming: #2c2c34;
    --ios-bg-message-outgoing: #2c3e5a;
    --ios-text-primary: #ffffff;
    --ios-text-secondary: #8e8e98;
    --ios-text-message-incoming: #ffffff;
    --ios-text-message-outgoing: #ffffff;
    --ios-border: rgba(255, 255, 255, 0.08);
    --ios-shadow: rgba(0, 0, 0, 0.4);
    --ios-accent: #007aff;
    --ios-danger: #ff3b30;
    --ios-success: #34c759;
    --ios-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --widget-width: 380px;
    --widget-height: 600px;
    --border-radius-lg: 24px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;
}

body.day-theme {
    --ios-bg-page: #f8f9fc;
    --ios-bg-header: #ffffff;
    --ios-bg-input: #ffffff;
    --ios-bg-message-incoming: #e9ecef;
    --ios-bg-message-outgoing: #007aff;
    --ios-text-primary: #1c1c1e;
    --ios-text-secondary: #8e8e93;
    --ios-text-message-incoming: #1c1c1e;
    --ios-text-message-outgoing: #ffffff;
    --ios-border: rgba(0, 0, 0, 0.06);
    --ios-shadow: rgba(0, 0, 0, 0.08);
    --ios-accent: #007aff;
}

/* Кнопка открытия чата */
#mini-chat-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10000;
    background: linear-gradient(135deg, #007aff, #af52de);
    box-shadow: 0 4px 16px var(--ios-shadow);
    transition: all var(--transition-normal);
}

#mini-chat-button i {
    color: white;
    font-size: 24px;
}

/* Виджет - фиксированная структура */
#mini-chat-widget {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: var(--widget-width);
    height: var(--widget-height);
    background: var(--ios-bg-page);
    border-radius: var(--border-radius-lg);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    box-shadow: 0 20px 60px var(--ios-shadow);
    overflow: hidden;
    transform: translateY(100%) scale(0.95);
    opacity: 0;
    transition: all var(--transition-slow);
    border: 1px solid var(--ios-border);
}

#mini-chat-widget.open {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Шапка - ВСЕГДА ВИДИМА, НЕ ПРОКРУЧИВАЕТСЯ */
#mini-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: var(--ios-bg-header);
    height: 56px;
    min-height: 56px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--ios-border);
    position: relative;
    z-index: 10;
}

#mini-chat-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: transparent;
    color: var(--ios-text-secondary);
    flex-shrink: 0;
}

#mini-chat-close:hover {
    background: rgba(128, 128, 128, 0.2);
}

#mini-chat-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    max-width: 140px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-text {
    font-size: 12px;
    font-weight: 500;
    font-family: var(--ios-font);
    color: var(--ios-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#mini-chat-status.status-online .status-dot {
    background: var(--ios-success);
}

#mini-chat-status.status-online .status-text {
    color: var(--ios-success);
}

#mini-chat-status.status-offline .status-dot {
    background: var(--ios-text-secondary);
}

#mini-chat-header-buttons {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

#mini-chat-header-buttons button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    cursor: pointer;
    border: none;
    color: var(--ios-text-secondary);
    font-size: 18px;
}

#mini-chat-header-buttons button:hover {
    background: rgba(128, 128, 128, 0.2);
}

/* Контейнер сообщений - ТОЛЬКО ОН ПРОКРУЧИВАЕТСЯ */
#mini-chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--ios-bg-page);
    min-height: 0;
    /* Пункт 9: Эффект затухания старых сообщений */
    mask-image: linear-gradient(to bottom, transparent 0%, black 20px, black calc(100% - 20px), transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 20px, black calc(100% - 20px), transparent 100%);
}

/* Сообщения - цвета поменяны местами */
.incoming-msg,
.outgoing-msg {
    max-width: 78%;
    padding: 10px 14px;
    font-size: 16px;
    line-height: 1.45;
    word-break: break-word;
    font-family: var(--ios-font);
    border-radius: 20px !important;
}

/* Входящие сообщения (слева) - тёмно-серые в ночной, светло-серые в дневной */
.incoming-msg {
    align-self: flex-start;
    background: var(--ios-bg-message-incoming);
    color: var(--ios-text-message-incoming);
}

/* Исходящие сообщения (справа) - тёмно-синие в ночной, синие в дневной */
.outgoing-msg {
    align-self: flex-end;
    background: var(--ios-bg-message-outgoing);
    color: var(--ios-text-message-outgoing);
}

/* Эмодзи */
.emoji-msg {
    background: transparent !important;
    padding: 4px 0 !important;
}

.emoji-msg .msg-text {
    font-size: 44px !important;
    line-height: 1.2 !important;
    background: transparent !important;
}

.emoji-msg.single-emoji .msg-text {
    font-size: 64px !important;
}

.incoming-msg.emoji-msg,
.outgoing-msg.emoji-msg {
    background: transparent !important;
}

/* Разделитель времени - без фона */
.msg-time-divider {
    text-align: center;
    font-size: 11px;
    font-weight: 500;
    font-family: var(--ios-font);
    color: var(--ios-text-secondary);
    margin: 8px 0;
    padding: 4px 12px;
    background: transparent !important;
    border-radius: 50px;
    align-self: center;
}

/* Ссылки в сообщениях - без фона */
.msg-text a {
    color: var(--ios-accent);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.msg-text a:hover {
    text-decoration: underline;
}

/* Исходящие сообщения - ссылки белые */
.outgoing-msg .msg-text a {
    color: #ffffff;
}

/* Входящие сообщения - ссылки синие */
.incoming-msg .msg-text a {
    color: #007aff;
}

/* Дневная тема */
body.day-theme .outgoing-msg .msg-text a {
    color: #ffffff;
}

body.day-theme .incoming-msg .msg-text a {
    color: #007aff;
}

/* Блок ввода - ФИКСИРОВАННЫЙ ВНИЗУ, ВСЕ ЭЛЕМЕНТЫ В ОДНОЙ СТРОКЕ */
#mini-chat-input-block {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--ios-bg-header);
    border-top: 1px solid var(--ios-border);
    min-height: 56px;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* Кнопка прикрепления */
#mini-chat-add-file {
    width: 40px;
    height: 40px;
    min-width: 40px;
    max-width: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    cursor: pointer;
    border: none;
    color: var(--ios-text-secondary);
    font-size: 20px;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
}

#mini-chat-add-file:hover {
    background: rgba(128, 128, 128, 0.15);
}

/* Обертка поля ввода */
.input-wrapper {
    flex: 1;
    background: var(--ios-bg-input);
    border-radius: 28px;
    padding: 4px 12px;
    border: 0.5px solid var(--ios-border);
    min-width: 0;
    box-sizing: border-box;
}

/* Поле ввода */
#mini-chat-message {
    width: 100%;
    padding: 8px 0;
    border: none;
    background: transparent;
    color: var(--ios-text-primary);
    font-size: 16px;
    font-family: var(--ios-font);
    line-height: 1.4;
    resize: none;
    outline: none;
    overflow-y: auto;
    min-height: 24px;
    max-height: 100px;
    box-sizing: border-box;
}

#mini-chat-message::placeholder {
    color: var(--ios-text-secondary);
}

/* Кнопка отправки */
#mini-chat-send {
    width: 40px;
    height: 40px;
    min-width: 40px;
    max-width: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    cursor: pointer;
    border: none;
    color: var(--ios-text-secondary);
    font-size: 20px;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
}

#mini-chat-send:hover {
    background: rgba(128, 128, 128, 0.15);
}

/* ============================================
   ОВЕРЛЕЙ ЗВОНКА - iOS 26 STYLE (градиент)
   ============================================ */

#call-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(30, 30, 45, 0.95) 0%,
        rgba(20, 20, 35, 0.98) 50%,
        rgba(40, 25, 55, 0.95) 100%);
    z-index: 1000;
    transition: all var(--transition-normal);
    border-radius: var(--border-radius-lg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

#call-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.call-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 60px 20px 40px;
    position: relative;
    box-sizing: border-box;
}

/* Верхняя панель с кнопкой три точки */
.call-top-bar {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 20;
}

/* Кнопка три точки в правом верхнем углу */
.call-more-btn-top {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(128, 128, 128, 0.3);
    backdrop-filter: blur(10px);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.2s ease;
}

.call-more-btn-top:active {
    transform: scale(0.95);
}

/* Аватар (круг с инициалами) */
.call-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

.call-avatar .initials {
    font-size: 48px;
    font-weight: 500;
    font-family: var(--ios-font);
    color: white;
}

/* Имя */
.call-name {
    font-size: 34px;
    font-weight: 600;
    font-family: var(--ios-font);
    color: white;
    margin-bottom: 8px;
    text-align: center;
}

/* Статус */
.call-status {
    font-size: 17px;
    font-family: var(--ios-font);
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
}

/* Таймер звонка */
.call-timer {
    font-size: 48px;
    font-weight: 300;
    font-family: monospace;
    color: white;
    letter-spacing: 2px;
    margin: 10px 0;
}

/* Контейнер для кнопок */
.call-buttons-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 10;
    position: relative;
    margin-top: auto;
    margin-bottom: 40px;
}

/* Ряд кнопок */
.call-buttons-row {
    display: flex;
    justify-content: center;
    gap: 35px;
    width: 100%;
}

/* Кнопка звонка */
.call-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.call-btn-icon {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(128, 128, 128, 0.3);
    backdrop-filter: blur(10px);
}

.call-btn-label {
    font-size: 11px;
    font-family: var(--ios-font);
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    margin-top: 8px;
}

/* Кнопка принятия звонка */
.call-btn-accept .call-btn-icon {
    background: #34c759;
    box-shadow: 0 4px 16px rgba(52, 199, 89, 0.4);
}

.call-btn-accept .call-btn-label {
    color: #34c759;
}

/* Кнопка отклонения/завершения звонка - без текста */
.call-btn-decline .call-btn-icon,
.call-btn-end .call-btn-icon {
    background: #ff3b30;
    box-shadow: 0 4px 16px rgba(255, 59, 48, 0.4);
}

.call-btn-decline .call-btn-label,
.call-btn-end .call-btn-label {
    display: none;
}

/* Меню дополнительных опций */
.call-extra-menu {
    position: absolute;
    top: 70px;
    right: 20px;
    left: auto;
    transform: none;
    width: 280px;
    background: rgba(30, 30, 35, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 14px;
    padding: 12px 0;
    z-index: 15;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 0.5px solid rgba(255, 255, 255, 0.1);
}

.call-extra-menu.hidden {
    display: none;
}

.call-extra-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.call-extra-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.call-extra-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.call-extra-left i {
    width: 24px;
    color: white;
    font-size: 18px;
}

.call-extra-left span {
    color: white;
    font-size: 16px;
    font-family: var(--ios-font);
}

.call-extra-toggle {
    width: 44px;
    height: 24px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    position: relative;
    cursor: pointer;
}

.call-extra-toggle.on {
    background: #34c759;
}

.call-extra-toggle .toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    transition: all 0.2s ease;
}

.call-extra-toggle.on .toggle-slider {
    left: calc(100% - 22px);
}

/* Дневная тема для оверлея звонка */
body.day-theme #call-overlay {
    background: linear-gradient(135deg, 
        rgba(245, 245, 250, 0.95) 0%,
        rgba(235, 235, 245, 0.98) 50%,
        rgba(245, 240, 255, 0.95) 100%);
}

body.day-theme .call-name,
body.day-theme .call-timer,
body.day-theme .call-status {
    color: #000000;
}

body.day-theme .call-avatar {
    background: rgba(0, 0, 0, 0.1);
}

body.day-theme .call-avatar .initials {
    color: #000000;
}

body.day-theme .call-btn-icon {
    background: rgba(0, 0, 0, 0.1);
}

body.day-theme .call-btn-label {
    color: rgba(0, 0, 0, 0.7);
}

/* Видео контейнер */
#video-call-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 2000;
    overflow: hidden;
    border-radius: var(--border-radius-lg);
}

#video-call-container.hidden {
    display: none;
}

.remote-video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
}

#remote-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remote-video-status {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: white;
    background: rgba(0, 0, 0, 0.5);
    padding: 16px 24px;
    border-radius: 50px;
    backdrop-filter: blur(10px);
    font-family: var(--ios-font);
}

.remote-video-status.hidden {
    opacity: 0;
    visibility: hidden;
}

.local-video-container {
    position: absolute;
    bottom: 100px;
    right: 20px;
    width: 120px;
    height: 160px;
    border-radius: 20px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    z-index: 3;
    background: #2a2a2a;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.local-video-container:hover {
    transform: scale(1.05);
}

#local-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.local-video-label {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-family: var(--ios-font);
    backdrop-filter: blur(5px);
}

.video-controls {
    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 16px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    z-index: 5;
}

.video-control-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.video-control-btn.end-call {
    background: #ff3b30;
}

.video-call-info {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 5;
    pointer-events: none;
}

.video-call-timer {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    color: white;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    font-family: monospace;
}

.video-call-peer {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    color: rgba(255, 255, 255, 0.9);
    padding: 4px 14px;
    border-radius: 50px;
    font-size: 13px;
    font-family: var(--ios-font);
}

/* Адаптивность для iPhone */
@media only screen and (max-width: 428px) {
    #mini-chat-widget {
        width: calc(100vw - 20px) !important;
        height: 80vh !important;
        bottom: 70px !important;
        right: 10px !important;
    }
    
    #mini-chat-header {
        height: 52px !important;
        padding: 6px 12px !important;
    }
    
    #mini-chat-button {
        bottom: 20px !important;
        right: 20px !important;
        width: 52px !important;
        height: 52px !important;
    }
    
    #mini-chat-messages {
        padding: 10px 12px !important;
        /* Адаптация эффекта затухания для мобильных */
        mask-image: linear-gradient(to bottom, transparent 0%, black 12px, black calc(100% - 12px), transparent 100%);
        -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 12px, black calc(100% - 12px), transparent 100%);
    }
    
    .incoming-msg,
    .outgoing-msg {
        max-width: 85% !important;
        font-size: 15px !important;
        padding: 8px 12px !important;
    }
    
    .emoji-msg .msg-text {
        font-size: 40px !important;
    }
    
    .emoji-msg.single-emoji .msg-text {
        font-size: 56px !important;
    }
    
    #mini-chat-input-block {
        padding: 8px 12px !important;
        min-height: 52px !important;
        gap: 6px !important;
    }
    
    #mini-chat-add-file,
    #mini-chat-send {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        max-width: 36px !important;
        font-size: 18px !important;
    }
    
    .input-wrapper {
        padding: 3px 10px !important;
    }
    
    #mini-chat-message {
        font-size: 15px !important;
        padding: 6px 0 !important;
        min-height: 22px !important;
    }
    
    .call-more-btn-top {
        width: 36px;
        height: 36px;
    }
    
    .call-avatar {
        width: 100px !important;
        height: 100px !important;
        margin: 15px 0 !important;
    }
    
    .call-avatar .initials {
        font-size: 40px !important;
    }
    
    .call-name {
        font-size: 28px !important;
    }
    
    .call-status {
        font-size: 15px !important;
    }
    
    .call-timer {
        font-size: 40px !important;
    }
    
    .call-btn-icon {
        width: 58px !important;
        height: 58px !important;
    }
    
    .call-buttons-row {
        gap: 25px !important;
    }
    
    .call-extra-menu {
        width: 260px;
        top: 65px;
        right: 15px;
    }
    
    .local-video-container {
        width: 100px !important;
        height: 133px !important;
        bottom: 90px !important;
        right: 12px !important;
    }
    
    .video-control-btn {
        width: 45px !important;
        height: 45px !important;
        font-size: 18px !important;
    }
}

@media only screen and (max-width: 375px) {
    #mini-chat-header {
        height: 48px !important;
        padding: 4px 10px !important;
    }
    
    #mini-chat-status {
        max-width: 100px !important;
    }
    
    .status-text {
        font-size: 10px !important;
    }
    
    .incoming-msg,
    .outgoing-msg {
        font-size: 14px !important;
        padding: 6px 10px !important;
    }
    
    .emoji-msg .msg-text {
        font-size: 36px !important;
    }
    
    .emoji-msg.single-emoji .msg-text {
        font-size: 48px !important;
    }
    
    #mini-chat-input-block {
        padding: 6px 10px !important;
        min-height: 48px !important;
        gap: 5px !important;
    }
    
    #mini-chat-add-file,
    #mini-chat-send {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        max-width: 32px !important;
        font-size: 16px !important;
    }
    
    .input-wrapper {
        padding: 2px 8px !important;
    }
    
    #mini-chat-message {
        font-size: 14px !important;
        padding: 5px 0 !important;
        min-height: 20px !important;
    }
    
    .call-more-btn-top {
        width: 32px;
        height: 32px;
    }
    
    .call-avatar {
        width: 85px !important;
        height: 85px !important;
    }
    
    .call-avatar .initials {
        font-size: 34px !important;
    }
    
    .call-name {
        font-size: 24px !important;
    }
    
    .call-timer {
        font-size: 36px !important;
    }
    
    .call-btn-icon {
        width: 52px !important;
        height: 52px !important;
    }
    
    .call-buttons-row {
        gap: 20px !important;
    }
    
    .call-extra-menu {
        width: 240px;
        top: 60px;
        right: 12px;
    }
    
    .local-video-container {
        width: 85px !important;
        height: 113px !important;
        bottom: 80px !important;
    }
    
    .video-control-btn {
        width: 42px !important;
        height: 42px !important;
        font-size: 16px !important;
    }
}

/* Убираем скроллбар */
#mini-chat-messages::-webkit-scrollbar {
    display: none;
}

#mini-chat-messages {
    scrollbar-width: none;
}

/* ============================================
   АНИМАЦИЯ ПОЯВЛЕНИЯ СООБЩЕНИЙ - iMessage STYLE
   Эффект "надувания" от маленького пузырька
   ============================================ */

.incoming-msg,
.outgoing-msg {
    animation: messagePopIn 0.35s cubic-bezier(0.34, 1.3, 0.64, 1) forwards;
    transform-origin: bottom;
}

@keyframes messagePopIn {
    0% {
        opacity: 0;
        transform: scale(0.7) translateY(8px);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02) translateY(-2px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Для эмодзи сообщений - более пружинистая анимация */
.emoji-msg {
    animation: emojiPopIn 0.3s cubic-bezier(0.34, 1.3, 0.64, 1) forwards !important;
    transform-origin: center;
}

@keyframes emojiPopIn {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    60% {
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Анимация для первого сообщения после паузы - более заметный эффект */
.first-message-after-pause {
    animation: messageBouncePop 0.45s cubic-bezier(0.34, 1.3, 0.64, 1) forwards;
}

@keyframes messageBouncePop {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(15px);
    }
    40% {
        transform: scale(1.05) translateY(-3px);
    }
    70% {
        transform: scale(0.98) translateY(1px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Анимация для новых сообщений при загрузке истории */
.history-message {
    animation: messageFadeIn 0.2s ease-out forwards;
}

@keyframes messageFadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}
/* ============================================
   АМЕБООБРАЗНЫЕ ПУЗЫРЬКИ - МЕДЛЕННОЕ ПЕРЕЛИВАНИЕ
   ============================================ */

.call-amoeba-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
    border-radius: var(--border-radius-lg);
}

.call-amoeba {
    position: absolute;
    border-radius: 60% 40% 50% 50% / 45% 50% 40% 55%;
    filter: blur(55px);
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: opacity 2s ease, background 0.3s ease;
    will-change: transform, opacity, background;
    animation: amoebaFloat 18s ease-in-out infinite alternate;
}

.call-amoeba-container.active .call-amoeba {
    opacity: 0.7;
}

@keyframes amoebaFloat {
    0% {
        border-radius: 60% 40% 50% 50% / 45% 50% 40% 55%;
        transform: translate(-50%, -50%) scale(1);
    }
    20% {
        border-radius: 45% 55% 52% 48% / 50% 52% 48% 50%;
        transform: translate(-48%, -52%) scale(1.08);
    }
    40% {
        border-radius: 52% 48% 47% 53% / 53% 47% 53% 47%;
        transform: translate(-52%, -49%) scale(0.95);
    }
    60% {
        border-radius: 48% 52% 53% 47% / 49% 51% 49% 51%;
        transform: translate(-49%, -51%) scale(1.05);
    }
    80% {
        border-radius: 55% 45% 49% 51% / 52% 48% 52% 48%;
        transform: translate(-51%, -48%) scale(1.02);
    }
    100% {
        border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
        transform: translate(-50%, -50%) scale(1);
    }
}

#call-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(15, 15, 25, 0.9) 0%,
        rgba(10, 10, 20, 0.95) 100%);
    z-index: 1000;
    transition: all var(--transition-normal);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

#call-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.call-container {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 60px 20px 40px;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Дневная тема */
body.day-theme #call-overlay {
    background: linear-gradient(135deg, 
        rgba(235, 235, 245, 0.85) 0%,
        rgba(225, 225, 235, 0.9) 100%);
}

body.day-theme .call-container {
    background: rgba(255, 255, 255, 0.2);
}

body.day-theme .call-amoeba {
    filter: blur(60px);
}

body.day-theme .call-amoeba-container.active .call-amoeba {
    opacity: 0.5;
}

/* ============================================
   МЕНЮ ДЕЙСТВИЙ С СООБЩЕНИЯМИ - iOS 26 STYLE
   Версия: 3.1
   ============================================ */

.message-actions-menu {
    position: fixed;
    background: rgba(28, 28, 30, 0.92);
    backdrop-filter: blur(60px);
    -webkit-backdrop-filter: blur(60px);
    border-radius: 18px;
    padding: 8px;
    min-width: 180px;
    z-index: 10001;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25), 0 0 0 0.5px rgba(255, 255, 255, 0.1);
    animation: menuFadeIn 0.2s ease-out;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

@keyframes menuFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.message-action-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--ios-font);
    font-size: 17px;
    font-weight: 500;
    background: transparent;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
}

.message-action-item i {
    width: 24px;
    font-size: 20px;
    text-align: center;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

.message-action-item span {
    flex: 1;
    letter-spacing: -0.2px;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

/* Специальные стили для каждой кнопки */
.message-action-item[data-action="edit"] {
    color: #0a84ff;
}

.message-action-item[data-action="delete"] {
    color: #ff3b30;
}

/* Эффект нажатия (iOS style) */
.message-action-item:active {
    background: rgba(128, 128, 128, 0.2);
    transform: scale(0.98);
}

/* Hover эффект для десктопа */
@media (hover: hover) {
    .message-action-item:hover {
        background: rgba(128, 128, 128, 0.1);
    }
}

/* Для десктопа - позиционирование с отступом от сообщения */
@media only screen and (min-width: 429px) {
    .message-actions-menu {
        margin-bottom: 12px;
        transform: translateY(-100%);
    }
}

/* Для мобильных устройств - центрированное меню */
@media only screen and (max-width: 428px) {
    .message-actions-menu {
        width: calc(100vw - 48px);
        max-width: 280px;
        min-width: auto;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        border-radius: 20px;
        padding: 10px;
        animation: menuModalIn 0.2s ease-out;
    }
    
    @keyframes menuModalIn {
        0% {
            opacity: 0;
            transform: translate(-50%, -50%) scale(0.95);
        }
        100% {
            opacity: 1;
            transform: translate(-50%, -50%) scale(1);
        }
    }
    
    .message-action-item {
        padding: 14px 20px;
        font-size: 17px;
    }
    
    .message-action-item i {
        width: 26px;
        font-size: 22px;
    }
    
    .message-action-item:active {
        background: rgba(128, 128, 128, 0.25);
    }
}

/* Дневная тема */
body.day-theme .message-actions-menu {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(60px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.05);
}

body.day-theme .message-action-item:active {
    background: rgba(0, 0, 0, 0.08);
}

@media (hover: hover) {
    body.day-theme .message-action-item:hover {
        background: rgba(0, 0, 0, 0.05);
    }
}

/* Тёмная тема (дополнительно) */
body.dark-theme .message-actions-menu {
    background: rgba(28, 28, 30, 0.96);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4), 0 0 0 0.5px rgba(255, 255, 255, 0.08);
}

/* Анимация удаления сообщения - простое плавное исчезновение */
.incoming-msg.deleting,
.outgoing-msg.deleting {
    animation: messageFadeOut 0.25s ease-out forwards !important;
}

@keyframes messageFadeOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.95);
        display: none;
    }
}

/* Стили для текстового поля редактирования */
.msg-text textarea {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    resize: none !important;
    width: 100% !important;
    font-family: inherit !important;
    font-size: inherit !important;
    line-height: inherit !important;
    color: inherit !important;
    padding: 0 !important;
    margin: 0 !important;
    user-select: text !important;
    -webkit-user-select: text !important;
}

.msg-text textarea:focus {
    outline: none !important;
    background: transparent !important;
}

/* Для экранов с высоким разрешением */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .message-actions-menu {
        border-width: 0.5px;
    }
}

/* Адаптация для iPad */
@media only screen and (min-width: 429px) and (max-width: 1024px) {
    .message-actions-menu {
        min-width: 200px;
        padding: 10px;
    }
    
    .message-action-item {
        padding: 14px 18px;
        font-size: 18px;
    }
    
    .message-action-item i {
        width: 26px;
        font-size: 22px;
    }
}
/* ============================================
   ГОЛОСОВЫЕ СООБЩЕНИЯ - iOS 26 STYLE
   Версия: 1.0
   ============================================ */

/* ------------------------------
   КНОПКА МИКРОФОНА
------------------------------ */
.input-action-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    max-width: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    cursor: pointer;
    border: none;
    color: var(--ios-text-secondary);
    font-size: 20px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.input-action-btn:hover {
    background: rgba(128, 128, 128, 0.15);
}

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

.input-action-btn.hidden {
    display: none;
}

/* Активное состояние при записи */
#mini-chat-voice.recording {
    color: #ff3b30;
    background: rgba(255, 59, 48, 0.2);
    animation: voicePulse 1s ease-in-out infinite;
}

@keyframes voicePulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ------------------------------
   ПАНЕЛЬ ЗАПИСИ (появляется при записи)
------------------------------ */
.voice-recording-panel {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: var(--ios-bg-header);
    border-top: 1px solid var(--ios-border);
    border-bottom: 1px solid var(--ios-border);
    animation: slideUp 0.25s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

.voice-recording-panel.hidden {
    display: none;
}

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

/* Контейнер визуализации */
.voice-waveform-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 2px;
    height: 44px;
    background: var(--ios-bg-input);
    border-radius: 28px;
    padding: 0 16px;
    border: 0.5px solid var(--ios-border);
}

/* Волны (бары) */
.voice-waveform-bars {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 2px;
    height: 100%;
}

.voice-waveform-bar {
    flex: 1;
    min-width: 2px;
    max-width: 6px;
    background: var(--ios-accent);
    border-radius: 2px;
    transition: height 0.05s ease;
    opacity: 0.7;
}

/* Таймер записи */
.voice-recording-duration {
    font-family: monospace;
    font-size: 16px;
    font-weight: 500;
    color: var(--ios-text-primary);
    min-width: 48px;
    text-align: center;
    letter-spacing: 0.5px;
}

/* Кнопки управления записью */
.voice-recording-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.voice-cancel-btn,
.voice-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.voice-cancel-btn {
    background: rgba(255, 59, 48, 0.2);
    color: #ff3b30;
}

.voice-cancel-btn:hover {
    background: rgba(255, 59, 48, 0.3);
    transform: scale(1.05);
}

.voice-send-btn {
    background: var(--ios-accent);
    color: white;
}

.voice-send-btn:hover {
    transform: scale(1.05);
}

.voice-cancel-btn:active,
.voice-send-btn:active {
    transform: scale(0.95);
}

/* ------------------------------
   ПРЕДПРОСМОТР ГОЛОСОВОГО СООБЩЕНИЯ
   (после записи, перед отправкой)
------------------------------ */
.voice-preview-panel {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: var(--ios-bg-header);
    border-top: 1px solid var(--ios-border);
    border-bottom: 1px solid var(--ios-border);
    animation: slideUp 0.25s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

.voice-preview-panel.hidden {
    display: none;
}

.voice-preview-play {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ios-accent);
    border: none;
    cursor: pointer;
    color: white;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.voice-preview-play:hover {
    transform: scale(1.05);
}

.voice-preview-play:active {
    transform: scale(0.95);
}

.voice-preview-waveform {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 2px;
    height: 44px;
    background: var(--ios-bg-input);
    border-radius: 28px;
    padding: 0 16px;
    border: 0.5px solid var(--ios-border);
}

.voice-preview-waveform-placeholder {
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        90deg,
        var(--ios-text-secondary),
        var(--ios-text-secondary) 2px,
        transparent 2px,
        transparent 6px
    );
    opacity: 0.3;
    border-radius: 2px;
}

.voice-preview-duration {
    font-family: monospace;
    font-size: 14px;
    font-weight: 500;
    color: var(--ios-text-secondary);
    min-width: 48px;
    text-align: center;
}

.voice-preview-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.voice-preview-cancel,
.voice-preview-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.voice-preview-cancel {
    background: rgba(255, 59, 48, 0.2);
    color: #ff3b30;
}

.voice-preview-cancel:hover {
    background: rgba(255, 59, 48, 0.3);
    transform: scale(1.05);
}

.voice-preview-send {
    background: var(--ios-accent);
    color: white;
}

.voice-preview-send:hover {
    transform: scale(1.05);
}

/* ------------------------------
   ПУЗЫРЁК ГОЛОСОВОГО СООБЩЕНИЯ В ЧАТЕ
------------------------------ */
.voice-message {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 180px;
    max-width: 260px;
}

/* Кнопка воспроизведения */
.voice-play-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(128, 128, 128, 0.2);
    border: none;
    cursor: pointer;
    color: inherit;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.voice-play-btn:hover {
    transform: scale(1.05);
}

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

/* Визуализация волн в сообщении */
.voice-waveform-visual {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 2px;
    height: 36px;
}

.voice-waveform-bars-mini {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 2px;
    height: 100%;
}

.voice-waveform-bar-mini {
    flex: 1;
    min-width: 2px;
    max-width: 4px;
    background: currentColor;
    border-radius: 2px;
    opacity: 0.6;
    transition: height 0.1s ease;
}

/* Анимация при воспроизведении */
.voice-message.playing .voice-waveform-bar-mini {
    animation: voiceWavePlay 0.3s ease-in-out infinite alternate;
}

@keyframes voiceWavePlay {
    0% {
        opacity: 0.4;
        transform: scaleY(0.3);
    }
    100% {
        opacity: 1;
        transform: scaleY(1);
    }
}

/* Длительность голосового сообщения */
.voice-duration {
    font-family: monospace;
    font-size: 12px;
    font-weight: 500;
    opacity: 0.8;
    flex-shrink: 0;
    min-width: 40px;
    text-align: center;
}

/* Стили для исходящих голосовых сообщений */
.outgoing-msg .voice-play-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.outgoing-msg .voice-duration {
    color: rgba(255, 255, 255, 0.8);
}

/* Стили для входящих голосовых сообщений */
.incoming-msg .voice-play-btn {
    background: rgba(0, 0, 0, 0.1);
    color: var(--ios-text-primary);
}

.incoming-msg .voice-duration {
    color: var(--ios-text-secondary);
}

/* ------------------------------
   ДНЕВНАЯ ТЕМА
------------------------------ */
body.day-theme .voice-cancel-btn {
    background: rgba(255, 59, 48, 0.15);
}

body.day-theme .voice-preview-waveform {
    background: var(--ios-bg-input);
}

body.day-theme .incoming-msg .voice-play-btn {
    background: rgba(0, 0, 0, 0.08);
}

/* ------------------------------
   АДАПТИВНОСТЬ ДЛЯ МОБИЛЬНЫХ
------------------------------ */
@media only screen and (max-width: 428px) {
    .input-action-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    .voice-waveform-container {
        height: 40px;
        padding: 0 12px;
    }
    
    .voice-recording-duration {
        font-size: 14px;
        min-width: 44px;
    }
    
    .voice-cancel-btn,
    .voice-send-btn {
        width: 36px;
        height: 36px;
    }
    
    .voice-preview-play {
        width: 40px;
        height: 40px;
    }
    
    .voice-preview-play i {
        font-size: 18px;
    }
    
    .voice-message {
        min-width: 150px;
        max-width: 220px;
    }
    
    .voice-play-btn {
        width: 36px;
        height: 36px;
    }
    
    .voice-play-btn i {
        font-size: 16px;
    }
    
    .voice-duration {
        font-size: 11px;
        min-width: 36px;
    }
}

@media only screen and (max-width: 375px) {
    .input-action-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .voice-waveform-container {
        height: 36px;
        padding: 0 10px;
    }
    
    .voice-recording-duration {
        font-size: 13px;
        min-width: 40px;
    }
    
    .voice-cancel-btn,
    .voice-send-btn {
        width: 32px;
        height: 32px;
    }
    
    .voice-preview-play {
        width: 36px;
        height: 36px;
    }
    
    .voice-message {
        min-width: 130px;
        max-width: 200px;
        gap: 8px;
    }
    
    .voice-play-btn {
        width: 32px;
        height: 32px;
    }
    
    .voice-play-btn i {
        font-size: 14px;
    }
    
    .voice-duration {
        font-size: 10px;
        min-width: 32px;
    }
}
/* ============================================
   АНИМАЦИЯ "CONNECTING..." ДЛЯ ЗВОНКА - iOS 26 STYLE
   ============================================ */

.call-timer-container {
    position: relative;
    min-height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.call-connecting-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.call-connecting-animation.hidden {
    display: none;
}

.call-timer.hidden {
    display: none;
}

/* Контейнер для точек */
.connecting-dots {
    display: flex;
    gap: 14px;
    justify-content: center;
    align-items: center;
}

/* Стили для точек - белые */
.connecting-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    animation: dotPulse 1.4s ease-in-out infinite;
    transition: background 0.3s ease;
}

.connecting-dots .dot:nth-child(1) {
    animation-delay: 0s;
}

.connecting-dots .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.connecting-dots .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotPulse {
    0% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
    100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
}

/* Текст "Соединение" */
.connecting-text {
    font-size: 15px;
    font-weight: 500;
    font-family: var(--ios-font);
    letter-spacing: -0.2px;
    transition: color 0.3s ease;
}

/* ========== НОЧНАЯ ТЕМА (по умолчанию) ========== */
.connecting-text {
    color: rgba(255, 255, 255, 0.7);
}

/* ========== ДНЕВНАЯ ТЕМА ========== */
body.day-theme .connecting-dots .dot {
    background: rgba(0, 0, 0, 0.7);
}

body.day-theme .connecting-text {
    color: rgba(0, 0, 0, 0.6);
}

/* ========== АЛЬТЕРНАТИВНЫЙ ВАРИАНТ: точки всегда белые, текст меняется ========== */
/*
body.day-theme .connecting-dots .dot {
    background: rgba(0, 0, 0, 0.6);
}
*/

/* Адаптивность для мобильных устройств */
@media only screen and (max-width: 428px) {
    .connecting-dots {
        gap: 10px;
    }
    
    .connecting-dots .dot {
        width: 8px;
        height: 8px;
    }
    
    .connecting-text {
        font-size: 13px;
    }
    
    .call-connecting-animation {
        gap: 12px;
    }
}

@media only screen and (max-width: 375px) {
    .connecting-dots {
        gap: 8px;
    }
    
    .connecting-dots .dot {
        width: 7px;
        height: 7px;
    }
    
    .connecting-text {
        font-size: 12px;
    }
}
/* ============================================
   КНОПКИ ЗВОНКА - iOS 26 STYLE
   ============================================ */

/* Общий контейнер для кнопок */
.call-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.call-btn-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(20px);
    transition: all 0.2s ease;
}

.call-btn-label {
    font-size: 12px;
    font-family: var(--ios-font);
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    margin-top: 8px;
}

/* Кнопка ПРИНЯТЬ (зелёная) */
.call-btn-accept .call-btn-icon {
    background: #34c759;
    box-shadow: 0 4px 16px rgba(52, 199, 89, 0.4);
}

.call-btn-accept .call-btn-icon i {
    color: white;
    font-size: 28px;
}

.call-btn-accept .call-btn-label {
    color: #34c759;
}

/* Кнопка ОТКЛОНИТЬ (красная) */
.call-btn-decline .call-btn-icon {
    background: #ff3b30;
    box-shadow: 0 4px 16px rgba(255, 59, 48, 0.4);
}

.call-btn-decline .call-btn-icon i {
    color: white;
    font-size: 28px;
}

.call-btn-decline .call-btn-label {
    display: none;
}

/* Кнопка ЗАВЕРШИТЬ (белая, горизонтальная трубка) */
.call-btn-end .call-btn-icon {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.call-btn-end .call-btn-icon i {
    color: #ff3b30;
    font-size: 28px;
}

.call-btn-end .call-btn-label {
    display: none;
}

/* Эффекты нажатия */
.call-btn-accept:active .call-btn-icon {
    transform: scale(0.95);
    background: #2db84d;
}

.call-btn-decline:active .call-btn-icon {
    transform: scale(0.95);
    background: #e63a2e;
}

.call-btn-end:active .call-btn-icon {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.85);
}

/* Дневная тема */
body.day-theme .call-btn-end .call-btn-icon {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

body.day-theme .call-btn-end .call-btn-icon i {
    color: #ff3b30;
}

body.day-theme .call-btn-label {
    color: rgba(0, 0, 0, 0.7);
}

/* Адаптивность для мобильных */
@media only screen and (max-width: 428px) {
    .call-btn-icon {
        width: 60px;
        height: 60px;
    }
    
    .call-btn-end .call-btn-icon i {
        font-size: 24px;
    }
    
    .call-btn-accept .call-btn-icon i,
    .call-btn-decline .call-btn-icon i {
        font-size: 24px;
    }
}

@media only screen and (max-width: 375px) {
    .call-btn-icon {
        width: 55px;
        height: 55px;
    }
    
    .call-btn-end .call-btn-icon i {
        font-size: 22px;
    }
    
    .call-btn-accept .call-btn-icon i,
    .call-btn-decline .call-btn-icon i {
        font-size: 22px;
    }
}
/* ============================================
   Пункт 10: АНИМАЦИЯ СТАТУСА ОНЛАЙН/ОФФЛАЙН
   ============================================ */

/* Пульсация точки статуса когда онлайн */
#mini-chat-status.status-online .status-dot {
    animation: statusPulse 2s infinite;
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.4);
}

@keyframes statusPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.6);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(52, 199, 89, 0);
        transform: scale(1.05);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(52, 199, 89, 0);
        transform: scale(1);
    }
}

/* Статус офлайн - без анимации */
#mini-chat-status.status-offline .status-dot {
    animation: none;
    box-shadow: none;
}

/* Плавное появление/исчезновение статуса */
#mini-chat-status {
    transition: all 0.3s ease;
}

.status-dot {
    transition: background-color 0.3s ease, transform 0.2s ease;
}

/* Эффект при смене статуса */
#mini-chat-status.status-online {
    animation: statusFadeIn 0.3s ease;
}

#mini-chat-status.status-offline {
    animation: statusFadeOut 0.3s ease;
}

@keyframes statusFadeIn {
    0% {
        opacity: 0.5;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes statusFadeOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0.7;
        transform: scale(0.98);
    }
}