/* MedChat Widget Styles */
#medchat-root {
    position: fixed;
    bottom: 30px;
    left: 30px; /* Перемещено влево */
    z-index: 2147483647;
    font-family: 'GothamPro', sans-serif;
}

#medchat-launcher {
    width: 250px;
    height: 46px;
    background-color: #5bbaf5; /* Точный цвет Envybox */
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(91, 186, 245, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 16px 0 6px;
    transition: transform 0.2s, background-color 0.2s;
}

#medchat-launcher:hover {
    transform: translateY(-2px);
    background-color: #4aa9e4;
}

/* Белый квадрат с крестиком */
#medchat-launcher svg {
    width: 34px;
    height: 34px;
    fill: #5bbaf5; 
    background-color: white;
    border-radius: 4px;
    margin-right: 12px;
    padding: 4px;
    box-sizing: border-box;
}

/* Текст на кнопке */
#medchat-launcher::after {
    content: "Мы онлайн! Напишите нам!";
    color: white;
    font-weight: 500;
    font-size: 14px;
}

#medchat-window {
    position: absolute;
    bottom: 60px;
    left: 0; /* Окно открывается слева, над кнопкой */
    width: 350px;
    height: 550px;
    max-height: calc(100vh - 100px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #eaeaea;
}

#medchat-window.open {
    display: flex;
}

#medchat-header {
    background: #00A1E1; /* Синий цвет сайта Нормы для шапки чата */
    color: white;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#medchat-header .title {
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

#medchat-header .title span.status {
    width: 8px;
    height: 8px;
    background: #7ed321;
    border-radius: 50%;
    display: inline-block;
}

#medchat-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    opacity: 0.8;
}

#medchat-close:hover {
    opacity: 1;
}

#medchat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f4f7f9;
}

.mc-msg {
    max-width: 85%;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.mc-msg.bot {
    align-self: flex-start;
    background: #fff;
    border: 1px solid #e5e9ec;
    border-bottom-left-radius: 4px;
    color: #312E2A;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.mc-msg.user {
    align-self: flex-end;
    background: #00A1E1;
    color: #fff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,161,225,0.2);
}

.mc-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.mc-btn {
    background: #fff;
    border: 1px solid #00A1E1;
    color: #00A1E1;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.mc-btn:hover {
    background: #00A1E1;
    color: #fff;
}

#medchat-input-area {
    padding: 12px;
    background: #fff;
    border-top: 1px solid #eaeaea;
    display: flex;
    gap: 8px;
}

#medchat-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

#medchat-input:focus {
    border-color: #00A1E1;
}

#medchat-send {
    background: #00A1E1;
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

#medchat-send:hover {
    background: #008cc4;
}

#medchat-send svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    margin-left: 2px;
}

.mc-typing {
    display: inline-block;
    width: 30px;
}
.mc-typing span {
    display: inline-block;
    width: 5px;
    height: 5px;
    background-color: #00A1E1;
    border-radius: 50%;
    margin: 0 2px;
    animation: typing 1s infinite alternate;
}
.mc-typing span:nth-child(2) { animation-delay: 0.2s; }
.mc-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0% { transform: translateY(0); opacity: 0.3; }
    100% { transform: translateY(-4px); opacity: 1; }
}

/* Mobile adjustments */
@media (max-width: 480px) {
    #medchat-root {
        bottom: 15px;
        left: 15px; 
        right: 15px;
    }
    
    #medchat-launcher {
        width: 100%;
        justify-content: center;
    }

    #medchat-window {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
        border: none;
        z-index: 2147483647;
    }
}

.mc-specialty-card {
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-width: 85%;
    padding: 12px 14px;
    border-left: 4px solid #00A1E1;
    border-radius: 8px;
    background: #eef9ff;
    color: #173b55;
}

.mc-specialty-card .mc-specialty-label {
    font-size: 11px;
    color: #5b7484;
    text-transform: uppercase;
}

.mc-specialty-card strong {
    font-size: 16px;
}

.mc-specialty-card small {
    font-size: 11px;
    color: #5b7484;
}
