/**
 * Lesson AJAX Styles
 *
 * @package CYNO
 * @version 1.0.0
 */

/* Lesson states */
.lesson.active {
  background-color: #e67e221a;
  border-left: 4px solid var(--secondary-color);
}

.lesson.active .lesson-link {
  font-weight: 600;
}

/* Available lesson state (logged in users) */
.lesson.available {
  background-color: #f8f9fa;
  border-left: 3px solid #28a745;
}

.lesson.available .lesson-icon i {
  color: #28a745;
}

.lesson.available .lesson-link {
  color: #155724;
  font-weight: 500;
}

.lesson.available:hover {
  background-color: #e8f5e8;
}

/* Preview lesson state (accessible to all) */
.lesson.preview {
  background-color: #fff3cd;
  border-left: 3px solid #ffc107;
}

.lesson.preview .lesson-icon i {
  color: #856404;
}

.lesson.preview .lesson-link {
  color: #856404;
  font-weight: 500;
}

.lesson.preview:hover {
  background-color: #ffeaa7;
}

/* Locked lesson state (requires login) */
.lesson.locked {
  background-color: #f8f9fa;
  border-left: 3px solid #6c757d;
  opacity: 0.7;
}

.lesson.locked .lesson-icon i {
  color: #6c757d;
}

.lesson.locked .lesson-link {
  color: #6c757d;
  cursor: not-allowed;
}

.lesson.locked:hover {
  background-color: #e9ecef;
}

/* Loading state */
.lesson-link.loading {
  opacity: 0.6;
  pointer-events: none;
}

.lesson-link.loading::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 8px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #2196f3;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Video wrapper */
.video-wrapper {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  overflow: hidden;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Video placeholder */
.video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  background-color: #f8f9fa;
  border: 2px dashed #dee2e6;
  border-radius: 8px;
  color: #6c757d;
}

.video-placeholder i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: #adb5bd;
}

/* Resource items */
.resource-item {
  display: flex;
  align-items: center;
  padding: 12px;
  margin-bottom: 8px;
  background-color: #f8f9fa;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.resource-item:hover {
  background-color: #e9ecef;
}

.resource-icon {
  margin-right: 12px;
  font-size: 1.2rem;
}

.resource-icon i {
  color: #6c757d;
}

/* File type specific colors */
.resource-icon .fa-file-pdf {
  color: #dc3545;
}

.resource-icon .fa-file-word {
  color: #2b579a;
}

.resource-icon .fa-file-excel {
  color: #217346;
}

.resource-icon .fa-file-powerpoint {
  color: #d24726;
}

.resource-icon .fa-file-archive {
  color: #6c757d;
}

.resource-icon .fa-file-image {
  color: #28a745;
}

.resource-icon .fa-file-video {
  color: #6f42c1;
}

.resource-icon .fa-file-audio {
  color: #fd7e14;
}

.resource-item a {
  color: #495057;
  text-decoration: none;
}

.resource-item a:hover {
  color: #007bff;
  text-decoration: underline;
}

/* Learning objectives */
.learning-objectives {
  background-color: #f8f9fa;
  padding: 20px;
  border-left: 4px solid #007cba;
  border-radius: 0 6px 6px 0;
  margin: 20px 0;
}

.learning-objectives h5 {
  color: #007cba;
  margin-bottom: 10px;
}

/* Smooth transitions */
#lesson-content-container {
  transition: opacity 0.3s ease;
}

#lesson-content-container.loading {
  opacity: 0.7;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .video-placeholder {
    height: 200px;
  }

  .video-placeholder i {
    font-size: 2rem;
  }

  .resource-item {
    padding: 8px;
  }

  .learning-objectives {
    padding: 15px;
  }
}

/* Quiz Styles */
.quiz-question {
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  background-color: #fff;
}

.quiz-option {
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 12px 15px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: #f8f9fa;
}

.quiz-option:hover {
  background-color: #e9ecef;
  border-color: #007cba;
}

.quiz-option.selected {
  background-color: #e3f2fd;
  border-color: #2196f3;
}

.quiz-option.correct {
  background-color: #d4edda;
  border-color: #28a745;
  color: #155724;
}

.quiz-option.incorrect {
  background-color: #f8d7da;
  border-color: #dc3545;
  color: #721c24;
}

.quiz-option.correct-answer::after {
  color: #28a745;
  font-weight: bold;
}

.quiz-explanation {
  margin-top: 15px;
}

.quiz-explanation .alert {
  margin-bottom: 0;
}

#quiz-result {
  margin-top: 20px;
}

#quiz-result .alert ul {
  margin-bottom: 0;
}

#quiz-result .alert li {
  margin-bottom: 5px;
}

/* Quiz Progress Bar */
#quiz-result .progress {
  height: 25px;
  background-color: #e9ecef;
  border-radius: 12px;
  overflow: hidden;
}

#quiz-result .progress-bar {
  background: linear-gradient(45deg, #28a745, #20c997);
  transition: width 0.6s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Quiz Result Buttons */
#quiz-result .btn {
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.3s ease;
}

#quiz-result .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Quiz Result Alert Colors */
#quiz-result .alert-success {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  border-color: #28a745;
}

#quiz-result .alert-info {
  background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
  border-color: #17a2b8;
}

#quiz-result .alert-warning {
  background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
  border-color: #ffc107;
}

#quiz-result .alert-danger {
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  border-color: #dc3545;
}

/* Text Colors */
.text-success {
  color: #28a745 !important;
}

.text-danger {
  color: #dc3545 !important;
}
