/**
 * SCORM Player Styles
 * Uses CSS variables from scorm-variables.css
 */

/* =========================================================
   Player wrapper & card
   ========================================================= */
.scorm-player-wrapper {
  max-width: 100%;
}

.scorm-player-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: linear-gradient(135deg, #1a2a4a 0%, #0d3b6e 60%, #0073aa 100%);
  border-radius: var(--scorm-border-radius-lg);
  padding: 24px 28px;
  color: #fff;
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.22), 0 2px 8px rgba(0, 115, 170, 0.18);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.scorm-player-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top right, rgba(255,255,255,0.07) 0%, transparent 65%);
  pointer-events: none;
}

.scorm-player-card:hover {
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 115, 170, 0.25);
}

/* Play icon column */
.scorm-player-card__icon {
  flex-shrink: 0;
  width: 68px;
  height: 68px;
  color: rgba(255, 255, 255, 0.9);
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.25));
  transition: transform 0.25s ease, color 0.25s ease;
}

.scorm-player-card:hover .scorm-player-card__icon {
  transform: scale(1.08);
  color: #fff;
}

.scorm-player-card__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Course info column */
.scorm-player-card__body {
  flex: 1;
  min-width: 0;
}

.scorm-player-card__title {
  margin: 0 0 10px;
  font-size: clamp(15px, 2vw, 20px);
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
  text-align: left;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
}

.scorm-player-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Status badge */
.scorm-status {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.25);
}

.scorm-status--in-progress {
  background: rgba(255, 185, 0, 0.18);
  color: #ffd755;
  border-color: rgba(255, 185, 0, 0.4);
}

.scorm-status--completed {
  background: rgba(70, 180, 80, 0.18);
  color: #72e680;
  border-color: rgba(70, 180, 80, 0.4);
}

.scorm-status--failed {
  background: rgba(220, 50, 50, 0.18);
  color: #ff8888;
  border-color: rgba(220, 50, 50, 0.4);
}

/* Remote badge */
.scorm-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
}

/* Launch button — base state */
.scorm-launch-btn {
  flex-shrink: 0;
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border: 2px solid transparent;
  border-radius: var(--scorm-border-radius-sm);
  font-size: 15px;
  font-weight: 700;
  font-family: var(--scorm-font-family);
  cursor: pointer;
  background: #fff !important;
  color: #0d3b6e !important;
  box-shadow: 0 3px 12px rgba(0,0,0,0.18);
  transition: background 0.2s ease, color 0.2s ease,
              border-color 0.2s ease, transform 0.2s ease,
              box-shadow 0.2s ease;
  white-space: nowrap;
  text-decoration: none !important;
  line-height: 1.2;
}

/* Launch button — hover / focus */
.scorm-launch-btn:hover,
.scorm-launch-btn:focus,
.scorm-launch-btn:focus-visible {
  background: #0d3b6e !important;
  color: #fff !important;
  border-color: rgba(255,255,255,0.35);
  transform: scale(1.04);
  box-shadow: 0 6px 20px rgba(0,0,0,0.28);
  outline: none;
  text-decoration: none !important;
}

.scorm-launch-btn:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.scorm-launch-btn__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.scorm-launch-btn:hover .scorm-launch-btn__icon,
.scorm-launch-btn:focus .scorm-launch-btn__icon {
  transform: scale(1.12);
}

/* Responsive: stack vertically on small screens */
@media (max-width: 600px) {
  .scorm-player-card {
    flex-direction: column;
    text-align: center;
    padding: 22px 18px;
    gap: 16px;
  }

  .scorm-player-card__body {
    width: 100%;
  }

  .scorm-player-card__meta {
    justify-content: center;
  }

  .scorm-launch-btn {
    width: 100%;
    justify-content: center;
  }
}

/* =========================================================
   Modal overlay
   ========================================================= */
.scorm-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: var(--scorm-z-modal);
  overflow: hidden;
}

.scorm-modal-content {
  position: relative;
  width: 95vw;
  height: 85vh;
  max-width: 1400px;
  max-height: 900px;
  background: #000;
  border-radius: var(--scorm-border-radius);
  overflow: hidden;
  box-shadow: var(--scorm-shadow-lg);
  aspect-ratio: 16 / 9;
}

#scorm-modal-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.scorm-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 22px;
  font-weight: bold;
  color: #fff !important;
  background: rgba(0, 0, 0, 0.55);
  border-radius: var(--scorm-border-radius-full);
  cursor: pointer;
  z-index: var(--scorm-z-close);
  transition: background 0.2s ease, transform 0.2s ease;
  user-select: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  line-height: 1;
  border: none;
  text-decoration: none !important;
}

.scorm-close:hover {
  background: rgba(200, 30, 30, 0.85) !important;
  color: #fff !important;
  transform: scale(1.12);
}

/* Disable background scroll when modal open */
body.scorm-modal-open {
  overflow: hidden;
}

/* =========================================================
   Resume prompt
   ========================================================= */
.scorm-resume-prompt {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: var(--scorm-z-resume);
}

.scorm-resume-content {
  background: var(--scorm-bg);
  padding: var(--scorm-spacing-xl);
  border-radius: var(--scorm-border-radius-lg);
  max-width: 440px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.scorm-resume-content h3 {
  margin-top: 0;
  font-size: 20px;
  color: var(--scorm-text);
}

.scorm-resume-location {
  font-size: 15px;
  margin: 12px 0 0;
  line-height: 1.6;
  color: var(--scorm-text-muted);
}

.scorm-resume-buttons {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-direction: column;
}

.scorm-btn {
  padding: 13px 22px;
  border: none;
  border-radius: var(--scorm-border-radius-sm);
  font-size: var(--scorm-font-size-base);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
  font-family: var(--scorm-font-family);
  text-decoration: none !important;
}

.scorm-btn-primary {
  background: var(--scorm-primary) !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.scorm-btn-primary:hover,
.scorm-btn-primary:focus {
  background: var(--scorm-primary-hover) !important;
  color: #fff !important;
  transform: translateY(-1px);
  outline: none;
}

.scorm-btn-secondary {
  background: var(--scorm-secondary) !important;
  color: var(--scorm-text) !important;
}

.scorm-btn-secondary:hover,
.scorm-btn-secondary:focus {
  background: var(--scorm-secondary-hover) !important;
  color: var(--scorm-text) !important;
  transform: translateY(-1px);
  outline: none;
}
