@media (prefers-color-scheme: light) {
  :root {
    --background: #eaebed;
    --background-rgb: 234, 235, 237;
    --background-contrast: #ffffff;
    --standard-text: #72727c;
    --inverted-text: #b8bbc7;
    --link-text: #00af9d;
    --clear-text: #000000;
    --highlight-text: #e55901;
    --muted-text: #828295;
    --almost-invisible-text: #dec9e9;
    --error-message: #d01717;
    --valid-message: rgb(10, 150, 210);
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #2c2d38;
    --background-rgb: 44, 45, 56;
    --background-contrast: #111112;
    --standard-text: #d4d7db;
    --inverted-text: #3c3e47;
    --link-text: #7be880;
    --clear-text: #ffffff;
    --highlight-text: #f77cc6;
    --muted-text: #8b8d9f;
    --almost-invisible-text: #726076;
    --error-message: #da0d0d;
    --valid-message: rgb(4, 180, 239);
  }
}

.valid-message {
  color: var(--valid-message);
}
.error-message {
  color: var(--error-message);
}

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

ul,
li {
  list-style: none;
}

html,
body {
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
}

body {
  background: var(--background);
  color: var(--standard-text);
  font-size: 12px;
  font-family: 'Space Grotesk', serif;
  font-optical-sizing: auto;
  font-weight: '300';
  font-style: normal;
}

.logo-background {
  position: absolute;
  /* Posizione fissa per rimanere ancorato al body */
  top: 0.2rem;
  left: 0.3rem;
  z-index: -1;
  /* Sotto gli altri elementi */
  width: 50px;
  height: auto;
}

.logo-background svg path {
  fill: var(--inverted-text);
}

.wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
}

header {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  width: 100%;
  height: fit-content;
  z-index: 99;
  backdrop-filter: blur(10px);
  /* Applica la sfocatura */
  -webkit-backdrop-filter: blur(10px);
  /* Supporto per browser WebKit */
}

header::before {
  content: '';
  position: fixed;
  display: block;
  top: -450px;
  height: 520px;
  left: 0;
  width: 100%;
  z-index: -1;
  pointer-events: none;
  /* Per evitare che il pseudo-elemento blocchi interazioni */
  background: linear-gradient(
    to bottom,
    rgba(var(--background-rgb), 1) 0%,
    /* Colore pieno */ rgba(var(--background-rgb), 1) 90%,
    /* Semi-trasparente */ rgba(var(--background-rgb), 0.7) 100% /* Trasparente */
  );
}

@media (prefers-color-scheme: dark) {
  header::before {
    box-shadow: 0 4px 10px rgba(var(--background-rgb), 1);
    /* Ombra verso il basso */
  }
}

@media (prefers-color-scheme: light) {
  header::before {
    box-shadow: 0 2px 4px rgba(var(--background-rgb), 1);
  }
}

header h1 {
  text-align: left;
  font-size: 1.7rem;
  margin: 0.1rem 0 0 2.5rem;
}

@media (max-width: 768px) {
  header h1 {
    font-size: 1.5rem;
  }
}

header h1 a {
  color: var(--muted-text);
  text-decoration: none;
}

header h1 a:hover {
  color: var(--link-text);
}

nav {
  display: block;
  padding: 0.2rem 0.5rem 0 0;
}

nav ul {
  display: flex;
  flex-direction: row;
  gap: 1rem;
}

nav ul li a {
  color: var(--muted-text);
  font-size: 1rem;
  text-decoration: none;
  text-align: left;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.3rem;
}

nav ul li a:hover {
  color: var(--link-text);
}

@media (max-width: 768px) {
  nav {
    display: block;
    padding: 0.1rem 0.5rem 0 0;
  }

  nav ul li a {
    gap: 0 0.5rem;
    padding: 0 0 0 0.3rem;
  }

  nav ul li a span {
    display: none;
  }

  nav ul li a i {
    font-size: 1.8rem;
  }
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-top: 60px;
  padding: 1rem;
}

main .container {
  display: flex;
  width: 100%;
  height: 100%;
}

main .container .content {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

footer {
  padding: 0 0 0.5rem 1rem;
  text-align: left;
  color: var(--muted-text);
}

@media (max-width: 768px) {
  footer {
    padding: 0 0.5rem 1.5rem 0.5rem;
    text-align: center;
  }
}

footer a {
  color: var(--clear-text);
  text-decoration: none;
}

/* Qui includiamo gli stili */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  min-height: fit-content;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 500;
  padding: 1.5rem;
  overflow: visible;
  backdrop-filter: blur(2px);
}

.overlay.active {
  opacity: 1;
}

