/* ==========================================================================
   CLUTCHIT — STANDARDIZED PEDAGOGICAL LEARNING AID STYLESHEET (CGOS v2.0)
   Theme: Obsidian Slate (#0E1015 / #151820 / #1B1F2A), Electric Cyan (#0EA5E9),
          Structural Brushed Gold (#D4AF37 / #FCE38A), High-Contrast Print-Ready
   ========================================================================== */

:root {
  /* Structural Brand Gold Palette — Headings, Borders, Dividers & Stage Badges */
  --primary-gold: #D4AF37;
  --accent-gold: #FCE38A;
  --gold-muted: rgba(212, 175, 55, 0.16);

  /* ClutchIT Interactive Palette — All Buttons, Active Tabs, Links & Controls */
  --clutchit-cyan: #0EA5E9;
  --clutchit-cyan-light: #38BDF8;
  --clutchit-cyan-dark: #0369A1;
  --clutchit-navy: #0B192E;

  /* Obsidian Slate Dark Theme Surfaces (Matches AppTheme in ClutchIT) */
  --bg-black: #0E1015;
  --surface-black: #151820;
  --surface-elevated: #1B1F2A;
  --surface-card: #1E2433;
  --text-white: #F8FAFC;
  --text-muted: #94A3B8;

  /* Semantic Status Accents */
  --danger-red: #EF4444;
  --warning-amber: #F59E0B;
  --success-green: #10B981;
  --info-blue: #0EA5E9;

  --border-subtle: rgba(212, 175, 55, 0.25);
  --border-cyan: rgba(14, 165, 233, 0.40);
  --font-heading: 'Outfit', 'Segoe UI', Roboto, Helvetica, sans-serif;
  --font-body: 'Inter', 'Segoe UI', Roboto, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-black);
  color: var(--text-white);
  font-family: var(--font-body);
  line-height: 1.6;
  padding: 24px;
  -webkit-font-smoothing: antialiased;
}

.learning-aid-container {
  max-width: 1120px;
  margin: 0 auto;
  background-color: var(--surface-black);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}

/* ==========================================================================
   HEADER & CLUTCHIT BRANDING BAR
   ========================================================================== */
.aid-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 36px;
  background: linear-gradient(135deg, #1B1F2A 0%, #0B192E 55%, #151820 100%);
  border-bottom: 2px solid var(--primary-gold);
  position: relative;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand-logo {
  height: 58px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(14, 165, 233, 0.25));
}

.brand-title-group h1 {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-white);
  text-transform: uppercase;
}

.brand-title-group h1 span {
  color: var(--clutchit-cyan-light);
}

.brand-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.badge-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.badge-stage-1 {
  background: rgba(212, 175, 55, 0.16);
  color: var(--accent-gold);
  border: 1px solid var(--primary-gold);
}

.badge-qsafe {
  background: rgba(14, 165, 233, 0.16);
  color: var(--clutchit-cyan-light);
  border: 1px solid var(--clutchit-cyan);
}

.header-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-print,
.btn-primary {
  background: linear-gradient(135deg, var(--clutchit-cyan), var(--clutchit-cyan-dark));
  color: #FFFFFF;
  border: 1px solid rgba(56, 189, 248, 0.45);
  padding: 10px 18px;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-print:hover,
.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 6px 18px rgba(14, 165, 233, 0.4);
}

.btn-secondary {
  background: var(--surface-elevated);
  color: var(--text-white);
  border: 1px solid var(--border-subtle);
  padding: 10px 16px;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.btn-secondary:hover {
  border-color: var(--clutchit-cyan);
  background: rgba(14, 165, 233, 0.12);
  color: var(--clutchit-cyan-light);
}

/* ==========================================================================
   META BAR (Competency, Transmission, Duration, Q-SAFE Reference)
   ========================================================================== */
.aid-meta-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background-color: var(--clutchit-navy);
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 36px;
  gap: 16px;
}

.meta-item {
  display: flex;
  flex-direction: column;
}

.meta-item span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.meta-item strong {
  font-size: 14px;
  color: var(--accent-gold);
  font-weight: 600;
  margin-top: 2px;
}

/* ==========================================================================
   MAIN CONTENT LAYOUT
   ========================================================================== */
.aid-body {
  padding: 36px;
}

.section-intro {
  margin-bottom: 28px;
}

.section-intro h2 {
  font-family: var(--font-heading);
  font-size: 22px;
  color: var(--primary-gold);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-intro p {
  color: #CBD5E1;
  font-size: 15px;
  max-width: 900px;
}

/* Grid Systems */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.grid-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

/* Cards */
.clutch-card {
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 22px;
  position: relative;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.clutch-card:hover {
  border-color: rgba(14, 165, 233, 0.55);
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.10);
}

.clutch-card.highlight-gold {
  border-color: var(--primary-gold);
  background: linear-gradient(160deg, #1E2433 0%, rgba(212, 175, 55, 0.10) 100%);
}

.card-step-badge {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary-gold), #B38F24);
  color: #0E1015;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title .icon {
  color: var(--primary-gold);
}

.card-list {
  list-style: none;
  margin-top: 10px;
}

.card-list li {
  position: relative;
  padding-left: 18px;
  font-size: 13.5px;
  color: #E2E8F0;
  margin-bottom: 8px;
}

.card-list li::before {
  content: "•";
  color: var(--clutchit-cyan-light);
  font-weight: bold;
  position: absolute;
  left: 0;
  top: 0;
}

/* ==========================================================================
   VISUAL DIAGRAM / INFOGRAPHIC CONTAINERS
   ========================================================================== */
.diagram-box {
  background: linear-gradient(180deg, #0E1015 0%, #0B192E 100%);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 28px;
  text-align: center;
}

.diagram-title {
  font-family: var(--font-heading);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-gold);
  margin-bottom: 16px;
}

.svg-diagram {
  width: 100%;
  max-width: 860px;
  height: auto;
  margin: 0 auto;
  display: block;
}

/* ==========================================================================
   CALLOUTS: Q-SAFE ASSESSMENT & CRITICAL ERRORS
   ========================================================================== */
.callout-box {
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.callout-warning {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.45);
}

.callout-tip {
  background: rgba(14, 165, 233, 0.10);
  border: 1px solid rgba(14, 165, 233, 0.45);
}

.callout-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}

