:root {
  --color-salmon: #FFA69E;
  --color-salmon-dark: #FF8A7D;
  --color-cream: #FAF3DD;
  --color-aqua: #B8F2E6;
  --color-light-blue: #AED9E0;
  --color-slate: #5E6472;
  --color-slate-light: #7D8491;
  --color-white: #FFFFFF;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 20px;
  --radius-full: 50px;
  --transition: all 0.3s ease;
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--color-cream);
  color: var(--color-slate);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  font-size: 16px;
}

a {
  color: var(--color-slate);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--color-salmon);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.8rem;
  color: var(--color-slate);
}

h1 {
  font-size: 2.5rem;
  letter-spacing: -0.5px;
}

h2 {
  font-size: 1.75rem;
  margin-bottom: 1.2rem;
}

p {
  margin-bottom: 1.2rem;
}

/* Header */
header {
  background: linear-gradient(to right, var(--color-salmon), var(--color-salmon-dark));
  padding: 2rem;
  box-shadow: var(--shadow-md);
  position: relative;
  z-index: 10;
  text-align: center;
}

header h1 {
  color: var(--color-white);
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

.subtitle {
  font-size: 1.1rem;
  margin-top: 0.5rem;
  color: var(--color-white);
  opacity: 0.9;
  font-weight: 300;
}

/* Navigation */
nav {
  background-color: var(--color-white);
  box-shadow: var(--shadow-sm);
  padding: 0.8rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

nav ul {
  display: flex;
  justify-content: center;
  list-style: none;
  gap: 2rem;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
}

nav a {
  font-weight: 600;
  font-size: 1.05rem;
  padding: 0.5rem 0;
  position: relative;
}

nav a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 3px;
  bottom: 0;
  left: 0;
  background-color: var(--color-salmon);
  transition: var(--transition);
}

nav a:hover::after {
  width: 100%;
}

/* Main Content */
main {
  flex: 1;
  padding: 3rem 2rem;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
}

section {
  margin-bottom: 3.5rem;
}

/* Intro Section */
.intro {
  background: linear-gradient(135deg, var(--color-light-blue), var(--color-aqua));
  padding: 2rem;
  border-radius: var(--radius-md);
  margin-bottom: 3rem;
  box-shadow: var(--shadow-md);
  transform: translateY(-15px);
}

.intro h2 {
  color: var(--color-slate);
}

.intro p {
  line-height: 1.7;
}

/* Benefits Section */
#beneficios ul {
  list-style: none;
  padding: 0;
}

#beneficios li {
  margin-bottom: 0.8rem;
  padding-left: 1.8rem;
  position: relative;
}

#beneficios li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--color-salmon);
  font-weight: bold;
}

