/* AI Quiz Generation Modal Styles */
.video-modal.ai-quiz-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.video-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.ai-quiz-modal-content {
  position: relative;
  background: white;
  border-radius: 20px;
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Header */
.video-modal-header.ai-quiz-header {
  padding: 24px 32px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border-radius: 20px 20px 0 0;
  color: white;
}

.modal-header-content {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.modal-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.modal-title-wrapper h4 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.modal-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  opacity: 0.9;
}

.video-modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  color: white;
  font-size: 20px;
}

.video-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Body */
.video-modal-body {
  padding: 24px 32px;
  overflow-y: auto;
  flex: 1;
}

.ai-quiz-generation-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Info Section */
.ai-quiz-info {
  display: flex;
  gap: 16px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(37, 99, 235, 0.1) 100%);
  border-radius: 12px;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.info-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.info-content h5 {
  margin: 0 0 8px 0;
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
}

.info-content p {
  margin: 0 0 12px 0;
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
}

.quiz-length-indicator {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.length-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #4b5563;
  font-weight: 500;
}

.length-item i {
  color: #3b82f6;
}

/* Video Selection */
.video-selection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.video-selection-header h5 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
}

.selection-stats {
  display: flex;
  gap: 12px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
}

.stat-item i {
  color: #10b981;
  font-size: 16px;
}

/* Video List */
.video-selection-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  background: #f9fafb;
}

.video-selection-item {
  background: white;
  border-radius: 10px;
  margin-bottom: 10px;
  transition: all 0.2s;
}

.video-selection-item:last-child {
  margin-bottom: 0;
}

.video-selection-item.disabled {
  opacity: 0.5;
  background: #f3f4f6;
}

.video-selection-label {
  display: flex;
  gap: 12px;
  padding: 14px;
  cursor: pointer;
  width: 100%;
}

.video-selection-item.disabled .video-selection-label {
  cursor: not-allowed;
}

.checkbox-wrapper {
  flex-shrink: 0;
  position: relative;
}

.video-select-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
  appearance: none;
  transition: all 0.2s;
  position: relative;
}

.video-select-checkbox:checked {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: #667eea;
}

.video-select-checkbox:checked::after {
  content: '\2713';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 14px;
  font-weight: bold;
}

.video-select-checkbox:disabled {
  cursor: not-allowed;
  background: #e5e7eb;
}

.video-selection-info {
  flex: 1;
  min-width: 0;
}

.video-selection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.video-title-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.video-number {
  font-size: 11px;
  font-weight: 700;
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
  padding: 3px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}

.video-selection-title {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-selection-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.video-selection-badge.transcript-ready {
  background: #d1fae5;
  color: #065f46;
}

.video-selection-badge.transcript-processing {
  background: #dbeafe;
  color: #1e40af;
}

.video-selection-badge.no-transcript {
  background: #fee2e2;
  color: #991b1b;
}

.video-meta {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #9ca3af;
}

.meta-item i {
  font-size: 14px;
}

/* Language Selection */
.language-selection-section {
  padding-top: 8px;
}

.language-selection-header h5 {
  margin: 0 0 4px 0;
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
}

.language-selection-header p {
  margin: 0 0 16px 0;
  font-size: 13px;
  color: #6b7280;
}

.language-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.language-option-card {
  cursor: pointer;
  position: relative;
}

.language-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.language-card-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  background: white;
  transition: all 0.2s;
}

.language-option-card:hover .language-card-content {
  border-color: #667eea;
  background: rgba(102, 126, 234, 0.05);
}

.language-radio:checked + .language-card-content {
  border-color: #667eea;
  background: rgba(102, 126, 234, 0.1);
}

.language-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.language-details {
  flex: 1;
}

.language-name {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
}

.radio-checkmark {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  position: relative;
  transition: all 0.2s;
}

.language-radio:checked + .language-card-content .radio-checkmark {
  border-color: #667eea;
  background: #667eea;
}

.language-radio:checked + .language-card-content .radio-checkmark::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
}

/* Footer */
.video-modal-footer {
  padding: 20px 32px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 0 0 20px 20px;
}

.footer-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.footer-actions button {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.footer-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Empty State */
.no-videos-message {
  text-align: center;
  padding: 40px 20px;
}

.empty-state-icon {
  font-size: 48px;
  color: #d1d5db;
  margin-bottom: 16px;
}

.no-videos-message h5 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #6b7280;
}

/* Responsive */
@media (max-width: 768px) {
  .ai-quiz-modal-content {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .video-modal-header.ai-quiz-header {
    padding: 20px;
    border-radius: 0;
  }

  .video-modal-body {
    padding: 20px;
  }

  .video-modal-footer {
    padding: 16px 20px;
    border-radius: 0;
  }

  .language-options-grid {
    grid-template-columns: 1fr;
  }

  .footer-actions {
    flex-direction: column-reverse;
  }

  .footer-actions button {
    width: 100%;
    justify-content: center;
  }
}