.callout-content h4 {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

.callout-warning .callout-content h4 {
  color: #F87171;
}

.callout-tip .callout-content h4 {
  color: var(--clutchit-cyan-light);
}

.callout-content p,
.callout-content ul {
  font-size: 13.5px;
  color: #E2E8F0;
}

.callout-content ul {
  margin-top: 6px;
  padding-left: 18px;
}

.callout-content li {
  margin-bottom: 4px;
}

/* ==========================================================================
   FLOWCHART / TIMELINE STEPS
   ========================================================================== */
.flowchart-container {
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 28px;
  margin-bottom: 28px;
}

.flowchart-title {
  font-family: var(--font-heading);
  font-size: 18px;
  color: var(--primary-gold);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.flow-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.flow-step {
  display: flex;
  align-items: stretch;
  background: var(--surface-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
}

.flow-step-icon {
  width: 64px;
  background: rgba(14, 165, 233, 0.14);
  border-right: 2px solid var(--clutchit-cyan);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--clutchit-cyan-light);
  font-size: 18px;
  flex-shrink: 0;
}

.flow-step-content {
  padding: 14px 20px;
  flex: 1;
}

.flow-step-content h4 {
  font-family: var(--font-heading);
  font-size: 15px;
  color: var(--text-white);
  margin-bottom: 4px;
}

.flow-step-content p {
  font-size: 13.5px;
  color: #CBD5E1;
}

.flow-step-tip {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--accent-gold);
  background: rgba(212, 175, 55, 0.08);
  border-left: 2px solid var(--primary-gold);
  padding: 6px 10px;
  border-radius: 0 6px 6px 0;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.aid-footer {
  background-color: #0B192E;
  border-top: 1px solid var(--border-subtle);
  padding: 18px 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-brand-mark {
  height: 24px;
  width: auto;
  opacity: 0.95;
}

/* ==========================================================================
   RESPONSIVE & PRINT MEDIA QUERIES (A4 / Laminated Sheet Ready)
   ========================================================================== */
@media (max-width: 900px) {
  body {
    padding: 10px;
  }
  .aid-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 16px;
  }
  .brand-section {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .brand-logo {
    height: 44px;
  }
  .brand-title-group h1 {
    font-size: 20px;
  }
  .header-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }
  .btn-print,
  .btn-primary,
  .btn-secondary {
    padding: 8px 12px;
    font-size: 12px;
  }
  .aid-meta-bar {
    grid-template-columns: repeat(2, 1fr);
    padding: 12px 16px;
    gap: 12px;
  }
  .aid-body {
    padding: 18px 16px;
  }
  .grid-5,
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .diagram-box,
  .flowchart-container {
    padding: 14px;
    overflow-x: auto;
  }
  .callout-box {
    flex-direction: column;
    gap: 10px;
    padding: 16px;
  }
  .flow-step {
    flex-direction: column;
  }
  .flow-step-icon {
    width: 100%;
    height: 36px;
    border-right: none;
    border-bottom: 2px solid var(--clutchit-cyan);
  }
  .aid-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 14px 16px;
  }
}

@media (max-width: 480px) {
  .aid-meta-bar {
    grid-template-columns: 1fr;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 10mm;
  }

  body {
    background: #FFFFFF !important;
    color: #111111 !important;
    padding: 0 !important;
    font-size: 11pt;
  }

  .learning-aid-container {
    box-shadow: none !important;
    border: 2px solid #D4AF37 !important;
    background: #FFFFFF !important;
    max-width: 100% !important;
  }

  .header-actions {
    display: none !important;
  }

  .aid-header {
    background: #0E1015 !important;
    color: #FFFFFF !important;
    padding: 16px 24px !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .aid-meta-bar {
    background: #F4F4F6 !important;
    border-bottom: 1px solid #CCCCCC !important;
    padding: 10px 24px !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .meta-item span {
    color: #555555 !important;
  }

  .meta-item strong {
    color: #0E1015 !important;
  }

  .aid-body {
    padding: 20px 24px !important;
  }

  .section-intro h2,
  .flowchart-title {
    color: #9A7B1C !important;
  }

  .section-intro p {
    color: #222222 !important;
  }

  .clutch-card,
  .flowchart-container,
  .flow-step {
    background: #FAFAFA !important;
    border: 1px solid #DDDDDD !important;
    color: #111111 !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .card-title,
  .flow-step-content h4 {
    color: #000000 !important;
  }

  .card-list li,
  .flow-step-content p,
  .callout-content p,
  .callout-content ul {
    color: #222222 !important;
  }

  .diagram-box {
    background: #151820 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .callout-box {
    break-inside: avoid;
    page-break-inside: avoid;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .aid-footer {
    background: #F4F4F6 !important;
    color: #333333 !important;
    border-top: 1px solid #CCCCCC !important;
  }
}
