/* LiD Exam Styles - Matching Site Theme */

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

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
  }
  to {
    opacity: 1;
    max-height: 1000px;
  }
}

@keyframes smoothGlow {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(15, 111, 214, 0.1);
  }
  50% {
    box-shadow: 0 4px 16px rgba(15, 111, 214, 0.2);
  }
}

@keyframes radioPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(15, 111, 214, 0.4);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(15, 111, 214, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(15, 111, 214, 0);
  }
}

@keyframes scaleIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Main Container */
.tool-container {
  padding: var(--space-8) var(--space-4) var(--space-12);
  min-height: calc(100vh - 200px);
  animation: fadeIn 0.4s ease-out;
  padding-top: var(--space-12);
}

#lid-app {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

/* Title Card - Separate from selection */
.title-card {
  text-align: center;
  background: linear-gradient(180deg, var(--surface-1), var(--surface-2));
  padding: var(--space-8) var(--space-6);
  padding-top: var(--space-12);
  margin-top: var(--space-6);
  border-bottom: 2px solid var(--border);
  animation: fadeIn 0.4s ease-out;
}

.title-card h1 {
  font-size: 2rem;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-3);
  color: var(--text-primary);
  font-weight: 700;
}

.title-card .subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin: 0;
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Selection Card - Clean and spacious */
.selection-card {
  padding: var(--space-6) 0;
  margin-left: auto;
  margin-right: auto;
}

.selection-title {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: var(--space-10);
  font-weight: 700;
  text-align: center;
  padding: 0 var(--space-4);
}

/* Search Container - Horizontal layout for desktop, vertical for mobile */
.search-container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  box-sizing: border-box;
}

.search-fields-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  align-items: start;
  width: 100%;
}

.search-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: 100%;
}

/* Field Label - Clean and prominent */
.field-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  display: block;
  margin-bottom: var(--space-2);
}

.optional-text {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-tertiary);
  margin-left: var(--space-2);
}

[dir="rtl"] .optional-text {
  margin-left: 0;
  margin-right: var(--space-2);
}

/* Input Wrapper */
.input-wrapper {
  position: relative;
}

/* City Input - Larger, clearer with smooth transitions */
.city-input {
  width: 100%;
  padding: 16px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-family: inherit;
  background: white;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  position: relative;
}

.city-input:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.city-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(15, 111, 214, 0.1), 0 4px 12px rgba(15, 111, 214, 0.15);
  transform: translateY(-1px);
  background-color: #fafbfc;
}

.city-input::placeholder {
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

/* State Select - Match city input styling exactly */
.state-select {
  width: 100%;
  padding: 16px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-family: inherit;
  background: white;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='10' viewBox='0 0 16 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L8 8L15 1' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  padding-right: 48px;
  position: relative;
}

.state-select:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.state-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(15, 111, 214, 0.1), 0 4px 12px rgba(15, 111, 214, 0.15);
  transform: translateY(-1px);
  background-color: #fafbfc;
}

[dir="rtl"] .state-select {
  background-position: left 18px center;
  padding-right: 18px;
  padding-left: 48px;
}

/* Remove old field-header styles */
.field-header {
  display: none;
}

.field-icon {
  display: none;
}

.optional-badge {
  display: none;
}

/* Dropdown - Clean style */
.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1.5px solid var(--color-primary);
  border-radius: var(--radius-md);
  margin-top: 6px;
  max-height: 280px;
  overflow-y: auto;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  z-index: 100;
  animation: slideDown 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dropdown-item {
  padding: 12px 18px;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.95rem;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  position: relative;
}

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

.dropdown-item:hover {
  background: var(--surface-2);
  color: var(--color-primary);
  padding-left: 20px;
  font-weight: 500;
}

/* State Display - Cleaner, more compact design */
.state-display {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 2px solid #93c5fd;
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 8px rgba(15, 111, 214, 0.1);
  min-height: 70px;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: smoothGlow 2s ease-in-out infinite;
  width: 100%;
  max-width: 100%;
  margin-top: var(--space-2);
}

.state-display.empty {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 2px dashed #cbd5e1;
  box-shadow: none;
  opacity: 0.7;
  animation: none;
}

.state-display img {
  width: 45px;
  height: auto;
  max-height: 35px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  background: white;
  padding: 3px;
  flex-shrink: 0;
  transition: opacity 0.3s ease;
}

.state-display.empty img {
  opacity: 0.3;
  filter: grayscale(100%);
}

.state-info {
  text-align: left;
  flex: 1;
}

[dir="rtl"] .state-info {
  text-align: right;
}

.state-info h4 {
  font-size: 0.9rem;
  color: var(--text-primary);
  margin: 0 0 2px 0;
  font-weight: 600;
  line-height: 1.2;
}

