/* Виджет */
#gcb-widget{
    position:fixed;
    bottom:90px;
    right:30px;
    width:380px;
    background:#ffffff;
    border-radius:12px;
    border:none;
    display:none;
    flex-direction:column;
    box-shadow:0 10px 40px rgba(0,0,0,0.15);
    z-index:99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow:hidden;
}
#gcb-widget.open{display:flex;}

/* Заголовок - СТИЛЬНЫЙ */
#gcb-header{
    background:#f8f9fa;
    padding:16px 20px;
    font-weight:600;
    color:#000000;
    display:flex;
    justify-content:space-between;
    align-items:center;
    border-bottom:1px solid #e9ecef;
    font-size:16px;
}
#gcb-header span {
    color: #000000;
    font-weight: 600;
}
#gcb-close{
    background:none;
    border:none;
    font-size:24px;
    cursor:pointer;
    color:#6c757d;
    padding:0;
    width:30px;
    height:30px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    transition:all 0.2s;
}
#gcb-close:hover{
    background:#e9ecef;
    color:#000;
}

/* Сообщения */
#gcb-messages{
    flex:1;
    padding:20px;
    overflow-y:auto;
    font-size:14px;
    background:#ffffff;
    max-height:400px;
}
.msg{
    margin:8px 0;
    padding:12px 16px;
    border-radius:18px;
    max-width:85%;
    line-height:1.4;
    box-shadow:0 2px 4px rgba(0,0,0,0.05);
}
.msg.user{
    background:#007bff;
    color:white;
    margin-left:auto;
}
.msg.bot{
    background:#f8f9fa;
    color:#333;
    border:1px solid #e9ecef;
}

/* Поле ввода - СТИЛЬНОЕ */
#gcb-input{
    padding:16px 20px;
    border-top:1px solid #e9ecef;
    display:flex;
    gap:12px;
    align-items:center;
    background:#f8f9fa;
}
#gcb-input input{
    flex:1;
    border:1px solid #e9ecef;
    padding:12px 16px;
    border-radius:25px;
    font-size:14px;
    outline:none;
    transition:all 0.2s;
    background:white;
}
#gcb-input input:focus{
    border-color:#007bff;
    box-shadow:0 0 0 2px rgba(0,123,255,0.1);
}

/* Кнопка отправки - ПРЕМИУМ */
#gcb-send{
    width:48px;
    height:48px;
    border-radius:50% !important;
    color:#fff;
    font-size:18px;
    border:none;
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    transition:all 0.3s;
    box-shadow:0 4px 12px rgba(0,0,0,0.15);
}
#gcb-send:hover{ 
    transform:scale(1.05);
    box-shadow:0 6px 16px rgba(0,0,0,0.2);
}

/* Кнопка открытия чата - ПРЕМИУМ */
#gcb-button{
    position:fixed;
    bottom:90px;
    right:5px;
    width:70px;
    height:70px;
    border-radius:50%;
    color:#fff;
    font-size:32px;
    display:flex;
    justify-content:center;
    align-items:center;
    cursor:pointer;
    z-index:100000;
    transition:all 0.3s;
    box-shadow:0 8px 25px rgba(0,0,0,0.2);
    border:none;
}
#gcb-button:hover{
    transform:scale(1.1) rotate(5deg);
    box-shadow:0 12px 30px rgba(0,0,0,0.3);
}

/* Скрытие кнопки, когда чат открыт */
#gcb-widget.open + #gcb-button{
    display:none;
}

/* Мобильная адаптация */
@media (max-width:480px){
    #gcb-widget{
        width:95%;
        right:2.5%;
        bottom:20px;
        height:85vh;
        border-radius:20px;
    }
    #gcb-button{
        bottom:60px;
        right:5px;
        width:60px;
        height:60px;
        font-size:28px;
    }
    #gcb-send{
        width:44px;
        height:44px;
    }
    #gcb-messages{
        padding:16px;
        max-height:60vh;
    }
}

/* 📌 СОВРЕМЕННЫЕ СООБЩЕНИЯ */

.gcb-msg {
    display: flex;
    gap: 12px;
    margin: 16px 0;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Бот (слева) */
.gcb-msg.bot {
    justify-content: flex-start;
}
.gcb-msg.bot .gcb-bubble {
    background: #ffffff;
    color: #2d3748;
    border-radius: 20px 20px 20px 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Пользователь (справа) */
.gcb-msg.user {
    justify-content: flex-end;
}
.gcb-msg.user .gcb-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border-radius: 20px 20px 8px 20px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Пузырь сообщения */
.gcb-bubble {
    max-width: 80%;
    padding: 14px 18px;
    font-size: 15px;
    line-height: 1.5;
    word-wrap: break-word;
}

/* Аватар для бот-сообщений */
.gcb-msg.bot::before {
    content: "";
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Анимация загрузки */
.gcb-msg.bot.typing .gcb-bubble {
    background: #f7fafc;
    color: transparent;
    position: relative;
    overflow: hidden;
}
.gcb-msg.bot.typing .gcb-bubble::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    animation: typing 1.5s infinite;
}

@keyframes typing {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* Скроллбар */
#gcb-messages::-webkit-scrollbar {
    width: 6px;
}
#gcb-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}
#gcb-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}
#gcb-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Подсказки */
#gcb-suggest {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin: 10px 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 150px;
    overflow-y: auto;
}
.gcb-s-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f1f1f1;
    transition: background 0.2s;
    font-size: 14px;
}
.gcb-s-item:hover {
    background: #f8f9fa;
}
.gcb-s-item:last-child {
    border-bottom: none;
}

/* Имя чат-бота - всегда черный */
#gcb-header span {
    color: #000000 !important;
    font-weight: bold;
}