/* Variables CSS para una gestión centralizada de colores y fuentes */
:root {
  --navbar-bg: #222;
  --navbar-color: #f2f2f2;
  --navbar-hover-bg: #444;
  --content-color: #1a1a1a;
  --background-color: #fdfdfd;
  --content-font: Arial, sans-serif;
}

/* Estilos Globales */
html {
  color: var(--content-color);
  background-color: var(--background-color);
}

body {
  margin: 0 auto;
  max-width: 60em;
  padding: 50px;
  font-family: var(--content-font);
  hyphens: auto;
  overflow-wrap: break-word;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
}

/* Navbar */
#navbar {
  position: sticky;
  top: 0;
  background-color: var(--navbar-bg);
  opacity: 1;
  z-index: 999;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

img, button, a, h2 {
  cursor: pointer;
}

#navbar a {
  color: var(--navbar-color);
  text-align: center;
  padding: 15px 20px;
  text-decoration: none;
  font-size: 16px;
  transition: all 0.3s ease;
  flex-grow: 1;
}

#navbar a:hover {
  background-color: var(--navbar-hover-bg);
  border-radius: 5px;
}

/* Sección del Cronómetro */
#cronometro {
  width: 60rem;
  display: flex;
  justify-content: space-evenly;
}

#cronometrop {
  font-size: 40px;
}

/* AI Chat */
#aichat {
  position: fixed;
  z-index: 998;
  top: 20vh;
  padding: 2em;
  width: 60rem;
  height: 80vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-y: scroll;
  overflow-wrap: break-word;
}

#aichat input {
  border: solid 3px black;
  max-width: 20em;
  height: 2em;
}

#respuestaai {
  color: white;
  padding: 1em;
  display: none;
}

/* Menús */
#menu {
  position: fixed;
  height: 50px;
  width: 50px;
  top: 1em;
  left: 10em;
}

#aimenu {
  position: fixed;
  height: 50px;
  width: 50px;
  top: 80vh;
  right: 10em;
}

/* Contenido */
.content {
  padding: 20px;
  font-size: 18px;
  line-height: 1.6;
}

/* Media Queries */

/* Para pantallas hasta 1400px */
@media (max-width: 1400px) {
  body {
    max-width: 40em;
  }

  #cronometrop {
    font-size: 1.2rem;
  }
}

/* Para pantallas hasta 1380px */
@media (max-width: 1380px) {
  body {
    max-width: 30em;
  }

  #aichat {
    width: 30rem;
    font-size: 15px;
  }

  #navbar a {
    padding: 5px;
    font-size: 16px;
  }

  #menu {
    left: 0;
    top: 18em;
    width: 50px;
    height: 50px;
    z-index: 1000;
  }

  #aimenu {
    left: 0;
    top: 22em;
    width: 50px;
    height: 50px;
    z-index: 1000;
  }

  #cronometro {
    width: 30rem;
  }
}

/* Para pantallas hasta 850px */
@media (max-width: 850px) {
  /* Navbar en columna para mejorar la legibilidad en dispositivos medianos */

  /* Ajustes para el cronómetro */
  #cronometro {
    width: 100%;
    flex-direction: column;
    align-items: center;
  }

  #cronometrop {
    font-size: 2rem;
  }

  /* Ajustes para AI Chat */
  #aichat {
    width: 90%;
    height: 70vh;
    padding: 1em;
    font-size: 14px;
  }

  #menu, 
  #aimenu {
    width: 40px;
    height: 40px;
  }
}


@media (max-width: 600px) {
  #menu {
    left: 0;
    top: 18em;
    width: 30px;
    height: 30px;
  }

  #aichat {
    width: fit-content;
    font-size: 10px;
  }

  #aimenu {
    left: 0;
    top: 22em;
    width: 30px;
    height: 30px;
  }

  body {
    font-size: 0.9em;
    padding: 12px;
    max-width: 38em;
  }

  #cronometro {
    width: 15em;
    flex-direction: column;
    align-items: center;
  }

  h1 {
    font-size: 1.8em;
  }
}

