/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

body {
  background: linear-gradient(135deg, #1a0b2e 0%, #2d1b4e 100%);
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  min-height: -moz-available;
  min-height: available;
  position: relative;
  overflow-x: hidden;
  background-size: cover;
  background-position: center;
}

/* Desktop: fixed background, Mobile: scroll background */
@media (min-width: 769px) {
  body {
    background-attachment: fixed;
  }
}

@media (max-width: 768px) {
  body {
    background-attachment: scroll;
    background-size: cover;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
  }
}

.glass-morphism {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.bg-pattern {
  position: fixed;
  width: 100%;
  height: 100%;
  opacity: 0.02;
  background-image:
    radial-gradient(circle at 20% 80%, transparent 50%, rgba(0,0,0,.03) 51%),
    radial-gradient(circle at 80% 20%, transparent 50%, rgba(0,0,0,.03) 51%),
    radial-gradient(circle at 40% 40%, transparent 50%, rgba(100,100,100,.01) 51%, transparent 60%),
    radial-gradient(circle at 60% 30%, transparent 40%, rgba(120,120,120,.008) 36%, transparent 55%),
    radial-gradient(circle at 70% 60%, transparent 45%, rgba(90,90,90,.012) 46%, transparent 65%);
  background-size: 100% 100%, 100% 100%, 100% 100%, 120% 120%, 110% 110%, 130% 130%;
  background-position: 0 0, 0 0, 0 0, 20% 10%, -10% 20%, 30% -20%;
  background-repeat: no-repeat;
  animation: wave 30s ease-in-out infinite;
  z-index: 1;
  pointer-events: none;
}

.parallax-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  pointer-events: none;
}

.parallax-layer {
  position: absolute;
  width: 100vw;
  height: 100vh;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  will-change: transform;
  pointer-events: none;
}

.animate-blob {
  animation: blob 20s infinite;
}

.animate-blob2 {
  animation: blob2 20s infinite;
}

.animate-blob3 {
  animation: blob3 20s infinite;
}

.animate-blob4 {
  animation: blob4 20s infinite;
}

.animate-blob5 {
  animation: blob5 20s infinite;
}

.animation-delay-2000 {
  animation-delay: 2s;
}

.animation-delay-4000 {
  animation-delay: 4s;
}

.animation-delay-500 {
  animation-delay: 0.5s;
}

.animation-delay-1500 {
  animation-delay: 1.5s;
}

.animation-delay-2500 {
  animation-delay: 2.5s;
}

.animation-delay-3500 {
  animation-delay: 3.5s;
}

.animation-delay-4500 {
  animation-delay: 4.5s;
}

.animation-delay-6000 {
  animation-delay: 6s;
}

.animation-delay-1000 {
  animation-delay: 1s;
}

.animation-delay-3000 {
  animation-delay: 3s;
}

@keyframes blob {
  0% { transform: translate(0px, 0px) scale(1); }
  33% { transform: translate(50px, -80px) scale(1.1); }
  66% { transform: translate(-35px, 35px) scale(0.9); }
  100% { transform: translate(0px, 0px) scale(1); }
}

@keyframes blob2 {
  0% { transform: translate(0px, 0px) scale(1); }
  25% { transform: translate(-40px, 60px) scale(1.05); }
  50% { transform: translate(30px, -50px) scale(0.95); }
  75% { transform: translate(-20px, 40px) scale(1.02); }
  100% { transform: translate(0px, 0px) scale(1); }
}

@keyframes blob3 {
  0% { transform: translate(0px, 0px) scale(1); }
  20% { transform: translate(60px, 40px) scale(1.08); }
  40% { transform: translate(-50px, -30px) scale(0.92); }
  60% { transform: translate(25px, 55px) scale(1.03); }
  80% { transform: translate(-15px, -45px) scale(0.97); }
  100% { transform: translate(0px, 0px) scale(1); }
}

@keyframes blob4 {
  0% { transform: translate(0px, 0px) scale(1); }
  30% { transform: translate(45px, 70px) scale(1.06); }
  60% { transform: translate(-55px, 20px) scale(0.94); }
  90% { transform: translate(35px, -60px) scale(1.01); }
  100% { transform: translate(0px, 0px) scale(1); }
}

@keyframes blob5 {
  0% { transform: translate(0px, 0px) scale(1); }
  15% { transform: translate(-30px, -50px) scale(1.04); }
  30% { transform: translate(55px, 25px) scale(0.96); }
  45% { transform: translate(-45px, 65px) scale(1.07); }
  60% { transform: translate(20px, -35px) scale(0.93); }
  75% { transform: translate(40px, 50px) scale(1.05); }
  90% { transform: translate(-25px, -20px) scale(0.98); }
  100% { transform: translate(0px, 0px) scale(1); }
}

.warning-pulse {
  animation: warningPulse 2s ease-in-out infinite;
}

@keyframes warningPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.05); }
}

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

