/* --- Botón Flotante --- */
#mcs-open-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #1a7431; /* <-- VERDE (Online) por defecto */
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 9998;
    transition: transform 0.2s, background-color 0.3s;
}
#mcs-open-button:hover {
    transform: scale(1.1);
}

/* ===============================================================
   ¡NUEVO! Color Oro para cuando esté OFFLINE
   =============================================================== */
#mcs-open-button.mcs-offline {
    background-color: #DAA520; /* <-- ORO (Offline) */
}
/* =============================================================== */


/* --- Contenedor del Widget --- */
#mcs-widget-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    max-height: 500px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 9999;
    overflow: hidden;
    /* Oculto por defecto */
    transform: scale(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease-in-out;
}
/* Clase para mostrar el widget */
#mcs-widget-container.mcs-visible {
    transform: scale(1);
}

/* --- Clases de utilidad --- */
.mcs-hidden {
    display: none !important;
}

/* --- Cabecera --- */
.mcs-header {
    background: #1a7431;
    color: white;
    padding: 15px;
    font-weight: bold;
    font-size: 1.1em;
    position: relative;
}

/* --- Contenido (Formularios, Espera, etc) --- */
.mcs-content {
    padding: 20px;
}
#mcs-login-form input,
#mcs-login-form textarea, /* <-- AÑADIDO */
#mcs-prechat-form textarea, /* <-- AÑADIDO */
#mcs-login-form button,
#mcs-prechat-form button, /* <-- AÑADIDO */
#mcs-chat-form button {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box; 
    resize: none; /* <-- AÑADIDO (para que no se estire el textarea) */
}
#mcs-login-form button,
#mcs-prechat-form button, /* <-- AÑADIDO */
#mcs-chat-form button {
    background: #1a7431;
    color: white;
    border: none;
    cursor: pointer;
}

/* --- Pantalla de Espera (Loader) --- */
.mcs-loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1a7431;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: mcs-spin 1s linear infinite;
    margin: 20px auto;
}
@keyframes mcs-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Pantalla de Chat Activo --- */
#mcs-messages {
    list-style-type: none;
    padding: 10px;
    margin: 0;
    height: 280px;
    overflow-y: auto;
    background: #f9f9f9;
}
#mcs-messages li {
    padding: 8px 12px;
    margin-bottom: 5px;
    border-radius: 10px;
    max-width: 80%;
    word-wrap: break-word; /* Para que el texto no se salga */
}
/* Mensajes del cliente */
#mcs-messages li.cliente {
    background: #1a7431;
    color: white;
    margin-left: auto;
    text-align: right;
}
/* Mensajes del admin */
#mcs-messages li.admin {
    background: #e0e0e0;
    color: #333;
    margin-right: auto;
}
/* Mensajes del sistema */
#mcs-messages li.sistema {
    background: #fff;
    color: #888;
    font-style: italic;
    text-align: center;
    max-width: 100%;
}
#mcs-chat-form {
    display: flex;
    padding: 10px;
    border-top: 1px solid #ddd;
}
#mcs-chat-input {
    flex-grow: 1;
    border: 1px solid #ddd;
    padding: 8px;
    border-radius: 5px;
}