/* Global font (using a Jinja2 variable for font name if needed) */
* {
  font-family: "{{font}}", sans-serif;
}

/* Hide scrollbar */
::-webkit-scrollbar {
  display: none;
}

/* Custom utility classes */
.highlighted-section {
  outline: 2px solid #3F20FB;
  background-color: rgba(63, 32, 251, 0.1);
}

.edit-button {
  position: absolute;
  z-index: 1000;
}

/* CSS Variables for Light Theme */
:root {
  /* Base Colors */
  --color-base: #ffffff;
  --color-base-50: #f9fafb;
  --color-base-100: #f3f4f6;
  --color-base-200: #e5e7eb;
  --color-base-300: #d1d5db;
  --color-base-400: #9ca3af;
  --color-base-500: #6b7280;
  --color-base-600: #4b5563;
  --color-base-700: #374151;
  --color-base-800: #1f2937;
  --color-base-900: #111827;
  --color-base-content: #1f2937;

  /* Primary Colors */
  --color-primary: #3b82f6;
  --color-primary-50: #eff6ff;
  --color-primary-100: #dbeafe;
  --color-primary-200: #bfdbfe;
  --color-primary-300: #93c5fd;
  --color-primary-400: #60a5fa;
  --color-primary-500: #3b82f6;
  --color-primary-600: #2563eb;
  --color-primary-700: #1d4ed8;
  --color-primary-800: #1e40af;
  --color-primary-900: #1e3a8a;
  --color-primary-focus: #2563eb;
  --color-primary-content: #ffffff;

  /* Secondary Colors */
  --color-secondary: #8b5cf6;
  --color-secondary-50: #f5f3ff;
  --color-secondary-100: #ede9fe;
  --color-secondary-200: #ddd6fe;
  --color-secondary-300: #c4b5fd;
  --color-secondary-400: #a78bfa;
  --color-secondary-500: #8b5cf6;
  --color-secondary-600: #7c3aed;
  --color-secondary-700: #6d28d9;
  --color-secondary-800: #5b21b6;
  --color-secondary-900: #4c1d95;
  --color-secondary-focus: #7c3aed;
  --color-secondary-content: #ffffff;

  /* Accent Colors */
  --color-accent: #f472b6;
  --color-accent-50: #fdf2f8;
  --color-accent-100: #fce7f3;
  --color-accent-200: #fbcfe8;
  --color-accent-300: #f9a8d4;
  --color-accent-400: #f472b6;
  --color-accent-500: #ec4899;
  --color-accent-600: #db2777;
  --color-accent-700: #be185d;
  --color-accent-800: #9d174d;
  --color-accent-900: #831843;
  --color-accent-focus: #db2777;
  --color-accent-content: #ffffff;

  /* Neutral Colors */
  --color-neutral: #6b7280;
  --color-neutral-50: #f9fafb;
  --color-neutral-100: #f3f4f6;
  --color-neutral-200: #e5e7eb;
  --color-neutral-300: #d1d5db;
  --color-neutral-400: #9ca3af;
  --color-neutral-500: #6b7280;
  --color-neutral-600: #4b5563;
  --color-neutral-700: #374151;
  --color-neutral-800: #1f2937;
  --color-neutral-900: #111827;
  --color-neutral-focus: #4b5563;
  --color-neutral-content: #ffffff;

  /* Info Colors */
  --color-info: #3b82f6;
  --color-info-50: #eff6ff;
  --color-info-100: #dbeafe;
  --color-info-200: #bfdbfe;
  --color-info-300: #93c5fd;
  --color-info-400: #60a5fa;
  --color-info-500: #3b82f6;
  --color-info-600: #2563eb;
  --color-info-700: #1d4ed8;
  --color-info-800: #1e40af;
  --color-info-900: #1e3a8a;
  --color-info-focus: #2563eb;
  --color-info-content: #ffffff;

  /* Success Colors */
  --color-success: #10b981;
  --color-success-50: #ecfdf5;
  --color-success-100: #d1fae5;
  --color-success-200: #a7f3d0;
  --color-success-300: #6ee7b7;
  --color-success-400: #34d399;
  --color-success-500: #10b981;
  --color-success-600: #059669;
  --color-success-700: #047857;
  --color-success-800: #065f46;
  --color-success-900: #064e3b;
  --color-success-focus: #059669;
  --color-success-content: #ffffff;

  /* Warning Colors */
  --color-warning: #f59e0b;
  --color-warning-50: #fffbeb;
  --color-warning-100: #fef3c7;
  --color-warning-200: #fde68a;
  --color-warning-300: #fcd34d;
  --color-warning-400: #fbbf24;
  --color-warning-500: #f59e0b;
  --color-warning-600: #d97706;
  --color-warning-700: #b45309;
  --color-warning-800: #92400e;
  --color-warning-900: #78350f;
  --color-warning-focus: #d97706;
  --color-warning-content: #ffffff;

  /* Error Colors */
  --color-error: #ef4444;
  --color-error-50: #fef2f2;
  --color-error-100: #fee2e2;
  --color-error-200: #fecaca;
  --color-error-300: #fca5a5;
  --color-error-400: #f87171;
  --color-error-500: #ef4444;
  --color-error-600: #dc2626;
  --color-error-700: #b91c1c;
  --color-error-800: #991b1b;
  --color-error-900: #7f1d1d;
  --color-error-focus: #dc2626;
  --color-error-content: #ffffff;
}

