/* Paleta de colores de Chile */
:root {
  --chile-red: #d52b1e;
  --chile-blue: #0039a6;
  --chile-white: #ffffff;
  --bg-color: #1a1a1a;
  --bg-secondary: #252525;
  --text-primary: #f0f0f0;
  --text-secondary: #cccccc;
  --accent-color: #d52b1e;
  /* Rojo chileno */
  --accent-secondary: #0039a6;
  /* Azul chileno */
  --border-color: #333333;
  --code-bg: #2d2d2d;
  --warning-color: #d52b1e;
  --success-color: #4d8c57;
  --info-color: #0039a6;
  --danger-color: #d52b1e;
  --star-color: #ffffff;
  /* Blanco para la estrella chilena */
}

/* Estilos generales */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Encabezados */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 1.5em;
  margin-bottom: 0.8em;
  font-weight: 500;
  line-height: 1.2;
}

h1 {
  font-size: 2.5rem;
  text-align: center;
  margin-top: 2rem;
  color: var(--chile-red);
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

h2 {
  font-size: 1.8rem;
  border-bottom: 1px solid var(--chile-blue);
  padding-bottom: 0.3em;
  color: var(--text-primary);
}

h3 {
  font-size: 1.5rem;
  color: var(--chile-red);
}

h4 {
  font-size: 1.2rem;
  color: var(--chile-blue);
}

/* Párrafos y texto */
p {
  margin-bottom: 1.2em;
}

a {
  color: var(--chile-blue);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--chile-red);
  text-decoration: underline;
}

/* Contenedores */
.container {
  padding: 2rem 0;
}

header {
  text-align: center;
  padding: 3rem 0 2rem;
  background-color: var(--bg-secondary);
  border-bottom: 3px solid var(--chile-red);
  margin-bottom: 2rem;
  position: relative;
}

header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 10px;
  background: linear-gradient(to right, var(--chile-blue) 33%, var(--chile-white) 33%, var(--chile-white) 66%, var(--chile-red) 66%);
}

.subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 2rem;
  font-style: italic;
}

.date {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 1rem;
}

/* Secciones */
section {
  margin: 3rem 0;
  padding: 1.5rem;
  background-color: var(--bg-secondary);
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border-left: 4px solid var(--chile-blue);
}

section:nth-child(odd) {
  border-left: 4px solid var(--chile-red);
}

/* Navegación */
nav {
  position: sticky;
  top: 0;
  background-color: var(--bg-secondary);
  padding: 1rem 0;
  margin-bottom: 2rem;
  z-index: 100;
  border-bottom: 3px solid var(--chile-red);
  overflow-x: auto;
  white-space: nowrap;
}

nav ul {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  list-style: none;
}

nav li {
  margin: 0 0.5rem;
}

nav a {
  color: var(--text-secondary);
  font-weight: 500;
  padding: 0.5rem 0.3rem;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  border-bottom: 2px solid transparent;
}

nav a:hover,
nav a.active {
  color: var(--chile-white);
  text-decoration: none;
  border-bottom: 2px solid var(--chile-red);
}

/* Ejemplos de código */
.code-example {
  background-color: var(--code-bg);
  padding: 1rem;
  border-radius: 4px;
  margin: 1.5rem 0;
  font-family: 'Consolas', 'Monaco', monospace;
  overflow-x: auto;
  border-left: 3px solid var(--chile-blue);
}

/* Tablas */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

th,
td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background-color: var(--chile-blue);
  color: var(--chile-white);
}

/* Notas y advertencias */
.note,
.warning,
.deprecated,
.danger,
.huaso-tip {
  padding: 1rem;
  border-radius: 4px;
  margin: 1.5rem 0;
}

.note {
  background-color: rgba(0, 57, 166, 0.1);
  /* Azul chileno */
  border-left: 4px solid var(--chile-blue);
}

.warning {
  background-color: rgba(213, 43, 30, 0.1);
  /* Rojo chileno */
  border-left: 4px solid var(--chile-red);
}

.deprecated {
  background-color: rgba(213, 43, 30, 0.1);
  border-left: 4px solid var(--chile-red);
  text-decoration: line-through;
  opacity: 0.7;
}

.danger {
  background-color: rgba(213, 43, 30, 0.15);
  border-left: 4px solid var(--chile-red);
}

.huaso-tip {
  background-color: rgba(255, 255, 255, 0.1);
  border: 2px dashed var(--chile-red);
  font-style: italic;
}

/* Listas */
ul,
ol {
  margin-left: 1.5rem;
  margin-bottom: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

/* Pie de página */
footer {
  text-align: center;
  padding: 2rem 0;
  margin-top: 3rem;
  border-top: 3px solid var(--chile-red);
  color: var(--text-secondary);
  font-size: 0.9rem;
  background-color: var(--bg-secondary);
  position: relative;
}

footer::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 10px;
  background: linear-gradient(to right, var(--chile-blue) 33%, var(--chile-white) 33%, var(--chile-white) 66%, var(--chile-red) 66%);
}

/* Diseño responsivo */
@media (max-width: 768px) {
  body {
    padding: 0 15px;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.3rem;
  }

  nav ul {
    flex-direction: column;
    align-items: center;
  }

  nav li {
    margin: 0.5rem 0;
  }

  .code-example {
    font-size: 0.9rem;
  }
}

/* Animaciones sutiles */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Estilos específicos para ejemplos chilenos */
.chile-example {
  border-left: 4px solid var(--chile-red);
  background-color: rgba(213, 43, 30, 0.05);
  padding: 1rem;
  border-radius: 4px;
  margin: 1.5rem 0;
}

/* Estilos para recetas de búsqueda */
.recipe {
  border: 2px solid var(--chile-blue);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
  background-color: rgba(0, 57, 166, 0.05);
}

.recipe h4 {
  color: var(--chile-red);
  margin-top: 0;
}

.recipe-result {
  font-style: italic;
  color: var(--text-secondary);
  margin-top: 1rem;
}

/* Estilos para herramientas */
.tool {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
  border: 1px solid var(--chile-blue);
  padding: 1rem;
  border-radius: 8px;
  background-color: rgba(0, 57, 166, 0.05);
}

.tool-content {
  flex: 1;
}

/* Estilos para consideraciones legales */
.legal {
  background-color: rgba(213, 43, 30, 0.05);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
  border: 1px solid var(--chile-red);
}

.legal h3 {
  color: var(--chile-red);
}

/* Bandera chilena estilizada */
.chile-flag {
  display: flex;
  height: 30px;
  width: 60px;
  margin: 0 auto 1rem;
}

.chile-flag-blue {
  background-color: var(--chile-blue);
  width: 33.33%;
  height: 100%;
  position: relative;
}

.chile-flag-blue::after {
  content: "★";
  color: var(--chile-white);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 16px;
}

.chile-flag-white {
  background-color: var(--chile-white);
  width: 33.33%;
  height: 100%;
}

.chile-flag-red {
  background-color: var(--chile-red);
  width: 33.33%;
  height: 100%;
}