/* Course Hub - Visual Design Guide Compliant Styles */


/* =============================================================================
   CSS VARIABLES & DESIGN SYSTEM
   ============================================================================= */

:root {
  --accent: #38bdf8;
  --border: #334155;
  --text-primary: #0b0b0c;
  --text-secondary: #475569;
  --bg-light: #f8fafc;
  --bg-medium: #cbd5e1;
  --status-info: #3b82f6;
  --status-success: #22d3ee;
  --status-error: #ef4444;
}

/* =============================================================================
   TYPOGRAPHY & READABILITY
   ============================================================================= */

html {
  font-size: 16px;
}

body {
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
}

/* Headings - Design Guide Scale */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.25;
  margin-top: 1.6rem;
  margin-bottom: 0.75rem;
}

h1 {
  font-size: 1.75rem; /* 28px */
  font-weight: 700;
}

h2 {
  font-size: 1.5rem; /* 24px */
  font-weight: 600;
}

h3 {
  font-size: 1.25rem; /* 20px */
  font-weight: 600;
}

/* =============================================================================
   LINKS & INTERACTIVE ELEMENTS
   ============================================================================= */

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent);
  text-decoration: underline;
}

a:focus {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* =============================================================================
   CALLOUTS & SPECIAL CONTENT
   ============================================================================= */

.callout {
  border-left: 4px solid var(--accent);
  background-color: var(--bg-light);
  padding: 1.25rem;
  margin: 1.5rem 0;
  border-radius: 0 4px 4px 0;
}

.callout-title {
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--accent);
}

/* =============================================================================
   CODE BLOCKS & SYNTAX HIGHLIGHTING
   ============================================================================= */

pre {
  background-color: var(--bg-light);
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.5;
}

code {
  background-color: #f1f5f9;
  padding: 0.125rem 0.25rem;
  border-radius: 3px;
  font-size: 0.875em;
}

pre code {
  background-color: transparent;
  padding: 0;
}

/* =============================================================================
   TABLES
   ============================================================================= */

table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.2rem 0;
}

th, td {
  border-bottom: 1px solid #e5e7eb;
  padding: 0.5rem 0.6rem;
  text-align: left;
}

th {
  font-weight: 600;
}

/* =============================================================================
   NAVIGATION & COURSE STRUCTURE
   ============================================================================= */

.course-nav {
  background-color: #f8fafc;
  padding: 1.5rem;
  border-radius: 8px;
  margin: 2rem 0;
  border: 1px solid #e2e8f0;
}

.module-list, .section-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.module-list li, .section-list li {
  margin-bottom: 0.75rem;
}

.module-list a, .section-list a {
  display: block;
  padding: 0.875rem 1rem;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  transition: all 0.2s ease;
  color: #374151;
  text-decoration: none;
}

.module-list a:hover, .section-list a:hover {
  background-color: #f8fafc;
  border-color: #2c5aa0;
  color: #1e3d6f;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* =============================================================================
   RESPONSIVE DESIGN
   ============================================================================= */

@media (max-width: 768px) {
  body {
    font-size: 0.9rem;
  }
  
  h1 {
    font-size: 1.875rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  h3 {
    font-size: 1.25rem;
  }
  
  .callout {
    padding: 1rem;
    margin: 1rem 0;
  }
  
  .course-nav {
    padding: 1rem;
  }
}

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

@media print {
  .page-sidebar,
  .navbar,
  .course-nav {
    display: none;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.4;
  }
  
  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
  }
  
  pre, code {
    page-break-inside: avoid;
  }
}

/* =============================================================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================================================= */

/* Focus indicators */
*:focus {
  outline: 2px solid #2c5aa0;
  outline-offset: 2px;
}

/* Skip links for screen readers */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: #2c5aa0;
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
}

.skip-link:focus {
  top: 6px;
}

/* =============================================================================
   COURSE HEADER v2.0 - Inline Header System
   ============================================================================= */

/* 
 * DEVELOPERS: This section styles the dynamic course headers
 * 
 * FEATURES:
 * - 50% reduced height from v1.0 (padding: 0.5rem vs 1rem)
 * - Gradient background using CSS variables
 * - Responsive design with mobile breakpoints
 * - Readable navigation buttons (dark text on light background)
 * 
 * CUSTOMIZATION:
 * - Change header height: adjust .course-header padding
 * - Modify colors: update CSS variables in :root section
 * - Button styling: edit .course-nav a rules
 * 
 * LAST UPDATED: December 2024
 */

.course-header {
  background: linear-gradient(135deg, var(--accent) 0%, var(--border) 100%);
  color: white;
  padding: 0.5rem 0;        /* Reduced from 1rem for compact design */
  margin-bottom: 1rem;      /* Reduced from 2rem for better spacing */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.course-header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.course-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.course-header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
  opacity: 0.9;
}

.course-title-section {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.course-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  color: white;
  text-decoration: none;
  line-height: 1.2;
}

.course-title:hover {
  color: #e2e8f0;
  text-decoration: none;
}

.hub-link {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color 0.2s ease;
  font-weight: 400;
}

.hub-link:hover {
  color: white;
  text-decoration: underline;
}

.course-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* 
 * Navigation buttons - v2.0 major improvement for readability
 * 
 * CHANGES FROM v1.0:
 * - Dark text on light background (was white on white = invisible)
 * - Semi-transparent white background for visibility
 * - Hover effects with accent color and subtle animation
 * - Active state clearly highlighted
 */
