/* ============================================
   COURSE TEMPLATE - UMA BRANDED STYLESHEET
   Ultimate Medical Academy — Brand Guide 2023
   All styles live here. No inline CSS ever.
   ============================================ */

/* UMA Brand Fonts from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Merriweather:ital,wght@1,900&family=Roboto:wght@400;700&family=Roboto+Condensed:wght@400;700&display=swap');

/* --- 1. CSS VARIABLES (UMA Brand Colors & Fonts) --- */
/* Source: UMA 2023 Brand Guide */
:root {
  /* PRIMARY BRAND BLUES */
  --color-legend-blue: #0D3553;   /* darkest navy */
  --color-hero-blue: #1D6BA6;     /* main mid blue */
  --color-horizon-blue: #0095C8;  /* bright blue */
  --color-journey-green: #15EAC4; /* CTA / accent teal */

  /* NEUTRAL */
  --color-gracious-gray: #F9F9F9;
  --color-integrity-gray: #444444;
  --color-medium-gray-1: #DBDBDB;
  --color-medium-gray-2: #A5A5A5;

  /* MAPPED ROLES */
  --color-primary: var(--color-legend-blue);
  --color-secondary: var(--color-hero-blue);
  --color-accent: var(--color-journey-green);
  --color-bg: var(--color-gracious-gray);
  --color-surface: #ffffff;
  --color-text: var(--color-integrity-gray);
  --color-text-muted: var(--color-medium-gray-2);
  --color-border: var(--color-medium-gray-1);

  /* CALLOUT COLORS */
  --callout-info-bg: #e3f2fb;
  --callout-info-border: var(--color-horizon-blue);
  --callout-warning-bg: #fff8e1;
  --callout-warning-border: #f0a500;
  --callout-tip-bg: #e0fdf6;
  --callout-tip-border: var(--color-journey-green);
  --callout-danger-bg: #fdecea;
  --callout-danger-border: #e53935;

  /* UMA TYPOGRAPHY */
  /* Headlines: Merriweather UltraBold Italic */
  /* Body: Roboto (Regular & Bold) */
  --font-heading: 'Merriweather', Georgia, serif;
  --font-body: 'Roboto', Arial, sans-serif;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;

  /* Radius & Shadow */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.13);
}

/* --- 2. RESET & BASE --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
}

img { max-width: 100%; display: block; }
a { color: var(--color-secondary); text-decoration: underline; }
a:hover { color: var(--color-primary); }

/* --- 3. TYPOGRAPHY --- */
/* UMA Rule: Merriweather UltraBold Italic for headlines ONLY */
/* UMA Rule: Roboto for everything else */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 900;
  font-style: italic;
  color: var(--color-primary);
  line-height: 1.3;
  margin-bottom: var(--space-sm);
}
h1 { font-size: 2.2rem; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; }

p { margin-bottom: var(--space-sm); }

ul, ol { padding-left: 1.5rem; margin-bottom: var(--space-sm); }
li { margin-bottom: 0.3rem; }

/* --- 4. LAYOUT --- */
.page-wrapper {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  min-width: 260px;
  background-color: var(--color-primary);
  color: #fff;
  padding: var(--space-md);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.main-content {
  flex: 1;
  padding: var(--space-lg) var(--space-xl);
  max-width: 860px;
}

.content-section {
  margin-bottom: var(--space-xl);
}

/* --- 5. HEADER / COURSE BANNER --- */
.course-header {
  background: linear-gradient(135deg, var(--color-primary) 60%, var(--color-secondary));
  color: #fff;
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-xl);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-md);
}

.course-header .course-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.75;
  margin-bottom: var(--space-xs);
}

.course-header h1 {
  color: #fff;
  font-size: 2rem;
  margin-bottom: var(--space-xs);
}

.course-header .course-meta {
  font-size: 0.9rem;
  opacity: 0.8;
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-top: var(--space-sm);
}

/* --- 6. SIDEBAR NAV --- */
.sidebar-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.6;
  margin-bottom: var(--space-sm);
}

.sidebar-nav { list-style: none; padding: 0; }

.sidebar-nav li { margin-bottom: 0.2rem; }

.sidebar-nav a {
  display: block;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  transition: background 0.2s, color 0.2s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background-color: rgba(255,255,255,0.15);
  color: #fff;
}

.sidebar-nav .nav-section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.4);
  padding: var(--space-sm) 0.75rem 0.25rem;
}

/* --- 7. CALLOUT BOXES --- */
.callout {
  border-left: 4px solid;
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-md);
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
}

.callout-icon { font-size: 1.3rem; flex-shrink: 0; margin-top: 0.1rem; }

