/* --- Custom Styles for the Password Generator Page --- */

/* 1. Body and Background Animation */
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  color: #c9d1d9;
  overflow: hidden; /* Prevents scrollbars from the animated background */
  background: linear-gradient(-45deg, #141a24, #2a1a45, #1d3557, #457b9d);
  background-size: 400% 400%;
  animation: body-gradient 15s ease infinite;
}

@keyframes body-gradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Container for the floating bubble animations */
.animated-background {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* Individual floating bubble item */
.item {
  position: absolute;
  bottom: -20%; /* Start from below the screen */
  opacity: 0;
  border-radius: 50%;
}

/* Floating animation: moves items up and rotates them */
@keyframes float {
  0% {
    transform: translateY(0) rotate(0);
    opacity: 0;
  }
  50% {
    transform: rotate(360deg) scale(1.1);
    opacity: .4;
  }
  100% {
    transform: translateY(-120vh) rotate(720deg) scale(.8);
    opacity: 0;
  }
}

/* Hue rotation animation: changes the color of the bubbles over time */
@keyframes hue {
  0% { background: rgba(76, 93, 255, .15); }
  33% { background: rgba(0, 255, 255, .1); }
  66% { background: rgba(255, 76, 255, .1); }
  100% { background: rgba(76, 93, 255, .15); }
}

/* Default class to apply both animations to the bubbles */
.default-item {
  animation: float var(--duration) linear infinite, hue 20s infinite alternate;
}


/* 2. Main Card Styling */
.card {
  background: #161b22e0; /* Semi-transparent dark background */
  border: 1px solid #30363d;
  transition: .3s;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 60px rgba(0,0,0,.8);
}


/* 3. Button and Interactive Element Styling */

/* Generate Button */
.generate-btn {
  background: linear-gradient(135deg, #4c5dff, #0077ff);
  box-shadow: 0 5px 15px rgba(76,93,255,.4);
  transition: .2s;
}

.generate-btn:hover {
  background: linear-gradient(135deg, #6a7bff, #2088ff);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(76,93,255,.5);
}

/* Password strength bar */
#strength-bar {
  height: 8px;
  transition: .3s;
}

/* Checkbox option labels */
.option-label {
    display: flex;
    align-items: center;
    space-x: 2;
    background-color: rgba(55, 65, 81, 0.3); /* bg-gray-700/30 */
    padding: 0.75rem; /* p-3 */
    border-radius: 0.75rem; /* rounded-xl */
    cursor: pointer;
    transition: background-color 0.2s;
}

.option-label:hover {
    background-color: rgba(55, 65, 81, 0.6);
}

.form-checkbox {
    appearance: none;
    width: 1.25em;
    height: 1.25em;
    border: 2px solid #4a5568;
    border-radius: 0.375rem;
    transition: 0.2s;
    cursor: pointer;
    margin-right: 0.5rem;
}

.form-checkbox:checked {
    background-color: #3b82f6; /* text-blue-500 */
    border-color: #3b82f6;
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
}

/* Custom styling for the range slider thumb */
.slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  background: #cbd5e1;
  height: 1.25rem;
  width: 1.25rem;
  border-radius: 50%;
  cursor: pointer;
  margin-top: -6px; /* Vertically center the thumb */
  transition: background-color 0.2s;
}

.slider-thumb:hover {
    background: #ffffff;
}

/* 4. UI Feedback Animations */

/* Simple 360-degree spin for the refresh icon */
@keyframes spin-once {
  to { transform: rotate(360deg); }
}
.spin-once {
  animation: spin-once .5s ease-out;
}

/* Pulsing effect for the strength bar at 100% */
@keyframes pulse {
  50% { opacity: .7; }
}
.pulse {
  animation: pulse 1.5s infinite;
}

/* Reveal animation for new password text */
@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
}
.reveal {
  animation: reveal .3s ease-out;
}
