/* ===== Contenedor ======================================= */
#mgc-chat-container {
    font-family: 'Open Sans', Arial, sans-serif;
    width: 360px;
    max-width: 95%;
    height: 80vh;
    min-height: 480px;
    margin: 20px auto;
    background: #fff;
    border: none;
    border-radius: 15px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .1);
    display: flex;
    flex-direction: column;
    overflow: hidden
}

@media(max-width:480px) {
    #mgc-chat-container {
        height: 75vh;
        width: 95%
    }
}

/* ===== Encabezado ======================================= */
#mgc-chat-header {
    background: #B2EBF2;
    color: #333;
    text-align: center;
    font-family: 'Quicksand', sans-serif;
    font-size: 20px;
    font-weight: 700;
    padding: 16px 10px;
    border-radius: 15px 15px 0 0
}

/* ===== Mensajes ========================================= */
#mgc-chat-output {
    flex-grow: 1;
    padding: 18px 14px 14px;
    overflow-y: auto;
    background: #F8F8F8;
    display: flex;
    flex-direction: column;
    gap: 16px
}

.mgc-message {
    position: relative;
    max-width: 80%;
    padding: 14px 18px;
    border-radius: 15px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-wrap: break-word
}

.mgc-user-message {
    align-self: flex-end;
    background: #FFF9C4;
    color: #333;
    border-bottom-right-radius: 5px
}

.mgc-bot-message {
    align-self: flex-start;
    background: #F8BBDF;
    color: #333;
    border-bottom-left-radius: 5px
}

.mgc-bot-message.mgc-error {
    background: #Fbeaea;
    color: #c00;
    border: 1px solid #f5c6cb
}

/* ===== Icono copiar ===================================== */
.mgc-copy {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="%23666666" viewBox="0 0 24 24"><path d="M16 1H4a2 2 0 0 0-2 2v14h2V3h12V1zm3 4H8a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2zm0 18H8V7h11v16z"/></svg>') no-repeat center/18px;
    cursor: pointer;
    opacity: .7;
    transition: opacity .2s
}

.mgc-copy:hover {
    opacity: 1
}

.mgc-copied::after {
    content: '¡Copiado!';
    position: absolute;
    top: -22px;
    right: 0;
    background: #DCEDC8;
    color: #333;
    padding: 3px 6px;
    border-radius: 6px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    animation: fades 1.6s ease forwards
}

@keyframes fades {
    0% {
        opacity: 0;
        transform: translateY(-4px)
    }

    10% {
        opacity: 1;
        transform: none
    }

    90% {
        opacity: 1
    }

    100% {
        opacity: 0
    }
}

/* ===== Área de entrada ================================== */
#mgc-chat-input-area {
    background: #fff;
    border-top: 1px solid #E0E0E0;
    padding: 14px 12px;
    display: flex;
    gap: 10px
}

#mgc-chat-input {
    flex-grow: 1;
    min-height: 42px;
    max-height: 160px;
    padding: 12px 15px;
    font-size: 15px;
    line-height: 1.4;
    border: 1px solid #E0E0E0;
    border-radius: 20px;
    resize: none;
    overflow-y: auto
}

#mgc-chat-input:focus {
    border-color: #B2EBF2;
    outline: none;
    box-shadow: 0 0 0 3px rgba(178, 235, 242, .35)
}

#mgc-send-button {
    background: #50D8CE;
    color: #fff;
    border: none;
    padding: 0 26px;
    height: 42px;
    border-radius: 22px;
    font-family: 'Quicksand', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
    display: flex;
    align-items: center;
    justify-content: center
}

#mgc-send-button:hover {
    background: #3abcc4
}

/* ===== Indicador ======================================== */
.mgc-typing-indicator {
    font-style: italic;
    color: #666;
    padding: 4px 0
}