/* Dark Theme Overrides */
.dark {
  /* Base Colors */
  --color-base: #1f2937;
  --color-base-50: #111827;
  --color-base-100: #1f2937;
  --color-base-200: #374151;
  --color-base-300: #4b5563;
  --color-base-400: #6b7280;
  --color-base-500: #9ca3af;
  --color-base-600: #d1d5db;
  --color-base-700: #e5e7eb;
  --color-base-800: #f3f4f6;
  --color-base-900: #f9fafb;
  --color-base-content: #f9fafb;

  /* Primary Colors */
  --color-primary: #60a5fa;
  --color-primary-50: #1e3a8a;
  --color-primary-100: #1e40af;
  --color-primary-200: #1d4ed8;
  --color-primary-300: #2563eb;
  --color-primary-400: #3b82f6;
  --color-primary-500: #60a5fa;
  --color-primary-600: #93c5fd;
  --color-primary-700: #bfdbfe;
  --color-primary-800: #dbeafe;
  --color-primary-900: #eff6ff;
  --color-primary-focus: #3b82f6;
  --color-primary-content: #1f2937;

  /* Secondary Colors */
  --color-secondary: #a78bfa;
  --color-secondary-50: #4c1d95;
  --color-secondary-100: #5b21b6;
  --color-secondary-200: #6d28d9;
  --color-secondary-300: #7c3aed;
  --color-secondary-400: #8b5cf6;
  --color-secondary-500: #a78bfa;
  --color-secondary-600: #c4b5fd;
  --color-secondary-700: #ddd6fe;
  --color-secondary-800: #ede9fe;
  --color-secondary-900: #f5f3ff;
  --color-secondary-focus: #8b5cf6;
  --color-secondary-content: #1f2937;

  /* Accent Colors */
  --color-accent: #f472b6;
  --color-accent-50: #831843;
  --color-accent-100: #9d174d;
  --color-accent-200: #be185d;
  --color-accent-300: #db2777;
  --color-accent-400: #ec4899;
  --color-accent-500: #f472b6;
  --color-accent-600: #f9a8d4;
  --color-accent-700: #fbcfe8;
  --color-accent-800: #fce7f3;
  --color-accent-900: #fdf2f8;
  --color-accent-focus: #ec4899;
  --color-accent-content: #1f2937;

  /* Neutral, Info, Success, Warning & Error colors may be customized similarly if needed */
}

/* Mobile-friendly adjustments */
@media (max-width: 640px) {
  input, select, textarea {
    font-size: 16px !important; /* Prevents iOS zoom on focus */
  }
  
  /* Adjust spacing for mobile */
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }
  
  /* Ensure buttons are easy to tap */
  button, 
  [type="button"],
  [type="submit"],
  [type="reset"],
  a.btn,
  .btn,
  a[href]:not(.inline-link) {
    min-height: 44px; /* Apple's recommended minimum tap target size */
  }
  
  /* Improve touch targets for mobile */
  label {
    cursor: pointer;
  }
  
  /* Make radio buttons more tappable */
  input[type="radio"],
  input[type="checkbox"] {
    min-width: 20px;
    min-height: 20px;
  }
  
  /* Make labels tap-friendly */
  label.w-full .flex {
    min-height: 44px;
  }
}

/* Fix for iOS devices to prevent unnecessary elastic scrolling */
html, body {
  position: relative;
  overflow-x: hidden;
  width: 100%;
}

/* High contrast focus styles for accessibility */
:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

/* Improve form element styling on mobile */
input, select, textarea {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border-radius: 8px;
}

/* Prevent overflow on mobile */
.overflow-x-auto {
  -webkit-overflow-scrolling: touch;
}

/* Improved touch targets for inputs */
input[type="radio"] + label,
label input[type="radio"],
input[type="checkbox"] + label,
label input[type="checkbox"] {
  cursor: pointer;
}

/* Improve touch targets */
.touch-manipulation {
  touch-action: manipulation;
}

/* Make radio buttons and their labels more responsive to touch */
input[type="radio"],
input[type="checkbox"] {
  min-width: 24px;
  min-height: 24px;
}

/* Add active state for touch feedback */
.active\:bg-gray-100:active {
  background-color: rgba(243, 244, 246, 1);
}