.state-display.empty .state-info h4 {
  color: var(--text-tertiary);
  font-size: 0.8rem;
}

.state-info p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin: 0;
  font-weight: 500;
  line-height: 1.2;
}

.state-display.empty .state-info p {
  display: none;
}

/* Start Button Section - Hidden (moved to bottom) */
#lid-app .start-button-section {
  display: none;
}

/* Start Button Section Bottom - At the end of setup screen */
.start-button-section-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-10) auto var(--space-8);
  padding: var(--space-5) var(--space-6);
  width: 100%;
  max-width: 100%;
  background: linear-gradient(135deg, #f0f9ff 0%, #eff6ff 100%);
  border: 1px solid #dbeafe;
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 8px rgba(15, 111, 214, 0.08);
  animation: fadeIn 0.5s ease-out;
  flex-wrap: nowrap;
}

#lid-app .btn-large {
  min-width: 240px;
  max-width: 340px;
  flex-shrink: 0;
  padding: 18px 48px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 16px rgba(15, 111, 214, 0.25);
  border-radius: var(--radius-lg);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

#lid-app .btn-large::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
  pointer-events: none;
}

#lid-app .btn-large:hover:not(:disabled) {
  box-shadow: 0 6px 24px rgba(15, 111, 214, 0.35);
  transform: translateY(-2px);
}

#lid-app .btn-large:hover:not(:disabled)::before {
  width: 300px;
  height: 300px;
}

#lid-app .btn-large:active:not(:disabled) {
  transform: translateY(-1px);
}

#lid-app .btn-large:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* Tool Card - Base styles with enhanced effects */
.tool-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: fadeIn 0.5s ease-out;
  position: relative;
}

.tool-card:hover {
  box-shadow: 0 6px 16px rgba(15, 111, 214, 0.12);
  border-color: var(--color-primary);
  transform: translateY(-1px);
}

.tool-card h3 {
  font-size: 1.3rem;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* City Selection Section - New Layout */
.city-selection-section {
  margin-bottom: var(--space-6);
}

.city-selection-section h3 {
  font-size: 1.1rem;
  margin-bottom: var(--space-2);
}

.selection-hint {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

.selection-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.selection-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.selection-item label {
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 600;
}

/* Info Box */
.info-box {
  background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
  border: 2px solid #bae6fd;
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.info-box:hover {
  box-shadow: 0 2px 8px rgba(15, 111, 214, 0.1);
  border-color: #93c5fd;
  transform: translateY(-2px);
}

.info-box a {
  color: white;
  background: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  display: inline-block;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(15, 111, 214, 0.2);
}

.info-box a:hover {
  background: #0856a1;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(15, 111, 214, 0.3);
  transform: translateY(-1px);
}

/* Info Grid - 2 columns on desktop */
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  padding: 0;
  width: 100%;
}

.info-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  min-height: 70px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.info-item:hover {
  border-color: var(--color-primary);
  background: #f0f9ff;
  box-shadow: 0 2px 6px rgba(15, 111, 214, 0.08);
}

/* RTL Support for info items */
[dir="rtl"] .info-item {
  flex-direction: row;
  text-align: right;
}

[dir="ltr"] .info-item {
  flex-direction: row;
  text-align: left;
}

.info-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.info-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.info-content strong {
  font-size: 0.8rem;
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.3;
}

.info-content span {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Buttons - Scoped to LiD app only */
#lid-app .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-decoration: none;
  font-family: inherit;
  position: relative;
}

#lid-app .btn-primary {
  background: var(--color-primary) !important;
  color: white !important;
  box-shadow: 0 2px 6px rgba(15, 111, 214, 0.2);
}

#lid-app .btn-primary:hover {
  background: #0856a1 !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 111, 214, 0.3) !important;
  color: white !important;
}

#lid-app .btn-secondary {
  background: var(--surface-2);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

#lid-app .btn-secondary:hover {
  background: var(--surface-3);
}

#lid-app .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* State Selection */
.state-selector {
  display: grid;
  gap: var(--space-4);
}

.state-selector label {
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 600;
}

/* State Display - Fixed Image Size */
.state-display {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-md);
  margin-top: var(--space-4);
}

.state-display img {
  width: 120px;
  height: auto;
  max-height: 90px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.state-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.state-info h4 {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin: 0;
}

.state-info p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Dropdown */
.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-top: 4px;
  max-height: 300px;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

.dropdown-item {
  padding: 12px 16px;
  cursor: pointer;
  transition: background-color 0.15s;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.dropdown-item:hover {
  background: var(--surface-2);
}

.state-display {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
}

.state-display strong {
  color: var(--text-primary);
}

.state-display span {
  color: var(--text-secondary);
}

/* Timer Bar */
.timer-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: white;
  padding: 5px var(--space-3);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-6);
  z-index: 95;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
}

