@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --warning-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  --dark-gradient: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  --glass-bg: rgba(255, 255, 255, 0.25);
  --glass-border: rgba(255, 255, 255, 0.18);
  --shadow-light: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  --shadow-heavy: 0 15px 35px rgba(31, 38, 135, 0.2);
  --text-primary: #2d3748;
  --text-secondary: #4a5568;
  --border-radius: 20px;
  --transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  min-height: 100vh;
  color: var(--text-primary);
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

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

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="%23ffffff" opacity="0.15"/><circle cx="20" cy="80" r="0.5" fill="%23ffffff" opacity="0.15"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
  pointer-events: none;
  z-index: -1;
}

.container {
  max-width: 1000px;
  margin: 40px auto;
  padding: 0;
  background: var(--glass-bg);
  border-radius: 30px;
  box-shadow: var(--shadow-heavy);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--glass-border);
  transform: translateY(0) scale(1);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.container::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.8s ease;
  z-index: 1;
}

.container:hover::before {
  left: 100%;
}

.container:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 25px 50px rgba(31, 38, 135, 0.3);
}

.screen {
  display: none;
  padding: 50px;
  text-align: center;
  animation: fadeInUp 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  z-index: 2;
}

.screen.active {
  display: block;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translate3d(0, 0, 0);
  }
  40%, 43% {
    transform: translate3d(0, -8px, 0);
  }
  70% {
    transform: translate3d(0, -4px, 0);
  }
  90% {
    transform: translate3d(0, -2px, 0);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

h1 {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 30px;
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  position: relative;
  animation: slideInUp 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

h1::before {
  content: '💕';
  position: absolute;
  left: -70px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.5rem;
  animation: bounce 2s infinite;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

h2 {
  background: var(--secondary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 25px;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  animation: slideInUp 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.2s both;
}

h3 {
  color: var(--text-primary);
  font-size: 1.8rem;
  font-weight: 600;
  margin: 30px 0 20px;
  position: relative;
}

p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 30px;
  line-height: 1.8;
  font-weight: 400;
}

/* 3D Button Styles */
.btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 20px 50px;
  font-size: 1.3rem;
  font-weight: 700;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin: 20px 10px;
  position: relative;
  overflow: hidden;
  box-shadow: 
    0 12px 24px rgba(102, 126, 234, 0.4),
    0 8px 16px rgba(102, 126, 234, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.3),
    inset 0 -2px 0 rgba(0, 0, 0, 0.2);
  transform: translateY(0);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-family: inherit;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  border-bottom: 6px solid rgba(0, 0, 0, 0.2);
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 0.6s ease;
}

.btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn:hover {
  background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
  transform: translateY(-6px) scale(1.08);
  box-shadow: 
    0 20px 40px rgba(102, 126, 234, 0.5),
    0 15px 25px rgba(102, 126, 234, 0.4),
    inset 0 2px 0 rgba(255, 255, 255, 0.4),
    inset 0 -2px 0 rgba(0, 0, 0, 0.2);
  border-bottom: 8px solid rgba(0, 0, 0, 0.25);
}

.btn:hover::before {
  left: 100%;
}

.btn:hover::after {
  opacity: 1;
}

.btn:active {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 
    0 10px 20px rgba(102, 126, 234, 0.4),
    0 6px 12px rgba(102, 126, 234, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.3),
    inset 0 -2px 0 rgba(0, 0, 0, 0.2);
  border-bottom: 3px solid rgba(0, 0, 0, 0.2);
}

.btn:focus {
  outline: none;
  box-shadow: 
    0 10px 20px rgba(102, 126, 234, 0.3),
    0 6px 12px rgba(102, 126, 234, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1),
    0 0 0 4px rgba(102, 126, 234, 0.3);
}

/* Question Container */
#question-container {
  margin-bottom: 50px;
  animation: slideInUp 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  background: rgba(255, 255, 255, 0.1);
  padding: 30px;
  border-radius: var(--border-radius);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

#question-text {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 35px;
  line-height: 1.5;
  position: relative;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#question-text::before {
  content: '❓';
  position: absolute;
  left: -60px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
  animation: pulse 2s infinite;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

#options-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 40px 0;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* 3D Option Buttons */
.option {
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid rgba(102, 126, 234, 0.15);
  padding: 24px 32px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 1.2rem;
  font-weight: 600;
  color: #2d3748;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(15px);
  box-shadow: 
    0 10px 20px rgba(0, 0, 0, 0.12),
    0 6px 12px rgba(0, 0, 0, 0.08),
    inset 0 2px 0 rgba(255, 255, 255, 0.9),
    inset 0 -2px 0 rgba(0, 0, 0, 0.08);
  transform: translateY(0);
  border-bottom: 4px solid rgba(102, 126, 234, 0.15);
  text-align: left;
}

.option::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
  transition: left 0.5s ease;
}

.option::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(102, 126, 234, 0.05) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.option:hover {
  background: rgba(255, 255, 255, 1);
  border-color: rgba(102, 126, 234, 0.4);
  transform: translateY(-4px) scale(1.03);
  box-shadow: 
    0 16px 32px rgba(102, 126, 234, 0.2),
    0 12px 24px rgba(0, 0, 0, 0.15),
    inset 0 2px 0 rgba(255, 255, 255, 1),
    inset 0 -2px 0 rgba(0, 0, 0, 0.08);
  border-bottom: 6px solid rgba(102, 126, 234, 0.25);
}

.option:hover::before {
  left: 100%;
}

.option:hover::after {
  opacity: 1;
}

.option:active {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 
    0 8px 16px rgba(0, 0, 0, 0.12),
    0 4px 8px rgba(0, 0, 0, 0.08),
    inset 0 2px 0 rgba(255, 255, 255, 0.9),
    inset 0 -2px 0 rgba(0, 0, 0, 0.08);
  border-bottom: 2px solid rgba(102, 126, 234, 0.15);
}

.option.selected {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
  color: #2d3748;
  border-color: #667eea;
  transform: translateY(-3px) scale(1.03);
  box-shadow: 
    0 12px 24px rgba(102, 126, 234, 0.25),
    0 8px 16px rgba(102, 126, 234, 0.2),
    inset 0 2px 0 rgba(255, 255, 255, 0.6),
    inset 0 -2px 0 rgba(0, 0, 0, 0.1);
  border-bottom: 5px solid rgba(102, 126, 234, 0.3);
}

.option.selected::after {
  content: '✓';
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  color: #667eea;
  font-size: 1.8rem;
  font-weight: bold;
  animation: slideInUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Progress Bar */
#progress-bar {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  margin: 30px 0;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
}

/* Navigation Container */
#navigation-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 30px;
  padding: 0 20px;
}

