/* ============================================================================
   PHASE 2 VISUAL ENHANCEMENTS
   Icons, Animations, Status Badges, and Feature Card Improvements
   ============================================================================ */

/* ============================================================================
   ICON SYSTEM - Using Bootstrap Icons (already included in Quarto)
   ============================================================================ */

.icon-card {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.icon-card i {
  font-size: 2.5rem;
  color: #003399;
  flex-shrink: 0;
}

/* Section header icons */
.section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.section-header i {
  font-size: 1.5rem;
  color: #003399;
}

/* Button icons */
.btn i {
  margin-right: 0.5rem;
}

.btn-icon-only {
  padding: 0.75rem;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================================
   ENHANCED FEATURE CARDS WITH ICONS
   ============================================================================ */

.feature-card-enhanced {
  position: relative;
  padding: 2rem;
  background: white;
  border: 1px solid rgba(0,0,0,.1);
  border-radius: 1rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  will-change: transform; /* Performance hint for GPU acceleration */
}

/* Focus styles for keyboard navigation */
.feature-card-enhanced:focus-within {
  outline: 3px solid #003399;
  outline-offset: 4px;
}

.feature-card-enhanced a:focus,
.feature-card-enhanced button:focus {
  outline: 3px solid #0066cc;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Top gradient accent */
.feature-card-enhanced::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #003399, #0066cc, #003399);
  background-size: 200% 100%;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
  animation: shimmer 3s infinite;
}

.feature-card-enhanced:hover::before {
  transform: scaleX(1);
}

@keyframes shimmer {
  0%, 100% { background-position: 0% 0; }
  50% { background-position: 100% 0; }
}

/* Card icon container */
.card-icon {
  width: 64px;
  height: 64px;
  min-width: 64px;
  min-height: 64px;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, #003399, #0066cc);
  border-radius: 1rem;
  display: flex;
}

/* Fix for Quarto wrapping icons in <p> tags */
.card-icon > p {
  margin: 0;
  line-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.card-icon > p > i,
.card-icon > i {
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2rem;
  width: 100%;
  height: 100%;
  transition: all 0.3s ease;
}

.feature-card-enhanced:hover .card-icon {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 8px 20px rgba(0,51,153,.3);
}

/* Card content */
.card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  text-align: center;
}

.card-content h3 {
  color: #212529;
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.card-content p {
  color: #6c757d;
  margin-bottom: 1.5rem;
  flex: 1;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Card meta information */
.card-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: #adb5bd;
  margin-bottom: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Fix for Quarto wrapping meta content in <p> tags */
.card-meta > p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  width: 100%;
  justify-content: center;
}

.card-meta-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.card-meta-item i {
  font-size: 1rem;
}

/* Card hover effect - GPU accelerated */
.feature-card-enhanced:hover {
  transform: translate3d(0, -8px, 0); /* Use translate3d for GPU acceleration */
  box-shadow: 0 12px 28px rgba(0,51,153,.18);
  border-color: rgba(0,51,153,.25);
}

/* ============================================================================
   STATUS BADGE SYSTEM
   ============================================================================ */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

/* Completed status */
.status-badge.status-completed {
  background: linear-gradient(135deg, #d4edda, #c3e6cb);
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status-badge.status-completed::before {
  content: '✓';
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: #28a745;
  color: white;
  border-radius: 50%;
  font-size: 0.75rem;
}

.status-badge.status-completed:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(40,167,69,.3);
}

/* In Progress status */
.status-badge.status-in-progress {
  background: linear-gradient(135deg, #fff3cd, #ffeaa7);
  color: #856404;
  border: 1px solid #ffeaa7;
  position: relative;
  overflow: hidden;
}

.status-badge.status-in-progress::before {
  content: '⟳';
  font-size: 1rem;
  animation: spin 2s linear infinite;
}

.status-badge.status-in-progress::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent);
  animation: progress-shine 2s infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes progress-shine {
  0% { left: -100%; }
  100% { left: 200%; }
}

/* Locked status */
.status-badge.status-locked {
  background: linear-gradient(135deg, #e9ecef, #dee2e6);
  color: #6c757d;
  border: 1px solid #dee2e6;
  cursor: not-allowed;
  opacity: 0.8;
}

.status-badge.status-locked::before {
  content: '🔒';
  font-size: 0.875rem;
}

/* Not Started status */
.status-badge.status-not-started {
  background: linear-gradient(135deg, #e7f3ff, #cce5ff);
  color: #004085;
  border: 1px solid #bee5eb;
}

.status-badge.status-not-started::before {
  content: '○';
  font-size: 1.125rem;
  font-weight: 700;
}

/* Coming Soon status */
.status-badge.status-coming-soon {
  background: linear-gradient(135deg, #f3e5f5, #e1bee7);
  color: #6a1b9a;
  border: 1px solid #e1bee7;
}

.status-badge.status-coming-soon::before {
  content: '⏳';
  font-size: 0.875rem;
}

/* ============================================================================
   COMPLETION INDICATORS
   ============================================================================ */

.completion-checkmark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #28a745;
  color: white;
  border-radius: 50%;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 2px 8px rgba(40,167,69,.3);
  animation: check-bounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.completion-checkmark::after {
  content: '✓';
}

/* Staggered animation delays to avoid overwhelming motion */
.completion-checklist li:nth-child(1) .completion-indicator::after,
.completion-checklist li:nth-child(1) .completion-checkmark {
  animation-delay: 0.1s;
}
.completion-checklist li:nth-child(2) .completion-indicator::after,
.completion-checklist li:nth-child(2) .completion-checkmark {
  animation-delay: 0.2s;
}
.completion-checklist li:nth-child(3) .completion-indicator::after,
.completion-checklist li:nth-child(3) .completion-checkmark {
  animation-delay: 0.3s;
}
.completion-checklist li:nth-child(4) .completion-indicator::after,
.completion-checklist li:nth-child(4) .completion-checkmark {
  animation-delay: 0.4s;
}
.completion-checklist li:nth-child(5) .completion-indicator::after,
.completion-checklist li:nth-child(5) .completion-checkmark {
  animation-delay: 0.5s;
}
.completion-checklist li:nth-child(6) .completion-indicator::after,
.completion-checklist li:nth-child(6) .completion-checkmark {
  animation-delay: 0.6s;
}
.completion-checklist li:nth-child(7) .completion-indicator::after,
.completion-checklist li:nth-child(7) .completion-checkmark {
  animation-delay: 0.7s;
}
.completion-checklist li:nth-child(8) .completion-indicator::after,
.completion-checklist li:nth-child(8) .completion-checkmark {
  animation-delay: 0.8s;
}
.completion-checklist li:nth-child(9) .completion-indicator::after,
.completion-checklist li:nth-child(9) .completion-checkmark {
  animation-delay: 0.9s;
}
.completion-checklist li:nth-child(10) .completion-indicator::after,
.completion-checklist li:nth-child(10) .completion-checkmark {
  animation-delay: 1.0s;
}

@keyframes check-bounce {
  0% { transform: scale(0) rotate(-45deg); opacity: 0; }
  50% { transform: scale(1.2) rotate(0deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Session completion list */
.session-completion-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
}

.session-completion-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: white;
  border: 1px solid rgba(0,0,0,.1);
  border-radius: 0.75rem;
  margin-bottom: 0.75rem;
  transition: all 0.3s ease;
}

.session-completion-item:hover {
  background: #f8f9fa;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.session-completion-item.completed {
  background: rgba(212,237,218,.3);
  border-color: rgba(40,167,69,.3);
}

.session-completion-item.completed .session-number {
  background: #28a745;
  color: white;
}

.session-number {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #6c757d;
  transition: all 0.3s ease;
}

.session-title {
  flex: 1;
  font-weight: 600;
  color: #212529;
}

/* ============================================================================
   ANIMATED ELEMENTS
   ============================================================================ */

/* Pulse animation for important elements */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.pulse-animation {
  animation: pulse 2s ease-in-out infinite;
}

/* Fade in animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* Stagger children animations */
.stagger-children > * {
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.5s; }

/* Slide in from left */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in-left {
  animation: slideInLeft 0.6s ease-out;
}

/* ============================================================================
   INTERACTIVE TOOLTIPS
   ============================================================================ */

.tooltip-container {
  position: relative;
  display: inline-block;
}

.tooltip-text {
  visibility: hidden;
  width: 200px;
  background-color: #212529;
  color: white;
  text-align: center;
  border-radius: 0.5rem;
  padding: 0.75rem;
  position: absolute;
  z-index: 1000;
  bottom: 125%;
  left: 50%;
  margin-left: -100px;
  opacity: 0;
  transition: opacity 0.3s, visibility 0.3s;
  font-size: 0.875rem;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
}

.tooltip-text::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #212529 transparent transparent transparent;
}

.tooltip-container:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* ============================================================================
   NOTIFICATION BADGES
   ============================================================================ */

.notification-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 0.5rem;
  background: #dc3545;
  color: white;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  position: absolute;
  top: -8px;
  right: -8px;
  box-shadow: 0 2px 4px rgba(220,53,69,.3);
  animation: badge-bounce 1s ease-in-out;
}

@keyframes badge-bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* ============================================================================
   PROGRESS RINGS (Circular Progress)
   ============================================================================ */

.progress-ring-container {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 80px;
  height: 80px;
}

.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring-circle {
  transition: stroke-dashoffset 0.5s ease;
  fill: none;
  stroke-width: 4;
}

.progress-ring-bg {
  stroke: #e9ecef;
}

.progress-ring-fill {
  stroke: #003399;
  stroke-linecap: round;
}

.progress-ring-text {
  position: absolute;
  font-size: 1.25rem;
  font-weight: 700;
  color: #003399;
}

/* ============================================================================
   ENHANCED BUTTONS WITH ICONS
   ============================================================================ */

.btn-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.btn-with-icon i {
  transition: transform 0.3s ease;
}

.btn-with-icon:hover i {
  transform: translateX(4px);
}

.btn-start {
  background: linear-gradient(135deg, #28a745, #20c997);
  border: none;
  color: white;
  box-shadow: 0 4px 12px rgba(40,167,69,.3);
}

.btn-start:hover {
  background: linear-gradient(135deg, #20c997, #28a745);
  box-shadow: 0 6px 16px rgba(40,167,69,.4);
  color: white;
}

.btn-continue {
  background: linear-gradient(135deg, #003399, #0066cc);
  border: none;
  color: white;
  box-shadow: 0 4px 12px rgba(0,51,153,.3);
}

.btn-continue:hover {
  background: linear-gradient(135deg, #0066cc, #003399);
  box-shadow: 0 6px 16px rgba(0,51,153,.4);
  color: white;
}

/* ============================================================================
   DARK MODE SUPPORT
   ============================================================================ */

[data-bs-theme="dark"] .feature-card-enhanced {
  background: #212529;
  border-color: rgba(255,255,255,.1);
}

[data-bs-theme="dark"] .feature-card-enhanced:hover {
  border-color: rgba(255,255,255,.2);
  box-shadow: 0 12px 28px rgba(0,0,0,.4);
}

[data-bs-theme="dark"] .card-content h3 {
  color: #f8f9fa;
}

[data-bs-theme="dark"] .session-completion-item {
  background: #212529;
  border-color: rgba(255,255,255,.1);
}

[data-bs-theme="dark"] .session-completion-item:hover {
  background: #343a40;
}

[data-bs-theme="dark"] .tooltip-text {
  background-color: #f8f9fa;
  color: #212529;
}

[data-bs-theme="dark"] .tooltip-text::after {
  border-color: #f8f9fa transparent transparent transparent;
}

/* ============================================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================================ */

/* Tablet (768px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .card-icon {
    width: 60px;
    height: 60px;
    font-size: 1.875rem;
  }

  .feature-card-enhanced {
    padding: 1.75rem;
  }

  .status-badge {
    font-size: 0.875rem;
  }
}

/* Mobile (< 768px) */
@media (max-width: 768px) {
  .card-icon {
    width: 56px;
    height: 56px;
    font-size: 1.75rem;
  }

  .feature-card-enhanced {
    padding: 1.5rem;
  }

  .status-badge {
    font-size: 0.8125rem;
    padding: 0.375rem 0.875rem;
  }

  .tooltip-text {
    width: 150px;
    margin-left: -75px;
    font-size: 0.8125rem;
  }

  .card-meta {
    font-size: 0.8125rem;
  }
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
  /* Hide interactive/decorative elements */
  .status-badge,
  .notification-badge,
  .tooltip-text,
  .feature-card-enhanced::before,
  .card-icon {
    display: none !important;
  }

  /* Simplify for print */
  .feature-card-enhanced,
  .session-completion-item {
    page-break-inside: avoid;
    box-shadow: none !important;
    transform: none !important;
    background: white !important;
    border: 1px solid #000 !important;
    color: #000 !important;
  }

  /* Ensure links are visible in print */
  .feature-card-enhanced a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }

  /* Remove animations in print */
  * {
    animation: none !important;
    transition: none !important;
  }
}
