/* ============================================================
   GPT MUNICIPAL – ESTILO MAQUETA MODERNA (CREMA)
   Este CSS reemplaza por completo cualquier estilo anterior.
============================================================ */

/* CONTENEDOR PRINCIPAL */
.gpt-mun-shell {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px 60px;
    background: #f6f4f0;
    border-radius: 24px;
    font-family: "Inter", sans-serif;
	min-height: 85vh;
    max-height: 90vh;        /* Nunca sobrepasa el 90% */
    overflow-y: auto;        /* Activa scroll si se llena */
    overflow-x: hidden;      /* Evita scroll lateral */
}

/* HEADER */
.gpt-mun-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
}

.gpt-mun-header {
    text-align: center;
    margin: 0 auto;
}

.gpt-mun-header h1 {
    margin: 0 0 8px;
    font-size: 52px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.gpt-mun-header p {
    margin: 0;
    font-size: 22px;
}

/* BOTÓN SALIR */
.gpt-mun-logout-form button {
    background: transparent;
	color: #E78561;
    border: 1px solid #ccc;
    padding: 6px 12px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 13px;
}

.gpt-mun-logout-form button:hover {
    background: #eee;
}

/* ÁREA DE CONVERSACIÓN */
.gpt-mun-conversation {
    min-height: 180px;
    max-height: 380px;
    overflow-y: auto;
    padding: 10px 20px 30px;
}

.gpt-mun-msg {
    display: block;
    margin-bottom: 48px;
}

/* MENSAJE DEL USUARIO (derecha) */
.gpt-mun-msg-user {
	display: flex !important;
    justify-content: flex-end !important;
	text-align: right;
}

.gpt-mun-bubble-user {
    background: #a9afb6;
    color: #fff;
    border-radius: 26px;
    border-top-right-radius: 6px;
    padding: 14px 18px;
    max-width: 70%;
    font-size: 18px;
    line-height: 1.4;
	margin-left: auto !important;
}

/* MENSAJE DEL BOT (izquierda) */
.gpt-mun-msg-bot {
    justify-content: flex-start;
	text-align: left;
}

.gpt-mun-bubble-bot {
    background: transparent;
    color: #333;
    padding: 0;
    border-radius: 0;
    max-width: 80%;
    font-size: 18px;
    line-height: 1.5;
}

/* ACCIONES DE RESPUESTA DEL BOT */
.gpt-mun-actions {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 14px;
}

.gpt-mun-actions button {
    border-radius: 999px;
    border: 1px solid #444;
    padding: 6px 12px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
}

.gpt-mun-actions button:hover {
    background: #eee;
}

/* TÍTULO DE SUGERENCIAS */
.gpt-mun-suggestions-title {
    margin-top: 20px;
    text-align: center;
    font-size: 16px;
}

.gpt-mun-suggestions-title strong {
    font-weight: 700;
}

/* INPUT: barra redondeada */
.gpt-mun-input-row {
    margin: 12px auto 10px;
    max-width: 650px;
    display: flex;
    align-items: center;
    border-radius: 40px;
    border: 1px solid #333;
    background: #fff;
    overflow: hidden;
}

.gpt-mun-input-row input {
    flex: 1;
    border: none;
    padding: 14px 20px;
    font-size: 16px;
    outline: none;
}

.gpt-mun-input-row button {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 22px;
    background: #E78561;
    color: #f75a36;
    display: flex;
    align-items: center;
    justify-content: center;
	margin: 5px;
}

/* DISCLAIMER */
.gpt-mun-disclaimer {
    text-align: center;
    font-size: 13px;
    margin-top: 8px;
}

.gpt-mun-disclaimer strong {
    font-weight: 700;
}

/* FORMULARIO DE REGISTRO – MATCH MAQUETA */
.gpt-mun-register-wrapper {
    max-width: 700px;
    margin: 0 auto;
    padding: 40px 30px;
    border-radius: 16px;
    border: 1px solid #ddd;
    background: #f6f4f0;
}

.gpt-mun-register-wrapper h2 {
    text-align: center;
    font-size: 34px;
    margin-bottom: 10px;
    font-weight: 700;
}

.gpt-mun-register-wrapper p {
    text-align: center;
    margin-bottom: 20px;
    font-size: 18px;
}

.gpt-mun-register-wrapper input[type="text"],
.gpt-mun-register-wrapper input[type="email"] {
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 14px;
    border: 2px solid #e74c3c;
    border-radius: 6px;
    font-size: 16px;
}

.gpt-mun-register-wrapper button {
    width: 100%;
    padding: 16px;
    background: #e74c3c;
    color: #fff;
    font-size: 18px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.gpt-mun-register-wrapper button:hover {
    opacity: 0.85;
}

/* RESPONSIVE */
@media (max-width:768px){
    .gpt-mun-shell { padding: 24px 16px 10px; }
    .gpt-mun-header h1 { font-size: 36px; }
    .gpt-mun-header p { font-size: 18px; }
    .gpt-mun-bubble-user,
    .gpt-mun-bubble-bot { font-size: 16px; max-width: 90%; }
}

/* Quitar borde del input del chatbot */
#gpt-mun-input {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    background: transparent;
}

/* ============================================================
   MENSAJE DE BIENVENIDA COMO BURBUJA ESPECIAL
============================================================ */

.gpt-mun-welcome-wrapper {
    text-align: center;
    margin-bottom: 32px;
    width: 100%;
}

.gpt-mun-welcome-title {
    font-size: 52px;
    font-weight: 700;
    margin: 0 0 10px 0;
    letter-spacing: 0.03em;
    color: #000;
}

.gpt-mun-welcome-sub {
    font-size: 22px;
    margin: 0;
    opacity: 0.9;
    color: #333;
}

/* ============================================================
   FIX: Botones de acciones del chatbot (Copiar, Compartir…)
============================================================ */

.gpt-mun-actions button {
    all: unset !important;            /* borra TODOS los estilos heredados */
    display: inline-block !important;
    padding: 6px 12px !important;
    border-radius: 20px !important;
    border: 1px solid #444 !important;
    background: #fff !important;
    cursor: pointer !important;
    font-size: 14px !important;
    color: #333 !important;
    line-height: 1.2 !important;
    text-align: center !important;
    white-space: nowrap !important;
}

/* Hover */
.gpt-mun-actions button:hover {
    background: #eee !important;
}

/* Contenedor horizontal normal */
.gpt-mun-actions {
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

.gpt-mun-welcome-spacer {
    height: 200px;
}

/* ===================================================================
   ICONOS DE ACCIÓN (Copiar, Compartir, Fuentes, Correo)
=================================================================== */

.gpt-mun-actions {
    display: flex;
    gap: 14px;
    margin-top: 8px;
    align-items: center;
}

.gpt-mun-actions button {
    all: unset !important;
    cursor: pointer !important;
    width: 26px;
    height: 26px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid #666;
    background: #fff;
    transition: 0.2s ease;
}

.gpt-mun-actions button:hover {
    background: #eee;
}

.gpt-mun-actions button svg {
    width: 14px;
    height: 14px;
    stroke: #444;
}

.gpt-mun-actions {
    margin-top: 6px;
    margin-left: 4px;
    display: flex;
    gap: 12px;
}

/* ============================================================
   RESPONSIVE – Ajustes para móviles y tablets
============================================================ */

/* Tablets medianos (768px a 991px) */
@media (max-width: 991px) {

    /* Espaciado debajo del mensaje de bienvenida */
    .gpt-mun-welcome-spacer {
        height: 80px;
    }

    /* Títulos */
    .gpt-mun-welcome-title {
        font-size: 40px;
    }
    .gpt-mun-welcome-sub {
        font-size: 18px;
    }

    /* Burbuja */
    .gpt-mun-bubble-user,
    .gpt-mun-bubble-bot {
        font-size: 16px;
        max-width: 90%;
    }

    /* Input */
    .gpt-mun-input-row {
        max-width: 100%;
        border-radius: 32px;
    }

    .gpt-mun-input-row input {
		margin: 5px 5px 10px;
        font-size: 15px;
        padding: 12px 18px;
    }

    .gpt-mun-input-row button {
        width: 52px;
        height: 52px;
        font-size: 18px;
    }

}

/* Móviles (480px a 767px) */
@media (max-width: 767px) {

    /* Espaciado */
    .gpt-mun-welcome-spacer {
        height: 0px;
    }

    /* Títulos */
    .gpt-mun-welcome-title {
        font-size: 24px;
    }
    .gpt-mun-welcome-sub {
        font-size: 12px;
    }

    /* Burbujas */
    .gpt-mun-bubble-user,
    .gpt-mun-bubble-bot {
        font-size: 15px;
        line-height: 1.4;
        max-width: 95%;
    }

    /* Input */
    .gpt-mun-input-row {
        border-radius: 28px;
		margin: 5px 5px 10px;
		min-height: 70px;
    }

    .gpt-mun-input-row input {
        font-size: 14px;
        padding: 10px 16px;
    }

    .gpt-mun-input-row button {
        width: 58px;
        height: 58px;
        font-size: 18px;
    }

    /* Acciones */
    .gpt-mun-actions button {
        width: 22px;
        height: 22px;
    }

    .gpt-mun-actions button svg {
        width: 12px;
        height: 12px;
    }

	.gpt-mun-header-row {
		margin-bottom: 16px;
	}

	.gpt-mun-disclaimer {
		font-size: 9px;
	}
	
	.gpt-mun-shell {
		max-width: 100%;
		margin: 0;
		border-radius: 0;
		display: flex;
		flex-direction: column;
		min-height: 90vh;
		padding: 10px 0px 20px;
		overflow: visible !important;
		position: relative;
		z-index: 1;
	}

	.gpt-mun-conversation {
		flex: 1;
		min-height: 0;
		max-height: 58vh;
	}

	.gpt-mun-header-row {
		margin-bottom: 16px;
	}

	.gpt-mun-disclaimer {
		font-size: 9px;
	}

	.gpt-mun-register-wrapper h2 {
		font-size: 24px;
	}

	.gpt-mun-register-wrapper p {
		font-size: 15px;
	}
	
	.gpt-mun-register-wrapper input[type="text"],
	.gpt-mun-register-wrapper input[type="email"] {
		padding: 10px 12px;
		font-size: 14px;
	}
	
	.gpt-mun-register-wrapper button {
    padding: 12px;
    font-size: 15px;
	}

	.elementor-nav-menu--dropdown {
		position: absolute !important;
		z-index: 999999 !important;
	}
	.elementor-nav-menu__container {
		z-index: 999999 !important;
	}

}

/* Móviles muy pequeños (menos de 400px) */
@media (max-width: 400px) {

    .gpt-mun-welcome-spacer {
        height: 0px;
    }

    .gpt-mun-welcome-title {
        font-size: 28px;
    }
    .gpt-mun-welcome-sub {
        font-size: 14px;
    }

    .gpt-mun-input-row input {
        font-size: 13px;
        padding: 8px 14px;
    }

    .gpt-mun-input-row button {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

}

.gpt-mun-thinking-bubble {
    padding: 10px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.gpt-mun-thinking-bubble img {
    width: 128px;      /* 👈 aquí controlas tamaño real */
    height: auto;
    opacity: 0.85;
}

.gpt-mun-thinking-bubble {
    padding: 14px 18px;
}

.gpt-mun-thinking-wrapper {
    height: 64px;              /* 👈 reserva el espacio */
    visibility: hidden;        /* invisible pero ocupa espacio */
}

.gpt-mun-thinking-wrapper.active {
    visibility: visible;
}

/* ===============================
   QUOTA POPUP UI
================================ */

.muni-quota-container {
    margin-top: 20px;
}

.muni-quota-card {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 24px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    font-family: inherit;
}

.muni-quota-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    margin-bottom: 16px;
}

.muni-quota-header strong {
    font-size: 16px;
}

.muni-quota-bar {
    width: 100%;
    height: 12px;
    background: #eeeeee;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 12px;
}

.muni-quota-bar-fill {
    height: 100%;
    background: #4caf50;
    transition: width 0.4s ease;
}

.muni-quota-stats {
    font-size: 13px;
    color: #555;
    margin-bottom: 8px;
}

.muni-quota-remaining {
    font-size: 14px;
    margin-bottom: 6px;
}

.muni-quota-reset {
    font-size: 12px;
    color: #777;
}

/* Forzar layout vertical del popup */

.elementor-popup-modal .dialog-message {
    display: flex;
    flex-direction: column;
/*    align-items: center; */
}

/* Asegurar que el título ocupe todo el ancho */
.elementor-popup-modal .dialog-message > * {
    width: 100%;
}

.muni-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.muni-modal.active {
  display: flex;
}

.muni-modal-content {
  background: #F6F4F0;
  width: 90%;
  max-width: 700px;
  max-height: 80vh;
  overflow-y: auto;
  border-radius: 14px;
  padding: 24px;
  position: relative;
  animation: muniFade .2s ease;
}

@keyframes muniFade {
  from { transform: translateY(10px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.muni-modal-close {
  position: absolute;
  right: 16px;
  top: 12px;
  border: none;
  background: none;
  font-size: 22px;
  cursor: pointer;
}

#muni-sources-list {
  display: flex;
  flex-direction: row;   /* 🔥 fuerza horizontal */
  gap: 16px;
  overflow-x: auto;      /* 🔥 scroll lateral */
  overflow-y: hidden;
  padding-bottom: 10px;
  scroll-snap-type: x mandatory;
}

.muni-source-item {
  flex: 0 0 260px;       /* 🔥 ancho fijo tipo card */
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  padding: 14px;
  scroll-snap-align: start;
  transition: transform .15s ease, box-shadow .15s ease;
}

.muni-source-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.muni-source-item img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 10px;
}

.muni-source-text h4 {
  margin: 0 0 6px 0;
  font-size: 16px;
}

.muni-source-text p {
  margin: 0;
  font-size: 14px;
  color: #555;
}

.gpt-mun-disclaimer a {
  color: #E78561;
  text-decoration: none;
}

.gpt-mun-disclaimer a:hover {
  text-decoration: underline;
}