/* At page top keep timer attached under header; after scrolling it moves to top:0. */
.timer-bar.timer-below-header {
  top: 59px;
}

.timer-bar.timer-top {
  top: 0;
}

.timer {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* Keep exam content visible below fixed timer */
#examScreen {
  padding-top: 56px;
}

.timer.warning {
  color: #f59e0b;
}

.timer.danger {
  color: #ef4444;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: var(--space-3);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), #3b82f6);
  transition: width 0.3s ease;
  border-radius: 4px;
}

.progress-text {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0;
}

/* Question Cards - Light and spacious */
.question-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin: var(--space-4) var(--space-4) var(--space-5);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding-top: var(--space-8);
}

.question-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, rgba(15, 111, 214, 0.03), transparent);
  border-radius: var(--radius-lg);
  transition: width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.question-card:hover {
  box-shadow: 0 6px 16px rgba(15, 111, 214, 0.1);
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.question-card:hover::before {
  width: 100%;
}

/* Unanswered Question Highlighting */
.question-card.unanswered {
  border: 2px solid #fca5a5;
  background: #fef2f2;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.08);
}

.question-card.unanswered .question-number {
  background: #ef4444;
  animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.question-number {
  display: inline-block;
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  background: var(--color-primary);
  color: white;
  padding: 4px 10px;
  border-radius: var(--radius-md);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 8px rgba(15, 111, 214, 0.2);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
}

.question-card:hover .question-number {
  box-shadow: 0 4px 12px rgba(15, 111, 214, 0.3);
  transform: scale(1.05);
}

.question-text {
  font-size: 1.05rem;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  font-weight: 500;
  line-height: 1.6;
  direction: ltr;
  text-align: left;
  word-wrap: break-word;
  overflow-wrap: break-word;
  padding: var(--space-4) var(--space-3) var(--space-3) var(--space-3);
  padding-top: var(--space-8);
  background: #fafbfc;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--color-primary);
}

@media (min-width: 769px) {
  .question-text {
    margin-top: var(--space-4);
  }
}

[dir="rtl"] .question-text {
  direction: ltr;
  text-align: left;
}

.question-text-fa {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  background: #f8fafc;
  border-left: 3px solid #e2e8f0;
  border-radius: var(--radius-md);
  line-height: 1.7;
  direction: ltr;
  text-align: left;
}

[dir="rtl"] .question-text-fa {
  border-left: none;
  border-right: 3px solid #e2e8f0;
  direction: rtl;
  text-align: right;
}

.question-image {
  width: 100%;
  max-width: 500px;
  height: auto;
  border-radius: var(--radius-md);
  margin: var(--space-4) 0;
  border: 1px solid #e2e8f0;
  display: block;
}

/* Answers */
/* Answers - Clean and accessible */
.answers {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding: var(--space-3);
  background: #fafbfc;
  border-radius: var(--radius-md);
}

.answer-option {
  display: flex;
  align-items: start;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: white;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.answer-option::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, rgba(15, 111, 214, 0.04), transparent);
  transition: width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 0;
  pointer-events: none;
}

.answer-option:hover {
  border-color: var(--color-primary);
  background: #f0f9ff;
  box-shadow: 0 4px 12px rgba(15, 111, 214, 0.12);
  transform: translateY(-2px);
}

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

.answer-option.selected {
  border-color: var(--color-primary);
  background: #f0f9ff;
  box-shadow: 0 4px 12px rgba(15, 111, 214, 0.15);
  transform: translateY(-2px);
}

.answer-option input[type="radio"] {
  margin-top: 4px;
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--color-primary);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  transition: all 0.2s ease;
}

