/* =========================================
   1. BASE & ANIMATED BACKGROUND
========================================= */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #f8f9ff;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(0, 255, 213, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(255, 0, 200, 0.14), transparent 35%),
    linear-gradient(135deg, #070710 0%, #13143a 42%, #0f1429 100%);
}

.background-bubbles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.bubble {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  box-shadow: inset 0 0 25px rgba(255, 255, 255, 0.25);
  animation: animate_4010 8s ease-in-out infinite;
  opacity: 0.95;
  mix-blend-mode: screen;
  --bubble-scale: 1;
}

.bubble:nth-child(1) {
  left: 16%;
  top: 7%;
}

.bubble:nth-child(2) {
  --bubble-scale: 0.45;
  left: 6%;
  top: 20%;
  animation-delay: -4s;
}

.bubble:nth-child(3) {
  --bubble-scale: 0.45;
  left: 72%;
  top: 12%;
  animation-delay: -6s;
}

.bubble:nth-child(4) {
  --bubble-scale: 0.35;
  left: 14%;
  top: 64%;
  animation-delay: -3s;
}

.bubble:nth-child(5) {
  --bubble-scale: 0.5;
  left: 64%;
  top: 70%;
  animation-delay: -5s;
}

@keyframes animate_4010 {
  0%, 100% {
    transform: translateY(-20px) scale(var(--bubble-scale));
  }

  50% {
    transform: translateY(20px) scale(calc(var(--bubble-scale) * 1.02));
  }
}

.bubble::before {
  content: '';
  position: absolute;
  top: 50px;
  left: 45px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  z-index: 10;
  filter: blur(2px);
}

.bubble::after {
  content: '';
  position: absolute;
  top: 80px;
  left: 80px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  z-index: 10;
  filter: blur(2px);
}

.bubble span {
  position: absolute;
  border-radius: 50%;
}

.bubble span:nth-child(1) {
  inset: 10px;
  border-left: 15px solid #0fb4ff;
  filter: blur(8px);
}

.bubble span:nth-child(2) {
  inset: 10px;
  border-right: 15px solid #ff4484;
  filter: blur(8px);
}

.bubble span:nth-child(3) {
  inset: 10px;
  border-top: 15px solid #ffeb3b;
  filter: blur(8px);
}

.bubble span:nth-child(4) {
  inset: 30px;
  border-left: 15px solid #ff4484;
  filter: blur(12px);
}

.bubble span:nth-child(5) {
  inset: 10px;
  border-bottom: 10px solid #fff;
  filter: blur(8px);
  transform: rotate(330deg);
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  filter: blur(90px);
  z-index: -1;
  opacity: 0.65;
  animation: floatGlow 10s ease-in-out infinite alternate;
}

body::before {
  top: -70px;
  left: -50px;
  background: rgba(0, 255, 213, 0.28);
}

body::after {
  bottom: -80px;
  right: -40px;
  background: rgba(138, 92, 255, 0.32);
  animation-delay: -4s;
}

@keyframes floatGlow {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(24px, 20px, 0) scale(1.08);
  }
}

/* =========================================
   2. NAVBAR (GLASSMORPHISM)
========================================= */
.navbar {
  width: min(1100px, calc(100% - 32px));
  margin-top: 24px;
  position: relative;
  z-index: 2;
  padding: 18px 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
}

.nav-logo {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(90deg, #00ffd5, #8a5cff 50%, #ff4fd8);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 1px;
}

.nav-links a {
  color: #d9dcf7;
  text-decoration: none;
  margin-left: 20px;
  font-weight: 500;
  transition: color 0.25s ease, transform 0.25s ease;
}

.nav-links a:hover {
  color: #ffffff;
  transform: translateY(-1px);
}

/* =========================================
   3. MAIN CONTAINER
========================================= */
.container {
  width: min(480px, calc(100% - 32px));
  margin: 36px 0 40px;
  position: relative;
  z-index: 2;
  padding: 36px 28px;
  border-radius: 24px;
  text-align: center;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  box-sizing: border-box;
}

h1 {
  margin-top: 0;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #ffffff;
}

/* =========================================
   4. INPUTS & PREVIEW
========================================= */
.input-group {
  text-align: left;
  margin: 20px 0;
}

.input-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 14px;
  color: #e8e9ff;
}

.input-group label span {
  font-weight: 400;
  color: #bfc3e8;
  font-size: 12px;
}

input[type="file"],
input[type="number"] {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  color: #fff;
  box-sizing: border-box;
  outline: none;
  transition: all 0.25s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

input[type="file"]:focus,
input[type="number"]:focus {
  border-color: rgba(0, 255, 213, 0.85);
  box-shadow: 0 0 0 3px rgba(0, 255, 213, 0.16);
  background: rgba(255, 255, 255, 0.14);
}

input[type="file"]::file-selector-button {
  background: linear-gradient(135deg, #2f2d47, #44405f);
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  margin-right: 12px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

input[type="file"]::file-selector-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
}

#imagePreview {
  max-width: 100%;
  max-height: 250px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  object-fit: contain;
}

/* =========================================
   5. GLASSY BUTTON
========================================= */
.btn {
  margin: 20px auto;
  padding: 14px 28px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  outline: none;
  color: #ffffff;
  cursor: pointer;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  display: inline-block;
  text-decoration: none;
  letter-spacing: 0.4px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.08));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
  position: relative;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.34) 50%, transparent 100%);
  transform: translateX(-140%);
  transition: transform 0.7s ease;
  pointer-events: none;
}

.btn:hover::before {
  transform: translateX(140%);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.25);
  border-color: rgba(0, 255, 213, 0.62);
}

.btn:active {
  transform: translateY(0);
}

.preview-card {
  margin: 18px 0 8px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.preview-card::before {
  content: "";
  position: absolute;
  inset: -2px;
  background: linear-gradient(120deg, transparent 0%, rgba(0, 255, 213, 0.16) 35%, transparent 70%);
  transform: translateX(-100%);
  animation: shimmerCard 6s linear infinite;
  pointer-events: none;
}

.preview-label {
  font-size: 13px;
  font-weight: 700;
  color: #dce6ff;
  text-align: left;
  margin-bottom: 10px;
  letter-spacing: 0.4px;
}

#imagePreview {
  display: none;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

#previewHint {
  margin: 8px 0 0;
  color: #bfc6ea;
  font-size: 13px;
}

@keyframes shimmerCard {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

#statusText {
  margin-top: 10px;
  font-weight: 600;
  color: #8de4ff;
}

#output {
  margin-top: 24px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

#resultText {
  margin: 0 0 12px;
  color: #ffffff;
}

/* =========================================
   6. RESPONSIVE DESIGN (Mobiles & Tablets)
========================================= */
@media screen and (max-width: 768px) {
  .navbar {
    padding: 15px 22px;
  }

  .container {
    padding: 30px 22px;
    margin-top: 32px;
  }
}

@media screen and (max-width: 480px) {
  .navbar {
    padding: 15px 20px;
    flex-direction: column;
    gap: 12px;
    border-radius: 20px;
  }

  .nav-links {
    display: flex;
    gap: 14px;
  }

  .nav-links a {
    margin-left: 0;
  }

  .container {
    padding: 24px 18px;
    margin-top: 24px;
    border-radius: 18px;
  }

  h1 {
    font-size: 22px;
  }

  .btn {
    width: 100%;
    box-sizing: border-box;
    padding: 15px 20px;
  }
}

