:root {
    /* iOS 18 Inspired Colors - Deep & Vibrant */
    --primary: #007aff;
    --primary-dark: #0056b3;
    --accent: #bf5af2;
    --success: #34c759;
    --danger: #ff3b30;
    --warning: #ff9f0a;
    
    /* Light Glass Fluid Variables */
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 
        0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --blur-amount: 20px;
    
    /* Text Colors (Dark for Light Mode) */
    --text-primary: #000000;
    --text-secondary: rgba(60, 60, 67, 0.6);
    --text-tertiary: rgba(60, 60, 67, 0.3);
    
    /* Animation */
    --ease-ios: cubic-bezier(0.25, 1, 0.5, 1);
}

body.dark-mode {
    /* Deep Glass Fluid Variables (iOS 18 Dark) */
    --glass-bg: rgba(22, 22, 24, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    --blur-amount: 40px;

    /* Text Colors (White for Dark Mode) */
    --text-primary: #ffffff;
    --text-secondary: rgba(235, 235, 245, 0.6);
    --text-tertiary: rgba(235, 235, 245, 0.3);
    
    /* Vibrant Colors for Dark Mode */
    --primary: #2997ff;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "TikTok Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  background: #f2f2f7;
  color: var(--text-primary);
  overflow-x: hidden;
  transition: background-color 0.5s ease;
}

body.dark-mode {
  background: #000000;
}

/* Fluid Background */
.background-shapes {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(0, 0, 0, 0) 100%
  );
}

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.6;
  animation: float-fluid 20s infinite ease-in-out alternate;
}

.shape-1 {
  top: -10%;
  left: -10%;
  width: 60vw;
  height: 60vw;
  background: #007aff;
  animation-delay: 0s;
}

.shape-2 {
  bottom: -10%;
  right: -10%;
  width: 50vw;
  height: 50vw;
  background: #5856d6;
  animation-delay: -5s;
}

.shape-3 {
  top: 40%;
  left: 30%;
  width: 40vw;
  height: 40vw;
  background: #34c759;
  opacity: 0.4;
  animation-delay: -10s;
}

.shape-4 {
  bottom: 20%;
  left: 10%;
  width: 30vw;
  height: 30vw;
  background: #ff9500;
  opacity: 0.4;
  animation-delay: -15s;
}

@keyframes float-fluid {
  0% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(30px, -50px) scale(1.1);
  }
  66% {
    transform: translate(-20px, 20px) scale(0.9);
  }
  100% {
    transform: translate(10px, -10px) scale(1);
  }
}

.glass-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(60px);
  -webkit-backdrop-filter: blur(60px);
  z-index: 0;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: clamp(0.75rem, 2vw, 1rem) clamp(1rem, 3vw, 1.5rem);
  z-index: 1000;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 2vw, 0.75rem);
  font-weight: 700;
  font-size: clamp(1rem, 3vw, 1.2rem);
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.theme-toggle {
  background: rgba(120, 120, 128, 0.12);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s var(--ease-ios);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background: rgba(120, 120, 128, 0.2);
  transform: scale(1.05);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "TikTok Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  background: #f2f2f7;
  color: var(--text-primary);
  overflow-x: hidden;
  transition: background-color 0.5s ease;
}

body.dark-mode {
  background: #000000;
}

/* Fluid Background */
.background-shapes {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(0, 0, 0, 0) 100%
  );
}

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.6;
  animation: float-fluid 20s infinite ease-in-out alternate;
}

.shape-1 {
  top: -10%;
  left: -10%;
  width: 60vw;
  height: 60vw;
  background: #007aff;
  animation-delay: 0s;
}

.shape-2 {
  bottom: -10%;
  right: -10%;
  width: 50vw;
  height: 50vw;
  background: #5856d6;
  animation-delay: -5s;
}

.shape-3 {
  top: 40%;
  left: 30%;
  width: 40vw;
  height: 40vw;
  background: #34c759;
  opacity: 0.4;
  animation-delay: -10s;
}

.shape-4 {
  bottom: 20%;
  left: 10%;
  width: 30vw;
  height: 30vw;
  background: #ff9500;
  opacity: 0.4;
  animation-delay: -15s;
}

@keyframes float-fluid {
  0% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(30px, -50px) scale(1.1);
  }
  66% {
    transform: translate(-20px, 20px) scale(0.9);
  }
  100% {
    transform: translate(10px, -10px) scale(1);
  }
}

.glass-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(60px);
  -webkit-backdrop-filter: blur(60px);
  z-index: 0;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: clamp(0.75rem, 2vw, 1rem) clamp(1rem, 3vw, 1.5rem);
  z-index: 1000;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 2vw, 0.75rem);
  font-weight: 700;
  font-size: clamp(1rem, 3vw, 1.2rem);
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.theme-toggle {
  background: rgba(120, 120, 128, 0.12);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s var(--ease-ios);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background: rgba(120, 120, 128, 0.2);
  transform: scale(1.05);
}

