/* SCORM Course View Template Styles */

/* Reset for custom header body */
body.scorm-custom-header {
  margin: 0;
  padding: 0;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu,
    Cantarell, "Helvetica Neue", sans-serif;
  background: #f8f9fa;
  overflow-x: hidden;
}

/* Main course viewer container */
.scorm-course-viewer {
  width: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
}

/* Header section */
.scorm-viewer-header {
  background: white;
  border-bottom: 1px solid #e1e5e9;
  padding: 15px 25px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

.scorm-header-content {
  max-width: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.scorm-header-left {
  flex: 1;
}

.scorm-course-title {
  margin: 0;
  font-size: 1.4em;
  color: #2c3e50;
  font-weight: 600;
  line-height: 1.3;
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scorm-header-right {
  display: flex;
  align-items: center;
}

.scorm-course-progress {
  min-width: 120px;
  text-align: right;
  font-size: 0.9em;
  color: #666;
}

/* Content container */
.scorm-content-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  padding: 0;
  margin: 0;
}

.scorm-content-wrapper {
  flex: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.scorm-player-outer-container {
  height: 100vh;
}

/* Override the default scorm-player styles for full screen */
.scorm-content-wrapper .scorm-player-container {
  margin: 0 !important;
  box-shadow: none !important;
  width: 100% !important;
  height: 100% !important;
  min-height: calc(100vh - 80px) !important;
  position: relative !important;
  border-radius: 0 !important;
  overflow: hidden;
}

.scorm-content-wrapper .scorm-player-container iframe {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: calc(100vh - 80px) !important;
  border: none !important;
  border-radius: 0 !important;
}

/* Error message styling */
.scorm-error-message {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  padding: 40px 20px;
  background: #f8f9fa;
}

.access-denied-container {
  text-align: center;
  max-width: 600px;
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border: 1px solid #e9ecef;
}

.access-denied-icon {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.7;
}

.access-denied-icon .dashicons {
  width: 64px;
  height: 64px;
  font-size: 64px;
}

.access-denied-container h2 {
  margin: 0 0 15px;
  color: #2c3e50;
  font-size: 2em;
}

.access-denied-container p {
  color: #666;
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 30px;
}

.access-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.scorm-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  text-decoration: none !important;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.scorm-btn-primary {
  background: #0073aa;
  color: white;
}

.scorm-btn-primary:hover {
  background: #005a87;
  color: white;
  text-decoration: none !important;
}

.scorm-btn-secondary {
  background: #6c757d;
  color: white;
}

.scorm-btn-secondary:hover {
  background: #545b62;
  color: white;
  text-decoration: none !important;
}

.scorm-btn .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
}

.course-info-summary {
  padding-top: 30px;
  border-top: 1px solid #e9ecef;
}

.course-info-summary h3 {
  margin: 0 0 15px;
  color: #2c3e50;
  font-size: 1.4em;
}

.course-price {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 15px;
}

.course-price.free {
  color: #0073aa;
}

.course-price.open {
  color: #46b450;
}

.course-price .woocommerce-Price-amount {
  color: #d63638;
}

.course-excerpt {
  color: #666;
  font-style: italic;
  line-height: 1.6;
}

/* Loading state */
.scorm-content-wrapper.loading {
  position: relative;
}

.scorm-content-wrapper.loading::before {
  content: "Loading course...";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.95);
  padding: 25px 35px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  font-size: 1.1em;
  color: #2c3e50;
  font-weight: 500;
  border: 1px solid #e1e5e9;
}

/* Focus and accessibility */
.scorm-content-wrapper:focus-within {
  outline: 2px solid #0073aa;
  outline-offset: -2px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .scorm-viewer-header {
    padding: 12px 20px;
  }

  .scorm-header-content {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .scorm-course-title {
    font-size: 1.2em;
    max-width: 100%;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }

  .scorm-header-right {
    width: 100%;
    justify-content: flex-start;
  }

  .scorm-content-wrapper .scorm-player-container,
  .scorm-content-wrapper .scorm-player-container iframe {
    min-height: calc(100vh - 120px) !important;
  }

  .scorm-error-message {
    padding: 20px;
  }

  .scorm-error-message p {
    padding: 20px;
    font-size: 1em;
  }

  .access-denied-container {
    padding: 30px 20px;
  }

  .access-actions {
    flex-direction: column;
    align-items: center;
  }

  .scorm-btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .scorm-viewer-header {
    padding: 10px 15px;
  }

  .scorm-course-title {
    font-size: 1.1em;
  }

  .scorm-content-wrapper .scorm-player-container,
  .scorm-content-wrapper .scorm-player-container iframe {
    min-height: calc(100vh - 140px) !important;
  }

  .scorm-course-progress {
    min-width: 80px;
    font-size: 0.8em;
  }
}

/* High resolution displays */
@media (min-height: 1200px) {
  .scorm-content-wrapper .scorm-player-container,
  .scorm-content-wrapper .scorm-player-container iframe {
    min-height: calc(100vh - 70px) !important;
  }
}

/* Print styles */
@media print {
  .scorm-viewer-header {
    display: none;
  }

  .scorm-course-viewer {
    height: auto;
  }

  .scorm-content-container {
    height: auto;
    min-height: 100vh;
  }

  .scorm-content-wrapper .scorm-player-container,
  .scorm-content-wrapper .scorm-player-container iframe {
    min-height: 100vh !important;
    height: auto !important;
  }
}