@keyframes glare {
  0% { opacity: 0.3; transform: scale(0.8) rotate(0deg); }
  25% { opacity: 0.6; transform: scale(1.1) rotate(90deg); }
  50% { opacity: 0.4; transform: scale(0.9) rotate(180deg); }
  75% { opacity: 0.7; transform: scale(1.05) rotate(270deg); }
  100% { opacity: 0.3; transform: scale(0.8) rotate(360deg); }
}

.random-glare {
  animation: glare 8s ease-in-out infinite;
}

/* Content */
.content {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

/* Tool Background Elements */
.tool-bg-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.03;
  background-image:
    radial-gradient(circle at 30% 70%, transparent 40%, rgba(255, 102, 94, 0.1) 41%, transparent 60%),
    radial-gradient(circle at 70% 30%, transparent 35%, rgba(188, 80, 155, 0.08) 36%, transparent 55%),
    radial-gradient(circle at 50% 50%, transparent 45%, rgba(255, 179, 87, 0.06) 46%, transparent 65%);
  background-size: 200% 200%, 180% 180%, 150% 150%;
  background-position: 0 0, 20% 10%, 40% 30%;
  background-repeat: no-repeat;
  animation: wave 40s ease-in-out infinite;
  z-index: 1;
  pointer-events: none;
}

.tool-parallax-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
}

.tool-parallax-layer {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  will-change: transform;
  pointer-events: none;
}

.placeholder {
  text-align: center;
  color: #48484a;
}

.placeholder h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.placeholder p {
  font-size: 1.2rem;
  opacity: 0.8;
}

/* Mobile optimizations - keep blobs visible in corners */
@media (max-width: 480px) {
  .parallax-layer div {
    width: 40vw;
    height: 40vw;
  }
  
  /* Keep corner blobs visible on mobile */
  .parallax-layer div[class*="-top-"] {
    top: -10%;
  }
  
  .parallax-layer div[class*="-bottom-"] {
    bottom: -10%;
  }
  
  /* GPU acceleration for smooth mobile scrolling */
  .parallax-layer,
  .animate-blob,
  .animate-blob2,
  .animate-blob3,
  .animate-blob4,
  .animate-blob5 {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }
}

/* Password Field */
.password-field {
  font-family: 'Courier New', monospace;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.06);
}

#password-display {
  text-align: center;
}

@media (max-width: 480px) {
  #password-display {
    font-size: 1.23984375rem !important;
    padding-right: 2.5rem !important;
    padding-left: 0.5rem !important;
    text-align: left !important;
    direction: ltr !important;
  }
  
  #password-display::placeholder {
    font-size: 0.8625rem !important;
    text-align: left !important;
    direction: ltr !important;
  }
}

.password-field[type="password"] {
  color: transparent;
  text-shadow: 0 0 0 #48484a;
}

/* Strength Indicators */
.strength-weak {
  background: linear-gradient(90deg, #ef4444 0%, #f87171 100%);
}

.strength-medium {
  background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
}

.strength-strong {
  background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
}

.strength-very-strong {
  background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
}

/* Copy Button */
.copy-btn {
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.1);
  touch-action: manipulation;
}

.btn-text-mobile {
  display: none;
}

@media (max-width: 767px) {
  .btn-text-desktop {
    display: none;
  }
  .btn-text-mobile {
    display: inline;
  }
}

.copy-btn:hover {
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2), 0 3px 12px rgba(0, 0, 0, 0.15);
}

.copy-btn.copied {
  background-color: #22c55e !important;
}

/* Validity Buttons */
.validity-btn {
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.12), 0 1px 6px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.validity-btn:hover {
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.18), 0 2px 10px rgba(0, 0, 0, 0.12);
}

/* Animations */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn 0.6s ease-in forwards;
}