/* Main Content */
.main-content {
  padding-top: clamp(60px, 12vh, 80px);
  padding-bottom: clamp(10px, 2vh, 20px);
  min-height: calc(100vh - 150px); /* Account for navbar and footer */
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  width: clamp(85%, 90%, 95%);
  max-width: 800px; /* Increased from 600px for better monitor usage */
  margin: 0 auto;
  padding: 0 clamp(0.5rem, 2vw, 1rem);
}

/* Cards */
.card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur-amount));
  -webkit-backdrop-filter: blur(var(--blur-amount));
  border: 1px solid var(--glass-border);
  border-radius: 32px;
  padding: clamp(2rem, 5vw, 3rem);
  box-shadow: var(--glass-shadow);
  transition: transform 0.4s var(--ease-ios);
  position: relative;
  overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}

.search-card {
  text-align: center;
}

.card-header h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #2997ff 0%, #bf5af2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 10px rgba(41, 151, 255, 0.3));
}

.card-header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
}

/* Form */
.input-group {
  position: relative;
  display: flex;
  flex-direction: row;
  gap: 1rem;
  align-items: stretch;
}

@media (max-width: 640px) {
    .input-group {
        flex-direction: column;
    }
}

input {
  width: 100%;
  padding: 1.2rem 1.5rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.3);
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 500;
  outline: none;
  transition: all 0.4s var(--ease-ios);
  box-shadow: 
    inset 0 2px 4px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

body.dark-mode input {
  background: linear-gradient(
    145deg,
    rgba(40, 40, 45, 0.9),
    rgba(30, 30, 35, 0.9)
  );
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05), inset 0 -2px 8px rgba(0, 0, 0, 0.3);
}

/* Hide number input spinner */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 8px 25px rgba(0, 122, 255, 0.2),
    0 0 0 4px rgba(0, 122, 255, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -2px 8px rgba(0, 0, 0, 0.05);
  transform: translateY(-2px) scale(1.01);
}

/* Error State */
input.error {
  border-color: var(--danger);
  animation: shake 0.5s ease-in-out, error-pulse 0.6s ease-in-out;
  box-shadow: 0 8px 25px rgba(255, 59, 48, 0.25),
    0 0 0 4px rgba(255, 59, 48, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -2px 8px rgba(255, 59, 48, 0.1);
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-8px);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translateX(8px);
  }
}

@keyframes error-pulse {
  0%,
  100% {
    background: linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.9),
      rgba(240, 240, 245, 0.9)
    );
  }
  50% {
    background: linear-gradient(
      145deg,
      rgba(255, 245, 245, 0.9),
      rgba(255, 235, 235, 0.9)
    );
  }
}

body.dark-mode input.error {
  animation: shake 0.5s ease-in-out, error-pulse-dark 0.6s ease-in-out;
}

@keyframes error-pulse-dark {
  0%,
  100% {
    background: linear-gradient(
      145deg,
      rgba(40, 40, 45, 0.9),
      rgba(30, 30, 35, 0.9)
    );
  }
  50% {
    background: linear-gradient(
      145deg,
      rgba(60, 30, 30, 0.9),
      rgba(50, 25, 25, 0.9)
    );
  }
}

.btn-primary {
  padding: clamp(0.8rem, 2.5vw, 1rem) clamp(2.5rem, 5vw, 3rem);
  border-radius: 50px;
  border: none;
  /* Light Mode: Ultra Smooth & Vibrant (Blue -> Cyan -> Purple -> Blue) */
  background: linear-gradient(
    90deg,
    #007aff 0%,
    #00e5ff 25%,
    #b45eff 50%,
    #00e5ff 75%,
    #007aff 100%
  );
  background-size: 400% 100%;
  color: white;
  font-weight: 800;
  font-size: clamp(1.1rem, 2.5vw, 1.25rem);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  position: relative;
  overflow: hidden;
  /* 3D Effect */
  box-shadow: 
    0 10px 20px -5px rgba(0, 122, 255, 0.4),
    0 4px 6px -2px rgba(0, 122, 255, 0.2),
    inset 0 -4px 4px rgba(0, 0, 0, 0.1),
    inset 0 2px 4px rgba(255, 255, 255, 0.4);
  /* Animation: Alternate direction for seamless ping-pong flow */
  animation: gradient-flow-x 8s ease-in-out infinite alternate;
  white-space: nowrap;
  letter-spacing: 0.5px;
  z-index: 1; /* Ensure text is above pseudo-elements */
}

/* Dark Mode Gradient Layer (Smooth Transition) */
.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.5s ease;
  /* Dark Mode Gradient (Ultra Smooth) */
  background: linear-gradient(
    90deg,
    #8a2be2 0%,    /* BlueViolet */
    #ff00ff 25%,   /* Magenta */
    #00e5ff 50%,   /* Cyan */
    #ff00ff 75%,   /* Magenta */
    #8a2be2 100%   /* Loop back */
  );
  background-size: 400% 100%;
  animation: gradient-flow-x 8s ease-in-out infinite alternate;
}