.answer-option input[type="radio"]:checked {
  animation: radioPulse 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.answer-option input[type="radio"]:checked + .answer-text {
  font-weight: 600;
}

.answer-text {
  flex: 1;
  position: relative;
  z-index: 1;
}

.answer-text-de {
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
  line-height: 1.5;
  direction: ltr;
  text-align: left;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

[dir="rtl"] .answer-text-de {
  direction: ltr;
  text-align: left;
}

.answer-text-fa {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  direction: ltr;
  text-align: left;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* RTL styling only when page is in RTL mode */
[dir="rtl"] .answer-text-fa {
  direction: rtl;
  text-align: right;
}

/* Results - Redesigned cleaner, lighter version */
.result-summary {
  text-align: center;
  padding: var(--space-10) var(--space-8);
  padding-top: var(--space-12);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-6);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border);
  background: var(--surface-1);
}

.result-summary.result-passed {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 2px solid #86efac;
}

.result-summary.result-failed {
  background: linear-gradient(135deg, #fef2f2 0%, #fef9f9 100%);
  border: 2px solid #fca5a5;
}

.result-icon {
  font-size: 4rem;
  margin-bottom: var(--space-4);
  line-height: 1;
}

.result-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: var(--space-3);
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.result-score-large {
  font-size: 2rem;
  font-weight: 800;
  margin: var(--space-3) 0;
  color: var(--text-primary);
  letter-spacing: -0.05em;
  line-height: 1;
}

.result-summary.result-passed .result-score-large {
  color: #059669;
}

.result-summary.result-failed .result-score-large {
  color: #dc2626;
}

.result-message {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 550px;
  margin: var(--space-4) auto var(--space-6);
  font-weight: 500;
}

.result-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
  margin-top: var(--space-8);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.result-stat-box {
  padding: var(--space-6) var(--space-4);
  border-radius: var(--radius-lg);
  text-align: center;
  background: white;
  border: 1px solid var(--border);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation-fill-mode: both;
}

.result-stat-box:nth-child(1) {
  animation-delay: 0.1s;
}

.result-stat-box:nth-child(2) {
  animation-delay: 0.2s;
}

.result-stat-box:nth-child(3) {
  animation-delay: 0.3s;
}

.result-stat-box:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.result-stat-box.correct {
  border: 2px solid #86efac;
  background: #f0fdf4;
}

.result-stat-box.incorrect {
  border: 2px solid #fca5a5;
  background: #fef2f2;
}

.result-stat-box.time {
  border: 2px solid #bfdbfe;
  background: #eff6ff;
}

.result-stat-box .stat-number {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: var(--space-3);
  line-height: 1;
  letter-spacing: -0.03em;
}

.result-stat-box.correct .stat-number {
  color: #10b981;
}

.result-stat-box.incorrect .stat-number {
  color: #ef4444;
}

.result-stat-box.time .stat-number {
  color: var(--color-primary);
}

.result-stat-box .stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Result Actions - New Exam Button Section */
.result-actions {
  text-align: center;
  margin: var(--space-8) 0 var(--space-10);
}

.btn-new-exam {
  min-width: 320px !important;
  padding: 20px 56px !important;
  font-size: 1.15rem !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 16px rgba(15, 111, 214, 0.25) !important;
  transition: all 0.2s ease !important;
}

.btn-new-exam:hover:not(:disabled) {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 24px rgba(15, 111, 214, 0.35) !important;
}

/* Wrong Answers Card - Lighter design with better spacing */
.wrong-answers-card {
  margin-top: var(--space-8);
  width: 100%;
  max-width: 100%;
  overflow: visible;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.wrong-answers-title {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.wrong-answer-item {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  width: 100%;
  max-width: 100%;
  display: block;
  box-sizing: border-box;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: slideDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation-fill-mode: both;
  position: relative;
}

[dir="rtl"] .wrong-answer-item {
  border-left: 1px solid #e2e8f0;
  border-right: none;
}

.wrong-answer-item:nth-child(1) {
  animation-delay: 0.4s;
}

.wrong-answer-item:nth-child(2) {
  animation-delay: 0.5s;
}

.wrong-answer-item:nth-child(3) {
  animation-delay: 0.6s;
}

.wrong-answer-item:nth-child(n+4) {
  animation-delay: 0.7s;
}

.wrong-answer-item:hover {
  box-shadow: 0 6px 16px rgba(15, 111, 214, 0.1);
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.wrong-answer-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, rgba(15, 111, 214, 0.03), transparent);
  border-radius: var(--radius-lg);
  transition: width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.wrong-answer-item:hover::before {
  width: 100%;
}

.wrong-answer-item:last-child {
  margin-bottom: 0;
}

.wrong-question-header {
  margin-bottom: var(--space-3);
}

.question-badge {
  display: inline-block;
  background: var(--color-primary);
  color: white;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: var(--space-3);
  letter-spacing: 0.05em;
  box-shadow: 0 2px 8px rgba(15, 111, 214, 0.2);
}

.wrong-question-text {
  font-size: 1.05rem;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  font-weight: 500;
  line-height: 1.6;
  direction: ltr;
  text-align: left;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

[dir="rtl"] .wrong-question-text {
  direction: ltr;
  text-align: left;
}

.wrong-question-text-fa {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  background: #f8fafc;
  border-left: 3px solid #e2e8f0;
  border-radius: var(--radius-md);
  line-height: 1.7;
  direction: ltr;
  text-align: left;
}

[dir="rtl"] .wrong-question-text-fa {
  border-left: none;
  border-right: 3px solid #e2e8f0;
  direction: rtl;
  text-align: right;
}

.question-image {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: var(--space-3) 0;
  display: block;
}

.answer-comparison {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-4);
  width: 100%;
}

.answer-box {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid;
  word-wrap: break-word;
  overflow-wrap: break-word;
  width: 100%;
  box-sizing: border-box;
}

.answer-box.your-answer {
  background: #fef9c3;
  border-color: #fbbf24;
  border-left: 3px solid #f59e0b;
}

[dir="rtl"] .answer-box.your-answer {
  border-left: 1px solid #fbbf24;
  border-right: 3px solid #f59e0b;
}

.answer-box.correct-answer {
  background: #d1fae5;
  border-color: #6ee7b7;
  border-left: 3px solid #10b981;
}

[dir="rtl"] .answer-box.correct-answer {
  border-left: 1px solid #6ee7b7;
  border-right: 3px solid #10b981;
}

.answer-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: var(--space-2);
  letter-spacing: 0.05em;
  display: block;
}

.answer-box.your-answer .answer-label {
  color: #92400e;
}

.answer-box.correct-answer .answer-label {
  color: #065f46;
}

.answer-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.answer-content-de {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.5;
  direction: ltr;
  text-align: left;
  word-wrap: break-word;
  overflow-wrap: break-word;
  color: var(--text-primary);
}

.answer-content-fa {
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.6;
  direction: ltr;
  text-align: left;
  word-wrap: break-word;
  overflow-wrap: break-word;
  color: var(--text-secondary);
}

/* RTL styling only when page is in RTL mode */
[dir="rtl"] .answer-content-fa {
  direction: rtl;
  text-align: right;
}

.answer-box.your-answer .answer-content-de {
  color: #78350f;
}

.answer-box.your-answer .answer-content-fa {
  color: #92400e;
}

.answer-box.correct-answer .answer-content-de {
  color: #064e3b;
}

.answer-box.correct-answer .answer-content-fa {
  color: #065f46;
}

/* Old styles - Keep for compatibility but marked as deprecated */
.result-score {
  font-size: 4rem;
  font-weight: 700;
  margin: var(--space-4) 0;
  background: linear-gradient(135deg, var(--color-primary), #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.result-status {
  display: inline-block;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: var(--space-3);
}

.result-status.passed {
  background: #10b981;
  color: white;
}

.result-status.failed {
  background: #ef4444;
  color: white;
}

.result-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-5);
}

.result-stat {
  text-align: center;
  padding: var(--space-4);
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.result-stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.result-stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Review Section */
.review-question {
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-6);
  border-bottom: 2px solid var(--border);
}

.review-question:last-child {
  border-bottom: none;
}

.review-answer {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  margin-top: var(--space-2);
  font-size: 0.95rem;
  border: 2px solid;
}

.review-answer.correct {
  background: #d1fae5;
  border-color: #10b981;
  color: #065f46;
}

.review-answer.incorrect {
  background: #fee2e2;
  border-color: #ef4444;
  color: #991b1b;
}

.review-answer.user-answer {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

.review-answer strong {
  font-weight: 700;
}

/* Utilities - Scoped to LiD app */
#lid-app .hidden {
  display: none !important;
}

#lid-app .screen {
  animation: fadeIn 0.3s ease;
}

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

#lid-app .text-center {
  text-align: center;
}

