/* Global styles */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;700&display=swap');

img.sena-logo {
    position: absolute;
    width: 90px;
    top: 10px;
    left: 10px;
    user-select: none;
}

img.ds-logo {
    position: absolute;
    width: 90px;
    top: 10px;
    right: 10px;
    user-select: none;
}

h1.smartory {
    color: white;
    text-align: center;
    user-select: none;
    font-size: 50px;
    margin-top: 10px;
}

br {
    user-select: none;
}


/* Login styles (index) */

body.login-body {
    font-size: 16px;
    background-image: url("../img/background.png");
    background-size: cover;
    background-repeat: repeat;
    font-family: "Poppins", sans-serif;
}

div.content-login {
    background-image: url("../img/form.png");
    background-repeat: no-repeat;
    background-size: cover;
    position: absolute;
    border-radius: 15px;
    padding: 3%;
    left: 55%;
    right: 10%;
    top: 13%;
}

h1.title-login {
    color: white;
    text-align: center;
    user-select: none;
    text-align: center;
    font-size: 35px;
    margin-top: -10px;
}

label.username,
label.password {
    color: white;
    cursor: pointer;
    user-select: none;
    font-size: 18px;
}

input.input-login {
    background-color: transparent;
    border: none;
    color: white;
    width: 97%;
    border-bottom: 1px solid white;
    outline: none;
    padding: 3px;
    font-size: 14px;
}

input.input-login::placeholder {
    color: white;
    opacity: 0.3;
    font-size: 15px;
    border: none;
    width: 100%;
    height: 5%;
    user-select: none;
    font-family: "Poppins", sans-serif;
}

input.access {
    border: none;
    outline: none;
    width: 100%;
    height: 40px;
    background-color: #00bf63;
    font-size: 19px;
    font-family: "Poppins", sans-serif;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    transition: all ease 0.1s;
    box-shadow: 0px 5px 0px 0px green;
}

input.access:active {
    transform: translateY(5px);
    box-shadow: 0px 0px 0px 0px green;
}

a.recuperar-contrasena {
    margin-left: 10px;
    color: white;
    cursor: pointer;
    user-select: none;
    text-decoration: none;
}

a.recuperar-contrasena:hover {
    text-decoration: underline;
    color: #00bf63;
}



/* Menu Styles (menu)*/
body.menu-body {
    font-size: 16px;
    background-image: url("../img/background.png");
    background-size: cover;
    background-repeat: repeat;
    font-family: "Poppins", sans-serif;
    user-select: none;
}

div.content-menu {
    background-image: url("../img/menu.png");
    background-repeat: repeat;
    background-size: cover;
    position: absolute;
    border-radius: 15px;
    padding: 2%;
    left: 30%;
    right: 30%;
    top: 13%;
}

div.mensajes-menu {
    color: white;
    text-align: center;
}

h1.title-menu {
    font-size: 350%;
}

h1#welcome-menu {
    font-size: 30px;
}

h3#subtitle-menu {
    font-size: 20px;
}

.menu-options a {
    text-decoration: none;
    text-align: center;
    display: flex;
    padding: 3%;
    justify-content: center;
    user-select: none;
    transform: translateY(-20%);
}

input.option {
    color: white;
    background-color: #398da5;
    width: 280px;
    height: 50px;
    padding: 0 20px;
    font-size: 18px;
    text-transform: uppercase;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: hsl(210deg 87% 36%) 0px 7px 0px 0px;
    overflow: hidden;
    transition: 31ms cubic-bezier(.5, .7, .4, 1);
}

input.option:before {
    content: attr(alt);
    display: flex;
    inset: 0;
    user-select: none;
    text-decoration: none;
    font-size: 15px;
    font-weight: bold;
    color: white;
    letter-spacing: 4px;
    opacity: 1;
}

input.option:active {
    box-shadow: none;
    transform: translateY(7px);
    transition: 35ms cubic-bezier(.5, .7, .4, 1);
}

input.option:hover:before {
    transition: all .0s;
    transform: translateY(100%);
    opacity: 0;
}

.Btn {
    --black: #000000;
    --ch-black: #141414;
    --eer-black: #1b1b1b;
    --night-rider: #2e2e2e;
    --white: #ffffff;
    --af-white: #f3f3f3;
    --ch-white: #e1e1e1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 45px;
    height: 45px;
    border: none;
    top: 90%;
    left: 4%;
    border-radius: 5px;
    cursor: pointer;
    position: absolute;
    overflow: hidden;
    transition-duration: .3s;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.199);
    background-color: var(--af-white);
}