.btn-primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s;
}

.btn-primary:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 
    0 15px 30px -5px rgba(0, 122, 255, 0.5),
    0 8px 10px -2px rgba(0, 122, 255, 0.3),
    inset 0 -4px 4px rgba(0, 0, 0, 0.1),
    inset 0 2px 4px rgba(255, 255, 255, 0.5);
}

.btn-primary:active {
  transform: translateY(2px) scale(0.98);
  box-shadow: 
    0 5px 10px -5px rgba(0, 122, 255, 0.4),
    inset 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Dark mode - brighter for visibility */
/* Dark mode - brighter for visibility */
/* Dark mode - brighter for visibility */
body.dark-mode .btn-primary::after {
  opacity: 1;
}

body.dark-mode .btn-primary {
  /* Box Shadow transition handled by main element */
  /* Enhanced 3D Effect for Dark Mode */
  /* Enhanced 3D Effect for Dark Mode - High Contrast */
  /* Enhanced 3D Effect for Dark Mode - Soft & Pill-like (Matching Light Mode) */
  /* Enhanced 3D Effect for Dark Mode - Glassy Bottom Lip */
  box-shadow: 
    0 10px 20px -5px rgba(138, 43, 226, 0.5), /* Soft outer glow */
    0 4px 6px -2px rgba(255, 0, 255, 0.3),    /* Inner glow */
    inset 0 -4px 4px rgba(255, 255, 255, 0.2), /* Glassy bottom reflection (Bounce Light) */
    inset 0 2px 4px rgba(255, 255, 255, 0.4);  /* Soft top highlight */
}

body.dark-mode .btn-primary:hover {
  box-shadow: 
    0 15px 30px -5px rgba(138, 43, 226, 0.6),
    0 8px 10px -2px rgba(255, 0, 255, 0.4),
    inset 0 -4px 4px rgba(255, 255, 255, 0.3), /* Brighter reflection on hover */
    inset 0 2px 4px rgba(255, 255, 255, 0.5);
}

@keyframes gradient-flow-x {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}

/* Loading - Modern Web3 Style */
/* Loading - Modern Web3 Style */
.loading {
  position: relative;
  width: 100%;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  gap: clamp(2rem, 5vw, 3rem);
  padding: 2rem;
}

/* Web3 Loader Container */
.web3-loader {
  position: relative;
  width: clamp(200px, 40vw, 300px);
  height: clamp(200px, 40vw, 300px);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Animated Gradient Rings */
.loader-ring {
  position: absolute;
  border-radius: 50%;
  border: 3px solid transparent;
  animation: rotate-ring 2s linear infinite;
}

.ring-1 {
  width: 100%;
  height: 100%;
  border: 4px solid transparent;
  border-top: 4px solid #ff6b9d;
  border-right: 4px solid rgba(255, 107, 157, 0.3);
  border-bottom: 4px solid rgba(255, 107, 157, 0.1);
  animation: rotate-ring 3s linear infinite;
  filter: drop-shadow(0 0 20px rgba(255, 107, 157, 0.6));
}

.ring-2 {
  width: 75%;
  height: 75%;
  border: 3px solid transparent;
  border-top: 3px solid #6c5ce7;
  border-right: 3px solid rgba(108, 92, 231, 0.3);
  animation: rotate-ring-reverse 2.5s linear infinite;
  filter: drop-shadow(0 0 15px rgba(108, 92, 231, 0.6));
}

.ring-3 {
  width: 50%;
  height: 50%;
  border: 2px solid transparent;
  border-top: 2px solid #00cec9;
  border-right: 2px solid rgba(0, 206, 201, 0.3);
  animation: rotate-ring 2s linear infinite;
  filter: drop-shadow(0 0 10px rgba(0, 206, 201, 0.6));
}

/* Center Glowing Orb */
.loader-orb {
  position: absolute;
  width: clamp(30px, 8vw, 50px);
  height: clamp(30px, 8vw, 50px);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 1) 0%,
    rgba(255, 107, 157, 0.8) 30%,
    rgba(108, 92, 231, 0.6) 60%,
    rgba(0, 206, 201, 0.3) 100%
  );
  box-shadow: 0 0 30px rgba(255, 107, 157, 0.8),
    0 0 60px rgba(108, 92, 231, 0.6), inset 0 0 20px rgba(255, 255, 255, 0.9);
  animation: orb-glow 2s ease-in-out infinite;
}

/* Floating Particles */
.particle {
  position: absolute;
  width: clamp(6px, 1.5vw, 10px);
  height: clamp(6px, 1.5vw, 10px);
  border-radius: 50%;
  box-shadow: 0 0 15px rgba(255, 107, 157, 0.8);
  animation: float-particle 4s ease-in-out infinite;
}