/* Chat Container */
.chat-container {
  background-color: var(--color-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin: 2rem 0 3.5rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.chat-container h2 {
  padding: 1.5rem;
  margin: 0;
  background-color: var(--color-aqua);
  color: var(--color-slate);
  font-size: 1.5rem;
}

.chat-messages {
  height: 400px;
  overflow-y: auto;
  padding: 1.5rem;
  background-color: rgba(174, 217, 224, 0.1);
  scrollbar-width: thin;
  scrollbar-color: var(--color-salmon) #f1f1f1;
}

.chat-messages::-webkit-scrollbar {
  width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: var(--radius-full);
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--color-salmon);
  border-radius: var(--radius-full);
}

.messages-container {
  display: flex;
  flex-direction: column;
}

.message {
  margin-bottom: 1.2rem;
  padding: 1rem 1.3rem;
  border-radius: var(--radius-md);
  max-width: 80%;
  line-height: 1.6;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  animation: fadeIn 0.3s ease-out;
}

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

.user-message {
  background-color: var(--color-light-blue);
  align-self: flex-end;
  margin-left: auto;
  border-bottom-right-radius: 0;
}
/* Estilos base para mensajes de la IA */
.ai-message {
  background-color: #e6f2ff; /* Fondo azul claro para mensajes de la IA */
  color: #333333;           /* Color de texto más oscuro para mejor contraste */
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Estilos para elementos de Markdown en los mensajes de la IA */
.ai-message h1, .ai-message h2, .ai-message h3, .ai-message h4, .ai-message h5, .ai-message h6 {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
  font-weight: bold;
  color: #0d47a1; /* Azul oscuro para encabezados */
}

.ai-message h1 {
  font-size: 1.4em;
}

.ai-message h2 {
  font-size: 1.3em;
}

.ai-message h3 {
  font-size: 1.2em;
}

.ai-message p {
  margin-bottom: 0.8em;
  line-height: 1.5;
}

.ai-message ul, .ai-message ol {
  margin-left: 1.5em;
  margin-bottom: 0.8em;
}

.ai-message li {
  margin-bottom: 0.3em;
}

.ai-message code {
  background-color: #f8f8f8;
  color: #d81b60; /* Rosa oscuro para código en línea */
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-family: monospace;
}

.ai-message pre {
  background-color: #f8f8f8;
  padding: 1em;
  border-radius: 5px;
  overflow-x: auto;
  margin-bottom: 0.8em;
  border: 1px solid #e0e0e0;
}

.ai-message pre code {
  background-color: transparent;
  color: #333;
  padding: 0;
}

.ai-message blockquote {
  border-left: 4px solid #1976d2; /* Azul para citas */
  padding-left: 1em;
  margin-left: 0;
  color: #555;
  font-style: italic;
  background-color: #f5f5f5;
  padding: 0.5em;
  border-radius: 0 4px 4px 0;
}

.ai-message a {
  color: #1565c0; /* Azul para enlaces */
  text-decoration: underline;
}

.ai-message table {
  border-collapse: collapse;
  margin-bottom: 0.8em;
  width: 100%;
}

.ai-message th {
  background-color: #e3f2fd; /* Azul muy claro para cabeceras de tabla */
  font-weight: bold;
}

.ai-message th, .ai-message td {
  border: 1px solid #bbdefb;
  padding: 0.4em 0.6em;
  text-align: left;
}

.ai-message img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}
.chat-input {
  display: flex;
  padding: 1.2rem;
  background-color: var(--color-white);
  border-top: 1px solid #eee;
}

#user-input {
  flex: 1;
  padding: 1rem 1.5rem;
  border: 2px solid var(--color-light-blue);
  border-radius: var(--radius-full);
  font-size: 1rem;
  outline: none;
  transition: var(--transition);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

#user-input:focus {
  border-color: var(--color-salmon);
  box-shadow: 0 0 0 3px rgba(255, 166, 158, 0.3);
}

#send-btn {
  background: linear-gradient(to right, var(--color-salmon), var(--color-salmon-dark));
  color: white;
  border: none;
  border-radius: var(--radius-full);
  padding: 0.8rem 1.8rem;
  margin-left: 0.8rem;
  cursor: pointer;
  font-weight: bold;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

#send-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

#send-btn:active {
  transform: translateY(0);
}

/* Thinking Animation */
.thinking {
  display: none;
  align-items: center;
  padding: 0.8rem 1rem;
  font-style: italic;
  color: var(--color-slate);
  opacity: 0.7;
  margin-top: 0.5rem;
}

.dot-flashing {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-slate);
  color: var(--color-slate);
  animation: dot-flashing 1s infinite alternate;
  animation-delay: 0.5s;
  margin-left: 10px;
}

.dot-flashing::before, .dot-flashing::after {
  content: "";
  display: inline-block;
  position: absolute;
  top: 0;
}

.dot-flashing::before {
  left: -15px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-slate);
  color: var(--color-slate);
  animation: dot-flashing 1s infinite alternate;
  animation-delay: 0s;
}

.dot-flashing::after {
  left: 15px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-slate);
  color: var(--color-slate);
  animation: dot-flashing 1s infinite alternate;
  animation-delay: 1s;
}

@keyframes dot-flashing {
  0% {
    background-color: var(--color-slate);
  }
  50%, 100% {
    background-color: rgba(94, 100, 114, 0.2);
  }
}

/* Contact Section */
#contacto {
  background-color: var(--color-white);
  padding: 2rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

