/* Flashcard Modal Styles — themed to Breadboard3D (dark cyan).
   Uses the global :root variables from style.css. Layout/sizing/animation are
   unchanged from the original; only colours were re-mapped to the app theme.
   Semantic state colours: cyan = accent, teal-green = correct, red = wrong,
   amber = medium difficulty. */
.flashcard-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 8, 12, 0.6);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 300ms ease, visibility 300ms ease;
}

.flashcard-modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.flashcard-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: auto;
  max-width: 900px;
  max-height: 90vh;
  background: var(--bg-panel, #0e1520);
  color: var(--text-primary, #d4e8f0);
  border: 1px solid var(--border-bright, #243348);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55), 0 0 28px var(--accent-glow, rgba(0, 229, 255, 0.18));
  z-index: 1001;
  opacity: 0;
  transition: opacity 300ms ease, transform 300ms ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.flashcard-modal.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Header */
.flashcard-modal-header {
  padding: 24px 32px;
  border-bottom: 1px solid var(--border, #1a2535);
  background: linear-gradient(180deg, var(--bg-surface, #0c1118), var(--bg-panel, #0e1520));
  color: var(--text-primary, #d4e8f0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-shrink: 0;
}

.flashcard-modal-title-container {
  flex: 1;
  min-width: 0;
}

.flashcard-modal-title {
  margin: 0 0 4px 0;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--accent, #00e5ff);
}

.flashcard-modal-subtitle {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.9;
  line-height: 1.4;
  text-align: center;
  color: var(--text-secondary, #6a8fa8);
}

.flashcard-stats {
  display: flex;
  gap: 20px;
  font-size: 14px;
}

.flashcard-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-active, #1e2e42);
  border: 1px solid var(--border-bright, #243348);
  color: var(--text-primary, #d4e8f0);
  border-radius: 20px;
}

.flashcard-modal-close-button {
  background: var(--bg-hover, #1a2535);
  border: 1px solid var(--border, #1a2535);
  font-size: 1.75rem;
  color: var(--text-secondary, #6a8fa8);
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: all 0.2s ease;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.flashcard-modal-close-button:hover {
  background: var(--bg-active, #1e2e42);
  color: var(--accent, #00e5ff);
  transform: scale(1.1);
}

/* Body - Two Column Layout */
.flashcard-modal-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 0;
  overflow: hidden;
}

/* Left Column - Questions */
.flashcard-question-container {
  padding: 32px;
  overflow-y: auto;
  background: var(--bg-surface, #0c1118);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.flashcard-question-card {
  background: var(--bg-card, #121c28);
  border: 1px solid var(--border, #1a2535);
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.flashcard-question-number {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent, #00e5ff);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.flashcard-difficulty {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  text-transform: capitalize;
  font-weight: 600;
}

.flashcard-difficulty-easy {
  background: rgba(35, 214, 164, 0.16);
  color: #3fe6b0;
}

.flashcard-difficulty-medium {
  background: rgba(245, 179, 66, 0.16);
  color: #f5b342;
}

.flashcard-difficulty-hard {
  background: rgba(255, 90, 95, 0.16);
  color: #ff7a7f;
}

.flashcard-question-text {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary, #d4e8f0);
  line-height: 1.5;
}

.flashcard-choices {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.flashcard-choice {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-surface, #0c1118);
  border: 2px solid var(--border-bright, #243348);
  border-radius: 10px;
  cursor: pointer;
  transition: all 200ms ease;
  text-align: left;
  width: 100%;
  font-size: 1rem;
  color: var(--text-primary, #d4e8f0);
}

.flashcard-choice:hover:not(:disabled) {
  background: var(--bg-hover, #1a2535);
  border-color: var(--accent, #00e5ff);
  transform: translateX(4px);
}

.flashcard-choice:disabled {
  cursor: default;
}

.flashcard-choice-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--bg-card, #121c28);
  border: 2px solid var(--border-bright, #243348);
  border-radius: 8px;
  font-weight: 700;
  color: var(--text-secondary, #6a8fa8);
  flex-shrink: 0;
  transition: all 200ms ease;
}

.flashcard-choice:hover:not(:disabled) .flashcard-choice-label {
  border-color: var(--accent, #00e5ff);
  color: var(--accent, #00e5ff);
}

.flashcard-choice-text {
  flex: 1;
  color: var(--text-primary, #d4e8f0);
  line-height: 1.5;
}

.flashcard-choice.correct {
  background: rgba(35, 214, 164, 0.14);
  border-color: #20c997;
}

.flashcard-choice.correct .flashcard-choice-label {
  background: #20c997;
  border-color: #20c997;
  color: #06231a;
}

.flashcard-choice.incorrect {
  background: rgba(255, 90, 95, 0.14);
  border-color: #ff5a5f;
  animation: shake 400ms ease;
}

.flashcard-choice.incorrect .flashcard-choice-label {
  background: #ff5a5f;
  border-color: #ff5a5f;
  color: #2a0708;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

.flashcard-explanation {
  padding: 16px;
  background: var(--bg-card, #121c28);
  border: 1px solid var(--border, #1a2535);
  border-radius: 8px;
  color: var(--text-secondary, #6a8fa8);
  line-height: 1.6;
  display: none;
  max-height: 200px;
  overflow-y: auto;
}

.flashcard-explanation strong {
  color: var(--accent, #00e5ff);
}

/* Navigation */
.flashcard-navigation {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.flashcard-button {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.flashcard-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

.flashcard-button-primary {
  background: var(--accent-dim, #007a99);
  color: #eafcff;
}

.flashcard-button-primary:hover:not(:disabled) {
  background: var(--accent, #00e5ff);
  color: #06222c;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--accent-glow, rgba(0, 229, 255, 0.3));
}

.flashcard-button-secondary {
  background: var(--bg-hover, #1a2535);
  color: var(--text-secondary, #6a8fa8);
  border: 1px solid var(--border, #1a2535);
}

.flashcard-button-secondary:hover:not(:disabled) {
  background: var(--bg-active, #1e2e42);
  color: var(--text-primary, #d4e8f0);
  transform: translateY(-2px);
}

.flashcard-button-success {
  background: #20c997;
  color: #06231a;
}

.flashcard-button-success:hover:not(:disabled) {
  background: #2ee6a6;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(35, 214, 164, 0.3);
}

/* Right Column - Category Sidebar */
.flashcard-category-sidebar {
  padding: 24px;
  background: linear-gradient(180deg, var(--bg-surface, #0c1118) 0%, var(--bg-panel, #0e1520) 100%);
  border-left: 1px solid var(--border, #1a2535);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.flashcard-category-card {
  background: var(--bg-card, #121c28);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border-bright, #243348);
  text-align: center;
}

.flashcard-category-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  border-radius: 16px;
}

.flashcard-category-name {
  margin: 0 0 8px 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary, #d4e8f0);
}

.flashcard-category-description {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary, #6a8fa8);
  line-height: 1.5;
}

/* Progress Section */
.flashcard-progress-section {
  background: var(--bg-card, #121c28);
  border: 1px solid var(--border, #1a2535);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.flashcard-progress-section h4 {
  margin: 0 0 16px 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent, #00e5ff);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.flashcard-progress-bar {
  height: 12px;
  background: var(--bg-hover, #1a2535);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 16px;
}

.flashcard-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dim, #007a99) 0%, var(--accent, #00e5ff) 100%);
  border-radius: 6px;
  transition: width 400ms ease;
  width: 0%;
}

.flashcard-progress-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.flashcard-stat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  font-weight: 600;
}

.stat-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.stat-icon.correct {
  background: rgba(35, 214, 164, 0.16);
  color: #3fe6b0;
}

.stat-icon.incorrect {
  background: rgba(255, 90, 95, 0.16);
  color: #ff7a7f;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .flashcard-modal-body {
    grid-template-columns: 1fr;
  }

  .flashcard-category-sidebar {
    border-left: none;
    border-top: 1px solid var(--border, #1a2535);
    max-height: 300px;
  }
}

@media (max-width: 768px) {
  .flashcard-modal {
    width: 95%;
    max-height: 95vh;
  }

  .flashcard-modal-header {
    padding: 16px 20px;
    flex-wrap: wrap;
  }

  .flashcard-modal-title {
    font-size: 1.25rem;
  }

  .flashcard-stats {
    width: 100%;
    justify-content: space-between;
  }

  .flashcard-question-container {
    padding: 20px;
  }

  .flashcard-question-card {
    padding: 20px;
  }

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

  .flashcard-choice {
    padding: 12px 16px;
  }

  .flashcard-category-sidebar {
    padding: 20px;
  }

  .flashcard-navigation {
    gap: 8px;
  }

  .flashcard-button {
    padding: 10px 18px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .flashcard-modal-title {
    font-size: 1.1rem;
  }

  .flashcard-question-text {
    font-size: 1.1rem;
  }

  .flashcard-choice {
    gap: 12px;
  }

  .flashcard-choice-label {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
}