.particle-1 {
  top: 10%;
  left: 10%;
  background: linear-gradient(135deg, #ff6b9d, #c44569);
  animation-delay: 0s;
}

.particle-2 {
  top: 10%;
  right: 10%;
  background: linear-gradient(135deg, #6c5ce7, #0984e3);
  animation-delay: 1s;
}

.particle-3 {
  bottom: 10%;
  left: 10%;
  background: linear-gradient(135deg, #74b9ff, #00cec9);
  animation-delay: 2s;
}

.particle-4 {
  bottom: 10%;
  right: 10%;
  background: linear-gradient(135deg, #a29bfe, #6c5ce7);
  animation-delay: 3s;
}

/* Loading Text Web3 */
.loading-text-web3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: clamp(1rem, 3vw, 1.3rem);
  font-weight: 600;
}

.gradient-text {
  background: linear-gradient(
    90deg,
    #ff6b9d 0%,
    #c44569 20%,
    #6c5ce7 40%,
    #0984e3 60%,
    #74b9ff 80%,
    #00cec9 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-text-shift 3s ease infinite;
  font-weight: 700;
}

.loading-dots-web3 {
  display: inline-flex;
  gap: clamp(4px, 1vw, 6px);
  align-items: center;
}

.dot-pulse {
  width: clamp(6px, 1.5vw, 10px);
  height: clamp(6px, 1.5vw, 10px);
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6b9d, #c44569);
  animation: dot-pulse-anim 1.5s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(255, 107, 157, 0.6);
}

.dot-pulse:nth-child(2) {
  background: linear-gradient(135deg, #6c5ce7, #0984e3);
  animation-delay: 0.3s;
  box-shadow: 0 0 10px rgba(108, 92, 231, 0.6);
}

.dot-pulse:nth-child(3) {
  background: linear-gradient(135deg, #74b9ff, #00cec9);
  animation-delay: 0.6s;
  box-shadow: 0 0 10px rgba(0, 206, 201, 0.6);
}

/* Web3 Loader Responsive */
@media (max-width: 768px) {
  .web3-loader {
    width: clamp(150px, 50vw, 200px);
    height: clamp(150px, 50vw, 200px);
  }

  .loader-orb {
    width: clamp(20px, 10vw, 35px);
    height: clamp(20px, 10vw, 35px);
  }
}

/* Web3 Keyframe Animations */
@keyframes rotate-ring {
  0% {
    transform: rotate(360deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

@keyframes orb-glow {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 30px rgba(255, 107, 157, 0.8),
      0 0 60px rgba(108, 92, 231, 0.6), inset 0 0 20px rgba(255, 255, 255, 0.9);
  }
  50% {
    transform: scale(1.2);
    box-shadow: 0 0 40px rgba(255, 107, 157, 1),
      0 0 80px rgba(108, 92, 231, 0.8), inset 0 0 30px rgba(255, 255, 255, 1);
  }
}

@keyframes float-particle {
  0%,
  100% {
    transform: translateY(0) scale(1);
    opacity: 0.6;
  }
  50% {
    transform: translateY(-30px) scale(1.2);
    opacity: 1;
  }
}

@keyframes gradient-text-shift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes dot-pulse-anim {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.5);
    opacity: 1;
  }
}

/* Secondary Button */
.btn-secondary {
  padding: clamp(0.75rem, 2.5vw, 0.95rem) clamp(1.5rem, 4vw, 1.8rem);
  border-radius: 50px;
  border: none;
  background: linear-gradient(
    135deg,
    rgba(255, 200, 160, 0.95) 0%,
    /* Warm Peach */ rgba(255, 180, 200, 0.98) 25%,
    /* Pink */ rgba(220, 180, 255, 0.95) 50%,
    /* Lavender */ rgba(180, 200, 255, 0.98) 75%,
    /* Light Blue */ rgba(200, 240, 255, 0.95) 100% /* Cyan */
  );
  background-size: 200% 200%;
  backdrop-filter: blur(10px);
  color: #663399;
  font-weight: 800;
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
  /* Modern 3D Effect */
  box-shadow: 0 5px 0 rgba(0, 82, 204, 0.2), 0 7px 20px rgba(0, 102, 255, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transform: translateY(0);
  animation: gradient-shift-slow 5s ease infinite;
}

.btn-secondary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 102, 255, 0.1),
    transparent
  );
  transition: left 0.5s;
}

body.dark-mode .btn-secondary {
  border: none;
  background: linear-gradient(
    135deg,
    rgba(80, 50, 70, 0.95) 0%,
    /* Dark Purple */ rgba(70, 50, 90, 0.98) 25%,
    /* Violet */ rgba(50, 70, 110, 0.95) 50%,
    /* Deep Blue */ rgba(50, 90, 120, 0.98) 75%,
    /* Ocean Blue */ rgba(40, 100, 100, 0.95) 100% /* Teal */
  );
  background-size: 200% 200%;
  backdrop-filter: blur(10px);
  color: #80d4ff;
  box-shadow: 0 5px 0 rgba(77, 166, 255, 0.3),
    0 7px 20px rgba(77, 166, 255, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: gradient-shift-slow 5s ease infinite;
}

.btn-secondary:hover {
  transform: translateY(-3px);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 1) 0%,
    rgba(245, 252, 255, 1) 30%,
    rgba(235, 245, 255, 1) 60%,
    rgba(245, 252, 255, 1) 100%
  );
  background-size: 200% 200%;
  box-shadow: 0 5px 0 rgba(0, 82, 204, 0.3), 0 10px 25px rgba(0, 102, 255, 0.35),
    0 0 30px rgba(0, 204, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 1);
}

.btn-secondary:hover::before {
  left: 100%;
}

body.dark-mode .btn-secondary:hover {
  background: linear-gradient(
    135deg,
    rgba(40, 50, 70, 1) 0%,
    rgba(50, 65, 90, 1) 30%,
    rgba(45, 60, 85, 1) 60%,
    rgba(50, 65, 90, 1) 100%
  );
  background-size: 200% 200%;
  box-shadow: 0 5px 0 rgba(77, 166, 255, 0.4),
    0 10px 25px rgba(77, 166, 255, 0.4), 0 0 30px rgba(128, 212, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-secondary:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 rgba(0, 82, 204, 0.2), 0 4px 10px rgba(0, 102, 255, 0.2),
    inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

body.dark-mode .btn-secondary:active {
  box-shadow: 0 2px 0 rgba(77, 166, 255, 0.3),
    0 4px 10px rgba(77, 166, 255, 0.25), inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

@keyframes border-glow {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.1);
  }
}

@keyframes gradient-shift-slow {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* Result Card */
.result-card {
  margin-top: clamp(1rem, 3vw, 1.5rem);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur-amount));
  -webkit-backdrop-filter: blur(var(--blur-amount));
  border: 1px solid var(--glass-border);
  border-radius: clamp(20px, 4vw, 24px);
  overflow: hidden;
  box-shadow: var(--glass-shadow);
  animation: slideUp 0.6s var(--ease-ios) forwards;
  max-width: clamp(600px, 90vw, 800px);
  margin-left: auto;
  margin-right: auto;
}

.result-header {
  background: linear-gradient(
    120deg,
    #ff6b9d 0%,
    /* Pink */ #c44569 20%,
    /* Rose */ #6c5ce7 40%,
    /* Purple */ #0984e3 60%,
    /* Blue */ #74b9ff 80%,
    /* Light blue */ #00cec9 100% /* Cyan */
  );
  background-size: 200% 200%;
  animation: gradient-shift 15s ease infinite;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  color: white;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 2.5rem);
}

body.dark-mode .result-header {
  background: linear-gradient(
    120deg,
    #4a148c 0%,
    /* Deep purple */ #311b92 20%,
    /* Dark purple */ #1a237e 40%,
    /* Indigo */ #0d47a1 60%,
    /* Deep blue */ #01579b 80%,
    /* Dark blue */ #004d40 100% /* Dark teal */
  );
  background-size: 200% 200%;
  animation: gradient-shift 15s ease infinite;
}

.result-header::before,
.result-header::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 105, 180, 0.5) 0%,
    /* Hot pink */ rgba(255, 165, 0, 0.3) 40%,
    /* Orange */ rgba(255, 215, 0, 0.15) 70%,
    /* Gold */ transparent 100%
  );
  animation: bubble-float 10s ease-in-out infinite;
  z-index: 0;
  filter: blur(60px);
}

