@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

:root{
  --base-clr: #f4f4f4;
  --line-clr: #42434a;
  --hover-clr: #cad1cc;
  --text-clr: #31314f;
  --accent-clr: #ff6f5e;
  --secondary-text-clr: #1436d0;
  --parrafo: #121314;
  --bg-color: #f4f4f4;
  --text-color: #333;
  --card-bg: white;
  --border:#e0e0e0;
}

body.dark-mode {
  --base-clr: #0d0d12;
  --line-clr: #42434a;
  --hover-clr: #222533;
  --text-clr: #e6e6ef;
  --accent-clr: #ff6f5e;
  --secondary-text-clr: #b0b3c1;
  --parrafo: #b3b8c5;
  --bg-color: #0d0d12;
  --text-color: #f0f0f0;
  --card-bg: #14151e;
  --border:#2c2d37;
}

header h1 {
  margin: 0;
  font-size: 1.8rem;
}

*{
  margin: 0;
  padding: 0;
}
html{
  font-family: Poppins, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.5rem;
}

body{
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background 0.3s, color 0.3s;
  display: flex;
  grid-template-columns: auto 1fr;
  flex-direction: column;
}

#sidebar{
  box-sizing: border-box;
  height: 100vh;
  width: 250px;
  padding: 5px 1em;
  background-color: var(--base-clr);
  border-right: 1px solid var(--border);

  position: sticky;
  top: 0;
  align-self: start;
  transition: 300ms ease-in-out;
  overflow: hidden;
  text-wrap: nowrap;
}
#sidebar.close{
  padding: 5px;
  width: 60px;
}
#sidebar ul{
  list-style: none;
}
#sidebar > ul > li:first-child{
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
  .logo{
    font-weight: 600;
  }
}
#sidebar ul li.active a{
  color: var(--accent-clr);

  svg{
    fill: var(--accent-clr);
  }
}

#sidebar a, #sidebar .dropdown-btn, #sidebar .logo{
  border-radius: .5em;
  padding: .85em;
  text-decoration: none;
  color: var(--text-clr);
  display: flex;
  align-items: center;
  gap: 1em;
}
.dropdown-btn{
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
}
#sidebar svg{
  flex-shrink: 0;
  fill: var(--text-clr);
}
#sidebar a span, #sidebar .dropdown-btn span{
  flex-grow: 1;
}
#sidebar a:hover, #sidebar .dropdown-btn:hover{
  background-color: var(--hover-clr);
}
#sidebar .sub-menu{
  display: grid;
  grid-template-rows: 0fr;
  transition: 300ms ease-in-out;

  > div{
    overflow: hidden;
  }
}
#sidebar .sub-menu.show{
  grid-template-rows: 1fr;
}
.dropdown-btn svg{
  transition: 200ms ease;
}
.rotate svg:last-child{
  rotate: 180deg;
}
#sidebar .sub-menu a{
  padding-left: 2em;
}
#toggle-btn{
  margin-left: auto;
  padding: 1em;
  border: none;
  border-radius: .5em;
  background: none;
  cursor: pointer;

  svg{
    transition: rotate 150ms ease;
  }
}
#toggle-btn:hover{
  background-color: var(--hover-clr);
}

main p{
  color: var(--secondary-text-clr);
  margin-top: 5px;
  margin-bottom: 15px;
}
.container{
  border: 1px solid var(--line-clr);
  border-radius: 1em;
  margin-bottom: 20px;
  padding: min(3em, 15%);
}

.sidebar-collapsed #sidebar li span {
  visibility: hidden;
  opacity: 0;
}

  table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  }

  th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
  }

  th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #1f2937;
  }

  tr:hover td {
    background-color: #f1f5f9;
  }

  code {
    background-color: #f3f4f6;
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.95em;
  }

  @media (prefers-color-scheme: dark) {
    table {
      background-color: #111827;
      color: #f3f4f6;
    }

    th {
      background-color: #1f2937;
      color: #f9fafb;
    }

    tr:hover td {
      background-color: #1e293b;
    }

    td, th {
      border-bottom: 1px solid #374151;
    }

    code {
      background-color: #1f2937;
      color: #d1d5db;
    }
  }


@media(max-width: 800px){
  body{
    grid-template-columns: 1fr;
  }
  main{
    padding: 2em 1em 60px 1em;
  }
  .container{
    border: none;
    padding: 0;
  }
  #sidebar{
    height: 60px;
    width: 100%;
    border-right: none;
    border-top: 1px solid var(--line-clr);
    padding: 0;
    position: fixed;
    top: unset;
    bottom: 0;

    > ul{
      padding: 0;
      display: grid;
      grid-auto-columns: 60px;
      grid-auto-flow: column;
      align-items: center;
      overflow-x: scroll;
    }
    ul li{
      height: 100%;
    }
    ul a, ul .dropdown-btn{
      width: 60px;
      height: 60px;
      padding: 0;
      border-radius: 0;
      justify-content: center;
    }

    ul li span, ul li:first-child, .dropdown-btn svg:last-child{
      display: none;
    }

    ul li .sub-menu.show{
      position: fixed;
      bottom: 60px;
      left: 0;
      box-sizing: border-box;
      height: 60px;
      width: 100%;
      background-color: var(--hover-clr);
      border-top: 1px solid var(--line-clr);
      display: flex;
      justify-content: center;

      > div{
        overflow-x: auto;
      }
      li{
        display: inline-flex;
      }
      a{
        box-sizing: border-box;
        padding: 1em;
        width: auto;
        justify-content: center;
      }
    }
  }
}

.logo-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  height: 60px;
}

.sidebar-collapsed .logo-wrapper {
  flex-direction: column;
  justify-content: center;
  padding: 0;
}

.sidebar-collapsed .logo-img {
  display: none;
}

.logo-img {
  width: 50%;
}

.sidebar-collapsed #toggle-btn {
  margin: 0 auto;
}

main {
  padding: 4rem max(4vw, 2rem);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.8;
  font-size: 1.05rem;
  flex: 1;
}

.container {
  max-width: 780px;
  margin: 0 auto;
  padding: 3rem;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 0 0 1px var(--border);
  border: none;
}

.container h1 {
  font-size: 2.2rem;
  margin-bottom: 1.5rem;
  color: var(--text-clr);
}

.container h2 {
  font-size: 1.5rem;
  color: var(--text-color);
}

.container p {
  margin-bottom: 1.2rem;
  color: var(--parrafo);
}

.container ul {
  margin-left: 1.5rem;
  padding-left: 1rem;
  list-style: none;
}

.container ul li {
  margin-bottom: 0.75rem;
  position: relative;
  padding-left: 1.2rem;
}

.container ul li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent-clr);
}

.container a {
  color: var(--accent-clr);
  text-decoration: underline;
}

a{
  color: var(--text-color);
}

.container a:hover {
  opacity: 0.9;
}

  
  .whatsapp-icon {
  color: #25d366;
  font-size: 24px;
  position: relative;
  text-decoration: none;
  }

  .tooltip-icon {
position: relative;
display: inline-block;
cursor: help;
}

.tooltip-text {
visibility: hidden;
max-width: 520px;
background-color: var(--text-color, #333);
color: var(--bg-color, #fff);
text-align: center;
border-radius: 6px;
padding: 0.5rem;
position: absolute;
z-index: 9999;
bottom: 125%;
left: 50%;
transform: translateX(-50%);
opacity: 0;
transition: opacity 0.3s;
white-space: normal;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
font-weight:normal;
}

.tooltip-text::after {
content: "";
position: absolute;
top: 100%;
left: 50%;
transform: translateX(-50%);
border-width: 6px;
border-style: solid;
border-color: var(--text-color, #333) transparent transparent transparent;
}

.tooltip-icon:hover .tooltip-text {
visibility: visible;
opacity: 1;
}

.small-tooltip i {
  font-size: 0.8rem;
  margin-left: 4px;
  vertical-align: middle;
  }
  
  .small-tooltip .tooltip-text {
  font-size: 0.75rem;
  padding: 0.4rem;
  width: auto;
  max-width: 200px;
  }
  
  .tooltip-container {
  position: relative;
  display: inline-block;
  }
  
  .tooltip-container i {
  font-size: 22px;
  cursor: pointer;
  }
  
  .tooltip-message {
  position: absolute;
  top: 125%;
  right: 0;
  background-color: #333;
  color: #fff;
  padding: 0.5rem;
  border-radius: 6px;
  white-space: nowrap;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1000;
  }
  
  .tooltip-message::after {
  content: "";
  position: absolute;
  bottom: 100%;
  right: 5px;
  border-width: 6px;
  border-style: solid;
  border-color: transparent transparent #333 transparent;
  }
  
  .tooltip-container:hover .tooltip-message {
  opacity: 1;
  }

#topbar {
  position: fixed;
  top: 0;
  left: 250px; /* ancho del sidebar */
  right: 0;
  height: 60px;
  background-color: #14151e;
  color: white;
  z-index: 900; /* menor al sidebar si sidebar usa más */
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line-clr);
  transition: transform 0.3s ease;
}

body.sidebar-collapsed #topbar {
  left: 60px;
}

