/* Body styling */
body {
  font-family: 'Arial', sans-serif;
  margin: 0;
  padding: 0;
  background: linear-gradient(120deg, #1a1a1a, #0f0f0f);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
  color: #f5f5f5;
  transition: background 1s ease;
}

/* Container */
.container {
  position: relative;
  padding: 30px 35px 35px 35px;
  border-radius: 20px;
  text-align: center;
  width: 90%;
  max-width: 500px;
  background: rgba(20, 20, 25, 0.95);
  border: 2px solid transparent;
  background-clip: padding-box;
  box-shadow: 0 0 40px rgba(74, 144, 226, 0.6), 0 0 80px rgba(50, 226, 200, 0.3);
  animation: containerGlow 5s infinite alternate;
}

/* Container gradient glow animation */
@keyframes containerGlow {
  0% { box-shadow: 0 0 20px #4a90e2, 0 0 50px #50e3c2; }
  50% { box-shadow: 0 0 40px #d14ae2, 0 0 70px #4ae2b7; }
  100% { box-shadow: 0 0 20px #50e3c2, 0 0 50px #4a90e2; }
}

/* Floating image effect */
.top-image {
  display: block;
  margin: 0 auto 25px auto;
  width: 250px;
  max-width: 80%;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 8px 25px rgba(74,144,226,0.5);
  animation: floatImage 4s ease-in-out infinite;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Image floating keyframes */
@keyframes floatImage {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px) scale(1.02); }
}

.top-image:hover {
  transform: scale(1.1) rotate(-2deg);
  box-shadow: 0 0 35px #50e3c2, 0 0 50px #4a90e2;
}

/* Heading */
h1 {
  color: #f5f5f5;
  margin-bottom: 25px;
  font-size: 32px;
  text-shadow: 0 0 8px #4a90e2, 0 0 15px #50e3c2, 0 0 20px #d14ae2;
  animation: textGlow 2s infinite alternate;
}

/* Heading glow animation */
@keyframes textGlow {
  0% { text-shadow: 0 0 5px #4a90e2, 0 0 10px #50e3c2; }
  50% { text-shadow: 0 0 15px #d14ae2, 0 0 25px #4ae2b7; }
  100% { text-shadow: 0 0 5px #50e3c2, 0 0 10px #4a90e2; }
}

/* Input field */
input[type="number"] {
  padding: 14px;
  width: 90%;
  border-radius: 14px;
  border: 2px solid #2b2525;
  font-size: 16px;
  margin-bottom: 25px;
  outline: none;
  transition: all 0.4s ease;
  background-color: #1f1c1c;
  color: #f5f5f5;
  box-shadow: 0 0 10px rgba(74,144,226,0.2);
}

/* Animated border on focus */
input[type="number"]:focus {
  border-image-slice: 1;
  border-width: 2px;
  border-image-source: linear-gradient(90deg, #4a90e2, #50e3c2, #d14ae2);
  box-shadow: 0 0 25px rgba(74,144,226,0.8);
}

/* Buttons */
.button-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

button {
  padding: 14px 22px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: linear-gradient(135deg, #2c3239, #44746a);
  color: #f5f5f5;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 10px rgba(74,144,226,0.3);
}

/* Button hover glow */
button:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 0 20px #50e3c2, 0 0 30px #4a90e2, 0 0 40px #d14ae2;
  border-image-slice: 1;
  border-width: 2px;
  border-image-source: linear-gradient(90deg, #4a90e2, #50e3c2, #d14ae2);
  border-style: solid;
}

/* Result display */
#result {
  margin-top: 25px;
  font-weight: 600;
  color: #f5f5f5;
  white-space: pre-wrap;
  background: rgba(46, 49, 56, 0.95);
  padding: 18px;
  border-radius: 14px;
  border: 2px solid transparent;
  box-shadow: inset 0 0 8px rgba(0,0,0,0.1);
  transition: all 0.4s ease;
}

/* Animate border when result updates */
#result.active {
  border-image-slice: 1;
  border-image-source: linear-gradient(90deg, #4a90e2, #50e3c2, #d14ae2);
  border-style: solid;
  box-shadow: 0 0 25px #4a90e2, 0 0 35px #50e3c2;
}