@media print {
html {
background-color: white;
}
body {
background-color: transparent;
color: black;
font-size: 12pt;
}
p, h2, h3 {
orphans: 3;
widows: 3;
}
h2, h3, h4 {
page-break-after: avoid;
}
}
p {
margin: 1em 0;
}
a {
color: #1a1a1a;
}
a:visited {
color: #1a1a1a;
}
img {
max-width: 100%;
}
svg {
height: auto;
max-width: 100%;
}
h1, h2, h3, h4, h5, h6 {
margin-top: 1.4em;
}
h5, h6 {
font-size: 1em;
font-style: italic;
}
h6 {
font-weight: normal;
}
ol, ul {
padding-left: 1.7em;
margin-top: 1em;
}
li > ol, li > ul {
margin-top: 0;
}
blockquote {
margin: 1em 0 1em 1.7em;
padding-left: 1em;
border-left: 2px solid #e6e6e6;
color: #606060;
}
code {
font-family: Menlo, Monaco, Consolas, 'Lucida Console', monospace;
font-size: 85%;
margin: 0;
hyphens: manual;
}
pre {
margin: 1em 0;
overflow: auto;
}
pre code {
padding: 0;
overflow: visible;
overflow-wrap: normal;
}
.sourceCode {
background-color: transparent;
overflow: visible;
}
hr {
border: none;
border-top: 1px solid #1a1a1a;
height: 1px;
margin: 1em 0;
}
table {
margin: 1em 0;
border-collapse: collapse;
width: 100%;
overflow-x: auto;
display: block;
font-variant-numeric: lining-nums tabular-nums;
}
table caption {
margin-bottom: 0.75em;
}
tbody {
margin-top: 0.5em;
border-top: 1px solid #1a1a1a;
border-bottom: 1px solid #1a1a1a;
}
th {
border-top: 1px solid #1a1a1a;
padding: 0.25em 0.5em 0.25em 0.5em;
}
td {
padding: 0.125em 0.5em 0.25em 0.5em;
}
header {
margin-bottom: 4em;
text-align: center;
}
#TOC li {
list-style: none;
}
#TOC ul {
padding-left: 1.3em;
}
#TOC > ul {
padding-left: 0;
}
#TOC a:not(:hover) {
text-decoration: none;
}
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
div.columns{display: flex; gap: min(4vw, 1.5em);}
div.column{flex: auto; overflow-x: auto;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}

ul.task-list[class]{list-style: none;}
ul.task-list li input[type="checkbox"] {
font-size: inherit;
width: 0.8em;
margin: 0 0.8em 0.2em -1.6em;
vertical-align: middle;
}

html { -webkit-text-size-adjust: 100%; }
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
color: #aaaaaa;
}
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
code span.al { color: #ff0000; font-weight: bold; } 
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } 
code span.at { color: #7d9029; } 
code span.bn { color: #40a070; } 
code span.bu { color: #008000; } 
code span.cf { color: #007020; font-weight: bold; } 
code span.ch { color: #4070a0; } 
code span.cn { color: #880000; } 
code span.co { color: #60a0b0; font-style: italic; } 
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } 
code span.do { color: #ba2121; font-style: italic; } 
code span.dt { color: #902000; } 
code span.dv { color: #40a070; } 
code span.er { color: #ff0000; font-weight: bold; } 
code span.ex { } 
code span.fl { color: #40a070; } 
code span.fu { color: #06287e; } 
code span.im { color: #008000; font-weight: bold; } 
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } 
code span.kw { color: #007020; font-weight: bold; } 
code span.op { color: #666666; } 
code span.ot { color: #007020; } 
code span.pp { color: #bc7a00; } 
code span.sc { color: #4070a0; } 
code span.ss { color: #bb6688; } 
code span.st { color: #4070a0; } 
code span.va { color: #19177c; } 
code span.vs { color: #4070a0; } 
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } 