/* =========================================
   Main CSS (Organized for Clarity)
   Sections:
   1) Base / Resets
   2) Layout
   3) Typography
   4) Components
   5) Utilities / Helpers
   6) Media (Print & Mobile)
========================================= */

/* =========================================
   1) Base / Resets
========================================= */
hr {
  border: none;
  border-top: 1px solid #ccc;
  margin: 1rem 0;
}

iframe {
  display: block;
  margin: 0 auto;
}

/* =========================================
   2) Layout
========================================= */
.content-centered {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
}

.narrow {
  max-width: 700px;
  margin: 0 auto;
}

/* =========================================
   3) Typography
========================================= */
.center { text-align: center; }

h1 { text-align: center; margin: 20px 0; font-size: 28px; font-weight: 700; }
h2 { text-align: center; margin: 16px 0; font-size: 22px; font-weight: 600; }
h3 { text-align: center; margin: 12px 0; font-size: 18px; font-weight: 600; }

p {
  margin: 12px 0;
  font-size: 1.1em;   /* bumped size for readability */
  line-height: 1.5;
}

a       { color: blue; text-decoration: none; }
a:hover { color: red;  text-decoration: underline; }

.italic, .italic a { font-style: italic; }

.outline-block {
  margin-left: 1.5rem;
  white-space: pre-wrap;
  line-height: 1.25;
}

.spacer { margin-top: 1.5em; }

/* =========================================
   4) Components
========================================= */

/* Boxes */
.box {
  border: 1px solid #ccc;
  padding: 12px;
  margin: 16px 0;
  border-radius: 4px;
  background: #f9f9f9;
}

.box-lined {
  border-top: 1px solid #e1e1e1;
  margin-top: 40px;
  padding: 20px 0;
  text-align: center;
  font-size: 0.9rem;
  color: #666;
}

.reflection-section { max-width: 700px; margin: 0 auto; }

textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 140px;
  display: block;
  margin: 8px 0 16px;
}

/* Lists */
ol, ul {
  list-style: none;
  margin: 0 0 1rem 0;
  padding: 0;
}

/* Tables */
table {
  margin: 0 auto;
  border-collapse: collapse;
}

table th,
table td {
  border: 1px solid #666;
  padding: 5px;
  vertical-align: top;
}

table.allcenter th,
table.allcenter td { text-align: center; }

table.grid td:not(:first-child),
table.grid th:not(:first-child) { text-align: center; }

table.lesson-table th,
table.lesson-table td { border: none; }

table.environment th,
table.environment td { width: 20%; }

/* Buttons */
button,
input[type="submit"] {
  background-color: #003366;
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  display: block;
  margin: 1rem auto;
}

button:hover:not(:disabled),
input[type="submit"]:hover:not(:disabled) {
  background-color: #001f4d;
}

button:disabled,
input[type="submit"]:disabled {
  background-color: #999;
  cursor: not-allowed;
}

/* Cards */
.card {
  border-radius: 6px;
  padding: 16px;
  margin: 20px auto;
  max-width: 800px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.prompt-card { background-color: #f0f8ff; border: 1px solid #99c2ff; }
.answer-card { background-color: #f9fff0; border: 1px solid #b6e3a4; }

.reply-card {
  max-width: 830px;
  margin: 20px auto;
  border: none;
  background: none;
  box-shadow: none;
  padding: 0;
}

.reply-card textarea {
  width: 100%;
  box-sizing: border-box;
  font-size: 16px;
  line-height: 1.4;
  padding: 12px;
}

.ai-feedback {
  background-color: #fff8e6;
  border: 1px solid #ffd27f;
}

.mono {
  font-family: monospace, monospace;
  white-space: pre-wrap;
}

/* Doctor report timelines */
.doctor-report__timelines {
  display: flex;
  flex-direction: column;
  gap: 0.75em;
  margin: 0.5em 0 1em;
}

.timeline-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5em;
}

.timeline-bar {
  position: relative;
  background: #e0e0e0;
  height: 0.75em;
}

.timeline-marker {
  position: absolute;
  top: -0.25em;
  width: 0;
  height: 1.25em;
  border-left: 2px solid #333;
}

.timeline-label {
  font-size: 0.875em;
  color: #555;
  margin-left: 0.25em;
}


/* =========================================
   5) Utilities / Helpers
========================================= */
.nowrap { white-space: nowrap; }
.indent { padding-left: 16px; }

/* =========================================
   6) Media
========================================= */

/* Print */
@media print {
  .pagebreak { page-break-before: always; }
  .dontprint { display: none !important; }
  header, footer { display: none !important; }
}

/* Mobile */
@media (max-width: 600px) {
  html { font-size: 18px; }
  body { line-height: 1.5; }

  .content-centered { padding: 0 14px; }

  h1 { font-size: 1.6rem; margin: 1rem 0 .5rem; }
  h2 { font-size: 1.35rem; margin: 1rem 0 .5rem; }
  h3 { font-size: 1.15rem; margin: .75rem 0 .4rem; }
  p, li { font-size: 1rem; }

  a, button, input[type="submit"] {
    min-height: 44px;
    line-height: 1.2;
  }

  header p.center {
    word-break: break-word;
    white-space: normal;
  }
  header p.center a {
    display: inline-block;
    padding: 6px 0;
  }

  iframe {
    max-width: 100%;
    width: 100%;
    height: auto;
  }

  table { font-size: 1rem; }
  table th, table td { padding: 10px; }
}

/* =========================================
   7) Video Container
========================================= */
.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
}

.video-container iframe,
.video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}