/* Base Styles & Variables */
:root {
  --primary: hsl(354, 77%, 54%);
  --primary-light: hsl(354, 100%, 65%);
  --primary-dark: hsl(354, 77%, 44%);
  --primary-gradient: linear-gradient(135deg, var(--primary) 0%, #f53c76 100%);
  --primary-gradient-hover: linear-gradient(135deg, var(--primary-dark) 0%, #e02a64 100%);
  --primary-glow: 0 0 15px rgba(239, 68, 68, 0.6);
  --success: hsl(142, 71%, 49%);
  --warning: #ff9900;
  --dark-bg: #121212;
  --card-bg: rgba(25, 25, 25, 0.92);
  --card-hover-bg: rgba(35, 35, 35, 0.95);
  --border-color: rgba(255, 255, 255, 0.1);
  --text-color: #f5f5f5;
  --text-muted: #aaaaaa;
  --font-main: 'Open Sans', sans-serif;
  --font-headings: 'Montserrat', sans-serif;
  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 10px 15px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 20px 25px rgba(0, 0, 0, 0.3);
  --border-radius: 12px;
  --border-radius-lg: 20px;
  --animation-speed: 0.3s;
  --swipe-indicator: rgba(255, 255, 255, 0.12);
}

/* Global Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
  touch-action: manipulation;
}

body {
  font-family: var(--font-main);
  color: var(--text-color);
  background-color: var(--dark-bg);
  background-image: 
    linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.7) 100%), 
    url('https://images.unsplash.com/photo-1516535794938-6063be6c1555?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80');
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-headings);
  line-height: 1.3;
  margin-bottom: 0.5em;
}

/* Utility Classes */
.container {
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  padding: 0 20px;
}

.hide {
  display: none !important;
}

.highlight {
  color: var(--primary);
}

/* Header */
.site-header {
  background-color: rgba(18, 18, 18, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  padding: 15px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: padding var(--animation-speed) ease;
}

.site-header .container {
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.material-icons {
  font-size: 18px;
  margin-right: 4px;
}

/* Progress Bar */
.progress-container {
  width: 100%;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 65px;
  z-index: 90;
}

.progress-bar {
  height: 100%;
  background: var(--primary-gradient);
  width: 0%;
  transition: width 0.5s ease-out;
  box-shadow: 0 0 8px var(--primary);
}

/* Main Content & Quiz Container */
main {
  min-height: 100vh;
  padding: 2rem 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#quiz-container {
  margin: 0 auto;
  width: 100%;
}

/* Shared Quiz Screen Styles */
.quiz-screen {
  background-color: var(--card-bg);
  backdrop-filter: blur(10px);
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  text-align: center;
  border: 1px solid var(--border-color);
  margin-bottom: 1rem;
  position: relative;
  overflow: visible;
}

/* Feedback Screen */
.feedback-screen {
  text-align: center;
  background-color: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--primary);
  padding: 1.5rem;
}

.feedback-icon {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 1rem;
  animation: pulse 2s infinite;
  background: transparent;
  display: inline-block;
  border-radius: 50%;
  padding: 10px;
  border: 2px solid var(--primary);
}

.feedback-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: white;
}

.feedback-text {
  margin-bottom: 1.5rem;
  line-height: 1.5;
  font-size: 0.95rem;
}

.feedback-stat {
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--primary);
  padding: 0.8rem;
  margin: 1rem 0;
  border-radius: var(--border-radius);
  font-size: 0.9rem;
}

.stat-highlight {
  color: var(--primary);
  font-weight: 600;
}

.feedback-cta {
  margin-top: 1.5rem;
  font-weight: 500;
  color: white;
}

/* Swipe indicator for mobile */
.quiz-screen::after {
  content: "";
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 4px;
  border-radius: 4px;
  background-color: var(--swipe-indicator);
  opacity: 0.6;
}

/* Welcome Screen */
.badge {
  display: inline-block;
  background-color: var(--primary);
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.main-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.subtitle {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.features {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1.5rem;
  font-size: 0.85rem;
}

.feature {
  display: flex;
  align-items: center;
  color: var(--success);
}

.quick-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 1.5rem 0 0;
  padding: 0.75rem;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius);
  border: 1px dashed rgba(255, 255, 255, 0.2);
}

.quick-info .material-icons {
  font-size: 1.1rem;
  color: var(--primary);
}

/* Buttons Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.5rem;
  border-radius: var(--border-radius);
  font-family: var(--font-headings);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--animation-speed) ease;
  border: none;
  outline: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-primary:hover, .btn-primary:focus {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(239, 68, 68, 0.4);
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1rem;
  width: 100%;
}

.btn-xl {
  padding: 1.2rem 2.5rem;
  font-size: 1.1rem;
  width: 100%;
}

.pulse-button {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.5);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
  }
}

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

@keyframes warningPulse {
  0% {
    background-color: rgba(255, 255, 255, 0.05);
  }
  50% {
    background-color: rgba(239, 68, 68, 0.2);
  }
  100% {
    background-color: rgba(255, 255, 255, 0.05);
  }
}

.cta-container {
  margin: 1.5rem 0;
}

.cta-text {
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.btn-back {
  color: var(--text-muted);
  background: transparent;
  font-size: 0.9rem;
}

.btn-back:hover {
  color: white;
}

.btn-continue {
  color: var(--primary);
  background: transparent;
  font-size: 0.9rem;
}

.btn-continue:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.5;
}

.btn-continue:not(:disabled) {
  color: white;
  background-color: var(--primary);
  border-radius: var(--border-radius);
  transition: all 0.3s ease;
}

.btn-continue:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(239, 68, 68, 0.4);
}

/* Question Screens */
.question-screen {
  text-align: left;
}

.question-header {
  display: flex;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.question-number {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  font-size: 0.9rem;
  margin-top: 0.2rem;
}

.question-text {
  font-size: 1.25rem;
  flex: 1;
}

.options-container {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-bottom: 2rem;
}

.option-button {
  display: flex;
  align-items: center;
  padding: 1rem;
  border-radius: var(--border-radius);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-color);
  cursor: pointer;
  transition: all var(--animation-speed) ease;
  text-align: left;
  width: 100%;
  font-family: var(--font-main);
  font-size: 1rem;
  gap: 0.8rem;
}

.option-button .material-icons {
  color: var(--primary-light);
  margin-right: 0;
}

.option-button:hover {
  border-color: var(--primary);
  background-color: rgba(239, 68, 68, 0.1);
}

.option-button.selected {
  border-color: var(--primary);
  background-color: rgba(239, 68, 68, 0.15);
  box-shadow: 0 0 0 1px var(--primary);
}

.navigation-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
}