.result-header::before {
  width: 700px;
  height: 700px;
  top: -350px;
  left: -200px;
  animation-delay: 0s;
}

.result-header::after {
  width: 800px;
  height: 800px;
  bottom: -400px;
  right: -250px;
  animation-delay: -5s;
  background: radial-gradient(
    circle,
    rgba(255, 140, 180, 0.45) 0%,
    /* Light pink */ rgba(255, 180, 100, 0.28) 40%,
    /* Peach */ rgba(255, 220, 120, 0.12) 70%,
    /* Light gold */ transparent 100%
  );
}

body.dark-mode .result-header::before {
  background: radial-gradient(
    circle,
    rgba(75, 50, 120, 0.4) 0%,
    /* Deep purple */ rgba(60, 40, 100, 0.32) 25%,
    /* Dark violet */ rgba(45, 35, 85, 0.24) 50%,
    /* Deeper violet */ rgba(30, 30, 70, 0.16) 75%,
    /* Midnight blue */ transparent 100%
  );
}

body.dark-mode .result-header::after {
  background: radial-gradient(
    circle,
    rgba(85, 60, 130, 0.35) 0%,
    /* Medium purple */ rgba(65, 50, 110, 0.28) 25%,
    /* Dark purple */ rgba(50, 45, 95, 0.21) 50%,
    /* Deep slate */ rgba(35, 35, 75, 0.14) 75%,
    /* Dark navy */ transparent 100%
  );
}

