/* @import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap"); */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Inter, sans-serif;
}

body {
  height: 100dvh;
  width: 100vw;
  position: relative;
  background: radial-gradient(circle at top, #0f172a, #020617);
  overflow: hidden;
}

body::before {
  content: "";
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(
    circle,
    rgba(99, 102, 241, 0.25),
    transparent 60%
  );
  top: -150px;
  left: -150px;
  filter: blur(60px);
  animation: float 8s ease-in-out infinite alternate;
}

body::after {
  content: "";
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.2), transparent 60%);
  bottom: -150px;
  right: -150px;
  filter: blur(70px);
  animation: float 10s ease-in-out infinite alternate;
}

@keyframes float {
  from {
    transform: translateY(0px);
  }
  to {
    transform: translateY(30px);
  }
}

#timer {
  color: #6fc276;
}

#closeBtn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: none;
  border: 1px solid #ee4b2b;
  /* background: linear-gradient(135deg, #6366f1, #0ea5e9); */
  color: white;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
  transition: all 0.25s;
}

#closeBtn:hover {
  background: #ee4b2b;
}

.main {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  width: 420px;
  padding: 30px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
  color: #e2e8f0;
  animation: fadeIn 1s ease;
}

audio::-webkit-media-controls-panel {
  /* background-color: grey; */
  background: linear-gradient(135deg, #6366f1, #0ea5e9);
}

audio::-webkit-media-controls-play-button {
  /* background: transparent; */
  /* background: linear-gradient(135deg, #6366f1, #0ea5e9) !important; */
  background-color: rgba(255, 255, 255, 0) !important;
}

audio::-webkit-media-controls-timeline {
  background: transparent;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

p {
  cursor: default;
}
h2 {
  font-size: 18px;
  margin: 18px 0 10px;
  color: #cbd5f5;
}

input {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(2, 6, 23, 0.7);
  color: #e2e8f0;
  outline: none;
  transition: 0.2s;
}

input:focus {
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

button {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  color: white;
  background: linear-gradient(135deg, #6366f1, #0ea5e9);
  opacity: 45%;
  font-weight: 600;
  cursor: pointer;
  transition: 0.25s;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
}

button:hover {
  opacity: 100%;
}

button:active {
  transform: scale(0.98);
}

#status {
  margin-top: 10px;
  font-size: 13px;
  color: #94a3b8;
  min-height: 18px;
}

.app {
  display: flex;
  gap: 30px;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  padding: 40px;
}

/* right panel */
.result {
  display: none;
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translateX(-50%) translateY(-50%);
  width: 100%;
  height: 100%;
  padding: 20px;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  color: white;
  overflow-y: auto;
}

.popup {
  position: fixed;
  top: 50%;
  left: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 10px;
  transform: translate(-50%, -50%);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 20px;
  border-radius: 14px;
  width: 320px;
  color: white;
  z-index: 9999;
  animation: pop 0.2s ease;
}

.popup > p {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 80%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  margin: 0;
}

.popupbox {
  position: absolute;
  top: 0;
  z-index: 999;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(16px);
  width: 100%;
  height: 100dvh;
}

#fatherElement {
  width: 80%;
  gap: 10px;
  display: flex;
  flex-direction: row-reverse;
}
#inputBox {
  width: 80%;
}
#row0 {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.CloseSvg {
  padding: 2p;
  border: 1px solid #ee4b2b;
  fill: #ee4b2b;
  border-radius: 50%;
  transition: 0.25s;
}
.CloseSvg:hover {
  cursor: pointer;
  background: #ee4b2b;
  fill: white;
}

footer {
  width: 100%;
  position: absolute;
  bottom: 0;
  text-align: center;
  padding: 20px;
  margin-top: 30px;
  font-family: sans-serif;
  color: #666;
  font-size: 14px;
  /* border-top: 1px solid #eee; */
}

footer a {
  color: #4caf50;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s;
}

footer a:hover {
  color: #2e7d32;
  text-decoration: underline;
}

.storage-bar-container {
  margin-top: 10px;
  margin-bottom: 10px;
  font-size: 12px;
  color: #555;
}
.storage-label {
  color: rgba(255, 255, 255, 0.504);
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
}
.progress-bar-bg {
  width: 100%;
  height: 6px;
  background-color: #e0e0e0;
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background-color: #4caf50; /* رنگ سبز */
  width: 0%;
  transition:
    width 0.3s ease,
    background-color 0.3s ease;
}

.progress-bar-fill.low {
  background-color: #f44336;
}

@keyframes pop {
  from {
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
  }
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

/* mobile fix */
@media (max-width: 900px) {
  .app {
    flex-direction: column;
    align-items: center;
  }

  .result {
    width: 100%;
  }
}

@media (max-width: 600px) {
  body {
    overflow: auto;
  }

  .main {
    padding: 15px;
    align-items: flex-start;
  }

  .container {
    width: 100%;
    max-width: 100%;
    padding: 20px;
    border-radius: 12px;
  }

  input,
  button {
    font-size: 16px;
  }

  .popup {
    width: 90%;
    max-width: 320px;
  }

  .popup > p {
    font-size: 13px;
    word-break: break-word;
    white-space: normal;
  }

  #fatherElement {
    flex-direction: column;
    width: 100%;
  }

  #inputBox {
    width: 100%;
  }

  footer {
    font-size: 12px;
    padding: 10px;
  }
}

@media (max-width: 600px) {
  body::before,
  body::after {
    display: none;
  }

  .container {
    backdrop-filter: blur(8px);
  }

  .popup {
    backdrop-filter: blur(10px);
  }
}