#topbar.hidden {
  transform: translateY(-100%);
}

.topbar-content {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar-title {
  font-size: 1.3rem;
  font-weight: 600;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: white;
}

.mail-icon, .whatsapp-icon {
  font-size: 1.2rem;
  text-decoration: none;
  color: white;
}

.container-layout {
  display: flex;
  flex-direction: row;
}

#sidebar {
  width: 250px;
  position: sticky;
  top: 0;
  height: 100vh;
  background-color: var(--bg-color);
}

.container-layout {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  background-color: var(--base-clr);
}

header.global-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background-color: var(--card-bg);
  box-shadow: 0 0 0 1px var(--border);
  z-index: 1000;
}

aside.toc {
  width: 220px;
  padding: 2rem 1rem;
  position: sticky;
  top: 60px; /* altura de la topbar */
  height: fit-content;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  color: var(--text-clr);
  font-size: 0.9rem;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
  }
  
  .logo-title{
  display: contents;
  }
  
  .title{
    text-align: center;
  }
  
  .logo {
  height: 40px; 
  max-width: 100%;
  object-fit: contain;
  margin-right: 10px; 
  vertical-align: middle;
  }
  
  .header-icons {
  display: flex;
  align-items: center;
  gap: 15px;
  position: relative;
  }
  
  .whatsapp-icon {
  color: #25d366;
  font-size: 24px;
  position: relative;
  text-decoration: none;
  }
  
  #svg_form_time {
    height: 15px;
    max-width: 80%;
    margin: 40px auto 20px;
    display: block;
  }
  
  #svg_form_time circle,
  #svg_form_time rect {
    fill: white;
  }

  .button {
    display: inline-block;
    background: linear-gradient(135deg, #FF5A5F, #FF7E5F); /* degradado moderno */
    color: var(--bg-color);
    font-weight: bold;
    padding: 12px 24px;
    border-radius: 12px;
    margin: 10px;
    text-decoration: none;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(255, 90, 95, 0.3);
    transition: all 0.2s ease-in-out;
    cursor: pointer;
  }
  
  .button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(255, 90, 95, 0.4);
  }
  
  .disabled {
    display:none;
  }
  
  .alignbutton{
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
  }

aside.toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc a {
  display: block;
  padding: 0.25rem 0;
  text-decoration: none;
  color: #888;
  transition: color 0.2s ease;
}

.toc a.active {
  color: var(--text-clr);
  font-weight: 600;
  border-left: 2px solid var(--accent-clr);
  padding-left: 0.5rem;
}

.svg-code-snippet svg {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  overflow: visible;
}

/* Ocultar sidebar por defecto en mobile */
@media (max-width: 768px) {
  #sidebar {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    width: 80%;
    max-width: 260px;
    height: calc(100% - 60px);
    background-color: var(--base-clr);
    border-right: 1px solid var(--border);
    z-index: 1000;
    overflow-y: auto;
    box-shadow: 4px 0 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
  }

  #sidebar.active {
    display: block;
  }

  /* Botón hamburger */
  .hamburger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color);
    cursor: pointer;
  }

  .global-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .logo-title {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .header-icons {
    display: none;
  }

  .container ul {
    margin-left: 0;
    padding-left: 0;
  }

  .container {
    padding: 1rem;
  }

  #mobile-menu.hamburger-menu-dropdown {
  z-index: 3000; /* más que el sidebar y topbar */
}

  .hamburger-menu-dropdown {
    display: block;
    position: absolute;
    top: 60px;
    right: 10px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.5rem 0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    min-width: 160px;
  }

  .hamburger-menu-dropdown a,
  .hamburger-menu-dropdown button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.6rem 1rem;
    background: none;
    border: none;
    font-size: 1rem;
    color: var(--text-color);
    text-decoration: none;
    cursor: pointer;
  }

  .hamburger-menu-dropdown a:hover,
  .hamburger-menu-dropdown button:hover {
    background-color: var(--hover-clr);
  }

  main {
    padding: 1rem;
    margin-bottom: 2rem;
  }

  .toc {
    display: none;
  }
}

.hamburger-menu-dropdown i {
  width: 20px;
  text-align: center;
  margin-right: 8px;
}

/* Estilo general del botón en desktop */
.hamburger-btn {
  display: none;
}

/* Mostrar botón solo en mobile */
@media (max-width: 768px) {
  .hamburger-btn {
    display: inline-flex;
  }
}

#mobile-menu {
  display: none;
}

#mobile-menu.active {
  display: block;
}


.table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.table-wrapper table {
  width: 100%;
  min-width: 600px; /* o lo que necesites como mínimo */
  border-collapse: collapse;
}