/**
 * Listening-IELTS Authentic Pick-From-A-List Stylesheet
 * English Mastery Hub Design System Harmonization
 * Supports both Emerald (Parts 3/4) and Rose/Pink (Parts 1/2) themes
 */

.listening-picklist-wrapper {
  margin-top: 1rem;
  margin-bottom: 1.25rem;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  padding: 1.125rem 1.25rem;
  box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.05);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.listening-picklist-wrapper:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px -3px rgba(15, 23, 42, 0.08);
}

.listening-picklist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.875rem;
  padding-bottom: 0.625rem;
  border-bottom: 1px solid #f1f5f9;
}

.listening-picklist-prompt {
  font-size: 0.825rem;
  font-weight: 600;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.listening-picklist-counter {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.775rem;
  font-weight: 700;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  background: #f1f5f9;
  color: #475569;
}

.listening-picklist-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.listening-picklist-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.875rem;
  border-radius: 10px;
  border: 1.5px solid #e2e8f0;
  background: #ffffff;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease-out;
}

.listening-picklist-card:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.listening-picklist-card .card-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.listening-picklist-card .card-checkbox {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 6px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.listening-picklist-card .card-letter-badge {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 9999px;
  background: #f1f5f9;
  color: #475569;
  font-weight: 700;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e2e8f0;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.listening-picklist-card .card-text {
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
  line-height: 1.4;
}

/* Selected State */
.listening-picklist-card.is-selected {
  background: #f0fdf4;
  border-color: #10b981;
  box-shadow: 0 0 0 1px #10b981;
}

.listening-picklist-card.is-selected .card-checkbox {
  background: #059669;
  border-color: #059669;
}

.listening-picklist-card.is-selected .card-letter-badge {
  background: #059669;
  color: #ffffff;
  border-color: #059669;
}

.listening-picklist-card.is-selected .card-text {
  color: #064e3b;
  font-weight: 600;
}

/* Hidden Native Input Helper */
.listening-native-input-hidden {
  display: none !important;
}

/* Review State Highlighting */
.listening-picklist-card.is-correct-key {
  background: #f0fdf4 !important;
  border-color: #10b981 !important;
  box-shadow: 0 0 0 1px #10b981 !important;
}

.listening-picklist-card.is-correct-key .card-letter-badge {
  background: #059669 !important;
  color: #ffffff !important;
  border-color: #059669 !important;
}

.listening-picklist-card.is-correct-key .card-text {
  color: #064e3b !important;
  font-weight: 600 !important;
}

.listening-picklist-card.is-correct-key .card-checkbox {
  background: #059669 !important;
  border-color: #059669 !important;
}

.listening-picklist-card.is-correct-key .card-checkbox .checkmark {
  display: block !important;
}

.listening-picklist-card.is-wrong-choice {
  background: #fef2f2 !important;
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 1px #ef4444 !important;
}

.listening-picklist-card.is-wrong-choice .card-letter-badge {
  background: #dc2626 !important;
  color: #ffffff !important;
  border-color: #dc2626 !important;
}

.listening-picklist-card.is-wrong-choice .card-text {
  color: #991b1b !important;
  font-weight: 600 !important;
}

.listening-picklist-card.is-wrong-choice .card-checkbox {
  background: #dc2626 !important;
  border-color: #dc2626 !important;
}

.listening-picklist-card.is-wrong-choice .card-checkbox .checkmark {
  display: block !important;
}

/* Review Status Badges */
.picklist-status-badge {
  margin-left: auto;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
  text-transform: uppercase;
}

.picklist-status-badge.is-correct {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.picklist-status-badge.is-wrong {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

/* Explanation Container */
.listening-picklist-explanation {
  margin-top: 0.875rem;
  padding: 0.875rem 1rem;
  border-radius: 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #14532d;
  font-size: 0.8125rem;
  animation: picklistFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.listening-picklist-explanation .picklist-expl-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.8125rem;
  color: #166534;
  margin-bottom: 0.5rem;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid #dcfce7;
}

.listening-picklist-explanation .picklist-expl-body {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  font-size: 0.775rem;
  color: #334155;
  line-height: 1.5;
}

.listening-picklist-explanation .picklist-expl-line strong {
  color: #0f172a;
}

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

/* Dark Mode Tokens */
html.dark .listening-picklist-wrapper,
html[data-theme="dark"] .listening-picklist-wrapper {
  background: #0f172a;
  border-color: #1e293b;
}

html.dark .listening-picklist-header,
html[data-theme="dark"] .listening-picklist-header {
  border-bottom-color: #1e293b;
}

html.dark .listening-picklist-prompt,
html[data-theme="dark"] .listening-picklist-prompt {
  color: #94a3b8;
}

html.dark .listening-picklist-counter,
html[data-theme="dark"] .listening-picklist-counter {
  background: #1e293b;
  color: #94a3b8;
}

html.dark .listening-picklist-card,
html[data-theme="dark"] .listening-picklist-card {
  background: #1e293b;
  border-color: #334155;
}

html.dark .listening-picklist-card:hover,
html[data-theme="dark"] .listening-picklist-card:hover {
  background: #334155;
  border-color: #475569;
}

html.dark .listening-picklist-card .card-checkbox,
html[data-theme="dark"] .listening-picklist-card .card-checkbox {
  background: #0f172a;
  border-color: #475569;
}

html.dark .listening-picklist-card .card-letter-badge,
html[data-theme="dark"] .listening-picklist-card .card-letter-badge {
  background: #0f172a;
  color: #cbd5e1;
  border-color: #334155;
}

html.dark .listening-picklist-card .card-text,
html[data-theme="dark"] .listening-picklist-card .card-text {
  color: #e2e8f0;
}

html.dark .listening-picklist-card.is-selected,
html[data-theme="dark"] .listening-picklist-card.is-selected {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10b981;
}

html.dark .listening-picklist-card.is-selected .card-text,
html[data-theme="dark"] .listening-picklist-card.is-selected .card-text {
  color: #a7f3d0;
}

html.dark .listening-picklist-card.is-correct-key,
html[data-theme="dark"] .listening-picklist-card.is-correct-key {
  background: rgba(16, 185, 129, 0.18) !important;
  border-color: #10b981 !important;
}

html.dark .listening-picklist-card.is-correct-key .card-text,
html[data-theme="dark"] .listening-picklist-card.is-correct-key .card-text {
  color: #a7f3d0 !important;
}

html.dark .listening-picklist-card.is-wrong-choice,
html[data-theme="dark"] .listening-picklist-card.is-wrong-choice {
  background: rgba(239, 68, 68, 0.18) !important;
  border-color: #ef4444 !important;
}

html.dark .listening-picklist-card.is-wrong-choice .card-text,
html[data-theme="dark"] .listening-picklist-card.is-wrong-choice .card-text {
  color: #fca5a5 !important;
}

html.dark .picklist-status-badge.is-correct,
html[data-theme="dark"] .picklist-status-badge.is-correct {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.4);
}

html.dark .picklist-status-badge.is-wrong,
html[data-theme="dark"] .picklist-status-badge.is-wrong {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}

html.dark .listening-picklist-explanation,
html[data-theme="dark"] .listening-picklist-explanation {
  background: rgba(6, 78, 59, 0.25);
  border-color: rgba(16, 185, 129, 0.3);
  color: #d1fae5;
}

html.dark .listening-picklist-explanation .picklist-expl-header,
html[data-theme="dark"] .listening-picklist-explanation .picklist-expl-header {
  color: #6ee7b7;
  border-bottom-color: rgba(16, 185, 129, 0.2);
}

html.dark .listening-picklist-explanation .picklist-expl-body,
html[data-theme="dark"] .listening-picklist-explanation .picklist-expl-body {
  color: #cbd5e1;
}

html.dark .listening-picklist-explanation .picklist-expl-line strong,
html[data-theme="dark"] .listening-picklist-explanation .picklist-expl-line strong {
  color: #f1f5f9;
}