/* Custom checkbox and radio styling for better mobile visibility */
/* These styles will override browser defaults to ensure consistency */

/* Base styles for both checkbox and radio inputs */
input[type="checkbox"],
input[type="radio"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border: 2px solid #ccc;
  cursor: pointer;
  position: relative;
  margin-right: 8px;
  vertical-align: middle;
  transition: all 0.2s ease;
}

/* Size increase for mobile */
@media (max-width: 768px) {
  input[type="checkbox"],
  input[type="radio"] {
    width: 24px;
    height: 24px;
    border-width: 2px;
  }
}

/* Radio button specific styling */
input[type="radio"] {
  border-radius: 50%;
}

/* Checkbox specific styling */
input[type="checkbox"] {
  border-radius: 4px;
}

/* Checked state styling for radio buttons */
input[type="radio"]:checked {
  border-color: #FC7E01;
  background-color: #fff;
  box-shadow: 0 0 0 2px rgba(252, 126, 1, 0.2);
}

input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #FC7E01;
}

/* Checked state styling for checkboxes */
input[type="checkbox"]:checked {
  background-color: #FC7E01;
  border-color: #FC7E01;
}

input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 14px;
  line-height: 1;
}

/* Focus state for accessibility */
input[type="checkbox"]:focus,
input[type="radio"]:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(252, 126, 1, 0.3);
}

/* Hover state */
input[type="checkbox"]:hover,
input[type="radio"]:hover {
  border-color: #FC7E01;
}

/* Enhanced touch area for mobile */
label {
  display: inline-flex;
  align-items: center;
  user-select: none;
  cursor: pointer;
}

/* Make touch area larger without affecting layout */
label.choice-label {
  min-height: 44px;
  padding: 8px;
  margin: -8px;
  display: inline-flex;
  align-items: center;
}

/* For radio groups in questionnaires */
.question-item .flex label {
  position: relative;
  padding: 8px 0;
  min-width: 44px;
  text-align: center;
}

/* Ensure text is visible for selected options */
.question-item .flex label input:checked + span {
  color: #FC7E01;
  font-weight: 500;
}

/* Additional spacing for desktop - won't affect mobile */
@media (min-width: 768px) {
  input[type="checkbox"] + span,
  input[type="radio"] + span {
    margin-left: 15px;  /* More spacing on desktop */
  }
  
  /* Ensure label text is properly aligned with input */
  .choice-label {
    display: flex;
    align-items: center;
  }
  
  /* Specific to questionnaire checkboxes */
  .choice-label input[type="checkbox"],
  .choice-label input[type="radio"] {
    flex-shrink: 0;
  }
}

/* Additional spacing for checkbox and radio labels */
input[type="checkbox"] + span,
input[type="radio"] + span {
  margin-left: 10px;  /* Base spacing for all devices */
}

/* Add these game-specific styles to your existing custom.css */

/* Game Container Styles */
.game-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: var(--color-base);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Game Controls */
.game-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
}

.game-button {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
    background-color: var(--color-primary);
    color: var(--color-primary-content);
}

.game-button:hover {
    background-color: var(--color-primary-focus);
    transform: translateY(-1px);
}

.game-button:disabled {
    background-color: var(--color-base-300);
    cursor: not-allowed;
}

/* Game Canvas/Area Styles */
.game-area {
    background-color: var(--color-base-50);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Game Instructions */
.game-instructions {
    background-color: var(--color-info-50);
    border-left: 4px solid var(--color-info);
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0 8px 8px 0;
}

/* Game Progress */
.game-progress {
    height: 4px;
    background-color: var(--color-base-200);
    border-radius: 2px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-bar {
    height: 100%;
    background-color: var(--color-primary);
    transition: width 0.3s ease;
}

/* Game Results */
.game-results {
    background-color: var(--color-success-50);
    border: 1px solid var(--color-success-200);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
}

/* Game Score Display */
.score-display {
    font-size: 2rem;
    font-weight: bold;
    color: var(--color-primary);
    text-align: center;
    margin: 1rem 0;
}

/* Responsive Game Container */
@media (max-width: 640px) {
    .game-container {
        padding: 16px;
        margin: 0 8px;
    }

    .game-controls {
        flex-direction: column;
    }

    .game-button {
        width: 100%;
        padding: 12px;
    }

    .game-area {
        min-height: 300px;
    }
}

/* Game Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.game-fade-in {
    animation: fadeIn 0.3s ease-in;
}

/* Game Status Messages */
.game-status {
    text-align: center;
    padding: 0.5rem;
    border-radius: 4px;
    margin: 0.5rem 0;
}

.status-success {
    background-color: var(--color-success-50);
    color: var(--color-success-700);
}

.status-error {
    background-color: var(--color-error-50);
    color: var(--color-error-700);
}

.status-warning {
    background-color: var(--color-warning-50);
    color: var(--color-warning-700);
} 