/* Gender options specific */
.gender-options .option-button {
  padding-left: 1.5rem;
}

.gender-options .material-icons {
  color: var(--primary);
  margin-right: 1rem;
}

/* Results Screen */
#results-screen {
  max-height: none;
  overflow: visible;
  padding-bottom: 3rem;
}

.results-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  margin: 0 auto 1.5rem;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
}

.results-icon .material-icons {
  font-size: 2.5rem;
  color: var(--primary);
  margin: 0;
}

.results-title {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
}

.results-headline {
  font-family: var(--font-headings);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 1.5rem 0 1rem;
  color: var(--primary);
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
}

.results-text {
  padding: 0.75rem 0;
  margin-bottom: 1rem;
  line-height: 1.6;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.1);
}

.results-advice {
  color: var(--text-color);
  margin: 1.5rem 0;
  font-weight: 500;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
}

.btn-verify {
  margin-bottom: 1rem;
}

.results-confidential {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 1rem;
  margin-bottom: 0;
}



/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate__fadeIn {
  animation: fadeIn 0.5s ease-out;
}

/* Media Queries */
@media (max-width: 480px) {
  body {
    font-size: 15px;
  }
  
  .site-header {
    padding: 10px 0;
  }
  
  .logo h1 {
    font-size: 1.1rem;
  }
  
  .confidence span:not(.material-icons),
  .quick-info span:not(.material-icons) {
    font-size: 0.8rem;
  }
  
  .quiz-screen {
    padding: 1.25rem;
    margin-bottom: 0.5rem;
    overflow: visible;
  }
  
  .main-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
  }
  
  .subtitle {
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 1.5rem;
  }
  
  .btn-large {
    padding: 0.9rem 1.5rem;
  }
  
  .question-text {
    font-size: 1rem;
    line-height: 1.4;
  }
  
  .option-button {
    padding: 0.8rem;
    font-size: 0.9rem;
  }
  
  .navigation-buttons {
    position: sticky;
    bottom: 0;
    background-color: var(--card-bg);
    padding-top: 0.75rem;
    margin-top: 0.75rem;
  }
  
  .results-title {
    font-size: 1.4rem;
  }
  
  .results-headline {
    font-size: 1.1rem;
  }
  
  .results-text {
    padding: 0.75rem 0;
  }
  
  .results-confidential {
    font-size: 0.7rem;
  }
  

}

/* Ensure content fits on very small screens */
@media (max-width: 360px) {
  .container {
    padding: 0 15px;
  }
  
  .quiz-screen {
    padding: 1rem;
  }
  
  .main-title {
    font-size: 1.3rem;
  }
  
  .badge {
    font-size: 0.65rem;
  }
  
  .btn {
    padding: 0.6rem 1.2rem;
  }
  
  .question-number {
    min-width: 24px;
    height: 24px;
    font-size: 0.8rem;
  }
  
  .question-text {
    font-size: 0.95rem;
  }
  
  .results-icon {
    width: 60px;
    height: 60px;
  }
  
  .results-icon .material-icons {
    font-size: 2rem;
  }
}

/* Gradient Background Animation */
body:before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(25, 0, 37, 0.5) 0%,
    rgba(90, 0, 45, 0.5) 100%
  );
  z-index: -1;
  animation: gradientBG 15s ease infinite;
}

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