@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css");

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  overflow: auto;
  background: linear-gradient(135deg, #f5f5f5 0%, #f8f6fa 100%);
}

.header {
  background-image: linear-gradient(to right, #e1a9f1 0%, #7A378C 30%, #3C2440 60%, #542C59 100%);
  height: 70px;
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 99999;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  padding: 0 40px;
  width: 100%;
}

.logo-container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  padding: 12px 25px;
  border-radius: 0;
  min-width: auto;
  position: relative;
}

.logo-container::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 60%;
  background: linear-gradient(to bottom, 
    transparent, 
    rgba(255, 255, 255, 0.4) 20%, 
    rgba(255, 255, 255, 0.6) 50%, 
    rgba(255, 255, 255, 0.4) 80%, 
    transparent
  );
}

.logo-container::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 60%;
  background: linear-gradient(to bottom, 
    transparent, 
    rgba(255, 255, 255, 0.4) 20%, 
    rgba(255, 255, 255, 0.6) 50%, 
    rgba(255, 255, 255, 0.4) 80%, 
    transparent
  );
}

.logo {
  height: 65px;
  width: auto;
  max-width: none;
  object-fit: contain;
  filter: 
    brightness(1.2) 
    contrast(1.05)
    drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4))
    drop-shadow(0 0 20px rgba(255, 255, 255, 0.3));
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  transition: all 0.3s ease;
}

.logo:hover {
  filter: 
    brightness(1.3) 
    contrast(1.08)
    drop-shadow(0 3px 12px rgba(0, 0, 0, 0.5))
    drop-shadow(0 0 25px rgba(255, 255, 255, 0.4));
  transform: scale(1.02);
}

.content {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 16px;
  padding: 90px 40px 5px 40px;
  min-height: calc(100vh - 40px);
  max-width: 1800px;
  margin: 0 auto;
  width: 100%;
  height: calc(100vh - 20px);
  overflow: hidden;
}
/* Chat section - 45% del ancho esta en 55 si se ponen graficas debe ser en 45*/ 
.chat-section {
  flex: 0 1 55%;
  min-width: 0;
  max-width: 55%;
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: calc(100vh - 100px);
}
/* Info section - 30% del ancho */
.info-section {
  flex: 0 1 30%;
  min-width: 0;
  max-width: 30%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  position: relative;
}

.info-card {
  background: white;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  animation: fadeInRight 0.5s ease-out;
  border: 1px solid rgba(122, 55, 140, 0.08);
}

.info-card h3 {
  color: #7A378C;
  font-size: 0.9rem;
  margin: 0 0 10px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.info-card h3 i {
  font-size: 1rem;
}

.info-card p {
  color: #555;
  line-height: 1.5;
  margin: 0 0 8px 0;
  font-size: 0.85rem;
}

.info-card ul {
  margin: 0;
  padding-left: 18px;
}

.info-card li {
  color: #666;
  line-height: 1.5;
  margin-bottom: 5px;
  font-size: 0.8rem;
}

.suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.suggestion-btn {
  background: linear-gradient(135deg, #7A378C 0%, #9B59B6 100%);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 0.8rem;
  line-height: 1.3;
  box-shadow: 0 2px 6px rgba(122, 55, 140, 0.15);
}

.suggestion-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(122, 55, 140, 0.3);
  background: linear-gradient(135deg, #542C59 0%, #7A378C 100%);
}

.suggestion-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5 !important;
  transform: none !important;
  box-shadow: 0 2px 6px rgba(122, 55, 140, 0.15) !important;
}

/* Animaciones para rotación de sugerencias */
.suggestion-btn.fade-out {
  animation: fadeOutSlideUp 0.8s ease-in forwards;
}

.suggestion-btn.fade-in {
  animation: fadeInSlideDown 0.9s ease-out forwards;
}

@keyframes fadeOutSlideUp {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-12px);
  }
}