.student-avatar {
  width: clamp(100px, 20vw, 140px);
  height: clamp(100px, 20vw, 140px);
  background: rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(2.5rem, 8vw, 4rem);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 10;
  flex-shrink: 0;
  animation: float-gentle 3s ease-in-out infinite;
  border: 3px solid rgba(255, 255, 255, 0.3);
}

.info-container {
  display: flex;
  flex-direction: column;
  gap: clamp(0.75rem, 2vw, 1rem);
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 10;
}

.name-box {
  background: transparent;
  padding: 0;
  margin-bottom: 0.75rem;
}

body.dark-mode .name-box {
  background: transparent;
}

.name-box h2 {
  font-size: clamp(1.2rem, 4vw, 1.6rem);
  font-weight: 700;
  margin: 0;
  text-align: left;
  color: white;
}

.status-box {
  background: transparent;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

body.dark-mode .status-box {
  background: transparent;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: clamp(0.5rem, 2vw, 0.65rem) clamp(1.2rem, 4vw, 1.75rem);
  border-radius: 50px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.98),
    rgba(255, 255, 255, 0.9)
  );
  backdrop-filter: blur(15px);
  font-weight: 800;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  border: 2px solid rgba(255, 255, 255, 0.6);
  color: var(--primary);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 1), 0 0 30px rgba(255, 255, 255, 0.3);
  position: relative;
  animation: pulse-badge 2s ease-in-out infinite;
  overflow: hidden;
}

.status-badge::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.8) 50%,
    transparent 70%
  );
  animation: shimmer 3s infinite;
}

.status-badge .emoji {
  font-size: clamp(0.85rem, 2.5vw, 1rem);
  animation: sparkle 1.5s ease-in-out infinite;
  display: inline-block;
}

/* Mobile responsive layout */
@media (max-width: 640px) {
  .result-header {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }

  .student-avatar {
    margin: 0 auto;
  }

  .info-container {
    width: 100%;
  }

  .name-box h2 {
    text-align: center;
  }

  .status-box {
    justify-content: center;
  }
}

/* Animations */
@keyframes pulse-badge {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 1);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 1), 0 0 20px rgba(255, 255, 255, 0.5);
  }
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
  }
  100% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
  }
}

@keyframes sparkle {
  0%,
  100% {
    opacity: 0.5;
    transform: translateY(-50%) scale(1);
  }
  50% {
    opacity: 1;
    transform: translateY(-50%) scale(1.2);
  }
}

@keyframes rotate-gradient {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes bubble-float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(30px, -30px) scale(1.1);
  }
  50% {
    transform: translate(-20px, -50px) scale(0.9);
  }
  75% {
    transform: translate(40px, -20px) scale(1.05);
  }
}

@keyframes gradient-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.result-body {
  padding: clamp(1rem, 3vw, 1.5rem);
  display: flex;
  flex-direction: column;
  gap: clamp(0.8rem, 2.5vw, 1.2rem);
  position: relative;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(
    auto-fit,
    minmax(clamp(160px, 45vw, 250px), 1fr)
  );
  gap: clamp(0.75rem, 2vw, 1rem);
  margin-bottom: clamp(0.5rem, 1.5vw, 0.8rem);
}

.info-item {
  background: linear-gradient(145deg, #ffffff, #f5f5f7);
  padding: clamp(1rem, 3vw, 1.25rem) clamp(1.25rem, 4vw, 1.75rem);
  border-radius: 20px;
  display: flex;
  flex-direction: row;
  gap: clamp(1rem, 2.5vw, 1.25rem);
  align-items: center;
  text-align: left;
  border: 2px solid rgba(0, 0, 0, 0.06);
  position: relative;
  transition: all 0.4s var(--ease-ios);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 1), inset 0 -2px 8px rgba(0, 0, 0, 0.04);
  transform-style: preserve-3d;
  flex: 1 1 auto;
  min-width: fit-content;
  animation: slide-up-info 0.6s var(--ease-ios) forwards;
  opacity: 0;
}

body.dark-mode .info-item {
  background: linear-gradient(
    145deg,
    rgba(50, 50, 55, 0.95),
    rgba(35, 35, 40, 0.95)
  );
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 -2px 8px rgba(0, 0, 0, 0.3);
}

.info-item:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 1), inset 0 -2px 8px rgba(0, 0, 0, 0.04);
}

body.dark-mode .info-item:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 -2px 8px rgba(0, 0, 0, 0.3);
}

.info-icon {
  font-size: clamp(1.5rem, 4vw, 2rem);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  flex-shrink: 0;
}