/* plus sign */
.sign {
    width: 100%;
    transition-duration: .3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sign svg {
    width: 17px;
}

.sign svg path {
    fill: var(--night-rider);
}

/* text */
.text {
    position: absolute;
    right: 0%;
    width: 0%;
    opacity: 0;
    color: var(--night-rider);
    font-size: 1.2em;
    font-weight: 600;
    transition-duration: .3s;
}

/* hover effect on button width */
.Btn:hover {
    width: 125px;
    border-radius: 5px;
    transition-duration: .3s;
}

.Btn:hover .sign {
    width: 30%;
    transition-duration: .3s;
    padding-left: 3%;
}

/* hover effect button's text */
.Btn:hover .text {
    opacity: 1;
    width: 70%;
    transition-duration: .3s;
    padding-right: 3%
}

/* button click effect*/
.Btn:active {
    transform: translate(2px, 2px);
}


/* Agregar Producto Styles (agregar-producto)*/
body.body-crear-producto {
    background-image: url("../img/background.png");
    background-size: cover;
    font-size: 16px;
    background-repeat: repeat;
    font-family: "Poppins", sans-serif;
    user-select: none;
}

body.body-editar-producto {
    background-image: url("../img/background.png");
    background-size: cover;
    font-size: 16px;
    background-repeat: repeat;
    font-family: "Poppins", sans-serif;
    user-select: none;
}

div.content-crear-producto {
    background-image: url("../img/form.png");
    background-repeat: repeat;
    background-size: cover;
    position: absolute;
    border-radius: 15px;
    padding: 1%;
    left: 27%;
    width: 45%;
}

div.content-editar-producto {
    background-image: url("../img/form.png");
    background-repeat: repeat;
    background-size: cover;
    position: absolute;
    border-radius: 15px;
    padding: 1%;
    left: 27%;
    width: 45%;
}

h1#msg-menu-producto {
    text-align: center;
    color: white;
    font-size: 45px;
    margin-top: 10px;
    margin-bottom: 40px;
}

div.column-1 {
    float: left;
    width: 45%;
    text-align: center;
}

div.column-2 {
    float: right;
    width: 45%;
    text-align: center;
}

div.button-crear-producto {
    text-align: center;
    margin-top: 20px;
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    width: 100%;
    user-select: none;
}

div.button-save-changes {
    text-align: center;
    margin-top: 20px;
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    width: 100%;
    font-family: "Poppins", sans-serif;
    user-select: none;
}

label.categoria {
    color: white;
    font-size: 18px;
    cursor: pointer;
    user-select: none;
}

input.input-producto {
    background-color: #398da5;
    color: white;
    border: none;
    width: 200px;
    padding: 8px;
    border-radius: 8px;
}

select.option-producto {
    background-color: #398da5;
    color: white;
    font-family: "Poppins", sans-serif;
    border: none;
    width: 220px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
}

input.input-producto::placeholder,
select.option-producto::placeholder {
    color: white;
    opacity: 0.3;
    font-size: 15px;
    border: none;
    width: 200px;
    user-select: none;
    font-family: "Poppins", sans-serif;
}

input.producto {
    border: none;
    outline: none;
    width: 110%;
    height: 130%;
    background-color: #00bf63;
    font-size: 19px;
    font-family: "Poppins", sans-serif;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    transition: all ease 0.1s;
    box-shadow: 0px 5px 0px 0px green;
}

input.producto:active {
    transform: translateY(5px);
    box-shadow: 0px 0px 0px 0px green;
}

input:focus {
    outline: none;
}

/* Consultar producto styles (consultar-producto) */
body.body-consulta {
    background-image: url("../img/background.png");
    background-size: cover;
    font-size: 16px;
    background-repeat: repeat;
    font-family: "Poppins", sans-serif;
    user-select: none;
}

h1.title-consulta {

    text-align: center;
    color: #fff;
    margin-bottom: 20px;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
}

table.table-consulta {
    width: 95%;
    margin: auto;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

th,
td {
    padding: 10px;
    text-align: center;
}

th {
    background: #4caf8e;
    color: white;
}

tr:nth-child(even) {
    background: #f2f2f2;
}

tr:hover {
    background: #d1ffd6;
    transition: 0.3s;
}

.btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    margin: 2px;
}