@keyframes fadeInSlideDown {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.grafica {
  width: 500px;
  height: auto;
  
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Scrollbar para info-section */
.info-section::-webkit-scrollbar {
  width: 6px;
}

.info-section::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.info-section::-webkit-scrollbar-thumb {
  background: #c0c0c0;
  border-radius: 10px;
}

.info-section::-webkit-scrollbar-thumb:hover {
  background: #7A378C;
}

.chat-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  text-align: center;
  padding: 12px 40px;
  background: linear-gradient(135deg, #7A378C 0%, #6A2D7C 100%);
  border-radius: 12px 12px 0 0;
  width: 100%;
  box-shadow: 0 3px 8px rgba(0,0,0,0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  gap: 20px;
}

.chat-title-text {
  flex: 1;
  text-align: center;
  letter-spacing: 0.3px;
}

.back-button {
  position: absolute;
  left: 15px;
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 5px 10px;
  display: flex;
  align-items: center;
  transition: transform 0.2s;
}

.back-button:hover {
  transform: scale(1.1);
}

.btn-new-chat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  padding-right: -50px;
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  text-align: center;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 3px 8px rgba(40, 167, 69, 0.3);
  white-space: nowrap;
  border: none;
}

.btn-new-chat:hover {
  background: linear-gradient(135deg, #20c997 0%, #1aa179 100%);
  color: white;
  text-decoration: none;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.chat-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  flex: 1;
  background-color: #ffffff;
  border-radius: 0 0 15px 15px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  overflow: hidden;
}


.chat-messages {
  flex-grow: 1;
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background-color: #fafafa;
}

/* Scrollbar personalizado */
.chat-messages::-webkit-scrollbar {
  width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #c0c0c0;
  border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: #7A378C;
}

.message {
  max-width: 75%;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 3px;
  animation: fadeInUp 0.3s ease-out;
}

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

.message-content {
  flex: 1;
  padding: 10px 14px;
  border-radius: 16px;
  word-wrap: break-word;
  line-height: 1.4;
  font-size: 14px;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.message-content p {
  margin: 0;
  padding: 0;
}

.message-content p:not(:last-child) {
  margin-bottom: 8px;
}

.message-content .list-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 6px;
  line-height: 1.5;
}

.message-content .list-item.numbered {
  gap: 8px;
}

.message-content .list-item.bullet {
  gap: 8px;
}

.message-content .list-number {
  font-weight: 600;
  flex-shrink: 0;
  min-width: 20px;
}

.message-content .bullet-point {
  flex-shrink: 0;
  font-weight: 700;
}

.message-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
  font-weight: bold;
  color: white;
  overflow: hidden;
  background-color: white;
  border: 2px solid #e0e0e0;
}

.message-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-message {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.user-message .message-content {
  background-color: #7A378C;
  color: white;
  border-bottom-right-radius: 4px;
}

/* Ocultar el ícono del usuario */
.user-message .message-icon {
  display: none;
}

.ai-message {
  align-self: flex-start;
  flex-direction: row;
}

.ai-message .message-content {
  background-color: #f0f0f0;
  color: #333;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.ai-message .message-icon {
  background-color: white;
  border-color: #7A378C;
  padding: 2px;
}

.chat-input {
  display: flex;
  align-items: flex-end;
  padding: 12px 15px;
  background-color: #ffffff;
  border-top: 1px solid #e8e8e8;
  gap: 10px;
}

.chat-input textarea {
  flex-grow: 1;
  border: 1px solid #d0d0d0;
  border-radius: 20px;
  padding: 10px 16px;
  resize: none;
  height: 44px;
  font-size: 14px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  transition: border-color 0.3s;
}

.chat-input textarea:focus {
  outline: none;
  border-color: #7A378C;
}

.chat-input button {
  background-color: #7A378C;
  color: white;
  border: none;
  border-radius: 20px;
  padding: 10px 20px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 500;
  min-width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-input button:hover {
  background-color: #542C59;
  transform: scale(1.05);
}

@media (max-width: 768px) {
  .header {
    height: 60px;
  }

  .logo-container {
    padding: 8px 15px;
  }

  .logo {
    height: 45px;
  }

  .content {
    flex-direction: column;
    padding: 70px 15px 15px 15px;
    overflow-x: visible;
  }

  .chat-section {
    flex: none;
    min-width: 100%;
    max-width: 100%;
    width: 100%;
    height: auto;
    min-height: 500px;
    margin-bottom: 20px;
  }

  .info-section {
    flex: none;
    min-width: 100%;
    max-width: 100%;
    width: 100%;
    height: auto;
    max-height: none;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
  }
  
  .grafica-section {
    flex: none;
    min-width: 100%;
    max-width: 100%;
    width: 100%;
    height: auto;
    max-height: none;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
  }

  .chat-container {
    height: auto;
    min-height: 400px;
  }

  .chat-title {
    font-size: 0.95rem;
    padding: 10px 20px;
  }

  .btn-new-chat {
    font-size: 11px;
    padding: 6px 12px;
  }

  .message {
    max-width: 85%;
  }

  .message-icon {
    width: 40px;
    height: 40px;
  }

  .message-content {
    font-size: 13px;
    padding: 9px 12px;
  }

  .chat-input {
    padding: 10px;
  }

  .chat-input textarea {
    font-size: 14px;
    padding: 10px 14px;
    min-height: 40px;
  }

  .chat-input button {
    width: 40px;
    height: 40px;
    min-width: 40px;
  }

  .info-card {
    padding: 14px;
  }

  .info-card h3 {
    font-size: 0.9rem;
  }

  .info-card p {
    font-size: 0.85rem;
  }

  .info-card li {
    font-size: 0.8rem;
  }

  .suggestion-btn {
    font-size: 0.8rem;
    padding: 10px 14px;
  }

  .chat-messages {
    padding: 15px 12px;
    min-height: 300px;
  }
}@media (max-width: 480px) {
  .header {
    height: 55px;
  }

  .header-content {
    padding: 0 15px;
  }

  .logo-container {
    min-width: 120px;
    padding: 3px 6px;
  }

  .logo {
    transform: scale(0.8);
  }

  .content {
    padding: 70px 8px 10px 8px;
    gap: 10px;
  }

  .chat-section {
    min-height: 300px;
  }

  .info-section {
    max-height: 250px;
    gap: 10px;
  }

  .chat-title {
    font-size: 0.85rem;
    padding: 6px 25px;
  }

  .back-button {
    left: 8px;
    font-size: 20px;
    padding: 4px 6px;
  }

  .btn-new-chat {
    font-size: 9px;
    padding: 4px 8px;
  }

  .message {
    max-width: 92%;
  }

  .message-icon {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .message-content {
    font-size: 12px;
    padding: 7px 10px;
    border-radius: 14px;
  }

  .chat-input {
    padding: 6px 10px;
    gap: 8px;
  }

  .chat-input textarea {
    height: 36px;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 16px;
  }

  .chat-input button {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 16px;
    font-size: 16px;
  }

  .info-card {
    padding: 12px;
  }

  .info-card h3 {
    font-size: 0.85rem;
    gap: 6px;
    margin-bottom: 8px;
  }

  .info-card h3 i {
    font-size: 1rem;
  }

  .info-card p {
    font-size: 0.8rem;
    margin-bottom: 6px;
  }

  .info-card ul {
    padding-left: 16px;
  }

  .info-card li {
    font-size: 0.75rem;
    margin-bottom: 3px;
    line-height: 1.4;
  }

  .suggestion-btn {
    padding: 8px 10px;
    font-size: 0.75rem;
    line-height: 1.2;
    border-radius: 6px;
  }

  .chat-messages {
    padding: 12px 10px;
    gap: 10px;
  }

  .back-button {
    font-size: 20px;
  }
}

.typing-indicator {
  display: flex;
  align-items: center;
  padding-left: 18px;
  gap: 10px;
}

.typing-indicator .message-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  padding: 10px 14px;
  background-color: #f0f0f0;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
}

.typing-indicator .message-content span {
  height: 8px;
  width: 8px;
  float: left;
  margin: 0 2px;
  background-color: #7A378C;
  display: block;
  border-radius: 50%;
  opacity: 0.4;
  animation: typing 1s infinite;
}

.typing-indicator .message-content span:nth-of-type(2) {
  animation-delay: 0.2s;
}

.typing-indicator .message-content span:nth-of-type(3) {
  animation-delay: 0.4s;
}
@keyframes typing {
  0% { opacity: 0.4; }
  50% { opacity: 1; }
  100% { opacity: 0.4; }
}
.error-message {
  color: #c62828;
  font-style: italic;
  background-color: #ffebee;
  padding: 10px 14px;
  border-radius: 14px;
  border-left: 3px solid #c62828;
  max-width: 75%;
  align-self: center;
  margin: 8px 0;
  animation: fadeInUp 0.3s ease-out;
  font-size: 13px;
}

.chat-input {
  display: flex;
  align-items: flex-end;
  padding: 10px;
  background-color: #f0f0f0;
  border-top: 1px solid #ddd;
}

.textarea-wrapper {
  flex-grow: 1;
  position: relative;
  max-height: 150px;
  overflow: hidden;
}

#input-text {
  width: 100%;
  max-height: 150px;
  padding: 12px 20px;
  border: 1px solid #d0d0d0;
  border-radius: 24px;
  resize: none;
  overflow-y: auto;
  font-size: 15px;
  line-height: 1.5;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  transition: border-color 0.3s;
}

#input-text:focus {
  outline: none;
  border-color: #7A378C;
}

#input-text::-webkit-scrollbar {
  width: 0px;
  background: transparent;
}

#input-text {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.send-button {
  background-color: #7A378C;
  color: white;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  margin-left: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.3s;
  flex-shrink: 0;
}