.info-content {
  display: flex;
  flex-direction: row;
  gap: clamp(0.4rem, 1vw, 0.5rem);
  align-items: baseline;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.info-label {
  color: var(--text-secondary);
  font-size: clamp(0.8rem, 2vw, 0.9rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0;
}

.info-value {
  font-weight: 700;
  color: var(--text-primary);
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  line-height: 1.3;
}

/* Slide up animation for info items */
@keyframes slide-up-info {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.download-section {
  text-align: center;
  margin-top: clamp(0.5rem, 1.5vw, 1rem);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.download-section p {
  font-weight: 700;
  font-size: clamp(0.95rem, 2.3vw, 1.1rem);
  margin-bottom: clamp(0.8rem, 2vw, 1.2rem);
  color: var(--text-primary);
  position: relative;
}

/* Gradient text styling for SKL text */
.skl-gradient-text {
  background: linear-gradient(
    90deg,
    #ff6b9d 0%,
    /* Pink */ #c44569 12%,
    /* Rose */ #6c5ce7 25%,
    /* Purple */ #a29bfe 37%,
    /* Light Purple */ #0984e3 50%,
    /* Blue */ #74b9ff 62%,
    /* Light Blue */ #00cec9 75%,
    /* Cyan */ #00b894 87%,
    /* Teal */ #ff6b9d 100% /* Pink (loop) */
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-flow 6s linear infinite;
  font-weight: 800;
  display: inline-block;
  position: relative;
  filter: drop-shadow(0 0 15px rgba(255, 107, 157, 0.5))
    drop-shadow(0 0 25px rgba(108, 92, 231, 0.4))
    drop-shadow(0 0 35px rgba(0, 206, 201, 0.3));
}

body.dark-mode .skl-gradient-text {
  background: linear-gradient(
    90deg,
    #ff85b3 0%,
    /* Bright Pink */ #d67396 12%,
    /* Bright Rose */ #9b88ff 25%,
    /* Bright Purple */ #c5b8ff 37%,
    /* Light Lavender */ #4da6ff 50%,
    /* Bright Blue */ #99ccff 62%,
    /* Sky Blue */ #33e6d6 75%,
    /* Bright Cyan */ #5eead4 87%,
    /* Aqua */ #ff85b3 100% /* Bright Pink (loop) */
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-flow 6s linear infinite;
  filter: drop-shadow(0 0 18px rgba(255, 133, 179, 0.6))
    drop-shadow(0 0 30px rgba(155, 136, 255, 0.5))
    drop-shadow(0 0 40px rgba(77, 166, 255, 0.4));
}

@keyframes gradient-flow {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 300% 50%;
  }
}

/* Error State */
.error-container {
  margin-top: 2rem;
  padding: 3rem 2rem;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.85),
    rgba(255, 245, 245, 0.9)
  );
  border: 2px solid rgba(255, 59, 48, 0.15);
  border-radius: 30px;
  color: #d32f2f;
  text-align: center;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(255, 59, 48, 0.12),
    0 2px 8px rgba(255, 59, 48, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.8),
    inset 0 -2px 6px rgba(255, 59, 48, 0.05);
  position: relative;
  overflow: hidden;
  animation: float-gentle 3s ease-in-out infinite;
}

.error-container::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(255, 59, 48, 0.08) 0%,
    transparent 70%
  );
  animation: pulse-error-bg 4s ease-in-out infinite;
}

body.dark-mode .error-container {
  background: linear-gradient(
    145deg,
    rgba(60, 30, 30, 0.85),
    rgba(50, 25, 25, 0.9)
  );
  border-color: rgba(255, 100, 100, 0.2);
  color: #ff6b6b;
  box-shadow: 0 8px 32px rgba(255, 59, 48, 0.2), 0 2px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 100, 100, 0.1), inset 0 -2px 6px rgba(0, 0, 0, 0.2);
}

body.dark-mode .error-container::before {
  background: radial-gradient(
    circle,
    rgba(255, 100, 100, 0.12) 0%,
    transparent 70%
  );
}

.error-container h3 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  position: relative;
  z-index: 1;
}

.error-container p {
  font-size: 1.05rem;
  opacity: 0.85;
  margin-bottom: 2rem;
  position: relative;
  z-index: 1;
  line-height: 1.6;
}

.error-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  display: inline-block;
  position: relative;
  z-index: 1;
  animation: bounce-error 2s ease-in-out infinite;
}

