/* ==================== */
/* CSS Variables */
/* ==================== */
:root {
  --primary-color: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-light: #9ca3af;
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --border-color: #e5e7eb;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ==================== */
/* Reset & Base Styles */
/* ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
  'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: var(--text-primary);
  line-height: 1.6;
}

/* ==================== */
/* Container */
/* ==================== */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==================== */
/* Language Switcher */
/* ==================== */
.language-switcher {
  position: absolute;
  margin: 0;
  right: 1rem;
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}


.lang-btn {
  padding: 0.5rem 1rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all var(--transition-normal);
  backdrop-filter: blur(10px);
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

.lang-btn.active {
  background: white;
  color: var(--primary-color);
  border-color: white;
}

/* ==================== */
/* Header */
/* ==================== */
.header {
  text-align: center;
  margin-bottom: 1rem;
  color: white;
}

.header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==================== */
/* Info Icon & Tooltip */
/* ==================== */
.info-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: help;
  vertical-align: middle;
  margin-left: 0.25rem;
}

.info-icon svg {
  width: 24px;
  height: 24px;
  opacity: 0.8;
  transition: all var(--transition-normal);
}

.info-icon:hover svg {
  opacity: 1;
  transform: scale(1.1);
}

.tooltip {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: white;
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 400;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  pointer-events: none;
  z-index: 1000;
}

.tooltip::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: white;
}

.info-icon:hover .tooltip {
  opacity: 1;
  visibility: visible;
  top: calc(100% + 15px);
}

/* ==================== */
/* Disclaimer */
/* ==================== */
.disclaimer {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-xl);
  max-width: 600px;
  margin: 0 auto auto auto;
  text-align: center;
  animation: fadeInUp 0.6s ease;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.disclaimer-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
}

.disclaimer h2 {
  font-size: 2rem;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.disclaimer p {
  color: var(--text-secondary);
  font-size: 1.125rem;
  line-height: 1.8;
  margin-bottom: 2rem;
}

/* ==================== */
/* Buttons */
/* ==================== */
.btn-primary,
.btn-secondary {
  padding: 1rem 2rem;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  font-family: inherit;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--border-color);
}

.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ==================== */
/* Test Container */
/* ==================== */
.test-container {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  /* padding: 1.2rem; */
  padding: 0;
  box-shadow: var(--shadow-xl);
  animation: fadeInUp 0.6s ease;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: auto;
  max-height: 88vh;
  border: 1.2rem white solid;
}

/* ==================== */
/* Progress Bar */
/* ==================== */
.progress-wrapper {
  margin-bottom: 0.2rem;
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: #fff;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
}

.progress-bar {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
  border-radius: 999px;
  transition: width var(--transition-normal);
  width: 0%;
}

/* ==================== */
/* Content Wrapper */
/* ==================== */
.content-wrapper {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

/* ==================== */
/* Answered Questions Sidebar */
/* ==================== */
.answered-questions {
  flex-shrink: 0;
  width: 280px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  max-height: 600px;
  overflow-y: auto;
  position: sticky;
  top: 3rem;
}

.answered-questions h3 {
  font-size: 1.125rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-weight: 600;
}

.answered-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.answered-item {
  background: white;
  border-radius: var(--radius-md);
  padding: 0.75rem;
  border-left: 4px solid var(--primary-color);
  cursor: pointer;
  transition: all var(--transition-normal);
  animation: slideInFromRight 0.4s ease;
}

.answered-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(-4px);
}

.answered-item-number {
  font-size: 0.75rem;
  color: var(--text-light);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.answered-item-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.answered-item-value {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.answered-item-dots {
  display: flex;
  gap: 0.25rem;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border-color);
}

.dot.filled {
  background: var(--primary-color);
}

/* ==================== */
/* Question Area */
/* ==================== */
.question-area {
  flex: 1;
  min-width: 0;
}

.question-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 0.6rem 1.6rem;
}

.question-number {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-light);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
}

#currentQuestionNumber {
  color: var(--primary-color);
  font-size: 1.5rem;
}

.question-text {
  font-size: 1.75rem;
  color: var(--text-primary);
  margin-bottom: 2.5rem;
  line-height: 1.4;
  animation: fadeIn 0.4s ease;
}

/* ==================== */
/* Options Container */
/* ==================== */
.options-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.option-btn {
  padding: 1.25rem 1.5rem;
  border: 2px solid var(--border-color);
  background: white;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  text-align: left;
  position: relative;
  overflow: hidden;
}

.option-btn::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  background: var(--primary-color);
  transition: width var(--transition-normal);
  opacity: 0.05;
}

.option-btn:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
}

.option-btn:hover::before {
  width: 100%;
}

.option-btn.selected {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  box-shadow: var(--shadow-md);
}

.option-label {
  position: relative;
  z-index: 1;
}

/* ==================== */
/* Navigation Buttons */
/* ==================== */
.navigation-buttons {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.navigation-buttons button {
  flex: 1;
}

/* ==================== */
/* Results Container */
/* ==================== */
.results-container {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-xl);
  max-width: 800px;
  margin: 0 auto auto auto;
  animation: fadeInUp 0.6s ease;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.results-card {
  text-align: center;
}

.results-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.results-card h2 {
  font-size: 2.5rem;
  color: var(--text-primary);
  margin-bottom: 2rem;
}

/* ==================== */
/* Score Circle */
/* ==================== */
.score-display {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.score-circle {
  position: relative;
  width: 200px;
  height: 200px;
}

#scoreCircleProgress {
  transition: stroke-dashoffset 1s ease;
}

.score-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.score-number {
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary-color);
}