.callout-body { flex: 1; }

.callout-title {
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.callout-info    { background: var(--callout-info-bg);    border-color: var(--callout-info-border); }
.callout-warning { background: var(--callout-warning-bg); border-color: var(--callout-warning-border); }
.callout-tip     { background: var(--callout-tip-bg);     border-color: var(--callout-tip-border); }
.callout-danger  { background: var(--callout-danger-bg);  border-color: var(--callout-danger-border); }

.callout-info    .callout-title { color: var(--callout-info-border); }
.callout-warning .callout-title { color: var(--callout-warning-border); }
.callout-tip     .callout-title { color: var(--callout-tip-border); }
.callout-danger  .callout-title { color: var(--callout-danger-border); }

/* --- 8. ACCORDION --- */
.accordion { border: 1px solid var(--color-border); border-radius: var(--radius-md); margin-bottom: var(--space-md); overflow: hidden; }

.accordion-item { border-bottom: 1px solid var(--color-border); }
.accordion-item:last-child { border-bottom: none; }

.accordion-trigger {
  width: 100%;
  background: var(--color-surface);
  border: none;
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  font-size: 1rem;
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--color-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}

.accordion-trigger:hover { background: var(--color-bg); }

.accordion-trigger .accordion-icon {
  font-size: 1.2rem;
  transition: transform 0.3s;
  color: var(--color-secondary);
}

.accordion-trigger[aria-expanded="true"] .accordion-icon { transform: rotate(45deg); }

.accordion-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.2s;
  background: var(--color-surface);
  padding: 0 var(--space-md);
}

.accordion-panel.open {
  max-height: 600px;
  padding: var(--space-sm) var(--space-md) var(--space-md);
}

/* --- 9. CARDS --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.card-icon { font-size: 2rem; margin-bottom: var(--space-xs); }
.card-title { font-size: 1rem; font-weight: 700; color: var(--color-primary); margin-bottom: var(--space-xs); }

/* --- 10. TABLE --- */
.table-wrapper { overflow-x: auto; margin-bottom: var(--space-md); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

thead { background: var(--color-primary); color: #fff; }

th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) { background: var(--color-bg); }

/* --- 11. PROGRESS BAR --- */
.progress-wrap { margin-bottom: var(--space-md); }
.progress-label { font-size: 0.85rem; font-weight: 600; color: var(--color-text-muted); margin-bottom: 0.3rem; display: flex; justify-content: space-between; }
.progress-track { background: var(--color-border); border-radius: 999px; height: 10px; overflow: hidden; }
.progress-fill { background: linear-gradient(90deg, var(--color-hero-blue), var(--color-journey-green)); height: 100%; border-radius: 999px; transition: width 0.8s ease; }

/* --- 12. BUTTONS --- */
/* UMA Rule: Journey Green for primary CTA buttons */
/* UMA Rule: Legend Blue text on Journey Green (ADA compliance) */
.btn {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  text-decoration: none;
  border: 2px solid transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

/* Primary CTA — Journey Green + Legend Blue text */
.btn-primary { background: var(--color-journey-green); color: var(--color-legend-blue); }
.btn-primary:hover { background: #0ecfab; color: var(--color-legend-blue); }

/* Secondary CTA — Hero Blue outline */
.btn-outline { background: transparent; color: var(--color-hero-blue); border-color: var(--color-hero-blue); }
.btn-outline:hover { background: var(--color-hero-blue); color: #fff; }

/* Accent — Legend Blue */
.btn-accent { background: var(--color-legend-blue); color: #fff; }
.btn-accent:hover { background: #0a2840; color: #fff; }

/* --- 13. DIVIDER --- */
.divider { border: none; border-top: 1px solid var(--color-border); margin: var(--space-lg) 0; }

/* --- 14. BADGES --- */
.badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-primary { background: var(--callout-info-bg); color: var(--callout-info-border); }
.badge-warning { background: var(--callout-warning-bg); color: #b07800; }
.badge-success { background: var(--callout-tip-bg); color: #1e8449; }

/* --- 15. MEDIA EMBED PLACEHOLDER --- */
.media-embed {
  background: var(--color-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 300px;
  color: var(--color-text-muted);
  font-size: 1rem;
  margin-bottom: var(--space-md);
}

/* --- 16. FOOTER --- */
.page-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-md) var(--space-xl);
  text-align: right;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* --- 17. RESPONSIVE --- */
@media (max-width: 768px) {
  .page-wrapper { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: relative; }
  .main-content { padding: var(--space-md); }
  h1 { font-size: 1.6rem; }
}
