/* reset and global */

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

html {
  background-color: var(--blue950);
}

body {
  min-width: 320px;
  font-family: "Raleway", sans-serif;
  font-size: 0.9rem;
  font-weight: 400;
  color: #ffffff;
}

img {
  max-width: 100%;
  display: block;
}

/* root variables */

:root {
  --gradient1: hsl(6, 100%, 80%);
  --gradient2: hsl(335, 100%, 65%);
  --blue200: hsl(243, 100%, 93%);
  --graylishblue: hsl(229, 7%, 55%);
  --blue850: hsl(228, 56%, 26%);
  --blue950: hsl(229, 57%, 11%);
}

/* utilities */

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* main-layout */

main {
  min-height: 100svh;
  background: url("../images/bg-mobile.png") no-repeat center / cover;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.page-wrapper {
  width: 100%;
  height: 100%;
  position: relative;
  transition: filter 0.3s ease;
}

.page-wrapper.blur {
  filter: blur(6px);
  opacity: 0.7;
}

.cards-holder {
  width: 100%;
  flex-direction: column;
  gap: 1rem;
}

/* logo-card */

.card-logo {
  width: 85%;
  padding-right: 1rem;
  border-radius: 10px 100px 10px 10px;
  background-color: var(--blue850);
  display: flex;
  flex-direction: column;
}

.logo-container {
  margin: 2.5rem 0 1rem 2.5rem;
  display: flex;
}

.icons-container {
  display: flex;
  margin: 1rem 0 2.5rem;
}

.icons-container div {
  background-color: var(--blue950);
  padding: 10px;
  border-radius: 10px;
  margin: 1px 0.8rem;
}

.icons-container div:first-child {
  margin-left: 2.5rem;
}

/* storage-card */

.storage-card-holder {
  width: 85%;
  padding: 2rem 1rem 4rem;
  border-radius: 10px;
  background-color: var(--blue850);
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  position: relative;
}

.storage-card {
  width: 90%;
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: center;
}

/* progress bar */

.bar {
  width: 100%;
  height: 18px;
  background-color: var(--blue950);
  border-radius: 50px;
  display: flex;
  align-items: center;
  border: 2px solid var(--blue950);
}

.progress {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(to right, var(--gradient1), var(--gradient2));
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  transition: width 0.4s ease;
}

.progress::after {
  content: "";
  position: absolute;
  right: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #ffffff;
}

/* storage-text */

.storage-card > .storage-text {
  font-size: clamp(0.8rem, 4vw, 3rem);
  font-weight: 200;
}

.storage-card > .storage-text .storage-available {
  font-weight: 500;
}

.storage-label {
  width: 90%;
  display: flex;
  justify-content: space-between;
  margin-top: -10px;
}

.storage-label span {
  font-size: clamp(0.75rem, 2vw, 1.7rem);
  font-weight: 500;
}

/* storage-badge */

.storage-badge {
  position: absolute;
  bottom: -30px;
  right: 85px;
  padding: 0.3rem 0.9rem;
  border-radius: 10px;
  background-color: #ffffff;
  color: #000000;
}

.storage-left {
  font-size: 2.5rem;
  font-weight: bolder;
  margin: 10px 7px 10px 10px;
}

.storage-unit {
  font-size: 0.84rem;
  margin-right: 10px;
  font-weight: 600;
  color: var(--graylishblue);
}

.input-storage-left {
  display: none;
  font-size: 2.5rem;
  font-weight: bold;
  border: none;
  background: transparent;
  outline: none;
  cursor: text;
  color: inherit;
  font-family: inherit;
  -moz-appearance: textfield;
}

.input-storage-left::-webkit-outer-spin-button,
.input-storage-left::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}


.tooltip {
  display: none;
  position: absolute;
  bottom: 115%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--blue850);
  color: white;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.3s ease;
  font-family: inherit;
  font-weight: normal;
  opacity: 0;
}

.tooltip.active {
  opacity: 0.8;
  pointer-events: auto;
}

/* pop-up */

.pop-up-tip {
  width: 95%;
  max-width: 350px;
  height: 200px;
  background-color: var(--blue950);
  position: absolute;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  border-radius: 10px;
  border: 2px solid var(--blue200);
   opacity: 0;
  pointer-events: none;
  transition: 0.3s ease;
}

