/*
https://asbac-inicio.aleshy.net
*/

@font-face {
  font-family: "Roboto Mono";
  font-style: normal;
  font-weight: 100;
  src:
    local("Roboto Mono Thin"),
    local("RobotoMono-Thin"),
    url("../font/RobotoMono-Thin.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Roboto Mono";
  font-style: normal;
  font-weight: 300;
  src:
    local("Roboto Mono Light"),
    local("RobotoMono-Light"),
    url("../font/RobotoMono-Light.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Roboto Mono";
  font-style: normal;
  font-weight: 400;
  src:
    local("Roboto Mono Regular"),
    local("RobotoMono-Regular"),
    url("../font/RobotoMono-Regular.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Roboto Mono";
  font-style: normal;
  font-weight: 700;
  src:
    local("Roboto Mono Bold"),
    local("RobotoMono-Bold"),
    url("../font/RobotoMono-Bold.ttf") format("truetype");
  font-display: swap;
}

* {
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;

  list-style: none;
  text-decoration: none;
}

*,
*:before,
*:after {
  box-sizing: border-box;
}

:root {
  --font: "Roboto Mono", system-ui, Helvetica, Arial;
  --font-alt: "Segoe UI", sans-serif, Arial;
  --font-time: "Roboto Mono", Helvetica, Arial;

  /* Bookmarks colors */
  --bm-bg: #fdfdfd;

  --first-bm: #d8acac;
  --second-bm: #05c715;
  --third-bm: #e69a00;
  --fourth-bm: #c295fe;
  --fifth-bm: #caafb7;
  --sixth-bm: #00d7e6;

  /* general */
  --bg: #e6e6e6;
  --bg-reloj: rgba(134, 134, 134, 0.349);

  --orange: #ff9c8f;

  --white: #ffffff;
  --grey: #b3b3b3;
  --dark-grey: #1c1c1c;
  --black: #000000;

  /* no cambian independientes del tema */
  --fix-white: var(--white);
  --fix-black: var(--black);

  --wallpaper: url("../img/Chemical-Convection-by-teundenouden.jpeg");

  --border-radius: 15px;

  /* Transitions */
  --transition-smooth: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dark-mode {
  /* Bookmarks colors */
  --bm-bg: #1c1c1c;

  --first-bm: #381a1a;
  --second-bm: #024c08;
  --third-bm: #6e4a00;
  --fourth-bm: #3c018a;
  --fifth-bm: #6f4954;
  --sixth-bm: #00484d;

  /* general */
  --bg: #0a0a0a;
  --bg-reloj: rgba(23, 23, 23, 0.349);

  --orange: #8f1100;

  --white: #000000;
  --grey: #b3b3b3;
  --dark-grey: #c1c1c1;
  --black: #ffffff;

  .image {
    box-shadow: inset 0 0 100vw var(--fix-black);
  }
}

.fade {
  transition:
    background-color 0.4s ease,
    color 0.4s ease,
    border-color 0.4s ease,
    box-shadow 0.4s ease;
}

body {
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='12' viewBox='0 0 20 12'%3E%3Cg fill-rule='evenodd'%3E%3Cg id='charlie-brown' fill='%23585858' fill-opacity='0.05'%3E%3Cpath d='M9.8 12L0 2.2V.8l10 10 10-10v1.4L10.2 12h-.4zm-4 0L0 6.2V4.8L7.2 12H5.8zm8.4 0L20 6.2V4.8L12.8 12h1.4zM9.8 0l.2.2.2-.2h-.4zm-4 0L10 4.2 14.2 0h-1.4L10 2.8 7.2 0H5.8z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  font-family: var(--font);
  color: var(--black);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition:
    background-color var(--transition-smooth),
    color var(--transition-smooth);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  text-wrap: balance;
}

p,
li,
a {
  text-wrap: pretty;
}

button,
a,
input,
label {
  &:focus-visible {
    outline: 2px var(--orange) solid;
  }
}

.sombra {
  box-shadow:
    0px 3.7px 2.4px rgba(0, 0, 0, 0.031),
    0px 8.3px 5.7px rgba(0, 0, 0, 0.045),
    0px 14.1px 10.2px rgba(0, 0, 0, 0.055),
    0px 22.3px 16.9px rgba(0, 0, 0, 0.065),
    0px 34.7px 27.8px rgba(0, 0, 0, 0.075),
    0px 56px 48.5px rgba(0, 0, 0, 0.089),
    0px 109px 105px rgba(0, 0, 0, 0.12);
}

.sombra-sm {
  box-shadow:
    0.6px 1px 0.8px rgba(0, 0, 0, 0.057),
    1.6px 3px 2.7px rgba(0, 0, 0, 0.083),
    6px 11px 12px rgba(0, 0, 0, 0.14);
}

.container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 15px 0;
  align-items: center;
  justify-items: center;
  height: 100dvh;
  animation: fadein 1s var(--transition-smooth);
}

/*  Wallpaper */
.image {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background: var(--wallpaper);
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
  outline: 1px solid var(--orange);
  gap: 20px;
}

.container-botones-imagen {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.container-checkbox-tema {
  margin: 10px 0 0 10px;
}

label {
  display: flex;
  width: 50px;
  height: 20px;
  justify-content: space-between;
  align-items: center;
  padding: 0 6px;
  background: var(--white);
  border-radius: 50px;
  cursor: pointer;
  position: relative;
  transition:
    background-color var(--transition-smooth),
    transform var(--transition-smooth);

  &:active {
    transform: scale(0.96);
  }
}

.ball {
  position: absolute;
  display: block;
  width: 12px;
  height: 12px;
  top: 4px;
  left: 5px;
  background: var(--black);
  border-radius: 50%;
  transition:
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    background-color var(--transition-smooth);
}

.container-checkbox-tema input {
  position: absolute;
  padding: 0 6px;
  width: 50px;
  height: 20px;
  border-radius: 50px;
  overflow: hidden;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.container-checkbox-tema input:checked + label .ball {
  transform: translateX(28px);
  background: var(--black);
}

.container-checkbox-tema input:checked + label {
  background: var(--white);
}

/* Tiempo */
.tiempo-fondo {
  background-color: var(--bg-reloj);
  backdrop-filter: blur(10px);
  border-radius: var(--border-radius);
  padding: 20px;
}

.tiempo {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-family: var(--font-time);
  text-transform: uppercase;

  .reloj {
    display: inherit;
    font-size: clamp(3rem, 10vw, 4rem);
    font-variant-numeric: tabular-nums;

    .hora {
      font-weight: 700;
    }

    .am-pm {
      font-weight: 100;
    }
  }

  .fecha {
    font-weight: 300;
    font-size: clamp(1rem, 5vw, 2rem);
  }
}

.mention-wallpaper {
  align-self: flex-end;
  justify-self: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  background-color: var(--orange);
  font-size: smaller;
  white-space: normal;
  padding: 8px;
  border-radius: var(--border-radius) 0 0 0;
  opacity: 0.5;
  font-weight: 400;
  transition: opacity var(--transition-smooth);

  a {
    color: var(--black);
    font-weight: 700;
    border-bottom: 2px transparent solid;
    transition: border-color var(--transition-smooth);

    &:hover {
      border-bottom: 2px var(--black) solid;
    }
  }

  &:hover {
    opacity: 1;
  }
}

/*  MARK: searchbar */
.searchbar-section {
  display: flex;
  width: clamp(65%, 70%, 80%);
}

.custom-search-select {
  position: relative;
  display: flex;
  align-items: center;
  margin-right: 8px;
}

.search-select-btn {
  background: var(--bm-bg);
  border: none;
  border-radius: var(--border-radius);
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  min-width: 40px;
  min-height: 40px;
  transition:
    box-shadow var(--transition-smooth),
    transform var(--transition-smooth);

  &:hover {
    outline: 2px solid var(--orange);
  }

  &:active {
    transform: scale(0.96);
  }

  svg {
    width: 1.4rem;
    height: 1.4rem;
    color: var(--black);
  }
}

.search-select-list {
  display: block;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px) scale(0.95);
  position: absolute;
  top: 110%;
  left: 0;
  z-index: 10;
  background: var(--bm-bg);
  border-radius: var(--border-radius);
  min-width: 320px;
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
  outline: 2px solid var(--orange);
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  transition:
    opacity var(--transition-smooth),
    transform var(--transition-smooth),
    visibility var(--transition-smooth);

  &.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }
}

.search-select-option {
  display: flex;
  gap: 10px;
  margin: 4px 0;
  padding: 12px 16px;
  cursor: pointer;
  font-family: var(--font);
  font-size: 1rem;
  color: var(--black);
  background: none;
  border: none;
  width: 100%;
  border-radius: calc(var(--border-radius) - 6px);
  transition:
    background-color var(--transition-smooth),
    color var(--transition-smooth),
    transform 0.1s ease;

  svg {
    width: 1.4rem;
    height: 1.4rem;
  }

  &.active {
    background: var(--black);
    color: var(--white);
  }

  &:hover {
    background: var(--orange);
    color: var(--black);
  }

  &:active {
    transform: scale(0.98);
  }
}

.search-command {
  opacity: 0.7;
}

.search-name {
  font-weight: bolder;
  opacity: 0.8;
}

/* SEARCHBAR */
.searchbox {
  flex: 1 1 auto;
  height: 100%;
  margin-left: -2px;
  min-width: 0;
  background-color: var(--bm-bg);
  border-radius: var(--border-radius);
  padding: 0.5em 0.7em;
  outline: 2px transparent solid;
  color: var(--black);
  transition:
    outline-color var(--transition-smooth),
    box-shadow var(--transition-smooth),
    background-color var(--transition-smooth);

  &:focus {
    outline: 2px var(--orange) solid;
    box-shadow: 0 0 0 4px rgba(255, 156, 143, 0.25);
  }

  &:hover {
    outline: 2px solid var(--orange);
  }
}

/*  MARK: Bookmarks */
.bm-container {
  position: relative;
  width: clamp(65%, 70%, 80%);
  min-height: 300px;
  height: 100%;
}

.bm-container-tabs {
  position: absolute;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

.bm-container-tabs-titles,
.bm-container-tabs-content {
  display: grid;
  grid-template-columns: repeat(5, minmax(30px, 1fr));
  column-gap: 10px;
}

.bm-tab-title {
  font-size: clamp(1rem, 1vw, 2rem);
  background-color: var(--bm-bg);
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  padding: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  white-space: normal;
  transition:
    background-color var(--transition-smooth),
    border-color var(--transition-smooth),
    transform var(--transition-smooth);

  &:active {
    transform: scale(0.96);
  }

  &:nth-child(1) {
    border-bottom: 2px var(--first-bm) solid;
  }

  &:nth-child(2) {
    border-bottom: 2px var(--second-bm) solid;
  }

  &:nth-child(3) {
    border-bottom: 2px var(--third-bm) solid;
  }

  &:nth-child(4) {
    border-bottom: 2px var(--fourth-bm) solid;
  }

  &:nth-child(5) {
    border-bottom: 2px var(--fifth-bm) solid;
  }
}

.bm-container-tabs-content {
  overflow: hidden;
}

.bm-tab {
  display: flex;
  flex-direction: column;
  border-radius: 0 0 var(--border-radius) var(--border-radius);
  overflow: hidden;
  background-color: var(--bm-bg);
  scrollbar-width: thin;
  scrollbar-color: var(--grey) var(--bm-bg);

  &::-webkit-scrollbar {
    width: 4px;
  }

  &::-webkit-scrollbar-track {
    background: var(--bm-bg);
  }

  &::-webkit-scrollbar-thumb {
    background: var(--grey);
    border-radius: 4px;
  }
}

.bm-content {
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;

  a {
    color: var(--dark-grey);
    padding: 10px 15px;
    margin: 2px 6px;
    border-radius: 8px;
    transition:
      background-color var(--transition-smooth),
      color var(--transition-smooth);

    &:hover {
      color: var(--black);
    }
  }

  &[data-tab*="1"] a:hover {
    background-color: color-mix(in srgb, var(--first-bm) 25%, transparent);
  }

  &[data-tab*="2"] a:hover {
    background-color: color-mix(in srgb, var(--second-bm) 25%, transparent);
  }

  &[data-tab*="3"] a:hover {
    background-color: color-mix(in srgb, var(--third-bm) 25%, transparent);
  }

  &[data-tab*="4"] a:hover {
    background-color: color-mix(in srgb, var(--fourth-bm) 25%, transparent);
  }

  &[data-tab*="5"] a:hover {
    background-color: color-mix(in srgb, var(--fifth-bm) 25%, transparent);
  }
}

/* MARK: media */
@media screen and (max-width: 945px) {
  .bm-container-tabs-titles {
    column-gap: 0;
  }

  .bm-container-tabs-content {
    grid-template-columns: 1fr;
    column-gap: 0;
  }

  .bm-tab-title {
    border-radius: 0;
    font-size: smaller;

    &:first-child {
      border-radius: var(--border-radius) 0 0 0;
    }

    &:last-child {
      border-radius: 0 var(--border-radius) 0 0;
    }

    &.active {
      &:nth-child(1) {
        background-color: var(--first-bm);
      }

      &:nth-child(2) {
        background-color: var(--second-bm);
      }

      &:nth-child(3) {
        background-color: var(--third-bm);
      }

      &:nth-child(4) {
        background-color: var(--fourth-bm);
      }

      &:nth-child(5) {
        background-color: var(--fifth-bm);
      }
    }
  }

  .bm-content {
    display: none;
  }

  .bm-content.active {
    display: flex;
  }
}

.footer-message a {
  margin: 10px 0;
  color: var(--black);
  transition: color var(--transition-smooth);
}

.underline {
  background-image: linear-gradient(
    120deg,
    var(--orange) 0%,
    var(--orange) 100%
  );
  border-radius: 10px 10px 0 0;
  background-repeat: no-repeat;
  background-size: 100% 0.25em;
  background-position: 0 120%;
  transition:
    background-size 0.2s ease-in-out,
    color var(--transition-smooth),
    padding var(--transition-smooth);

  &:hover {
    color: var(--black);
    background-size: 100% 89%;
    padding: 5px 2px 0 2px;
  }
}

noscript {
  color: var(--black);
}

/* MARK: Animaciones */
@keyframes fadein {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