.nav-btn {
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  min-width: 120px;
}

#back-btn {
  background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

#back-btn:hover {
  background: linear-gradient(135deg, #5a6268 0%, #3d4043 100%);
  transform: translateY(-4px) scale(1.05);
  box-shadow: 
    0 15px 30px rgba(108, 117, 125, 0.4),
    0 10px 20px rgba(108, 117, 125, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.4),
    inset 0 -2px 0 rgba(0, 0, 0, 0.2);
  border-bottom: 6px solid rgba(0, 0, 0, 0.25);
}

#next-btn {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

#next-btn:hover {
  background: linear-gradient(135deg, #218838 0%, #1ba085 100%);
  transform: translateY(-4px) scale(1.05);
  box-shadow: 
    0 15px 30px rgba(40, 167, 69, 0.4),
    0 10px 20px rgba(40, 167, 69, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.4),
    inset 0 -2px 0 rgba(0, 0, 0, 0.2);
  border-bottom: 6px solid rgba(0, 0, 0, 0.25);
}

#next-btn:disabled {
  background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: 
    0 8px 16px rgba(108, 117, 125, 0.2),
    inset 0 2px 0 rgba(255, 255, 255, 0.3),
    inset 0 -2px 0 rgba(0, 0, 0, 0.2);
}

#next-btn:disabled:hover {
  transform: none;
  box-shadow: 
    0 8px 16px rgba(108, 117, 125, 0.2),
    inset 0 2px 0 rgba(255, 255, 255, 0.3),
    inset 0 -2px 0 rgba(0, 0, 0, 0.2);
}

#progress-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 2s infinite;
}

#progress {
  height: 100%;
  background: var(--success-gradient);
  border-radius: 10px;
  transition: width 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  box-shadow: 
    0 2px 4px rgba(79, 172, 254, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

#progress::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shimmer 1.5s infinite;
}

/* Payment Form */
#payment-form-container {
  background: rgba(255, 255, 255, 0.1);
  padding: 40px;
  border-radius: var(--border-radius);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  margin: 30px 0;
  box-shadow: var(--shadow-light);
}