.course-nav a {
  color: var(--text-primary);                    /* Dark, readable text */
  text-decoration: none;
  padding: 0.4rem 0.8rem;                       /* Compact padding */
  border-radius: 4px;
  transition: all 0.2s ease;
  font-size: 0.85rem;
  font-weight: 500;
  background-color: rgba(255, 255, 255, 0.9);   /* Semi-transparent white */
  border: 1px solid rgba(255, 255, 255, 0.3);   /* Subtle border */
}

.course-nav a:hover {
  background-color: white;                       /* Full white on hover */
  color: var(--accent);                          /* Blue accent color */
  text-decoration: none;
  transform: translateY(-1px);                   /* Subtle lift effect */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);    /* Hover shadow */
}

.course-nav a.active {
  background-color: white;                       /* Active state styling */
  color: var(--accent);                          /* Accent color for active */
  font-weight: 600;                              /* Bolder text */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);   /* Stronger shadow */
}

.course-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
}

.course-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.course-version {
  background-color: rgba(255, 255, 255, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

@media (max-width: 768px) {
  .course-header {
    padding: 0.4rem 0;
  }
  
  .course-header-content {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  
  .course-header-left {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .course-header-right {
    flex-direction: column;
    gap: 0.4rem;
  }
  
  .course-title {
    font-size: 1.1rem;
  }
  
  .course-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.3rem;
  }
  
  .course-nav a {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
  }
  
  .course-meta {
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.8rem;
  }
}

/* =============================================================================
   FIGURES & CAPTIONS
   ============================================================================= */

figure {
  margin: 1.2rem 0;
}

figcaption {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  margin-top: 0.5rem;
}

/* =============================================================================
   SIDEBAR TWEAKS (Design Guide Compliant)
   ============================================================================= */

.sidebar {
  width: 280px;
}

.sidebar nav a.active {
  border-left: 3px solid var(--accent);
  padding-left: 0.5rem;
}

/* =============================================================================
   UTILITY CLASSES
   ============================================================================= */

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-6 { margin-bottom: 1.5rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }
.mt-6 { margin-top: 1.5rem; }

/* =============================================================================
   COURSE HUB LANDING PAGE STYLES
   ============================================================================= */

/* Course Grid Layout */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
  padding: 0;
}

/* Course Card Styling */
.course-card {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.5rem;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.course-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.15);
  transform: translateY(-2px);
}

.course-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.75rem 0;
  color: var(--text-primary);
}

.course-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  flex-grow: 1;
}

/* Course Metadata */
.course-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1rem 0;
  padding: 0.75rem 0;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
}

.module-count {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Course Status Styling */
.course-status {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.status-complete {
  background-color: rgba(34, 211, 238, 0.1);
  color: #0891b2;
}

.status-partial {
  background-color: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}

.status-locked {
  background-color: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

/* Course Prerequisites and Outcomes */
.course-card strong {
  font-weight: 600;
  color: var(--text-primary);
  display: inline-block;
  margin-top: 0.5rem;
}

.course-card ul {
  margin: 0.5rem 0;
  padding-left: 1.25rem;
  list-style-type: disc;
}

.course-card li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

/* Course Links */
.course-card > a:last-child {
  display: inline-flex;
  align-items: center;
  margin-top: 1rem;
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 0.95rem;
}

.course-card > a:last-child:hover {
  color: #0284c7;
  text-decoration: underline;
}

.course-card > a:last-child::after {
  content: " →";
  margin-left: 0.25rem;
  transition: transform 0.2s ease;
}

.course-card > a:last-child:hover::after {
  transform: translateX(3px);
}

/* Navigation Section */
.nav-section {
  background-color: var(--bg-light);
  padding: 2rem;
  border-radius: 8px;
  margin: 2rem 0;
}

.nav-section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

/* Filter Buttons */
.status-filter,
.topic-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.filter-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background-color: white;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background-color: var(--accent);
  color: white;
  border-color: var(--accent);
  text-decoration: none;
}

.filter-btn:active {
  transform: scale(0.98);
}

/* Getting Started Section */
h2 + h3 {
  margin-top: 1.5rem;
  color: var(--text-primary);
  font-size: 1.125rem;
}

h3 + ol {
  margin-top: 0.75rem;
  padding-left: 1.5rem;
}

h3 + ol li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

h3 + ol li strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Responsive Design - Tablet */
@media (max-width: 1024px) {
  .course-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
  
  .nav-section {
    padding: 1.5rem;
  }
}

/* Responsive Design - Mobile */
@media (max-width: 768px) {
  .course-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .course-card {
    padding: 1.25rem;
  }
  
  .course-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .status-filter,
  .topic-filter {
    flex-direction: column;
  }
  
  .filter-btn {
    width: 100%;
    text-align: center;
  }
  
  .nav-section {
    padding: 1.25rem;
  }
}

/* Print Styles */
@media print {
  .nav-section,
  .filter-btn {
    display: none;
  }
  
  .course-grid {
    display: block;
  }
  
  .course-card {
    page-break-inside: avoid;
    margin-bottom: 1.5rem;
    border: 1px solid #d1d5db;
  }
  
  .course-card > a:last-child::after {
    content: " (" attr(href) ")";
    font-size: 0.8rem;
    color: var(--text-secondary);
  }
}

/* Accessibility Improvements */
.course-card:focus-within {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.filter-btn:focus {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .course-card {
    border-width: 2px;
  }
  
  .course-status {
    border: 1px solid currentColor;
  }
  
  .filter-btn {
    border-width: 2px;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .course-card,
  .filter-btn,
  .course-card > a:last-child::after {
    transition: none;
  }
  
  .course-card:hover {
    transform: none;
  }
}