/* ── plan.css — Shared plan, summary, and drill card styles ──────────────
   Load this on every page that displays a plan:
   - generator/index.html  (already has styles.css which includes these)
   - dashboard/index.html
   - calendar/index.html
   - plans/fundamentals/index.html
   - plans/pregame/index.html
   - plans/shooting/index.html
   - library/index.html (plan builder)
   ───────────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700;800&family=Barlow+Condensed:wght@600;700;800&display=swap');

:root {
  --navy:     #1C2B4A;
  --steel:    #3D5A80;
  --rule:     #CBD8E8;
  --input-bg: #F4F7FB;
  --skill-bg: #EFF4FB;
  --label:    #5B7A9D;
  --ghost:    #9AAFC4;
  --white:    #FFFFFF;
  --accent:   #4A90D9;
  --text:     #1C2B4A;
  --warning:  #E67E22;
  --danger:   #C0392B;
  --success:  #27AE60;
}

/* ── Plan output ─────────────────────────────────────────────────────────── */
.plan-output {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 28px 30px;
  color: var(--text);
  line-height: 1.7;
}
.plan-output h1 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px; font-weight: 700;
  color: var(--navy); letter-spacing: 0.04em;
  margin-bottom: 6px; margin-top: 0;
  border-bottom: 2px solid var(--accent); padding-bottom: 10px;
}
.plan-output h2 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 17px; font-weight: 700;
  color: #FFFFFF; letter-spacing: 0.05em;
  background: var(--navy); padding: 8px 14px; margin: 0 -30px 16px;
  border-left: 4px solid var(--accent);
  display: flex; align-items: center; gap: 10px; cursor: grab;
}
.plan-output h2:active { cursor: grabbing; }
.plan-output h3 {
  font-size: 14px; font-weight: 700; color: var(--steel);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin: 20px 0 8px; border-bottom: 1px solid var(--rule); padding-bottom: 5px;
}
.plan-output h4 { font-size: 13px; font-weight: 700; color: var(--navy); margin: 14px 0 5px; }
.plan-output p { font-size: 14px; margin-bottom: 12px; color: #2C3E58; }
.plan-output ul, .plan-output ol { margin: 8px 0 14px 0; padding-left: 20px; }
.plan-output li { font-size: 14px; margin-bottom: 6px; color: #2C3E58; }
.plan-output ul li::marker { color: var(--accent); }
.plan-output ol li::marker { color: var(--steel); font-weight: 700; }
.plan-output strong { font-weight: 700; color: var(--navy); }
.plan-output em { font-style: italic; color: var(--steel); }
.plan-output hr { border: none; border-top: 1px solid var(--rule); margin: 20px 0; }
.plan-output blockquote {
  border-left: 3px solid var(--accent); padding: 10px 16px;
  margin: 14px 0; background: var(--skill-bg); border-radius: 0 2px 2px 0;
}
.plan-output blockquote p { margin: 0; font-style: italic; color: var(--steel); }

/* ── Summary section ─────────────────────────────────────────────────────── */
.summary-section {
  display: none;
  margin-top: 32px;
  border-top: 3px solid var(--navy);
  padding-top: 24px;
}
.summary-section.visible { display: block; }
.summary-loading {
  padding: 20px 0;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}

/* ── Section blocks (drag/drop containers) ───────────────────────────────── */
.section-block { margin-bottom: 4px; }
.section-block-ghost {
  opacity: 0.4; background: var(--skill-bg);
  border: 2px dashed var(--accent); border-radius: 2px;
}
.section-block-chosen { box-shadow: 0 4px 20px rgba(28,43,74,0.18); }

.section-drag-handle {
  font-size: 16px; color: rgba(255,255,255,0.5); cursor: grab;
  flex-shrink: 0; line-height: 1; transition: color 0.15s;
}
.section-drag-handle:hover { color: rgba(255,255,255,0.9); }
.section-drag-handle:active { cursor: grabbing; }

/* ── Drill cards ─────────────────────────────────────────────────────────── */
.drill-card {
  border: 1px solid var(--rule);
  border-radius: 2px;
  margin-bottom: 10px;
  overflow: hidden;
  background: var(--white);
}
.drill-card-custom .drill-header { border-left-color: var(--warning); }

.drill-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; background: var(--skill-bg); cursor: pointer;
  user-select: none; transition: background 0.15s;
  border-left: 4px solid var(--accent); gap: 10px;
}
.drill-header:hover { background: #e4edf8; }

.drill-drag-handle {
  font-size: 16px; color: var(--ghost); cursor: grab;
  flex-shrink: 0; line-height: 1; padding: 0 2px; transition: color 0.15s;
}
.drill-drag-handle:hover { color: var(--steel); }
.drill-drag-handle:active { cursor: grabbing; }

.drill-header-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.drill-chevron { font-size: 9px; color: var(--accent); width: 12px; flex-shrink: 0; }
.drill-name {
  font-family: 'Barlow Condensed', sans-serif; font-size: 15px; font-weight: 700;
  color: var(--navy); letter-spacing: 0.04em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.drill-time {
  font-size: 11px; font-weight: 700; color: var(--accent);
  letter-spacing: 0.05em; white-space: nowrap; flex-shrink: 0;
}
.drill-header-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.drill-save-btn {
  background: transparent; color: rgba(28,43,74,0.4);
  border: 1px solid rgba(28,43,74,0.15); border-radius: 2px;
  padding: 3px 10px; font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  cursor: pointer; white-space: nowrap; transition: all 0.15s;
}
.drill-save-btn:hover { color: var(--accent); border-color: rgba(74,144,217,0.5); }

.drill-summary {
  padding: 8px 16px 10px 42px; font-size: 13px;
  color: var(--label); line-height: 1.5;
  background: var(--skill-bg); border-top: 1px solid var(--rule);
}
.drill-body { display: none; padding: 16px; border-top: 1px solid var(--rule); background: var(--white); }
.drill-card.open .drill-body { display: block; }

.drill-section { margin-bottom: 14px; }
.drill-section:last-child { margin-bottom: 0; }
.drill-section-label {
  font-size: 9px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 6px; padding-bottom: 4px; border-bottom: 1px solid var(--rule);
}
.drill-section-content { font-size: 13px; color: #2C3E58; line-height: 1.6; }
.drill-section-content p { margin-bottom: 6px; }
.drill-section-content p:last-child { margin-bottom: 0; }
.drill-section-content ul { padding-left: 18px; margin: 4px 0; }
.drill-section-content li { margin-bottom: 4px; }
.drill-section-content li::marker { color: var(--accent); }
.drill-section-content strong { color: var(--navy); font-weight: 700; }
.drill-section-content em { color: var(--steel); font-style: italic; }

.drill-card-ghost { opacity: 0.4; background: var(--skill-bg); }
.drill-card-chosen { box-shadow: 0 4px 20px rgba(28,43,74,0.2); }
.drill-card-drag { box-shadow: 0 8px 30px rgba(28,43,74,0.25); transform: rotate(0.5deg); }

/* ── Markdown table (COACH QUICK REFERENCE etc) ──────────────────────────── */
.md-table-wrap {
  overflow-x: auto; margin: 12px 0 16px;
  border-radius: 4px; border: 1px solid var(--rule);
}
.md-table { width: 100%; border-collapse: collapse; font-size: 13px; color: var(--text); }
.md-table th, .md-table td {
  padding: 9px 12px; text-align: left;
  border-bottom: 1px solid var(--rule); border-right: 1px solid var(--rule);
}
.md-table th:last-child, .md-table td:last-child { border-right: none; }
.md-table tr:last-child td { border-bottom: none; }
.md-table .md-table-header th {
  background: var(--skill-bg); color: var(--steel);
  font-family: 'Barlow Condensed', sans-serif; font-size: 11px;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  border-bottom: 1px solid var(--rule);
}
.md-table .md-table-row-even td { background: var(--input-bg); }

/* ── Loading spinner (shared) ────────────────────────────────────────────── */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--rule); border-top-color: var(--accent);
  border-radius: 50%; animation: plan-spin 0.7s linear infinite;
}
@keyframes plan-spin { to { transform: rotate(360deg); } }

.error-msg {
  color: #c0392b; font-size: 13px; padding: 12px;
  background: #fdf0ef; border: 1px solid #f5c6c2; border-radius: 2px;
}
/* ── Practice Card (on-screen, derived from plan content) ───────────────────
   Add these to the bottom of public/css/plan.css
   ─────────────────────────────────────────────────────────────────────────── */

.practice-card { display: flex; flex-direction: column; gap: 6px; }

.practice-card-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--accent);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 4px;
}

.practice-card-item {
  border: 1px solid var(--rule);
  border-radius: 2px;
  overflow: hidden;
}

.practice-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  background: var(--navy);
  border-left: 4px solid var(--accent);
}

.practice-card-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 14px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: white;
}

.practice-card-time {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--accent);
  flex-shrink: 0;
}

.practice-card-cue {
  padding: 8px 14px;
  font-size: 13px;
  color: #2C3E58;
  line-height: 1.5;
  background: var(--skill-bg);
  border-top: 1px solid var(--rule);
}
