@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");

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

body {
  font-family: "Poppins", sans-serif;
  min-height: 100vh;

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

  padding: 20px;

  background: linear-gradient(135deg, #0f172a, #1e293b, #312e81, #4338ca);

  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: 430px;

  padding: 35px 30px;

  border-radius: 25px;

  background: rgba(255, 255, 255, 0.08);

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);

  border: 1px solid rgba(255, 255, 255, 0.15);

  box-shadow: 0 25px 45px rgba(0, 0, 0, 0.25);

  transition: 0.35s;
}

.container:hover {
  transform: translateY(-5px);
}

.container h1 {
  color: #fff;

  text-align: center;

  font-size: 30px;

  font-weight: 700;

  margin-bottom: 8px;
}

.container > p {
  color: #dbeafe;
  text-align: center;
  margin-bottom: 25px;
  font-size: 15px;
  letter-spacing: 0.3px;
}

.container input {
  width: 100%;

  height: 55px;

  padding: 0 18px;

  border-radius: 14px;

  border: 1px solid rgba(255, 255, 255, 0.15);

  background: rgba(255, 255, 255, 0.08);

  color: #fff;

  font-size: 15px;

  outline: none;

  transition: 0.3s;
}

.container input::placeholder {
  color: #cbd5e1;
}

.container input:focus {
  border-color: #60a5fa;

  background: rgba(255, 255, 255, 0.12);

  box-shadow: 0 0 15px rgba(96, 165, 250, 0.35);
}

.container button {
  width: 100%;

  height: 55px;

  margin-top: 22px;

  border: none;

  border-radius: 14px;

  cursor: pointer;

  font-size: 16px;

  font-weight: 600;

  color: white;

  background: linear-gradient(135deg, #3b82f6, #6366f1);

  transition: 0.3s;

  box-shadow: 0 10px 25px rgba(59, 130, 246, 0.35);
}
.history-item .delete-btn {
  width: 28px;
  height: 28px;
  margin: 0;
}
.container button:hover {
  transform: translateY(-2px);

  box-shadow: 0 18px 35px rgba(59, 130, 246, 0.45);
}

.container button:active {
  transform: scale(0.98);
}

#imgBox {
  width: 220px;

  margin: auto;

  max-height: 0;

  overflow: hidden;

  transition: max-height 0.6s ease;
}

#imgBox img {
  width: 100%;

  display: block;

  padding: 12px;

  background: #fff;

  border-radius: 18px;
}

#imgBox.show-img {
  max-height: 320px;

  margin: 25px auto;

  padding: 10px;

  border-radius: 20px;

  background: rgba(255, 255, 255, 0.08);

  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ==========================
   Error
========================== */

.error-msg {
  display: none;

  margin-top: 15px;

  text-align: center;

  color: #fecaca;

  font-size: 14px;

  font-weight: 500;
}

#downloadBtn {
  display: none;
  margin-top: 15px;
  padding: 10px 18px;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background-color: #2d89ef;
  color: white;
  transition: 0.3s;
}

#downloadBtn:hover {
  background-color: #1b6fd8;
}

.history-section {
  margin-top: 14px;
  padding: 10px 12px;

  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.history-title {
  margin: 0 0 8px;
  padding-bottom: 6px;

  font-size: 15px;
  font-weight: 600;
  color: #fff;

  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.history-container {
  display: flex;
  flex-direction: column;
  gap: 6px;

  max-height: 110px;
  overflow-y: auto;

  padding-right: 3px;
}

/* Scrollbar */

.history-container::-webkit-scrollbar {
  width: 4px;
}

.history-container::-webkit-scrollbar-track {
  background: transparent;
}

.history-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 20px;
}

/* History Items */

/* History Item Layout */

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 8px 10px;

  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.15);
}

.history-text {
  margin: 0;
  flex: 1;

  color: #fff;
  font-size: 13px;
  font-weight: 500;

  text-align: left;

  cursor: pointer;
}
.delete-btn {
  width: 28px;
  height: 28px;

  margin-left: 10px;
  padding: 0;

  border: none;
  border-radius: 50%;

  background: transparent !important;
  box-shadow: none;

  color: rgba(255, 255, 255, 0.7);

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

  cursor: pointer;

  flex-shrink: 0;
}

.delete-btn:hover {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #ff4d4d;
  transform: scale(1.1);
}

/* ==========================
   Mobile
========================== */

@media (max-width: 500px) {
  .container {
    padding: 28px 20px;
  }

  .container h1 {
    font-size: 24px;
  }

  .container p {
    font-size: 14px;
  }

  .container input {
    height: 52px;
  }

  .container button {
    height: 52px;
  }

  #imgBox {
    width: 190px;
  }
}

@media (max-width: 380px) {
  body {
    padding: 12px 10px;
  }
  .container {
    padding: 22px 14px;
    border-radius: 18px;
  }
  .container h1 {
    font-size: 20px;
  }
  #imgBox {
    width: 165px;
  }
}

