/* Single SCORM Group Styles - Based on Single Course Structure */
.scorm-single-course {
  width: 100%;
  margin: 0 auto;
  padding: 40px 0;
}

.scorm-container {
  width: 100%;
}

.course-header {
  display: flex;
  gap: 40px;
  margin-bottom: 50px;
  align-items: flex-start;
}

.course-featured-image {
  flex: 0 0 500px;
  position: relative;
}

.course-featured-image img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Course Access Badge */
.course-access-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 5px;
}

.course-access-badge .dashicons {
  font-size: 14px;
}

.course-access-free {
  background: linear-gradient(135deg, #0073aa, #0085ba);
}

.course-access-paid {
  background: linear-gradient(135deg, #d63638, #dc3545);
}

.course-access-closed {
  background: linear-gradient(135deg, #6c757d, #5a6268);
}

/* Certificate Badge (used for enrollment/certification status) */
.certificate-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 5px;
  z-index: 10;
}

.certificate-badge .dashicons {
  font-size: 14px;
}

/* Different styles for enrolled vs certified */
.certificate-badge.enrolled-badge {
  background: linear-gradient(135deg, #46b450, #28a745);
}

.course-info {
  flex: 1;
}

.course-title {
  font-size: 3em;
  margin-bottom: 25px;
  color: var(--scorm-heading-color, #333333);
  line-height: 1.2;
  font-weight: 700;
}

/* Progress Section for Enrollment Status */
.course-progress {
  margin-bottom: 25px;
  padding: 20px;
  border-radius: 8px;
  border-left: 4px solid #28a745;
  background: #e8f5e8;
}

/* Expired (retake required) */
.course-progress.status-expired {
  border-left-color: var(--scorm-in-progress-color, #ffc107);
  background: rgba(var(--scorm-in-progress-rgb, 255, 193, 7), 0.1);
}
.course-progress.status-expired .progress-text {
  color: var(--scorm-in-progress-color, #ffc107);
}

.course-progress.status-expired .progress-fill {
  background: var(--scorm-in-progress-color, #ffc107);
}

.progress-bar {
  width: 100%;
  height: 12px;
  background: #dee2e6;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  width: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, #28a745, #20c997);
  transition: background 0.3s ease;
}

.progress-text {
  font-size: 14px;
  font-weight: 600;
  color: #155724;
}

.course-actions {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 30px;
}

/* Enrolled Status Message */
.enrolled-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px;
  background: #e8f5e8;
  border: 2px solid #28a745;
  border-radius: 8px;
  color: #155724;
  font-weight: 600;
  font-size: 16px;
}

.enrolled-status .dashicons {
  font-size: 20px;
  color: #28a745;
}

/* Certificate Actions */
.certificate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.certificate-actions .btn {
  font-size: 14px;
  padding: 10px 20px;
}

.certificate-actions .btn .dashicons {
  font-size: 16px;
}

/* Seats Info */
.seats-info {
  margin-top: 15px;
  padding: 10px 15px;
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 6px;
  color: #856404;
  font-weight: 500;
  font-size: 14px;
  text-align: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 30px;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn .dashicons {
  font-size: 18px;
}

.btn-primary {
  background: linear-gradient(135deg, #0073aa, #005a87);
  color: white;
  box-shadow: 0 4px 15px rgba(0, 115, 170, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #005a87, #004064);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 115, 170, 0.4);
}

.btn-secondary {
  background: linear-gradient(135deg, #6c757d, #495057);
  color: white;
  box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #495057, #343a40);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

.btn-large {
  padding: 18px 40px;
  font-size: 18px;
}

.btn-small {
  padding: 10px 20px;
  font-size: 14px;
}

/* Loading States */
.btn.loading {
  pointer-events: none;
  opacity: 0.7;
}

.btn.loading .dashicons {
  animation: spin 1s linear infinite;
}

.btn.success {
  background: linear-gradient(135deg, #28a745, #20c997) !important;
}

.btn.error {
  background: linear-gradient(135deg, #dc3545, #c82333) !important;
}

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

/* WooCommerce Integration Styles */
.woocommerce-info,
.scorm-group-info {
  padding: 20px;
  background: #e7f3ff;
  border: 1px solid #b3d7ff;
  border-radius: 8px;
  color: #0073aa;
}

.woocommerce-info p,
.scorm-group-info p {
  margin: 0;
  padding-bottom: 8px;
  font-weight: 500;
}

.woocommerce-error {
  padding: 20px;
  background: #ffe6e6;
  border: 1px solid #ffb3b3;
  border-radius: 8px;
  color: #d63638;
}

.woocommerce-error p {
  margin: 0;
  font-weight: 500;
}

/* Status Messages */
.cart-status-message,
.enrollment-status {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 25px;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  z-index: 9999;
  max-width: 300px;
  transform: translateX(400px);
  transition: transform 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.cart-status-message.show,
.enrollment-status.show {
  transform: translateX(0);
}

.cart-status-message.success,
.enrollment-status.success {
  background: linear-gradient(135deg, #28a745, #20c997);
}

.cart-status-message.error,
.enrollment-status.error {
  background: linear-gradient(135deg, #dc3545, #c82333);
}

.course-content {
  margin-top: 40px;
}

/* Course Description */
.course-description h2 {
  font-size: 2.2em;
  margin-bottom: 25px;
  color: var(--scorm-heading-color, #333333);
  border-bottom: 3px solid var(--scorm-primary-color, #0073aa);
  padding-bottom: 15px;
  font-weight: 700;
}

.content {
  font-size: 16px;
  line-height: 1.7;
}

.content p {
  margin-bottom: 20px;
}

.content h1,
.content h2,
.content h3,
.content h4,
.content h5,
.content h6 {
  margin-top: 30px;
  margin-bottom: 15px;
  color: var(--scorm-heading-color, #333333);
}

.content ul,
.content ol {
  margin-bottom: 20px;
  padding-left: 30px;
}

.content li {
  margin-bottom: 8px;
}

/* Group Statistics */
.group-statistics {
  display: flex;
  gap: 30px;
  margin: 40px 0;
  padding: 30px;
  background: #f8f9fa;
  border-radius: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
  min-width: 120px;
}

.stat-value {
  font-size: 2.5em;
  font-weight: 700;
  color: var(--scorm-secondary-color, #0073aa);
  display: block;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 14px;
  color: var(--scorm-text-color, #333333);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* Group Courses Section */
.group-courses {
  margin-top: 50px;
}

.group-courses h2 {
  font-size: 2.2em;
  margin-bottom: 30px;
  color: var(--scorm-heading-color, #333333);
  border-bottom: 3px solid var(--scorm-primary-color, #0073aa);
  padding-bottom: 15px;
  font-weight: 700;
}

.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 30px;
  margin-top: 30px;
}

.course-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border: 1px solid #e9ecef;
}

.course-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.course-card.no-access:hover {
  transform: none;
}

.course-image {
  position: relative;
  overflow: hidden;
  height: 200px;
}

.course-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.course-card:hover .course-image img {
  transform: scale(1.05);
}

.course-card.no-access .course-image img {
  filter: grayscale(50%);
}

/* Access Overlay */
.access-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.course-card.has-access .access-overlay {
  display: none;
}

.course-card.no-access .access-overlay {
  opacity: 1;
}

.progress-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  color: white;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
}

.progress-overlay.status-completed {
  background: linear-gradient(
    to top,
    rgba(40, 167, 69, 0.9),
    rgba(40, 167, 69, 0.3)
  );
}

.progress-overlay.status-in-progress {
  background: linear-gradient(
    to top,
    rgba(255, 193, 7, 0.9),
    rgba(255, 193, 7, 0.3)
  );
}

.progress-overlay.status-failed {
  background: linear-gradient(
    to top,
    rgba(220, 53, 69, 0.9),
    rgba(220, 53, 69, 0.3)
  );
}

.course-card .course-content {
  padding: 25px;
}

.course-card .course-title {
  font-size: 1.3em;
  margin-bottom: 15px;
  line-height: 1.3;
  font-weight: 600;
}

.course-card .course-title a {
  text-decoration: none;
  transition: color 0.3s ease;
}

.course-card .course-title a:hover {
  color: var(--scorm-secondary-color, #0073aa);
}

.course-card.no-access .course-title {
  color: var(--scorm-text-color, #333333);
}

.course-excerpt {
  color: var(--scorm-text-color, #333333);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.course-action {
  margin-top: 20px;
}

.course-action .btn {
  width: 100%;
  justify-content: center;
}

.access-required {
  color: var(--scorm-text-color, #333333);
  font-style: italic;
  text-align: center;
  padding: 10px;
  font-size: 14px;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .scorm-single-course {
    padding: 30px 0;
  }

  .course-featured-image {
    flex: 0 0 400px;
  }

  .course-header {
    gap: 30px;
  }

  .courses-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

@media (max-width: 992px) {
  .course-header {
    flex-direction: column;
    gap: 30px;
  }

  .course-featured-image {
    flex: none;
    max-width: 500px;
    margin: 0 auto;
  }

  .course-title {
    font-size: 2.5em;
    text-align: center;
  }

  .course-actions {
    justify-content: center;
  }

  .group-statistics {
    gap: 20px;
  }

  .courses-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  .scorm-single-course {
    padding: 20px 0;
  }

  .course-title {
    font-size: 2.2em;
  }

  .course-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    text-align: center;
    justify-content: center;
  }

  .course-content {
    margin-top: 30px;
  }

  .course-description h2,
  .group-courses h2 {
    font-size: 1.8em;
  }

  .group-statistics {
    flex-direction: column;
    gap: 20px;
  }

  .stat-item {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 15px;
  }

  .courses-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 480px) {
  .course-title {
    font-size: 1.8em;
  }

  .btn-large {
    padding: 15px 25px;
    font-size: 16px;
  }

  .course-access-badge,
  .certificate-badge {
    font-size: 10px;
    padding: 6px 10px;
  }

  .group-statistics {
    padding: 20px 15px;
  }

  .stat-value {
    font-size: 2em;
  }

  .enrollment-status,
  .cart-status-message {
    right: 10px;
    top: 10px;
    max-width: calc(100vw - 20px);
    padding: 12px 20px;
  }
}

/* Theme Integration */
.scorm-single-course.full-width {
  max-width: 100%;
}

.scorm-single-course.centered {
  text-align: center;
}

.scorm-single-course.compact {
  max-width: 1000px;
}
