:root {
  --primary-color: #1e1e2f;
  --accent-color: #ff4d6d;
  --bg-color: #f9f9f9;
  --text-color: #333;
  --transition-speed: 0.3s;
  --font-family-base: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --active-text-color: #53a8b1;

  /* fuentes */
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-md: 1rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.5rem;
  --font-size-xxl: 2rem;

  --background-gradient-color: linear-gradient(164deg, #2683a9 0%, #1f2f35 50%, #2c5364 100%);
  /*--scrollbar-gradient-color: linear-gradient(164deg, #329dc9 0%, #ffffff 50%, #2c5364 100%);*/
  --scrollbar-gradient-color: radial-gradient(circle,rgba(83, 168, 177, 1) 0%, rgba(255, 77, 109, 1) 100%);
  /*--scrollbar-hover-gradient-color: linear-gradient(164deg, #00aef5 0%, #e90303 50%, #2c5364 100%);*/
  --scrollbar-hover-gradient-color: linear-gradient(65deg,rgba(255, 77, 109, 1) 6%, rgba(37, 121, 155, 1) 100%);
/*   --scrollbar-background-color: #224f61; */
  --scrollbar-background-color: linear-gradient(82deg, #2683a9 0%, #1f2f35 50%, #2c5364 100%);
  --scrollbar-border-color: #0f1f3a;
}



* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
/* INI APLICAR FUENTES */
body {
  font-size: var(--font-size-md);
}

h1 { font-size: var(--font-size-xxl); }
h2 { font-size: var(--font-size-xl); }
h3 { font-size: var(--font-size-lg); }

a, p, li, span {
  font-size: var(--font-size-md);
}
/* FIN APLICAR FUENTES */

body {
  font-family: var(--font-family-base);
  background: var(--bg-color);
  color: var(--text-color);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  
  /* Fondo degradado */
  /*background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);*/
  /*background: linear-gradient(164deg, #2683a9 0%, #1f2f35 50%, #2c5364 100%);*/
  background: var(--background-gradient-color);
  background-attachment: fixed; /* efecto parallax */

}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(rgba(255,77,109,0.15) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* Tipografía global */
h1, h2, h3, h4, h5, h6 {
  font-weight: bold;
  color: var(--text-color);
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color var(--transition-speed);
}
a:hover {
  /* color: #e0435f; */
  color: #56202a;
}

/* Botones globales */
button {
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: background var(--transition-speed), transform var(--transition-speed);
}
button:hover {
  transform: translateY(-1px);
}

/* Header y footer globales */
header {
  display: flex;
  gap: 1rem;
  align-items: center;
  background: var(--primary-color);
  color: #fff;
  padding: 0.5rem 1rem;
  position: relative;

}
footer {
  background: var(--primary-color);
  color: #fff;
  text-align: center;
  padding: 1rem;
}

/* Elementos del header (menú, sidebar) */
.logo {
  font-size: 1.5rem;
  font-weight: bold;
}
.menu-toggle {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  margin-left: auto;
}
.sidebar {
  position: fixed;
  top: 0;
  left: -250px;
  width: 250px;
  height: 100%;
  background: #29293d;
  color: #fff;
  padding: 1rem;
  transition: left var(--transition-speed) ease;
  overflow-y: auto;
  z-index: 1000;
}
.sidebar.open { left: 0; }
.menu { list-style: none; }
.menu-item { margin-bottom: 1rem; }
.menu-item a, .submenu-toggle {
  background: none;      /* quitar fondo raro */
  border: none;          /* quitar borde */
  padding: 0;            /* asegurarnos de que no tenga padding extraño */
  font-family: inherit;
  
  color: #fff;
  text-decoration: none;
  font-size: 1.1rem;
  display: block;
  cursor: pointer;
  transition: color var(--transition-speed);
}
.menu-item a:hover, .submenu-toggle:hover { color: var(--accent-color); }
.submenu {
  list-style: none;
  margin-left: 1rem;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: max-height var(--transition-speed) ease, opacity var(--transition-speed);
}
.submenu.open {
  max-height: 500px;
  opacity: 1;
  pointer-events: auto;
}
/*
.submenu-container {
  position: relative;
}

.submenu-container:hover .submenu {
  max-height: 500px;
  opacity: 1;
  pointer-events: auto;
}
*/
@media (min-width: 768px) {
.menu-toggle { display: none; }

  .sidebar {
    position: static;
    width: auto;
    height: auto;
    background: none;
    color: inherit;
    padding: 0;
    left: 0;
    transition: none;

    overflow: visible;      /* 🔴 IMPORTANTE: que NO recorte el submenu */
  }

  .menu { 
    display: flex; 
    gap: 2rem; 
  }

  .menu-item {
    position: relative;      /* para anclar el submenu a cada item */
  }

  .submenu {
    position: absolute;
    top: 100%;               /* justo debajo del item */
    left: 0;
    margin-top: 0;           /* sin hueco */
    background: #29293d;
    border-radius: 6px;
    padding: 0.5rem;

    max-height: 0;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;        /* ✅ se mantiene para evitar la barra */
    transition: max-height var(--transition-speed), opacity var(--transition-speed);
    z-index: 999;
  }

  .menu-item:hover .submenu {
    max-height: 500px;
    opacity: 1;
    pointer-events: auto;
  }
  /*
  .menu-toggle { display: none; }
  .sidebar {
    position: static;
    width: auto;
    height: auto;
    background: none;
    color: inherit;
    padding: 0;
    left: 0;
    transition: none;
  }
  .menu { display: flex; gap: 2rem; }
  .submenu {
    position: absolute;
    background: #29293d;
    margin-top: 0.5rem;
    border-radius: 6px;
    padding: 0.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-speed);
  }
  .menu-item:hover .submenu { max-height: 500px; opacity: 1; pointer-events: auto; }
  */
}
/* CSS DEL TOAST*/
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #333;
  color: #fff;
  padding: 0.8rem 1.2rem;
  border-radius: 4px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s;
  z-index: 9999;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.toast.success { background: #4CAF50; }
.toast.error { background: #e0435f; }

/* CSS FOOTER ICONOS REDES */
.social-links {
  margin: 1rem 0;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.social-icon {
  font-size: 2rem;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  transition: transform 0.3s ease, background 0.3s ease;
}

.social-icon:hover {
  transform: scale(1.2);
  background: var(--accent-color);
}

/* Puedes personalizar colores específicos si quieres */
.social-icon.linkedin:hover { background: #0a66c2; }
.social-icon.github:hover   { background: #333; }
.social-icon.itch:hover     { background: #fa5c5c; }

.align-center{
  text-align: center;
}


/* ESTILO BARRA SCROLL */
/* Ancho de la barra */
::-webkit-scrollbar {
  width: 12px;
}

/* Fondo del track */
::-webkit-scrollbar-track {
  background: var(--scrollbar-background-color);
  border-radius: 10px;
}

/* Thumb scrollable */
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-gradient-color);
  /*background: radial-gradient(circle,rgba(83, 168, 177, 1) 0%, rgba(255, 77, 109, 1) 100%);*/
  border-radius: 10px;
  border: 2px solid #0f1f3a;
}

/* Hover del thumb */
::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-hover-gradient-color);
  /*background: linear-gradient(270deg,rgba(255, 255, 255, 1) 0%, rgba(30, 30, 47, 1) 63%);*/

}
/* para firefox, que no acpeta gradient */
/* Color thumb / track */
/*
* {
  scrollbar-width: thin;
  scrollbar-color: #25789a #ff4d6d;
}
*/