@keyframes float-gentle {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes pulse-error-bg {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  50% {
    transform: translate(10px, 10px) scale(1.05);
    opacity: 0.8;
  }
}

@keyframes bounce-error {
  0%,
  100% {
    transform: scale(1);
  }
  25% {
    transform: scale(0.95);
  }
  50% {
    transform: scale(1.05);
  }
  75% {
    transform: scale(0.98);
  }
}

/* Animations */
.animate-up {
  animation: slideUp 0.8s var(--ease-ios) forwards;
  opacity: 0;
  transform: translateY(40px);
}

.animate-out {
  animation: slideDownFade 0.5s var(--ease-ios) forwards;
}

@keyframes slideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDownFade {
  to {
    opacity: 0;
    transform: translateY(20px);
  }
}

/* Fade animations for loading */
.fade-in {
  animation: fadeIn 0.6s ease forwards;
}

.fade-out {
  animation: fadeOut 0.5s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.hidden {
  display: none !important;
}

/* Footer */
.footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-tertiary);
  font-size: 0.8rem;
  position: relative;
  z-index: 10;
}

/* Mobile Responsive - Enhanced Gradients for Phone */
@media (max-width: 768px) {
  /* Mobile - Download Section Text */
  .download-section p {
    font-size: clamp(0.9rem, 3.5vw, 1.05rem);
    line-height: 1.6;
    padding: 0 0.5rem;
    /* Solid color with colorful glow */
    color: #0052cc !important;
    text-shadow: 0 0 15px rgba(255, 107, 157, 0.7),
      0 0 30px rgba(108, 92, 231, 0.5), 0 0 45px rgba(0, 206, 201, 0.4) !important;
  }

  body.dark-mode .download-section p {
    color: #80d4ff !important;
    text-shadow: 0 0 15px rgba(255, 133, 179, 0.8),
      0 0 30px rgba(155, 136, 255, 0.6), 0 0 45px rgba(77, 166, 255, 0.5) !important;
  }



  /* Mobile - Secondary Button */
  .btn-secondary {
    padding: 1rem 1.8rem !important;
    font-size: 0.95rem !important;
    gap: 0.6rem;
    width: 100%;
    max-width: 300px;
    /* More vibrant gradient for mobile */
    background: linear-gradient(
      135deg,
      rgba(255, 200, 160, 1) 0%,
      rgba(255, 180, 200, 1) 16%,
      rgba(220, 180, 255, 1) 33%,
      rgba(180, 200, 255, 1) 50%,
      rgba(200, 240, 255, 1) 66%,
      rgba(255, 200, 160, 1) 83%,
      rgba(255, 180, 200, 1) 100%
    ) !important;
    background-size: 300% 300% !important;
    animation: gradient-shift-slow 6s ease infinite !important;
    color: #663399 !important;
  }

  body.dark-mode .btn-secondary {
    background: linear-gradient(
      135deg,
      rgba(80, 50, 70, 1) 0%,
      rgba(70, 50, 90, 1) 16%,
      rgba(50, 70, 110, 1) 33%,
      rgba(50, 90, 120, 1) 50%,
      rgba(40, 100, 100, 1) 66%,
      rgba(80, 50, 70, 1) 83%,
      rgba(70, 50, 90, 1) 100%
    ) !important;
    background-size: 300% 300% !important;
    color: #80d4ff !important;
  }

  /* Touch-friendly spacing */
  .download-section {
    padding: 1rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
}

@media (max-width: 767px) {
  .result-body {
    padding: 1.5rem;
  }

  .info-item {
    width: 100%;
    flex: 1 1 100%;
  }

  .btn-download {
    width: 100%;
    justify-content: center;
  }

  /* Animation is now global, no need for mobile override */
  .btn-primary {
    /* Ensure size allows movement */
    background-size: 400% 100%; 
  }
}

@media (min-width: 768px) {
  .input-group {
    flex-direction: row;
  }

  .btn-primary {
    width: auto;
    padding: 0 2.5rem;
  }

  .btn-download {
    width: auto;
    min-width: 200px;
    padding: 1rem 2rem;
    display: inline-flex;
    justify-content: center;
  }
}

/* Footer */
.footer {
  text-align: center;
  padding: clamp(0.75rem, 2vh, 1.5rem);
  color: var(--text-secondary); /* Increased visibility from tertiary */
  font-weight: 500;
  font-size: clamp(0.8rem, 2vw, 0.95rem);
  position: relative;
  z-index: 10;
}

.footer p {
  margin: 0;
  opacity: 0.9;
}

/* Small Mobile Devices (e.g. iPhone SE) */
@media (max-width: 380px) {
  .card-header h1 {
    font-size: 1.8rem;
  }
  
  .card {
    padding: 1.5rem;
  }
  
  .btn-primary, .btn-secondary {
    width: 100%;
    justify-content: center;
  }
  
  .input-group {
    gap: 0.75rem;
  }
}

/* Landscape Mode Fixes */
@media (max-height: 500px) and (orientation: landscape) {
  .main-content {
    padding-top: 20px;
    min-height: auto;
  }
  
  .navbar {
    position: absolute; /* Unstick navbar in landscape to save space */
  }
  
  .background-shapes {
    height: 100%; /* Ensure background covers scrollable area */
  }
}