.send-button:hover {
  background-color: #542C59;
  transform: scale(1.1);
}

/* Botón deshabilitado durante envío */
.send-button:disabled,
.send-button.disabled {
  background-color: #cccccc;
  cursor: not-allowed;
  opacity: 0.6;
  transform: scale(1) !important;
}

.send-button:disabled:hover,
.send-button.disabled:hover {
  background-color: #cccccc;
  transform: scale(1) !important;
}

/* Textarea deshabilitado durante envío */
#input-text:disabled {
  background-color: #f5f5f5;
  cursor: not-allowed;
  opacity: 0.7;
  border-color: #e0e0e0;
}

/* Estilos para la leyenda mejorada */
.leyenda-card {
  background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%);
  border-left: 4px solid #f39c12;
}

.leyenda {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #555;
}

.leyenda i {
  color: #f39c12;
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.leyenda strong {
  color: #333;
}

.leyenda a {
  color: #7A378C;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s;
  border-bottom: 1px solid transparent;
}

.leyenda a:hover {
  color: #542C59;
  border-bottom-color: #542C59;
}

/* Modal de Bienvenida */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 100000;
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease-out;
  transition: opacity 0.3s ease-out, backdrop-filter 0.3s ease-out;
}

.modal-overlay.show {
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-overlay.fade-out {
  opacity: 0;
  backdrop-filter: blur(0px);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 700px;
  width: 90%;
  overflow: hidden;
  animation: slideUp 0.4s ease-out;
  transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.modal-overlay.fade-out .modal-content {
  transform: translateY(30px) scale(0.95);
  opacity: 0;
}

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

.modal-body {
  display: flex;
  align-items: center;
  gap: 30px;
  padding: 40px;
}

.modal-text {
  flex: 1;
  display: flex;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
}

.speech-bubble {
  background: linear-gradient(135deg, #f8f6fa 0%, #ffffff 100%);
  border: 2px solid #7A378C;
  border-radius: 20px;
  padding: 20px 25px;
  position: relative;
  box-shadow: 0 4px 15px rgba(122, 55, 140, 0.15);
}

.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: 20px;
  right: -15px;
  width: 0;
  height: 0;
  border-top: 15px solid transparent;
  border-bottom: 15px solid transparent;
  border-left: 15px solid #7A378C;
}

.speech-bubble::before {
  content: '';
  position: absolute;
  bottom: 22px;
  right: -11px;
  width: 0;
  height: 0;
  border-top: 13px solid transparent;
  border-bottom: 13px solid transparent;
  border-left: 13px solid #ffffff;
  z-index: 1;
}

.welcome-message {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  color: #333;
}

.welcome-message strong {
  color: #7A378C;
  font-weight: 700;
}

.btn-start-chat {
  background: linear-gradient(135deg, #7A378C 0%, #9B59B6 100%);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(122, 55, 140, 0.3);
  align-self: center;
  margin: 0 auto;
}

.btn-start-chat:hover {
  background: linear-gradient(135deg, #542C59 0%, #7A378C 100%);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(122, 55, 140, 0.4);
}

.btn-start-chat i {
  font-size: 1.2rem;
}

.modal-image {
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.botas-welcome {
  width: 220px;
  height: 220px;
  object-fit: contain;
  filter: drop-shadow(0 10px 30px rgba(122, 55, 140, 0.3));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-15px);
  }
}

/* Responsive del modal */
@media (max-width: 768px) {
  .modal-body {
    flex-direction: column;
    padding: 30px 20px;
    gap: 20px;
  }

  .modal-text {
    width: 100%;
  }

  .speech-bubble {
    padding: 18px 20px;
  }

  /* Cambiar posición del pico en móviles */
  .speech-bubble::after {
    bottom: -15px;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 15px solid #7A378C;
    border-bottom: none;
  }

  .speech-bubble::before {
    bottom: -11px;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    border-left: 13px solid transparent;
    border-right: 13px solid transparent;
    border-top: 13px solid #ffffff;
    border-bottom: none;
  }

  .welcome-message {
    font-size: 0.95rem;
  }

  .botas-welcome {
    width: 180px;
    height: 180px;
  }

  .btn-start-chat {
    width: 100%;
    padding: 12px 24px;
  }
}

@media (max-width: 480px) {
  .modal-content {
    width: 95%;
    border-radius: 15px;
  }

  .modal-body {
    padding: 25px 15px;
  }

  .speech-bubble {
    padding: 15px 18px;
    border-radius: 15px;
  }

  .welcome-message {
    font-size: 0.9rem;
  }

  .botas-welcome {
    width: 150px;
    height: 150px;
  }

  .btn-start-chat {
    font-size: 0.95rem;
    padding: 12px 20px;
  }
}

.disclaimer {
  /* Tipografía */
  font-size: 0.8rem;
  font-weight: 400;
  font-family: 'Segoe UI', -apple-system, sans-serif;
  line-height: 1.5;
  
  /* Color y efecto muted */
  color: rgba(85, 85, 85, 0.7);
  
  /* Alineación y espaciado */
  text-align: center;
  padding: 10px 0;
  margin-top: 6px;
  
  /* Dimensiones y posicionamiento */
  width: 100%;
}

/* Ajuste responsive */
@media (max-width: 1200px) {
  .content {
    gap: 12px;
    padding: 100px 20px 20px 20px;
    overflow-x: auto;
  }

  .chat-section {
    flex: 0 0 42%;
    min-width: 350px;
    max-width: 42%;
  }

  .info-section {
    flex: 0 0 30%;
    min-width: 280px;
    max-width: 30%;
    gap: 12px;
  }
  
  .grafica-section {
    flex: 0 0 28%;
    min-width: 250px;
    max-width: 28%;
    gap: 12px;
  }

  .stats-grid {
    gap: 8px;
  }

  .disclaimer {
    font-size: 0.75rem;
  }
}

/* Sección de Gráficas - 25% del ancho */
.grafica-section {
  flex: 0 1 25%;
  min-width: 0;
  max-width: 25%;
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding: 0;
  position: relative;
}

.graficas-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
}

.grafica-card {
  background: white;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  border: 1px solid rgba(122, 55, 140, 0.08);
  transition: all 0.3s ease;
  overflow: hidden;
}

/* Carrusel de gráficas - ocupa 55% del espacio disponible */
.grafica-carousel {
  flex: 0 0 52%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* Contenedor de estadísticas - ocupa 45% del espacio */
.stats-container {
  flex: 0 0 45%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.grafica-card:hover {
  box-shadow: 0 2px 8px rgba(122, 55, 140, 0.1);
}

.grafica-card h3 {
  color: #7A378C;
  font-size: 0.8rem;
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  flex-shrink: 0;
}

.grafica-card h3 i {
  font-size: 0.9rem;
}

/* Estilos del carrusel */
.carousel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  flex-shrink: 0;
}

.carousel-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.carousel-btn {
  background: linear-gradient(135deg, #7A378C 0%, #9B59B6 100%);
  color: white;
  border: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 12px;
  opacity: 1 !important;
  visibility: visible !important;
}

.carousel-btn:hover {
  background: linear-gradient(135deg, #542C59 0%, #7A378C 100%);
  transform: scale(1.1);
}

.carousel-btn:active {
  transform: scale(0.95);
}

.carousel-indicator {
  font-size: 0.7rem;
  color: #666;
  font-weight: 500;
}

.carousel-container {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border-radius: 6px;
  width: 100%;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  box-sizing: border-box;
}

.carousel-slide.active {
  opacity: 1;
  position: relative;
}

.carousel-slide canvas {
  max-width: 100%;
  max-height: 100%;
  width: 100% !important;
  height: auto !important;
}

/* Cajas de estadísticas */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 0;
  margin-top: 6px;
  flex: 1;
}

.stat-box {
  padding: 8px 6px;
  border-radius: 8px;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 60px;
}

.stat-box:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.stat-yellow {
  background: linear-gradient(135deg, #f1c40f 0%, #f39c12 100%);
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.stat-blue {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.stat-purple {
  background: linear-gradient(135deg, #a569bd 0%, #8e44ad 100%);
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.stat-green {
  background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.stat-number {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 2px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
  line-height: 1;
}

.stat-label {
  font-size: 0.7rem;
  font-weight: 700;
  opacity: 0.95;
  line-height: 1.1;
}

/* Scrollbar para grafica-section */
.grafica-section::-webkit-scrollbar {
  width: 6px;
}

.grafica-section::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.grafica-section::-webkit-scrollbar-thumb {
  background: #c0c0c0;
  border-radius: 10px;
}

.grafica-section::-webkit-scrollbar-thumb:hover {
  background: #7A378C;
}

/* Responsive para gráficas */
@media (max-width: 1200px) {
  .content {
    gap: 12px;
    padding: 100px 20px 20px 20px;
    overflow: hidden;
  }

  .chat-section {
    flex: 0 1 42%;
    min-width: 0;
    max-width: 42%;
    height: 100%;
    max-height: calc(100vh - 120px);
  }

  .info-section {
    flex: 0 1 30%;
    min-width: 0;
    max-width: 30%;
    height: 100%;
    max-height: calc(100vh - 120px);
  }
  
  .grafica-section {
    flex: 0 1 28%;
    min-width: 0;
    max-width: 28%;
    height: 100%;
    max-height: calc(100vh - 120px);
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .disclaimer {
    width: 100%;
  }
}

@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  body {
    overflow-y: auto;
    overflow-x: hidden;
  }

  .content {
    padding: 85px 12px 15px 12px;
    flex-direction: column;
    gap: 15px;
    overflow: visible;
    max-height: none;
    height: auto;
  }

  .chat-section {
    flex: none;
    min-width: 100%;
    max-width: 100%;
    width: 100%;
    height: auto;
    min-height: 500px;
    margin-bottom: 0;
    order: 1;
  }

  .chat-container {
    height: 500px;
  }

  .info-section {
    flex: none;
    min-width: 100%;
    max-width: 100%;
    width: 100%;
    height: auto;
    max-height: none;
    gap: 12px;
    margin-bottom: 0;
    position: static;
    z-index: auto;
    overflow-y: visible;
    order: 2;
  }
  
  .grafica-section {
    flex: none;
    min-width: 100%;
    max-width: 100%;
    width: 100%;
    height: auto;
    max-height: none;
    margin-bottom: 0;
    position: static;
    z-index: auto;
    overflow-y: visible;
    order: 3;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .stat-number {
    font-size: 1.4rem;
  }
  
  .stat-label {
    font-size: 0.6rem;
  }
  
  .grafica-card {
    padding: 8px 10px;
  }
  
  .graficas-container {
    gap: 8px;
  }

  .chat-container {
    border-radius: 0 0 10px 10px;
    height: auto;
    min-height: 400px;
  }

  .chat-title {
    font-size: 0.95rem;
    padding: 8px 35px;
    border-radius: 8px 8px 0 0;
  }

  .btn-new-chat {
    font-size: 10px;
    padding: 5px 10px;
    gap: 4px;
  }

  .message {
    max-width: 88%;
  }

  .message-icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .message-content {
    font-size: 13px;
    padding: 8px 12px;
  }

  .chat-input {
    padding: 8px 12px;
  }

  .chat-input textarea {
    height: 40px;
    font-size: 13px;
    padding: 8px 14px;
    border-radius: 18px;
  }

  .chat-input button {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 18px;
  }

  .info-card {
    padding: 14px;
  }

  .info-card h3 {
    font-size: 0.9rem;
    margin: 0 0 10px 0;
  }

  .info-card p {
    font-size: 0.85rem;
    margin: 0 0 8px 0;
  }

  .info-card li {
    font-size: 0.8rem;
    margin-bottom: 4px;
  }

  .suggestion-btn {
    padding: 10px 12px;
    font-size: 0.8rem;
    border-radius: 8px;
  }

  .chat-messages {
    padding: 16px 12px;
    gap: 12px;
    min-height: 300px;
  }
}

@media (max-width: 480px) {
  body {
    overflow-y: auto;
    overflow-x: hidden;
  }

  .content {
    padding: 85px 8px 10px 8px;
    overflow: visible;
  }

  .chat-section {
    min-height: 450px;
  }

  .chat-container {
    height: 450px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  
  .stat-number {
    font-size: 1.2rem;
  }
  
  .stat-label {
    font-size: 0.55rem;
  }
  
  .stat-box {
    padding: 10px 8px;
  }

  .info-card, .grafica-card {
    padding: 12px;
  }
}