.btn-eliminar {
    background: #e74c3c;
    color: white;
}

.btn-eliminar:hover {
    background: #c0392b;
}

.btn-actualizar {
    background: #3498db;
    color: white;
}

.btn-actualizar:hover {
    background: #2980b9;
}

/* === MONITO ANIMADO CORREGIDO === */

.avatar {
  --sz-avatar: 166px;
  order: 0;
  width: var(--sz-avatar);
  min-width: var(--sz-avatar);
  max-width: var(--sz-avatar);
  height: var(--sz-avatar);
  min-height: var(--sz-avatar);
  max-height: var(--sz-avatar);
  border: 1px solid #707070;
  border-radius: 9999px;
  overflow: hidden;
  cursor: pointer;
  z-index: 2;
  perspective: 100px;
  position: relative;
  margin: 0 auto 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  --sz-svg: calc(var(--sz-avatar) - 10px);
}
.avatar svg {
  position: absolute;
  transition:
    transform 0.2s ease-in,
    opacity 0.1s;
  transform-origin: 50% 100%;
  height: var(--sz-svg);
  width: var(--sz-svg);
  pointer-events: none;
}
.avatar svg#monkey {
  z-index: 1;
}
.avatar svg#monkey-hands {
  z-index: 2;
  transform-style: preserve-3d;
  transform: translateY(calc(var(--sz-avatar) / 1.25)) rotateX(-21deg);
}

.avatar::before {
  content: "";
  border-radius: 45%;
  width: calc(var(--sz-svg) / 3.889);
  height: calc(var(--sz-svg) / 5.833);
  border: 0;
  border-bottom: calc(var(--sz-svg) * (4 / 100)) solid #3c302a;
  bottom: 20%;

  position: absolute;
  transition: all 0.2s ease;
  z-index: 3;
}
.blind-check:checked ~ .avatar::before {
  width: calc(var(--sz-svg) * (9 / 100));
  height: 0;
  border-radius: 50%;
  border-bottom: calc(var(--sz-svg) * (10 / 100)) solid #3c302a;
}
.avatar svg#monkey .monkey-eye-r,
.avatar svg#monkey .monkey-eye-l {
  animation: blink 10s 1s infinite;
  transition: all 0.2s ease;
}
@keyframes blink {
  0%,
  2%,
  4%,
  26%,
  28%,
  71%,
  73%,
  100% {
    ry: 4.5;
    cy: 31.7;
  }
  1%,
  3%,
  27%,
  72% {
    ry: 0.5;
    cy: 30;
  }
}
.blind-check:checked ~ .avatar svg#monkey .monkey-eye-r,
.blind-check:checked ~ .avatar svg#monkey .monkey-eye-l {
  ry: 0.5;
  cy: 30;
}
.blind-check:checked ~ .avatar svg#monkey-hands {
  transform: translate3d(0, 0, 0) rotateX(0deg);
}
.avatar svg#monkey,
.avatar::before,
.avatar svg#monkey .monkey-eye-nose,
.avatar svg#monkey .monkey-eye-r,
.avatar svg#monkey .monkey-eye-l {
  transition: all 0.2s ease;
}
.blind-check:checked ~ .form:focus-within ~ .avatar svg#monkey,
.blind-check:checked ~ .form:focus-within ~ .avatar::before,
.blind-check:checked ~ .form:focus-within ~ .avatar svg#monkey .monkey-eye-nose,
.blind-check:checked ~ .form:focus-within ~ .avatar svg#monkey .monkey-eye-r,
.blind-check:checked ~ .form:focus-within ~ .avatar svg#monkey .monkey-eye-l {
  animation: none;
}

/* Manos ocultas abajo del círculo y suben al cubrir los ojos */
#monkey-hands {
  width: 90%;
  height: 90%;
  z-index: 2;
  transform: translateY(90px) rotateX(-15deg);
  transform-origin: center top;
  transition: transform 0.4s ease;
}
.blind-check:checked ~ .form .avatar #monkey-hands {
  transform: translateY(0) rotateX(0deg);
}