.pop-up-tip.active {
  opacity: 1;
  pointer-events: auto;
}

.pop-up-tip p, .pop-up-tip button {
    font-family: inherit;
    font-weight: 500;
}

.pop-up-tip button {
  padding: 10px 25px;
  font-size: 1.2rem;
  background-color: var(--blue950);
  border: 2px solid var(--blue850);
  color: #ffffff;
  border-radius: 5px;
  opacity: 0.9;
}

.pop-up-tip button:hover {
  opacity: 1;
}

.pop-up-card {
  width: 90%;
  height: 250px;
  position: absolute;
  border-radius: 10px;
  backdrop-filter: blur(10px);
  border: 2px solid var(--blue200);
  flex-direction: column;
  gap: 20px;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s ease;
}

.pop-up-card.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

body.popup-open {
  overflow: hidden;
}

/* pop-up range */

.input-percentage {
  width: 100px;
  padding: 10px;
  border-radius: 10px;
  border: 2px solid var(--blue950);
  background-color: var(--blue950);
  font-size: 1.3rem;
  font-weight: 500;
  color: #ffffff;
  text-align: center;
}

.pop-up-bar {
  width: 70%;
  height: 20px;
  border-radius: 50px;
  border: 2px solid var(--blue950);
  background-color: var(--blue950);
  display: flex;
  align-items: center;
}

.range-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 100%;
  cursor: pointer;
  border-radius: 50px;
  background:
    linear-gradient(to right, var(--gradient1), var(--gradient2))
    0 / var(--progress, 0%) 100% no-repeat,
    var(--blue950);
}

.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.range-input::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

/* buttons */

.btn-done,
.btn-close {
  padding: 10px 20px;
  border-radius: 50px;
  border: 2px solid var(--blue850);
  background-color: var(--blue950);
  color: #ffffff;
  opacity: 0.9;
  cursor: pointer;
}

.btn-done:hover,
.btn-close:hover {
  opacity: 1;
}

/* on tablet screens */

@media (min-width: 768px) {

  .logo-container,
  .icons-container {
    justify-content: center;
  }

  .logo-container {
    margin-left: 0;
  }

  .icons-container div:first-child {
    margin-left: 0.8rem;
  }

  .logo-container img {
    width: clamp(150px, 15vw, 100px);
  }

  .icons-container img {
    width: clamp(20px, 2vw, 30px);
  }
}

/* on desktop screens */

@media (min-width: 1024px) {

  .pop-up-tip {
    display: none;
  }

  .pop-up-card {
    display: none;
  }

  .bar,
  .progress {
    pointer-events: none;
  }

  .tooltip {
    display: inline-block;
  }

  main {
    background: url("../images/bg-desktop.png") no-repeat bottom center / contain;
    gap: 3rem;
  }

  .cards-holder {
    flex-direction: row;
    gap: 2rem;
  }

  .card-logo {
    width: 19%;
    min-width: 303px;
  }

  .storage-card-holder {
    width: 35%;
    min-width: 558px;
    padding: 2.5rem 0;
    align-self: flex-end;
  }

  .logo-container {
    margin-left: 2.5rem;
    justify-content: flex-start;
  }

  .icons-container {
    justify-content: flex-start;
  }

  .icons-container div {
    width: 50px;
    height: 50px;
  }

  .icons-container div:first-child {
    margin-left: 2.5rem;
  }

  .storage-card > .storage-text {
    font-size: clamp(0.9rem, 4vw, 1rem);
    align-self: flex-start;
  }

  .storage-label span {
    font-size: clamp(0.75rem, 2vw, 1rem);
  }

  .storage-badge {
    top: -3rem;
    right: 2.5rem;
    bottom: auto;
    padding: 12px 15px 12px 20px;
  }

  .storage-badge::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -20px;
    border-top: 30px solid #ffffff;
    border-left: 30px solid transparent;
  }

  .tooltip::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -17px;
  border-top: 20px solid var(--blue850);
  border-left: 20px solid transparent;
}

  .storage-left {
    margin: 0;
  }

  .input-storage-left {
    display: flex;
  }

  .storage-text-2 {
    display: none;
  }
}