.chat-toggle {
    position: fixed;
    bottom: 40px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: #ffffff;
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    /* por si accidentalmente dejan texto dentro */
    font-size: 0;
    color: transparent;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    z-index: 1000;
}

.chat-toggle:hover {
    background-color: #ffca2c;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}

/* Imagen dentro del botón */
.chat-toggle-icon {
    width: 90%;
    height: 90%;
    object-fit: contain;
    pointer-events: none; /* para que el click siempre sea del botón, no de la imagen */
}


/* Posición específica para este chat */
#chatToggle {
    right: 25px;
}

/* =======================
   CONTENEDOR DE CHAT ? MISMO LOOK WHITE
   ======================= */
.chat-container {
    position: fixed;
    bottom: 150px;
    width: 400px;
    max-height: 700px;
    background-color: #ffffff;
    border-radius: 10px;
    border: 1px solid #ccc;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 999;
}

#chatContainer {
    right: 25px;
}

.chat-container.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* =======================
   CABECERA DEL CHAT
   ======================= */
.chat-header {
    background: #ffc107;
    color: #000;
    padding: 10px;
    font-weight: bold;
    font-size: 16px;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between; /* título a la izquierda, X a la derecha */
}

.chat-header span {
    flex: 1;
}

/* Botón de cerrar */
.chat-close {
    background: transparent;
    border: none;
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    color: #000;
}

.chat-close:hover {
    color: #333;
}


/* =======================
   ZONA DE MENSAJES
   ======================= */
.chat-messages {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-color: #f5f5f5;
}

.message {
    padding: 10px 12px;
    border-radius: 12px;
    max-width: 85%;
    line-height: 1.5;

    word-wrap: break-word;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
}

.message.bot {
    align-self: flex-start;
    background: #F2F2F2;
    color: #111;
    border-top-left-radius: 6px;
    white-space: normal;
}

.message.user {
    align-self: flex-end;
    background: #EDC81C;
    color: #0b1c4a;
    border-top-right-radius: 6px;
    white-space: pre-wrap;
}


/* =======================
   INPUT + BOTÓN ENVIAR
   ======================= */
.chat-input {
    display: flex;
    padding: 10px;
    border-top: 1px solid #ccc;
    background-color: #ffffff;
    gap: 5px;
}

.chat-input input {
    flex: 1;
    background: #ffffff;
    color: #000;
    border: 1px solid #ced4da;
    padding: 8px 10px;
    font-size: 14px;
    border-radius: 5px;
    outline: none;
}

.chat-input input:focus {
    border-color: #ffc107;
    box-shadow: 0 0 0 0.15rem rgba(255,193,7,.35);
}

.chat-input button {
    background-color: #ffc107;
    color: #000;
    border: none;
    padding: 8px 14px;
    cursor: pointer;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.chat-input button:hover {
    background-color: #ffca2c;
}

/* =======================
   MEDIA (IMÁGENES / VIDEOS) EN MENSAJES BOT
   ======================= */
.message.bot .chat-media-wrapper {
    margin-top: 6px;
    padding: 4px;
    border-radius: 6px;
    background-color: #e9ecef;
}

.message.bot .chat-media-preview {
    display: block;
    max-width: 100%;
    max-height: 160px;
    border-radius: 4px;
    object-fit: cover;
    cursor: pointer;
}

.message.bot .chat-media-expand {
    margin-top: 4px;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.35);
    background: transparent;
    color: #111;
    cursor: pointer;
}

.message.bot .chat-media-expand:hover {
    background-color: rgba(0,0,0,0.04);
}

.message.bot .chat-media-link {
    display: inline-block;
    font-size: 12px;
    margin-top: 4px;
    text-decoration: underline;
    color: #0d6efd;
}

.message.bot .chat-media-yt-mini iframe {
    width: 100%;
    height: 180px;
    border: 0;
    border-radius: 6px;
}

/* =======================
   MODAL DE MEDIA
   ======================= */
#chatMediaModal .modal-dialog {
    max-width: 900px;
}

#chatMediaModal .modal-content {
    background-color: rgba(0,0,0,0.85);
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}

#chatMediaModal .modal-body {
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 80vh;
}

#chatMediaModal img {
    max-width: 90%;
    max-height: 80vh;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}


.row.bg-warning.p-0 {
    background-color: #FFD100 !important;
    border-radius: 15px;
    padding: 14px 20px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    display: flex;
    justify-content: center;
}

.row.bg-warning.p-0 h5 {
    margin: 0;
    font-weight: 700;
    color: #000000 !important;
    text-align: center;
    font-size: 1rem;
}