/* Ojos parpadean y miran al escribir */
.monkey-eye-r,
.monkey-eye-l {
  animation: blink 8s infinite;
  transition: all 0.2s ease;
}
@keyframes blink {
  0%, 96%, 100% { ry: 4.5; }
  97%, 99% { ry: 0.5; }
}

/* Movimiento de cabeza */
.form:focus-within .avatar #monkey {
  animation: headMove 3s ease-in-out infinite;
}
@keyframes headMove {
  0%, 100% { transform: rotateY(0deg); }
  25% { transform: rotateY(-4deg); }
  75% { transform: rotateY(4deg); }
}

/* --- Ícono del ojo en el input --- */
.password-wrapper {
  position: relative;
}

.password-wrapper .blind_input {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-wrapper .blind_input svg {
  width: 20px;
  height: 20px;
  fill: #fff;
  transition: fill 0.2s ease;
}

.password-wrapper .blind_input svg:hover {
  fill: #00bf63;
}

/* Mostrar/Ocultar íconos */
.blind_input .hide {
  display: none;
}
.blind-check:checked ~ .form .password-wrapper .blind_input .show {
  display: none;
}
.blind-check:checked ~ .form .password-wrapper .blind_input .hide {
  display: block;
}

/* --- Centrado del monito en el card --- */
.card {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.title-login {
  margin-bottom: 10px;
}

/* ==========================================
   ✅ RESPONSIVE DESIGN (mantiene todo el CSS)
   ========================================== */

/* Tablets y pantallas medianas */
@media (max-width: 1024px) {
  img.sena-logo,
  img.ds-logo {
    width: 70px;
  }

  h1.smartory {
    font-size: 40px;
  }

  div.content-login {
    left: 25%;
    right: 25%;
  }

  div.content-menu {
    left: 20%;
    right: 20%;
  }

  div.content-crear-producto,
  div.content-editar-producto {
    width: 60%;
    left: 20%;
  }

  div.column-1,
  div.column-2 {
    width: 48%;
  }

  table.table-consulta {
    width: 100%;
  }
}

/* Móviles grandes y tablets pequeñas */
@media (max-width: 768px) {
  img.sena-logo,
  img.ds-logo {
    width: 60px;
  }

  h1.smartory {
    font-size: 32px;
  }

  div.content-login,
  div.content-menu,
  div.content-crear-producto,
  div.content-editar-producto {
    left: 10%;
    right: 10%;
    width: 80%;
    padding: 4%;
  }

  div.column-1,
  div.column-2 {
    float: none;
    width: 100%;
    margin-bottom: 20px;
  }

  input.input-producto,
  select.option-producto {
    width: 90%;
  }

  input.producto {
    width: 80%;
    height: auto;
  }

  h1#msg-menu-producto {
    font-size: 32px;
  }

  table.table-consulta {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .Btn {
    top: auto;
    bottom: 10%;
  }
}

/* Móviles pequeños */
@media (max-width: 480px) {
  img.sena-logo,
  img.ds-logo {
    width: 50px;
    top: 5px;
  }

  h1.smartory {
    font-size: 28px;
  }

  h1.title-login,
  h1#msg-menu-producto,
  h1.title-consulta {
    font-size: 26px;
  }

  div.content-login,
  div.content-menu,
  div.content-crear-producto,
  div.content-editar-producto {
    left: 5%;
    right: 5%;
    width: 90%;
    padding: 6%;
  }

  label.categoria {
    font-size: 16px;
  }

  input.input-producto,
  select.option-producto,
  input.access {
    font-size: 15px;
    width: 100%;
  }

  input.producto {
    font-size: 16px;
    width: 90%;
  }

  .menu-options a {
    padding: 5%;
  }

  input.option {
    width: 220px;
    height: 45px;
    font-size: 15px;
  }

  table.table-consulta {
    font-size: 13px;
  }

  th,
  td {
    padding: 8px;
  }

  .Btn {
    width: 40px;
    height: 40px;
    left: 5%;
  }

  .text {
    font-size: 1em;
  }

  .avatar {
    --sz-avatar: 120px;
  }
}

/* Pantallas muy grandes */
@media (min-width: 1440px) {
  div.content-crear-producto,
  div.content-editar-producto {
    width: 40%;
    left: 30%;
  }

  h1.smartory {
    font-size: 60px;
  }

  h1#msg-menu-producto {
    font-size: 52px;
  }

  table.table-consulta {
    width: 90%;
  }
}