@keyframes fadeIn {
  to { opacity: 1; transform: translateY(0); }
}

.breathing-circle {
  animation: breathe 4s ease-in-out infinite;
}

@keyframes breathe {
  0% { transform: scale(1); opacity: 0.9; }
  25% { transform: scale(1.02); opacity: 0.95; }
  50% { transform: scale(1.05); opacity: 1; }
  75% { transform: scale(1.02); opacity: 0.95; }
  100% { transform: scale(1); opacity: 0.9; }
}

.logo-fade-in {
  opacity: 0;
  transform: translateY(-20px);
  animation: logoFadeIn 0.4s ease-out 0.2s forwards;
}

@keyframes logoFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Brand Link */
.brand-link .brand-image {
  width: 75px;
  margin-left: -34px;
  margin-top: -22px;
  position: relative;
  z-index: 10;
  filter: grayscale(0.25) brightness(0.8);
  opacity: 0.9;
  transition: filter 0.2s ease, opacity 0.2s ease;
}

.brand-link .brand-logo {
  filter: grayscale(0.25) brightness(0.8);
  opacity: 0.9;
  transition: filter 0.2s ease, opacity 0.2s ease;
}

.brand-link:hover > img.brand-image,
.brand-link:hover > img.brand-logo {
  filter: grayscale(0) brightness(1);
  opacity: 1;
}

/* Tutorial Styles */
.tutorial-sticker {
  position: fixed;
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 50px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  z-index: 1000;
  font-size: 18px;
  transition: all 0.3s ease;
  animation: gentleBorderPulse 3s ease-in-out infinite;
}

.tutorial-sticker:hover {
  right: -20px;
}

@keyframes gentleBorderPulse {
  0%, 100% {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1), 0 0 0 rgba(255, 255, 255, 0);
    transform: translateY(-50%) translateX(0);
  }
  50% {
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15), 0 0 16px rgba(255, 255, 255, 0.15);
    transform: translateY(-50%) translateX(-2px);
  }
}

.tutorial-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(1px);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 20px;
  z-index: 1800;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tutorial-overlay:not(.hidden) {
  opacity: 1;
}

.tutorial-modal {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  padding: 0;
  max-width: 350px;
  width: 90%;
  max-height: 70vh;
  overflow-y: auto;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.2);
  transform: scale(0.95) translateX(30px);
  transition: transform 0.3s ease;
}

.tutorial-overlay:not(.hidden) .tutorial-modal {
  transform: scale(1) translateY(0);
}

.tutorial-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tutorial-close-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 18px;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.tutorial-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 1);
}

.tutorial-content {
  padding: 24px;
}

.tutorial-step {
  margin-bottom: 20px;
}

.tutorial-step-title {
  font-size: 18px;
  font-weight: 600;
  color: white;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
}

.tutorial-step-title i {
  margin-right: 10px;
  color: #fbbf24;
}

.tutorial-step-description {
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
  margin-bottom: 16px;
}

.tutorial-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.tutorial-progress {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

.tutorial-buttons {
  display: flex;
  gap: 12px;
}

.tutorial-nav-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.tutorial-nav-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.tutorial-nav-btn.tutorial-close {
  background: rgba(100, 116, 139, 0.8);
  border-color: rgba(100, 116, 139, 0.8);
}

.tutorial-nav-btn.tutorial-close:hover {
  background: rgba(100, 116, 139, 0.9);
}

.tutorial-highlight-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1500;
  pointer-events: none;
}

.tutorial-highlight-overlay .highlight-spot {
  position: absolute;
  background: rgba(96, 165, 250, 0.3);
  border: 2px solid #60a5fa;
  border-radius: 8px;
  animation: highlightPulse 2s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(96, 165, 250, 0.5);
}

@keyframes highlightPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.02); opacity: 0.8; }
}

.hidden {
  display: none !important;
}

/* Hide tutorial button on mobile */
@media (max-width: 768px) {
  #tutorial-btn {
    display: none !important;
  }
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .tutorial-modal {
    width: 95%;
    max-height: 85vh;
    margin: 0 10px;
  }

  .tutorial-header {
    padding: 16px 20px 12px;
  }

  .tutorial-content {
    padding: 20px;
  }

  .tutorial-navigation {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
  }

  .tutorial-buttons {
    justify-content: center;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .animate-blob,
  .random-glare,
  .bg-pattern {
    animation: none;
  }
}
