* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.dark {
  --bg-url: url(./assets/bg-mobile.jpg);
  --text-color: #ffffff;
  --stroke-color: rgba(255, 255, 255, 0.5);
  --surface-color: rgba(255, 255, 255, 0.1);
  --surface-color-hover: rgba(0, 0, 0, 0.3);
  --highlight-color: rgba(255, 255, 255, 0.1);
  --switch-bg: url(./assets/MoonStars.svg);
}

.light {
  --bg-url: url(./assets/bg-mobile-light.jpg);
  --text-color: black;
  --stroke-color: rgba(0, 0, 0, 0.5);
  --surface-color: rgba(0, 0, 0, 0.1);
  --surface-color-hover: rgba(0, 0, 0, 0.3);
  --highlight-color: rgba(0, 0, 0, 0.1);
  --switch-bg: url(./assets/Sun.svg);

  #switch button {
    animation: slide-in 0.4s forwards;
  }
}

body * {
  font-family: "Inter", sans-serif;
  color: var(--text-color) !important;
}

body {
  background-image: var(--bg-url);
  background-repeat: no-repeat;
  background-position: top center;
  background-size: cover;

  /* background: url(./assets/bg-mobile.jpg) no-repeat top center/cover*/

  min-height: 100dvh; /* for modern browsers */
  min-height: -webkit-fill-available; /* for Safari on iOS */
  height: 100%; /* fallback for older browsers */

  padding-bottom: max(
    20px,
    env(safe-area-inset-bottom)
  ); /* assegura que haja um espaçamento mínimo de 20px, mas também leva em consideração o espaço seguro do dispositivo */
  margin-bottom: env(
    safe-area-inset-bottom
  ); /* adiciona uma margem inferior para evitar que o conteúdo fique muito próximo do limite inferior da tela */
}

#container {
  width: 100%;
  min-height: 100dvh; /* for modern browsers */
  max-width: 380px;
  margin: 40px auto 0px;

  padding: 0px 15px;
}

#profile {
  text-align: center;

  h1 {
    font-size: 20px;
    line-height: 30px;
  }

  p {
    font-family:
      playwrite nz basic,
      sans-serif;
    font-weight: 400;
    font-size: 14px;
    color: var(--text-color);

    margin-bottom: 25px;
  }

  img {
    border-radius: 50%;
    width: 120px;
    overflow: hidden;
    object-fit: cover;
  }
}

#switch {
  position: relative;
  width: 64px;
  margin: 4px auto;

  button {
    width: 32px;
    height: 32px;

    background: white var(--switch-bg) no-repeat center;

    border-radius: 50%;
    border: 0;

    position: absolute;
    top: 50%;
    left: 0;
    z-index: 1;
    transform: translateY(-50%);

    animation: slide-out 0.4s;
  }

  span {
    display: block;

    width: 64px;
    height: 24px;

    background: var(--surface-color);
    border: 1px solid var(--stroke-color);
    border-radius: 999px;
    -webkit-backdrop-filter: blur(5px);
  }

  button:hover {
    cursor: pointer;
    outline: 8px solid var(--highlight-color);
  }
}

#listas {
  margin: 50px;
}

/* Links */
ul {
  list-style: none;

  display: flex;
  flex-direction: column;
  gap: 25px;

  padding: 24px 0px;

  li {
    border: 1px solid red;

    background: var(--surface-color);
    border: 1px solid var(--stroke-color);
    border-radius: 10px;
    -webkit-backdrop-filter: blur(5px);
    overflow: hidden;

    a {
      display: flex;
      align-items: center;
      justify-content: center;

      padding: 15px 25px;

      text-decoration: none;
      font-weight: 500;

      transition: background 0.5s;

      #social-links {
        pointer-events: none;
        margin-right: 10px;
      }
    }

    /* pseudo-selector */
    :hover {
      background: var(--surface-color-hover);
      /* border: 1.5px solid white; */
    }
  }
}

/* Social */
#social-media-title {
  p {
    font-family:
      playwrite nz basic,
      sans-serif;
    font-weight: 500;

    display: flex;
    justify-content: center;
  }
}

#social-media {
  display: flex;
  justify-content: center;
  gap: 20px;

  padding: 15px 0px;

  font-size: 30px;

  a {
    display: flex;
    align-items: center;
    justify-content: center;

    padding: 15px;

    transition: background 0.3s;
    border-radius: 50%;
  }
  a:hover {
    background: var(--highlight-color);
  }
}

footer {
  margin-top: 20px;
  padding: 25px 0;
  text-align: center;

  font-family:
    playwrite nz basic,
    sans-serif;
  font-size: 16px;
}

@mediaquery (min-width: 700px) {
  .dark {
    --bg-url: url(./assets/bg-desktop.jpg) !important;
  }

  .light {
    --bg-url: url(./assets/bg-desktop-light.jpg) !important;
  }
}

/* Responsive Design */
@media (min-width: 500px) {
  #container {
    max-width: 580px;
    padding: 0px 24px;

    font-size: 16px;

    footer {
      font-size: 16px;
    }
  }

  #profile img {
    width: 180px;

    p {
      font-size: 30px;
    }

    h1 {
      font-size: 28px;
    }
  }

  #listas {
    margin: 40px 0;

    a {
      padding: 15px 26px;
    }
  }

  #social-media {
    gap: 28px;
    font-size: 32px;
  }
}

@media (min-width: 900px) {
  #container {
    max-width: 800px;
    padding: 0px 30px;

    font-size: 20px;

    footer {
      font-size: 18px;
    }
  }

  #profile {
    img {
      width: 200px;
    }

    p {
      font-size: 20px;
    }

    h1 {
      font-size: 24px;
    }
  }

  #listas {
    margin: 80px 0;

    a {
      padding: 20px 36px;
    }
  }

  #social-media {
    gap: 40px;
    font-size: 36px;
  }
}

/* animations */
@keyframes slide-in {
  from {
    left: 0;
  }
  to {
    left: 50%;
  }
}

@keyframes slide-out {
  from {
    left: 50%;
  }
  to {
    left: 0;
  }
}

/* toggle language animation */
#lang-toggle {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 100;

  transform: scale(1.1);
  filter: brightness(1.2) drop-shadow(0 0 5px var(--highlight-color));
  transition: all 0.3s;

  button {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;

    padding: 5px 10px;
    border-radius: 999px;

    background: transparent var(--surface-color);
    border: 1px solid var(--stroke-color);
    -webkit-backdrop-filter: blur(5px);
    transition: background 0.3s;

    .flag {
      width: 24px;
      height: auto;
      border-radius: 5px;
      transition: all 0.3s ease;
      opacity: 0.5;

      &.active {
        opacity: 1;
        transform: scale(1.2);
        filter: drop-shadow(0 0 20px var(--highlight-color));
      }
    }

    #arrow {
      font-size: 15px;
      color: var(--text-color);
      transition: transform 0.5s ease;
      margin-top: 5px;

      .hidden {
        display: none;
      }

      &:hover {
        transform: scale(1.2);
      }
    }

    &:hover {
      background: var(--surface-color-hover);
      border-color: rgba(255, 255, 255, 0.8);
      box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    }
  }
}

[data-i18n] {
  transition: opacity 0.5s ease;
}