#payment-element {
  margin: 30px 0;
  padding: 20px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: var(--border-radius);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

#payment-message {
  margin-top: 20px;
  padding: 15px;
  border-radius: var(--border-radius);
  font-weight: 500;
  text-align: center;
  transition: var(--transition);
}

#payment-message.success {
  background: rgba(67, 233, 123, 0.1);
  color: #22543d;
  border: 1px solid rgba(67, 233, 123, 0.3);
}

#payment-message.error {
  background: rgba(245, 87, 108, 0.1);
  color: #742a2a;
  border: 1px solid rgba(245, 87, 108, 0.3);
}

/* Results Screen */
#personality-result {
  background: var(--primary-gradient);
  color: white;
  padding: 30px;
  border-radius: var(--border-radius);
  margin: 30px 0;
  font-size: 1.3rem;
  font-weight: 600;
  box-shadow: var(--shadow-light);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

#personality-result::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
  animation: shimmer 3s infinite;
}

#personality-advice,
#relationship-advice {
  text-align: left;
  margin: 30px 0;
  background: rgba(255, 255, 255, 0.1);
  padding: 25px;
  border-radius: var(--border-radius);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

#personality-advice li,
#relationship-advice li {
  margin: 15px 0;
  padding: 15px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  border-left: 4px solid;
  border-left-color: #667eea;
  font-weight: 500;
  line-height: 1.6;
  transition: var(--transition);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#personality-advice li:hover,
#relationship-advice li:hover {
  transform: translateX(5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  border-left-color: #764ba2;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    margin: 20px;
    border-radius: 20px;
  }
  
  .screen {
    padding: 30px 20px;
  }
  
  h1 {
    font-size: 2.5rem;
  }
  
  h1::before {
    left: -50px;
    font-size: 2rem;
  }
  
  h2 {
    font-size: 2rem;
  }
  
  #question-text {
    font-size: 1.3rem;
  }
  
  #question-text::before {
    left: -45px;
    font-size: 1.5rem;
  }
  
  .btn {
     padding: 18px 40px;
     font-size: 1.2rem;
     margin: 15px 5px;
   }
   
   .option {
     padding: 22px 28px;
     font-size: 1.1rem;
   }
  
  #options-container {
    gap: 15px;
  }
  
  #payment-form-container {
    padding: 25px 20px;
  }
  
  #navigation-container {
    padding: 0 10px;
    margin-top: 20px;
  }
  
  .nav-btn {
    padding: 14px 20px;
    font-size: 0.95rem;
    min-width: 100px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 2rem;
  }
  
  h1::before {
    display: none;
  }
  
  #question-text::before {
    display: none;
  }
  
  .btn {
     padding: 16px 35px;
     font-size: 1.1rem;
   }
   
   .option {
     padding: 20px 24px;
     font-size: 1.05rem;
   }
}

/* Loading Animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Error Message */
.error-message {
  background: rgba(245, 87, 108, 0.1);
  color: #742a2a;
  padding: 20px;
  border-radius: var(--border-radius);
  border: 1px solid rgba(245, 87, 108, 0.3);
  margin: 20px 0;
  font-weight: 500;
  backdrop-filter: blur(10px);
}

/* Success Message */
.success-message {
  background: rgba(67, 233, 123, 0.1);
  color: #22543d;
  padding: 20px;
  border-radius: var(--border-radius);
  border: 1px solid rgba(67, 233, 123, 0.3);
  margin: 20px 0;
  font-weight: 500;
  backdrop-filter: blur(10px);
}

/* Language Switcher */
.language-switcher {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.locale-select {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
  min-width: 140px;
}

.locale-select:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: translateY(-2px);
  box-shadow: var(--shadow-light);
}

.locale-select:focus {
  border-color: rgba(102, 126, 234, 0.5);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.locale-select option {
  background: #fff;
  color: var(--text-primary);
  padding: 8px;
}

/* Language switcher container positioning */
#language-switcher-container {
  position: relative;
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
}

/* Responsive adjustments for language switcher */
@media (max-width: 768px) {
  .language-switcher {
    position: static;
    margin-bottom: 20px;
  }
  
  #language-switcher-container {
    justify-content: center;
  }
  
  .locale-select {
    min-width: 120px;
    font-size: 13px;
  }
}