﻿:root{
  --bg:#0b0c10;
  --panel:#121317;
  --card:#181a20;
  --muted:#aab1b9;
  --text:#e6e9ee;
  --primary:#6ee7b7;
  --primary-ink:#0f766e;
  --ring:#2a2f39;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:Inter,system-ui,Segoe UI,Roboto,Arial,sans-serif;
  color:var(--text);
  background:linear-gradient(180deg,#0b0c10, #101218 35%, #0b0c10);
  padding-left:220px;
}

.container{width:min(1100px,92%);margin-inline:auto}

.site-header{
  border-bottom:1px solid var(--ring);
  padding:18px 0;
  background:rgba(18,19,23,.6);
  backdrop-filter:saturate(1.1) blur(6px);
  position:sticky;top:0;z-index:10;
  margin-left:-220px;
  padding-left:220px;
}

.header-grid{
  display:flex;align-items:center;justify-content:space-between;gap:16px
}

.branding{display:flex;align-items:center;gap:14px}
.branding-link{display:flex;align-items:center;gap:14px;text-decoration:none;color:inherit}
.logo-circle{
  width:44px;height:44px;border-radius:999px;
  display:grid;place-items:center;
  background:linear-gradient(135deg, var(--primary), #93c5fd);
  color:#002b2b;font-weight:800
}
.branding h1{margin:0;font-size:20px}
.branding p{margin:2px 0 0;color:var(--muted);font-size:12px}

.student-meta{font-size:13px;color:var(--muted);text-align:right}

/* Animated Logo Styles */
.logo-svg { width:60px; height:60px; display:block }

/* Circular logo for module pages (sidebar style) */
.logo-svg .ring { 
  fill:none; 
  stroke: var(--primary); 
  stroke-width:2; 
  filter: drop-shadow(0 0 4px rgba(110,231,183,.25));
}
.logo-svg .inner{ 
  fill:none; 
  stroke: #93c5fd; 
  stroke-width:1.5; 
  opacity:.7;
}

/* Hexagon logo for header - represents collaboration */
.header-logo .hex-outer {
  fill: none;
  stroke: var(--primary);
  stroke-width: 2.5;
  stroke-linejoin: miter;
  filter: drop-shadow(0 0 5px rgba(110,231,183,.4));
}

.header-logo .hex-inner {
  fill: none;
  stroke: #93c5fd;
  stroke-width: 2;
  stroke-linejoin: miter;
  opacity: 0.6;
}

/* HCD text beats like a heart */
.logo-svg .mark {
  fill: #ffffff;
  letter-spacing: 0.5px;
  paint-order: stroke fill;
  stroke: rgba(0,0,0,0.35);
  stroke-width: 1.2px;
  font-weight: 700;
  transform-origin: center;
  animation: heartbeat 1.2s ease-in-out infinite;
}

/* Heartbeat animation for module pages orb */
.logo-svg .orb  { 
  fill: var(--primary);
  filter: drop-shadow(0 0 4px rgba(110,231,183,.6));
  transform-origin: center;
  animation: heartbeat 1.2s ease-in-out infinite;
}

/* Realistic heartbeat rhythm - double pulse then pause */
@keyframes heartbeat {
  0% { 
    transform: scale(1);
    opacity: 1;
  }
  10% { 
    transform: scale(1.3);
    opacity: 0.9;
  }
  20% { 
    transform: scale(1);
    opacity: 1;
  }
  30% { 
    transform: scale(1.25);
    opacity: 0.9;
  }
  40%, 100% { 
    transform: scale(1);
    opacity: 1;
  }
}

/* Orbit animation for sidebar logo */
.logo-svg .orbit{ 
  transform-origin: 32px 32px;
  animation: spin 10s linear infinite;
}
@keyframes spin{ to{ transform: rotate(360deg) } }
@media (prefers-reduced-motion: reduce){ .logo-svg .orbit{ animation:none } }
.branding:hover .logo-svg { filter: brightness(1.05); transform: translateY(-1px); transition:.2s ease }

.tabs{
  display:flex;gap:8px;margin:18px auto
}
.tab-button{
  background:var(--panel);
  border:1px solid var(--ring);
  color:var(--text);
  padding:10px 14px;border-radius:10px;cursor:pointer;
  transition:transform .08s ease, background .2s;
}
.tab-button[aria-selected="true"]{
  background:linear-gradient(180deg,var(--card), #1e212a);
  border-color:#3a4151;
  box-shadow:0 0 0 2px rgba(110,231,183,.15) inset;
}
.tab-button:focus{outline:2px solid var(--primary);outline-offset:2px}

.tab-panel{margin:8px 0 42px}

/* Subtabs (nested within Part 2) */
.subtabs{
  display:flex;
  gap:6px;
  margin:20px 0;
  flex-wrap:wrap;
}
.subtab-btn{
  background:var(--panel);
  border:1px solid var(--ring);
  color:var(--text);
  padding:8px 12px;
  border-radius:8px;
  cursor:pointer;
  font-size:14px;
  transition:transform .08s ease, background .2s;
}
.subtab-btn[aria-selected="true"]{
  background:linear-gradient(135deg, rgba(110,231,183,.15), rgba(110,231,183,.08));
  border-color:var(--primary);
  color:var(--primary);
  font-weight:600;
}
.subtab-btn:hover{
  background:rgba(110,231,183,.08);
  border-color:rgba(110,231,183,.3);
}
.subtab-btn:focus{
  outline:2px solid var(--primary);
  outline-offset:2px;
}
.subtab-panel{
  margin-top:20px;
}

.card{
  background:var(--card);
  border:1px solid var(--ring);
  border-radius:16px;
  padding:22px;
  box-shadow:0 10px 30px rgba(0,0,0,.25);
}
.card h2{margin-top:0}
.muted{color:var(--muted)}
hr{border:none;border-top:1px solid var(--ring);margin:16px 0 18px}

.content h3,h4,h5{margin-top:18px}
.refs{line-height:1.5}
.refs li{margin:6px 0}

.cta{margin-top:20px}
.button{
  display:inline-block;text-decoration:none;
  background:var(--primary);
  color:#00332f;font-weight:700;
  padding:10px 14px;border-radius:10px
}
.button:hover{filter:brightness(1.05)}

/* Left Sidebar Navigation */
.site-footer {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 220px;
  background: linear-gradient(180deg, rgba(18,19,23,.95), rgba(18,19,23,.98));
  border-right: 1px solid var(--ring);
  padding: 0;
  overflow-y: auto;
  z-index: 100;
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
}

/* Logo in Sidebar */
.sidebar-logo-container {
  padding: 24px;
  border-bottom: 1px solid var(--ring);
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(180deg, rgba(110,231,183,.06), transparent);
}

.sidebar-logo-link {
  display: block;
  transition: transform 0.3s ease;
}

.sidebar-logo-link:hover {
  transform: scale(1.05);
}

.sidebar-logo-svg {
  width: 80px;
  height: 80px;
  display: block;
}

.sidebar-logo-svg .ring {
  fill: none;
  stroke: var(--primary);
  stroke-width: 2;
  filter: drop-shadow(0 0 6px rgba(110,231,183,.4));
}

.sidebar-logo-svg .inner {
  fill: none;
  stroke: #93c5fd;
  stroke-width: 1.5;
  opacity: .7;
}

.sidebar-logo-svg .mark {
  fill: #ffffff;
  letter-spacing: 0.5px;
  paint-order: stroke fill;
  stroke: rgba(0,0,0,0.35);
  stroke-width: 1.2px;
  font-size: 18px;
}

.sidebar-logo-svg .orb {
  fill: var(--primary);
  filter: drop-shadow(0 0 4px rgba(110,231,183,.6));
  transform-origin: center;
  animation: heartbeat 1.2s ease-in-out infinite;
}

.sidebar-logo-svg .orbit {
  transform-origin: 32px 32px;
  animation: spin 10s linear infinite;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 24px 12px;
  flex: 1;
}

.footer-nav-link {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  position: relative;
}

.footer-nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--primary);
  border-radius: 0 2px 2px 0;
  transition: height 0.2s ease;
}

.footer-nav-link:hover {
  background: rgba(110, 231, 183, 0.08);
  color: var(--primary);
  border-color: rgba(110, 231, 183, 0.2);
  transform: translateX(4px);
}

.footer-nav-link:hover::before {
  height: 60%;
}

.footer-nav-link.active {
  background: linear-gradient(135deg, rgba(110, 231, 183, 0.12), rgba(110, 231, 183, 0.06));
  color: var(--primary);
  border-color: rgba(110, 231, 183, 0.3);
  font-weight: 600;
}

.footer-nav-link.active::before {
  height: 80%;
}

.footer-text {
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  margin: 24px 12px 0;
  padding-top: 20px;
  border-top: 1px solid var(--ring);
  line-height: 1.5;
}

/* Adjust main content to make room for sidebar */
body {
  padding-left: 220px;
}

.container {
  width: min(1100px, 92%);
  margin-inline: auto;
}

@media (max-width:700px){ 
  .header-grid{flex-direction:column;align-items:flex-start} 
  .student-meta{text-align:left}
  
  /* Stack sidebar on mobile */
  body {
    padding-left: 0;
    padding-bottom: 80px;
  }
  
  .site-header {
    margin-left: 0;
    padding-left: 0;
  }
  
  .site-footer {
    position: fixed;
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    height: auto;
    border-right: none;
    border-top: 1px solid var(--ring);
    padding: 12px 0;
    flex-direction: row;
  }
  
  .sidebar-logo-container {
    display: none;
  }
  
  .footer-nav {
    flex-direction: row;
    overflow-x: auto;
    padding: 0 12px;
    gap: 8px;
  }
  
  .footer-nav-link {
    white-space: nowrap;
    padding: 8px 16px;
    font-size: 0.85rem;
  }
  
  .footer-nav-link::before {
    display: none;
  }
  
  .footer-nav-link:hover {
    transform: translateY(-2px);
  }
  
  .footer-text {
    display: none;
  }
}

/* Footer Styles */
.site-footer {
  border-top: 1px solid var(--ring);
  padding: 20px 0;
  color: var(--muted);
  background: rgba(18,19,23,.6);
  margin-top: 40px;
}

.footer-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.footer-nav-link {
  display: inline-block;
  padding: 8px 18px;
  background: linear-gradient(135deg, #1a1d24, #252932);
  color: #6ee7b7;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid #2a2f39;
  transition: all 0.25s ease;
}

.footer-nav-link:hover {
  background: linear-gradient(135deg, #6ee7b7, #5ad9a5);
  color: #0f766e;
  border-color: #6ee7b7;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(110, 231, 183, 0.25);
}

.footer-text {
  text-align: center;
  font-size: 0.85rem;
  color: #aab1b9;
  margin: 0;
}

@media (max-width:700px){
  .header-grid{flex-direction:column;align-items:flex-start}
  .student-meta{text-align:left}
}

/* Iframe styling for Part 2 subtabs */
#part2-sub2 iframe {
  margin-top: 0;
  padding: 0;
  background: white;
}