/* Hide language toggle during exam */
#examScreen ~ * #langToggle,
body.exam-active #langToggle {
  display: none !important;
}

/* Unanswered question indicator - Only show when unanswered class is added (on submit) */
.question-card.unanswered .question-number::after {
  content: ' ⚠️';
  font-size: 0.9em;
}

/* Submit Button - Bigger and More Prominent */
#submitExamBtn {
  min-width: 280px;
  padding: 18px 48px;
  font-size: 1.15rem;
  font-weight: 700;
  background: var(--color-primary) !important;
  color: white !important;
  box-shadow: 0 4px 12px rgba(15, 111, 214, 0.25);
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}

#submitExamBtn:hover:not(:disabled) {
  background: #0856a1 !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(15, 111, 214, 0.35) !important;
  color: white !important;
}

#submitExamBtn:active:not(:disabled) {
  transform: translateY(0);
  background: #0960b8 !important;
}

/* Submit warning message */
.submit-warning {
  background: #fef3c7;
  border: 2px solid #f59e0b;
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  text-align: center;
  color: #92400e;
  font-weight: 600;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid var(--surface-2);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-overlay p {
  margin-top: var(--space-4);
  font-size: 1.1rem;
  color: var(--text-secondary);
}

/* Alert Messages */
.alert {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  font-size: 0.95rem;
}

.alert-error {
  background: #fee2e2;
  border: 1px solid #ef4444;
  color: #991b1b;
}

.alert-success {
  background: #d1fae5;
  border: 1px solid #10b981;
  color: #065f46;
}

.alert-info {
  background: #dbeafe;
  border: 1px solid #3b82f6;
  color: #1e40af;
}

/* Translation Toggle Switch */
.toggle-section {
  display: flex;
  justify-content: center;
  margin: 0;
  padding: 0;
  width: auto;
  flex-shrink: 0;
}

.toggle-container {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: var(--space-2) var(--space-3);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 1px 4px rgba(15, 111, 214, 0.04);
  height: fit-content;
}

.toggle-container:hover {
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(15, 111, 214, 0.08);
  transform: translateY(-1px);
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.toggle-checkbox {
  display: none;
}

.toggle-slider {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 44px;
  height: 24px;
  background: linear-gradient(to right, #cbd5e1, #e2e8f0);
  border-radius: 12px;
  position: relative;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
  border: 1px solid transparent;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background-color: white;
  border-radius: 50%;
  top: 1px;
  left: 2px;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.toggle-checkbox:checked + .toggle-slider {
  background: linear-gradient(to right, var(--color-primary), #1e7ce8);
  border-color: var(--color-primary);
}

.toggle-checkbox:checked + .toggle-slider::after {
  left: 22px;
  box-shadow: 0 2px 8px rgba(15, 111, 214, 0.3);
}

.toggle-text {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.85rem;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.toggle-text::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.toggle-checkbox:checked ~ .toggle-text::before {
  content: '✓';
  font-size: 0.9rem;
  color: var(--color-primary);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
}

/* Hide translations when toggle is OFF */
body.hide-translations .question-text-fa,
body.hide-translations .answer-text-fa,
body.hide-translations .wrong-question-text-fa,
body.hide-translations .wrong-answer-text-fa {
  display: none !important;
}

/* Tablet Responsive (769px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
  .search-fields-row {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .state-display {
    width: 100%;
    max-width: 100%;
    justify-content: flex-start;
  }

  .info-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }

  .answer-comparison {
    flex-direction: column;
    gap: var(--space-3);
  }
}

/* Responsive - Improved Mobile Experience */
@media (max-width: 768px) {
  #lid-app {
    max-width: 100%;
  }

  .tool-container {
    padding: var(--space-4) var(--space-3);
  }

  .tool-card {
    padding: var(--space-5) var(--space-4);
    margin-bottom: var(--space-4);
    border-radius: var(--radius-md);
  }

  /* Title Card - Compact but readable */
  .title-card {
    padding: var(--space-6) var(--space-4);
  }

  .title-card h1 {
    font-size: 1.6rem;
    line-height: 1.3;
  }

  .title-card .subtitle {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  /* Toggle Section - Mobile optimized */
  .toggle-section {
    margin: var(--space-3) 0;
    padding: 0 var(--space-2);
  }

  .toggle-container {
    justify-content: center;
    padding: var(--space-3) var(--space-3);
  }

  .toggle-label {
    gap: var(--space-2);
  }

  .toggle-slider {
    width: 48px;
    height: 28px;
  }

  .toggle-slider::after {
    width: 24px;
    height: 24px;
  }

  .toggle-checkbox:checked + .toggle-slider::after {
    left: 22px;
  }

  .toggle-text {
    font-size: 0.85rem;
  }

  /* Selection Card - Better spacing */
  .selection-card {
    padding: var(--space-5) 0;
  }

  .selection-title {
    font-size: 1.4rem;
    margin-bottom: var(--space-6);
    padding: 0 var(--space-3);
  }

  /* Search Container - Vertical stack on mobile */
  .search-container {
    width: 100%;
    flex-direction: column;
    gap: var(--space-4);
    margin-bottom: var(--space-5);
    padding: 0 var(--space-3);
    max-width: 100%;
  }

  .search-fields-row {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .search-field {
    gap: var(--space-2);
    width: 100%;
  }

  .field-header {
    padding-left: 0;
    gap: var(--space-2);
  }

  .field-icon {
    font-size: 1.2rem;
  }

  .field-label {
    font-size: 0.9rem;
  }

  .optional-badge {
    font-size: 0.75rem;
  }

  .optional-text {
    font-size: 0.8rem;
  }

  /* Inputs - Touch-friendly size */
  .city-input,
  .state-select {
    padding: 16px 18px;
    font-size: 1rem;
    border-radius: var(--radius-md);
  }

  .state-select {
    background-position: right 18px center;
    padding-right: 50px;
  }

  [dir="rtl"] .state-select {
    background-position: left 18px center;
    padding-right: 18px;
    padding-left: 50px;
  }

  /* Dropdown - Better mobile UX */
  .dropdown {
    max-height: 240px;
    border-radius: var(--radius-md);
  }

  .dropdown-item {
    padding: 14px 16px;
    font-size: 0.95rem;
  }

  /* State Display - Full width on mobile, horizontal layout */
  .state-display {
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
    min-height: 70px;
    flex-direction: row;
    justify-content: flex-start;
  }

  .state-display img {
    width: 50px;
    max-height: 38px;
  }

  .state-info {
    text-align: left;
  }

  [dir="rtl"] .state-info {
    text-align: right;
  }

  .state-info h4 {
    font-size: 0.9rem;
  }

  .state-info p {
    font-size: 0.75rem;
  }

  /* Start Button - Mobile styling */
  #lid-app .start-button-section {
    display: none;
  }

  .start-button-section-bottom {
    margin: var(--space-6) auto var(--space-6);
    padding: var(--space-4) var(--space-3);
    width: 100%;
    flex-direction: column-reverse;
    gap: var(--space-3);
  }

  .toggle-section {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 0;
  }

  .toggle-container {
    width: auto;
    justify-content: center;
    padding: var(--space-2) var(--space-3);
  }

  #lid-app .btn-large {
    width: 100%;
    min-width: auto;
    max-width: 100%;
    padding: 16px 28px;
    font-size: 1rem;
  }

  /* Info Grid - Single column on mobile, proper RTL */
  .info-grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
    padding: 0;
  }

  .info-item {
    padding: var(--space-4);
    gap: var(--space-3);
    min-height: auto;
  }

  [dir="rtl"] .info-item {
    flex-direction: row;
  }

  [dir="ltr"] .info-item {
    flex-direction: row;
  }

  .info-icon {
    font-size: 1.6rem;
  }

  .info-content strong {
    font-size: 0.9rem;
  }

  .info-content span {
    font-size: 0.95rem;
  }

  /* Exam Screen - Better mobile layout */
  .timer-bar {
    top: 0;
    padding: 4px var(--space-2);
    margin-bottom: var(--space-3);
  }

  .timer {
    font-size: 1rem;
  }

  #examScreen {
    padding-top: 52px;
  }

  /* Question Cards - Compact but readable */
  .question-card {
    padding: var(--space-4);
    margin: var(--space-3) var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    padding-top: var(--space-8);
  }

  .question-number {
    font-size: 0.8rem;
    padding: 5px 10px;
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
  }

  .question-text {
    font-size: 1rem;
    line-height: 1.6;
    padding: var(--space-3) var(--space-3) var(--space-3) var(--space-3);
    padding-top: var(--space-8);
    margin-bottom: var(--space-2);
    margin-top: var(--space-3);
  }

  .question-text-fa {
    font-size: 0.9rem;
    padding: var(--space-3);
    margin-bottom: var(--space-3);
  }

  .question-image {
    max-width: 100%;
    margin: var(--space-3) 0;
    border-radius: var(--radius-md);
  }

  /* Answers - Touch-friendly */
  .answers {
    gap: var(--space-2);
    margin-top: var(--space-3);
  }

  .answer-option {
    padding: var(--space-3);
    gap: var(--space-2);
    border-radius: var(--radius-md);
  }

  .answer-option input[type="radio"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
  }

  .answer-text-de {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  .answer-text-fa {
    font-size: 0.85rem;
    line-height: 1.5;
  }

  /* Progress Bar - Visible */
  .progress-bar {
    height: 6px;
  }

  .progress-text {
    font-size: 0.85rem;
  }

  /* Results - Mobile optimized */
  .result-summary {
    padding: var(--space-6) var(--space-4);
    padding-top: var(--space-8);
  }

  .result-icon {
    font-size: 3.5rem;
    margin-bottom: var(--space-3);
  }

  .result-title {
    font-size: 0.95rem;
    margin-bottom: var(--space-3);
  }

  .result-score-large {
    font-size: 2.2rem;
    margin: var(--space-3) 0;
  }

  .result-message {
    font-size: 0.85rem;
    margin: var(--space-3) auto var(--space-5);
    line-height: 1.5;
  }

  .result-stats-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
    margin-top: var(--space-6);
  }

  .result-stat-box {
    padding: var(--space-5) var(--space-4);
  }

  .result-stat-box .stat-number {
    font-size: 1.75rem;
  }

  .result-stat-box .stat-label {
    font-size: 0.85rem;
  }

  /* Result Actions - Mobile */
  .result-actions {
    margin: var(--space-6) 0 var(--space-8);
  }

  .btn-new-exam {
    width: 100% !important;
    min-width: auto !important;
    padding: 18px 32px !important;
    font-size: 1.1rem !important;
  }

  /* Wrong Answers - Mobile optimized list */
  .wrong-answers-card {
    width: 100%;
    max-width: 100%;
    overflow: visible;
    padding: var(--space-4);
    margin-top: var(--space-6);
  }

  .wrong-answers-title {
    font-size: 1.1rem;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
  }

  .wrong-answer-item {
    padding: var(--space-4);
    margin-bottom: var(--space-3);
    width: 100%;
    max-width: 100%;
    display: block;
    border-radius: var(--radius-md);
  }

  .question-badge {
    font-size: 0.75rem;
    padding: 4px 10px;
    margin-bottom: var(--space-2);
  }

  .wrong-question-text {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: var(--space-2);
  }

  .wrong-question-text-fa {
    font-size: 0.88rem;
    padding: var(--space-3);
    line-height: 1.6;
  }

  .question-image {
    max-width: 100%;
    margin: var(--space-3) 0;
  }

  .answer-comparison {
    flex-direction: column;
    gap: var(--space-3);
    margin-top: var(--space-3);
    width: 100%;
  }

  .answer-box {
    padding: var(--space-3);
    width: 100%;
    box-sizing: border-box;
  }

  .answer-label {
    font-size: 0.7rem;
    margin-bottom: var(--space-2);
  }

  .answer-content-de {
    font-size: 0.88rem;
    line-height: 1.4;
  }

  .answer-content-fa {
    font-size: 0.85rem;
    line-height: 1.5;
  }

  /* Old result styles for backward compatibility */
  .result-score {
    font-size: 3.5rem;
  }

  .result-status {
    padding: 10px 20px;
    font-size: 1rem;
  }

  .result-details {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .result-stat {
    padding: var(--space-4);
  }

  .result-stat-value {
    font-size: 1.8rem;
  }

  .result-stat-label {
    font-size: 0.85rem;
  }

  /* Review Section - Readable on mobile */
  .review-question {
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-4);
  }

  .review-answer {
    padding: var(--space-3);
    font-size: 0.9rem;
  }

  /* Buttons - Full width on mobile */
  #lid-app .btn {
    padding: 12px 20px;
    font-size: 0.95rem;
  }

  #lid-app .btn-large {
    padding: 16px 32px;
    font-size: 1.05rem;
  }

  /* Submit Button - Full width on mobile */
  #submitExamBtn {
    width: 100%;
    min-width: auto;
    padding: 18px 32px;
    font-size: 1.1rem;
  }

  #examScreen .btn-primary,
  #resultsScreen .btn-primary,
  #resultsScreen .btn-secondary {
    width: 100%;
    margin-bottom: var(--space-2);
  }

  /* Loading Overlay - Smaller spinner */
  .spinner {
    width: 50px;
    height: 50px;
    border-width: 3px;
  }

  .loading-overlay p {
    font-size: 1rem;
    margin-top: var(--space-3);
  }
}