.loading-spinner {
  border: 4px solid var(--background);
  border-left-color: var(--clear-text);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

.popup {
  max-width: 100%;
  max-height: 100%;
  min-height: fit-content;
  background: var(--background);
  border: 1px solid var(--almost-invisible-text);
  border-radius: 10px;
  padding: 3rem 3rem 2rem 3rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  overflow: visible;
}

@media (max-width: 768px) {
  .popup {
    padding: 2.5rem 1.5rem 2rem 1.5rem;
  }
}

.popup .label {
  font-size: 0.9rem;
  line-height: 1.4rem;
  margin-bottom: 0.5rem;
}

.popup .label .thanks {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.3rem;
}

.popup .label b {
  font-weight: 500;
  font-size: 1.5rem;
  color: var(--clear-text);
}

.popup .label i {
  font-size: 1rem;
  color: var(--clear-text);
}

.popup .label u {
  color: var(--highlight-text);
  text-decoration: none;
}

.popup.active {
  transform: scale(1);
}

.close-btn {
  position: absolute;
  display: flex;
  flex: 1;
  align-items: center;
  top: 1rem;
  right: 1rem;
  border: none;
  width: 3rem;
  height: 3rem;
  border-radius: 100%;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  font-size: 3rem;
  z-index: 600;
  cursor: pointer;
}

@media (prefers-color-scheme: dark) {
  .close-btn {
    background: var(--standard-text);
    color: var(--background-contrast);
  }

  .close-btn:hover,
  .close-btn:active {
    background: var(--background-contrast);
    color: var(--standard-text);
  }
}

@media (prefers-color-scheme: light) {
  .close-btn {
    color: var(--standard-text);
    background: var(--background-contrast);
  }

  .close-btn:hover,
  .close-btn:active {
    color: var(--background-contrast);
    background: var(--standard-text);
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/**
 * Pagina principale
 */

.description {
  margin: 0 2rem 0 1.7rem;
  max-width: 700px;
}

.description p {
  padding: 1rem 0;
  font-size: 1rem;
  line-height: 1.5rem;
}

.description .evidence {
  color: var(--highlight-text) !important;
}

.description p a {
  text-underline-offset: 0px;
  text-decoration: none;
  color: var(--highlight-text);
}

.description p a:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.description p b {
  font-size: 0.95rem;
  list-style-type: 1.5rem;
  position: relative;
  bottom: -0.002rem;
  color: var(--clear-text);
}

.description p u {
  text-decoration: underline;
  text-decoration-color: var(--almost-invisible-text);
  text-decoration-thickness: 4px;
  text-underline-offset: 5px;
  color: var(--clear-text);
}

.label-wrapper {
  margin-top: 1rem;
  display: flex;
  flex-direction: row;
  align-items: top;
}

.label-wrapper label {
  color: var(--link-text);
  font-weight: 500;
  letter-spacing: 0.08rem;
}

.label-wrapper p {
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0 2rem;
  cursor: pointer;
}

.label-wrapper i.bi-arrow-90deg-down {
  color: var(--link-text);
  font-weight: 500;
  font-size: 1.5rem;
  margin: 0.2rem 0.5rem 0 1.5rem;
}

.textarea-wrapper,
.shortlink-wrapper {
  display: flex;
  height: 100%;
  max-height: 100%;
  min-height: 20%;
}

.textarea-wrapper i {
  font-size: 1rem;
  margin-top: 0.5rem;
}

.url {
  display: flex;
  width: 100%;
  max-height: 80%;
  font-size: 2rem;
  font-weight: 300;
  text-align: left;
  vertical-align: middle;
  border-radius: 5px;
  background: transparent;
  border: none;
  margin: 0 0 0.5rem 1.8rem;
  resize: none;
  /* Disattiva il ridimensionamento */
  color: var(--muted-text);
  overflow: auto;
  /* Scroll attivo */
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* Internet Explorer 10+ */
}

.url::-webkit-scrollbar {
  display: none;
}

.url::placeholder {
  color: var(--inverted-text);
}

.url:focus {
  outline: none;
  /* Disattiva il bagliore */
  border-color: inherit;
  /* Facoltativo: mantiene il colore del bordo normale */
}

.shortlink-wrapper {
  display: flex;
  flex-direction: column;
  vertical-align: middle;
  max-width: 100%;
  gap: 0.8rem;
}

.shortlink-text {
  position: relative;
  font-size: 1.5rem;
  background: none;
  border-radius: 5px;
  border: 1px solid var(--muted-text);
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
}

.shortlink-text span {
  display: block;
  padding: 1rem 2rem;
}

.shortlink-text span i.bi-clipboard-check {
  color: var(--highlight-text);
}

.shortlink-text .copy-confirmed {
  position: absolute;
  top: -1px;
  right: -1px;
  padding: 0.4rem 1rem;
  border: 1px solid var(--inverted-text);
  background-color: #ffe656;
  color: var(--inverted-text);
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .shortlink-text {
    font-size: 1.1rem;
  }
}

.wrapper-open {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wrapper-open .open-link {
  text-decoration: none;
  display: inline-flex;
  flex-direction: row;
  align-items: baseline;
  font-size: 1.2rem;
  background: var(--background-contrast);
  color: var(--clear-text);
  gap: 0.3rem;
  border: 1px solid var(--almost-invisible-text);
  border-radius: 14px;
  padding: 0.5rem 2.5rem;
  cursor: pointer;
}

.wrapper-open .open-link .ico-store {
  width: fit-content;
  height: fit-content;
  display: block;
}

.wrapper-open .open-link .ico-store img {
  display: block;
  height: 1.1rem;
  width: 1.1rem;
  border-radius: 4px;
  border: 1px solid var(--muted-text);
  padding: 0;
  margin: 0;
  position: relative;
  bottom: -0.15rem;
}

.wrapper-open .open-link:hover,
.wrapper-open .open-link:active {
  background: var(--clear-text);
  color: var(--background-contrast);
}

/**
 * Pagine secondarie
 */

main .container .content h2 {
  color: var(--highlight-text);
  font-size: 3rem;
  font-weight: 300;
  display: flex;
  flex-direction: row;
  align-content: flex-start;
  align-items: center;
  gap: 1rem;
}

.page {
  margin: 0;
  max-width: 800px;
  padding: 5% 0 4% 3%;
}

.page h3 {
  margin: 1rem 0 0 0;
  font-size: 1.5rem;
}

.page .wrapper-block-content {
  border-left: 1px solid var(--muted-text);
  margin: 2rem 0 2rem 1.5rem;
  padding: 0 2rem 0 3.3em;
}

@media (max-width: 768px) {
  .page .wrapper-block-content {
    border: none;
    margin: 1rem 0 0 0;
    padding: 1rem 2.5rem 2rem 1rem;
    border-bottom: 1px solid var(--muted-text);
  }
}

.page p {
  padding: 1rem 0;
  font-size: 0.85rem;
  line-height: 1.5rem;
}

.page p a {
  text-underline-offset: 0px;
  text-decoration: none;
  color: var(--highlight-text);
}

.page p a:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.page p b {
  font-size: 0.95rem;
  list-style-type: 1.5rem;
  position: relative;
  bottom: -0.002rem;
  color: var(--clear-text);
}

.page p .label {
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  display: inline-block;
  padding: 0.15rem 0.4rem;
  margin: 0 0.5rem 0.2rem 0;
  background-color: var(--link-text);
  color: var(--background-contrast);
  border-radius: 4px;
  text-align: center;
  line-height: 1rem;
}

.page p u {
  text-decoration: underline;
  text-decoration-color: var(--almost-invisible-text);
  text-decoration-thickness: 4px;
  text-underline-offset: 5px;
  color: var(--clear-text);
}

/**
 * Support
 */
.support p .label {
  min-width: 120px;
}

/** 
 * Laboratory
 */

.laboratory .drag-info {
  padding: 0 0 0.1rem 0.5rem;
  color: var(--clear-text);
}

.laboratory .bookmarklet-wrapper {
  display: inline-block;
  margin-left: 0.2rem;
}

.laboratory .bookmarklet {
  font-size: 1rem;
  text-decoration: none;
  color: var(--highlight-text);
  cursor: move;
}

.laboratory p .label {
  min-width: 100px;
}

.laboratory .code {
  border: 1px solid var(--almost-invisible-text);
  border-radius: 4px;
  background-color: var(--background-contrast);
  padding: 0.5rem 1rem 0.5rem 4rem;
  cursor: pointer;
  position: relative;
  font-size: 0.65rem;
  font-family: monospace;
  line-height: 0.9rem;
  color: var(--muted-text);
  box-sizing: border-box;
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  overflow: hidden;
  white-space: normal;
}

.laboratory .source-code {
  display: block;
  /* Garantisce un corretto wrapping */
  overflow: hidden;
  box-sizing: border-box;
  max-width: 100%;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.laboratory .source-code > * {
  display: inline-block;
  max-width: 100%;
  white-space: normal;
  overflow: hidden;
  word-wrap: break-word;
}

.laboratory .code i {
  display: block;
  position: absolute;
  font-size: 2rem;
  top: calc(50% - 1rem);
  left: 1rem;
  color: var(--almost-invisible-text);
}

.laboratory .code .copied-notification {
  position: absolute;
  top: 0;
  left: 0;
  padding: 0.4rem 1rem;
  border: 1px solid var(--inverted-text);
  background-color: #ffe656;
  color: var(--inverted-text);
  font-size: 0.9rem;
}
