/* Shared site styles extracted from model.html and index.html */
:root{
  --bg:#1a1a1a;
  --panel:#2d2d2d;
  --panel-border:#404040;
  --accent:#66ccff;
  --muted:#b0b0b0;
  --text:#e0e0e0;
  --link:#99ddff;
  --highlight:#0066cc;
  --sidebar-width:260px;
  --gutter:24px;
}

/* Base / Mobile-first */
body {
  margin: 0;
  font-family: Geneva, Verdana, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.sidebar {
  width: var(--sidebar-width);
  background-color: var(--panel);
  border-right: 2px solid var(--panel-border);
  padding: 20px;
  overflow-y: auto;
}

.collapse-toggle {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.9rem;
  margin-left: 8px;
  cursor: pointer;
}

.sidebar h2 {
  margin-top: 0;
  color: var(--accent);
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar li {
  margin: 10px 0;
}

.sidebar a {
  text-decoration: none;
  color: var(--muted);
  padding: 8px 12px;
  display: block;
  border-radius: 4px;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.sidebar a:hover {
  background-color: #404040;
  color: #ffffff;
}

.sidebar a.active {
  background-color: var(--highlight);
  color: white;
}

.main-content {
  flex: 1;
  padding: var(--gutter);
  overflow: auto;
  background-color: var(--bg);
}

h1 {
  color: #66ccff;
  margin-top: 0;
}

p, li {
  color: #cccccc;
  line-height: 1.5;
}

a {
  color: #99ddff;
}

.content-section {
  display: none;
}

.content-section.active {
  display: block;
}

.content-section h1 {
  color: #66ccff;
}

.content-section h3 {
  color: #99ddff;
}
.content-section {
  display: none;
}
.content-section.active {
  display: block;
}

.content-section ul li strong {
  color: #ffffff;
}

iframe {
  width: 100%;
  height: 80vh;
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  background-color: #000000;
}

/* Mobile / responsive rules */
.menu-toggle {
  display: none;
  background: #0066cc;
  color: #fff;
  border: none;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  z-index: 900;
}

.overlay.show {
  display: block;
}

@media (max-width: 800px) {
  body {
    display: block;
    min-height: 100vh;
  font-size: 20px; /* larger base font on mobile */
  line-height: 1.6;
  }

  .sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    height: 100vh;
    z-index: 1000;
    transition: left 0.25s ease;
    width: 280px;
    max-width: 85vw;
  }

  .sidebar.open {
    left: 0;
  }

  .main-content {
    padding: 60px 16px 24px 16px;
    margin-left: 0;
    width: 100%;
    box-sizing: border-box;
  }

  .menu-toggle {
    display: block;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1100;
  }

  /* ensure headings don't get covered when sidebar closed */
  h1 {
    margin-top: 0.25rem;
    font-size: 1.4rem;
  }

  h2 { font-size: 1.15rem; }

  p, li { font-size: 1rem; }

  /* hide desktop collapse toggle on mobile */
  .collapse-toggle { display: none; }

  /* Make the main content fill the mobile viewport (minus top controls) */
  .main-content {
    padding: 60px 16px 24px 16px;
    margin-left: 0;
    width: 100%;
    min-height: calc(100vh - 60px); /* fill remaining viewport */
    height: auto;
    overflow: auto; /* content scrolls naturally */
    -webkit-overflow-scrolling: touch; /* smooth scrolling on iOS */
    position: relative;
    box-sizing: border-box;
  }

  /* Embedded media should scale responsively on mobile */
  iframe, video, .media-16x9 {
    width: 100%;
    height: auto;
    max-height: calc(100vh - 120px);
  }
}

/* Desktop / PC layout adjustments */
@media (min-width: 801px) {
  /* keep sidebar visible and sticky on large screens */
  body { display: flex; }
  .menu-toggle { display: none; }
  .overlay { display: none !important; }

  .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
  }

  /* collapsed sidebar: reduce width and shift main content */
  .sidebar.collapsed {
    width: 56px; /* minimal width to show icons/text if any */
    padding-left: 10px;
    padding-right: 10px;
  }

  .sidebar.collapsed ul li a {
    padding-left: 6px;
    padding-right: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 40px;
  }

  .sidebar.collapsed h2 { font-size: 1rem; }

  .main-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: calc(var(--gutter) * 1.25);
    transition: margin-left 0.25s ease, max-width 0.25s ease;
  }

  /* when sidebar collapsed, expand main-content to left */
  .sidebar.collapsed + .main-content {
    margin-left: 56px; /* match collapsed width */
  }

  .main-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: calc(var(--gutter) * 1.25);
  }

  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.25rem; }
}