.score-percent {
  font-size: 2rem;
  font-weight: 600;
  color: var(--primary-color);
}

/* ==================== */
/* Result Interpretation */
/* ==================== */
.result-interpretation {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
}

.result-interpretation h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.result-interpretation p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.result-interpretation.low {
  background: rgba(16, 185, 129, 0.1);
  border: 2px solid var(--success-color);
}

.result-interpretation.low h3 {
  color: var(--success-color);
}

.result-interpretation.moderate {
  background: rgba(245, 158, 11, 0.1);
  border: 2px solid var(--warning-color);
}

.result-interpretation.moderate h3 {
  color: var(--warning-color);
}

.result-interpretation.high {
  background: rgba(239, 68, 68, 0.1);
  border: 2px solid var(--danger-color);
}

.result-interpretation.high h3 {
  color: var(--danger-color);
}

/* ==================== */
/* Result Details */
/* ==================== */
.result-details {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.result-details h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.detail-item {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 1rem;
}

.detail-item:last-child {
  border-bottom: none;
}

.detail-item span:first-child {
  color: var(--text-secondary);
}

.detail-item span:last-child {
  color: var(--text-primary);
  font-weight: 600;
}

/* ==================== */
/* Results Actions */
/* ==================== */
.results-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.results-actions button {
  flex: 1;
}

/* ==================== */
/* Final Disclaimer */
/* ==================== */
.final-disclaimer {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-top: 2rem;
}

.final-disclaimer p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==================== */
/* Footer */
/* ==================== */
.footer {
  text-align: center;
  margin-top: auto;
  padding: 1rem 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
}

.footer p {
  margin: 0;
  line-height: 1.4;
  white-space: nowrap;
}

/* ==================== */
/* Animations */
/* ==================== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

@keyframes slideInFromRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ==================== */
/* Scrollbar Styling */
/* ==================== */
.answered-questions::-webkit-scrollbar {
  width: 6px;
}

.answered-questions::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 999px;
}

.answered-questions::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 999px;
}

.answered-questions::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* ==================== */
/* Responsive Design */
/* ==================== */
@media (max-width: 1024px) {
  .content-wrapper {
    flex-direction: column;
  }

  .answered-questions {
    width: 100%;
    max-height: 300px;
    position: static;
    order: -1;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }


  .language-switcher {
    scale: 68%;
    flex-direction: column;
    right: 0;
    top: -10px;
  }

  .header h1 {
    font-size: 1.25rem;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .info-icon svg {
    width: 20px;
    height: 20px;
  }

  .tooltip {
    white-space: normal;
    max-width: 280px;
    text-align: center;
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    left: 50%;
    right: auto;
  }

  .disclaimer {
    padding: 2rem 1.5rem;
  }

  .disclaimer h2 {
    font-size: 1.5rem;
  }

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

  .question-card {
    padding: 1.5rem;
  }

  .results-card h2 {
    font-size: 1.75rem;
  }
}

@media (max-width: 480px) {
  .options-container {
    gap: 0.75rem;
  }

  .option-btn {
    padding: 1rem;
    font-size: 0.875rem;
  }
}

/* Donate Button */
.donate-button {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
  animation: floatIn 0.8s ease forwards;
  opacity: 0;
}

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

.donate-link {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #0070ba 0%, #003087 100%);
  color: white;
  text-decoration: none;
  padding: 14px 24px;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 112, 186, 0.4);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

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

.donate-link:hover::before {
  left: 100%;
}

.donate-link:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 32px rgba(0, 112, 186, 0.6);
}

.donate-link:active {
  transform: translateY(-1px) scale(1.02);
}

.donate-icon {
  font-size: 20px;
  animation: pulse 2s ease-in-out infinite;
}

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

.donate-text {
  display: flex;
  align-items: center;
  gap: 6px;
}

.paypal-logo {
  width: 60px;
  height: auto;
}

@media (max-width: 768px) {
  .donate-button {
    bottom: 20px;
    right: 20px;
  }

  .donate-link {
    padding: 12px 20px;
    font-size: 14px;
    gap: 8px;
  }

  .donate-icon {
    font-size: 18px;
  }

  .paypal-logo {
    width: 50px;
  }
}

@media (max-width: 480px) {
  .donate-button {
    bottom: 15px;
    right: 15px;
  }

  .donate-link {
    padding: 10px 16px;
    font-size: 13px;
    gap: 6px;
  }

  .donate-icon {
    font-size: 16px;
  }

  .donate-text span {
    /*display: none;*/
  }

  .paypal-logo {
    width: 45px;
  }
}

/* ==================== */
/* Print Styles */
/* ==================== */
@media print {
  body {
    background: white;
  }

  .language-switcher,
  .navigation-buttons,
  .donate-button,
  .results-actions {
    display: none;
  }

  .container {
    max-width: 100%;
    padding: 1rem;
  }
}