/* Extra small screens (phones < 400px) */
@media (max-width: 400px) {
  .tool-container {
    padding: var(--space-3) var(--space-2);
  }

  .tool-card {
    padding: var(--space-4) var(--space-3);
  }

  .title-card h1 {
    font-size: 1.4rem;
  }

  .title-card .subtitle {
    font-size: 0.9rem;
  }

  .selection-title {
    font-size: 1.2rem;
  }

  .city-input,
  .state-select {
    padding: 12px 14px;
    font-size: 0.95rem;
  }

  #lid-app .btn-large,
  #submitExamBtn {
    width: 100%;
    padding: 16px 24px;
    font-size: 1rem;
  }

  .result-score {
    font-size: 3rem;
  }
}

/* Large Desktop (1200px+) - Enhanced layout */
@media (min-width: 1200px) {
  .tool-container {
    padding: var(--space-10) var(--space-8) var(--space-16);
  }

  #lid-app {
    max-width: 1200px;
  }

  .search-container {
    max-width: 1000px;
  }

  .search-fields-row {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
  }

  .question-card {
    padding: var(--space-7);
    margin-bottom: var(--space-6);
  }

  .info-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
  }

  .result-stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-6);
  }
}

/* RTL Support */
[dir="rtl"] .answer-option {
  flex-direction: row-reverse;
}

[dir="rtl"] .state-display {
  direction: ltr;
}

[dir="rtl"] .timer-bar {
  direction: ltr;
}

[dir="rtl"] .field-header {
  padding-right: var(--space-2);
  padding-left: 0;
}