#contacto h2 {
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
}

#contacto h2::after {
  content: '';
  position: absolute;
  width: 50%;
  height: 3px;
  bottom: -5px;
  left: 0;
  background-color: var(--color-salmon);
}

#contacto ul {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

#contacto li {
  margin-bottom: 0.8rem;
  padding: 0.8rem 1rem;
  background-color: rgba(174, 217, 224, 0.2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
}

#contacto strong {
  color: var(--color-slate-light);
  margin-left: 0.5rem;
}

/* Footer */
footer {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: linear-gradient(to right, var(--color-salmon), var(--color-salmon-dark));
  color: var(--color-white);
  font-size: 0.95rem;
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.05);
}

footer p {
  margin-bottom: 1rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

footer nav {
  background: transparent;
  box-shadow: none;
  padding: 0;
  margin-top: 1.5rem;
}

footer nav a {
  color: var(--color-white);
  opacity: 0.9;
  padding: 0.3rem 1rem;
  font-weight: 400;
}

footer nav a:hover {
  opacity: 1;
  text-decoration: underline;
}

/* Additional Styles for Legal Pages */
.legal-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  background-color: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.legal-section {
  margin-bottom: 2.5rem;
}

.legal-section h3 {
  color: var(--color-slate);
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--color-aqua);
  padding-bottom: 0.8rem;
}

.legal-section ul {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.legal-section li {
  margin-bottom: 0.8rem;
  line-height: 1.6;
}

.highlight-box {
  background-color: rgba(174, 217, 224, 0.2);
  border-left: 4px solid var(--color-salmon);
  padding: 1.5rem;
  border-radius: var(--radius-sm);
  margin: 1.5rem 0;
}

.highlight-box strong {
  color: var(--color-salmon-dark);
}

/* Responsive Design */
@media (max-width: 768px) {
  header {
    padding: 1.5rem 1rem;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  nav ul {
    gap: 1rem;
    padding: 0 0.5rem;
    overflow-x: auto;
    justify-content: flex-start;
  }
  
  nav ul::-webkit-scrollbar {
    height: 3px;
  }
  
  main {
    padding: 2rem 1rem;
  }
  
  .message {
    max-width: 90%;
    padding: 0.8rem 1rem;
  }
  
  #send-btn {
    padding: 0.8rem 1.2rem;
  }
  
  .chat-messages {
    height: 350px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.75rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  .intro {
    padding: 1.5rem;
  }
  
  .message {
    max-width: 95%;
  }
  
  #user-input {
    padding: 0.8rem 1rem;
  }
  
  #send-btn {
    padding: 0.8rem;
    margin-left: 0.5rem;
  }
}

/* Accessibility Improvements */
.visually-hidden {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

button:focus, a:focus, input:focus {
  outline: 3px solid rgba(174, 217, 224, 0.5);
  outline-offset: 2px;
}

/* Additional Animation Effects */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.intro:hover {
  box-shadow: var(--shadow-lg);
  transition: box-shadow 0.3s ease;
}

#send-btn:focus {
  animation: pulse 1s infinite;
}
/* USEFUL LINKS ONLY*/

.usefull-links{
  font-size: 2.5rem;
  color:var(--color-slate);
}
.usefull-links i:hover{
  color:var(--color-light-blue);
}
/* Estilos para la funcionalidad de pantalla completa */
.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  background-color: var(--color-aqua);
  color: var(--color-slate);
}

.chat-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.fullscreen-btn {
  background: transparent;
  border: none;
  color: var(--color-slate);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.fullscreen-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
  transform: scale(1.1);
}

/* Clase para el modo de pantalla completa */
.chat-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  margin: 0;
  border-radius: 0;
  max-width: none;
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.chat-fullscreen .chat-header {
  border-radius: 0;
}

.chat-fullscreen .chat-messages {
  flex: 1;
  height: auto;
}

.chat-fullscreen .chat-input {
  border-radius: 0;
}

/* Ajustes para pantallas más pequeñas */
@media (max-width: 768px) {
  .fullscreen-btn {
    font-size: 1rem;
    padding: 0.4rem;
  }
}