/*
Theme Name:  Ajax Harwood Care Portal
Theme URI:   https://care.ajaxharwoodclinic.com
Author:      Dr. Carlos Yu — Ajax Harwood Clinic
Author URI:  https://ajaxharwoodclinic.com
Description: Patient-facing chronic disease management portal. Diabetes cohort v1. Awareness Expedition engagement system.
Version:     1.0.0
License:     Private
Text Domain: ajax-harwood-care
*/

/* ── Design Tokens ──────────────────────────────────────────────────────────── */
:root {
  /* Patient portal palette */
  --teal:         #2a9d8f;
  --teal-dark:    #1f7a6e;
  --teal-light:   #e8f5f3;
  --amber:        #e9c46a;
  --amber-dark:   #d4a832;
  --warm-white:   #fafaf8;
  --warm-grey:    #f0ede8;
  --text-dark:    #1a1a1a;
  --text-mid:     #444444;
  --text-soft:    #777777;
  --shadow-soft:  0 2px 12px rgba(0,0,0,0.08);
  --shadow-card:  0 4px 20px rgba(0,0,0,0.10);
  --radius:       12px;
  --radius-sm:    8px;

  /* Physician admin palette */
  --navy:         #1a2b5e;
  --navy-dark:    #111e42;
  --gold:         #c9a84c;
  --gold-light:   #f5edda;
}

/* ── Reset & Base ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Jost', system-ui, -apple-system, sans-serif;
  background: var(--warm-white);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-dark); text-decoration: underline; }

/* ── Typography ─────────────────────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-dark);
}
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.1rem; }
p  { margin-bottom: 1rem; color: var(--text-mid); }

/* ── Layout ─────────────────────────────────────────────────────────────────── */
.ahc-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.ahc-container--narrow { max-width: 720px; }
.ahc-container--wide   { max-width: 1300px; }

/* ── Header ─────────────────────────────────────────────────────────────────── */
.ahc-header {
  background: var(--teal);
  color: #fff;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.ahc-header--admin { background: var(--navy); }
.ahc-header__logo  { font-family: 'Cormorant Garamond', serif; font-size: 1.4rem; font-weight: 600; color: #fff; }
.ahc-header__sub   { font-size: 0.8rem; opacity: 0.8; }
.ahc-header__nav a { color: rgba(255,255,255,0.85); font-size: 0.9rem; margin-left: 1.5rem; }
.ahc-header__nav a:hover { color: #fff; text-decoration: none; }

/* ── Cards ──────────────────────────────────────────────────────────────────── */
.ahc-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.ahc-card--teal  { border-top: 4px solid var(--teal); }
.ahc-card--amber { border-top: 4px solid var(--amber); }
.ahc-card--navy  { border-top: 4px solid var(--navy); }

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.ahc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-family: 'Jost', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 0.2s, transform 0.1s;
  min-height: 48px;
  text-decoration: none;
}
.ahc-btn:active { transform: scale(0.98); }
.ahc-btn--primary   { background: var(--teal);  color: #fff; }
.ahc-btn--primary:hover { background: var(--teal-dark); color: #fff; text-decoration: none; }
.ahc-btn--secondary { background: var(--warm-grey); color: var(--text-dark); }
.ahc-btn--secondary:hover { background: #e0ddd8; text-decoration: none; }
.ahc-btn--amber     { background: var(--amber); color: var(--text-dark); }
.ahc-btn--amber:hover { background: var(--amber-dark); text-decoration: none; }
.ahc-btn--navy      { background: var(--navy);  color: #fff; }
.ahc-btn--navy:hover { background: var(--navy-dark); color: #fff; text-decoration: none; }
.ahc-btn--outline   { background: transparent; border: 2px solid var(--teal); color: var(--teal); }
.ahc-btn--full      { width: 100%; }
.ahc-btn--sm        { padding: 0.5rem 1rem; font-size: 0.875rem; min-height: 36px; }

/* ── Forms ──────────────────────────────────────────────────────────────────── */
.ahc-form-group { margin-bottom: 1.25rem; }
.ahc-label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--text-dark);
  font-size: 0.95rem;
}
.ahc-input,
.ahc-select,
.ahc-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid #ddd;
  border-radius: var(--radius-sm);
  font-family: 'Jost', sans-serif;
  font-size: 1rem;
  color: var(--text-dark);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-height: 48px;
}
.ahc-input:focus,
.ahc-select:focus,
.ahc-textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(42,157,143,0.15);
}
.ahc-textarea { min-height: 120px; resize: vertical; }
.ahc-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--teal-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.ahc-checkbox-row input[type="checkbox"] {
  width: 20px; height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--teal);
}

/* ── Tables (admin) ─────────────────────────────────────────────────────────── */
.ahc-table-wrap { overflow-x: auto; }
.ahc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.ahc-table th {
  background: var(--navy);
  color: #fff;
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 500;
  white-space: nowrap;
}
.ahc-table--patient th { background: var(--teal); }
.ahc-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
}
.ahc-table tr:hover td { background: var(--warm-grey); }
.ahc-row--red    td { background: #fff5f5; }
.ahc-row--amber  td { background: #fffbf0; }
.ahc-row--green  td { background: #f0faf8; }
.ahc-row--grey   td { background: #f5f5f5; color: var(--text-soft); }

/* ── Status badges ──────────────────────────────────────────────────────────── */
.ahc-badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ahc-badge--red    { background: #fee2e2; color: #dc2626; }
.ahc-badge--amber  { background: #fef3c7; color: #b45309; }
.ahc-badge--green  { background: #d1fae5; color: #059669; }
.ahc-badge--teal   { background: var(--teal-light); color: var(--teal-dark); }
.ahc-badge--navy   { background: #e8eaf6; color: var(--navy); }

/* ── Expedition map / milestones ────────────────────────────────────────────── */
.ahc-expedition-map {
  position: relative;
  padding: 2rem 0;
}
.ahc-milestone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}
.ahc-milestone-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  text-align: center;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s, box-shadow 0.2s;
}
.ahc-milestone-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); }
.ahc-milestone-card--earned { border: 2px solid var(--teal); }
.ahc-milestone-card--earned .ahc-milestone-icon { filter: none; }
.ahc-milestone-card--locked { opacity: 0.55; }
.ahc-milestone-card--locked .ahc-milestone-icon { filter: grayscale(1); }
.ahc-milestone-icon { width: 56px; height: 56px; margin: 0 auto 0.75rem; }
.ahc-milestone-name { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.25rem; }
.ahc-milestone-date { font-size: 0.75rem; color: var(--text-soft); }
.ahc-milestone-hint { font-size: 0.75rem; color: var(--text-soft); font-style: italic; }
.ahc-milestone-glow { box-shadow: 0 0 0 3px rgba(42,157,143,0.3), var(--shadow-card); }

/* ── Pathway buttons (portal dashboard) ────────────────────────────────────── */
.ahc-pathway-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.ahc-pathway-btn {
  background: #fff;
  border: 2px solid var(--teal-light);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  color: var(--text-dark);
  font-weight: 500;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-height: 110px;
  justify-content: center;
}
.ahc-pathway-btn:hover {
  border-color: var(--teal);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--teal-dark);
}
.ahc-pathway-btn__icon { font-size: 1.75rem; }
.ahc-pathway-btn__label { font-size: 0.95rem; }

/* ── Video player ───────────────────────────────────────────────────────────── */
.ahc-video-wrap {
  background: var(--teal-light);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.ahc-video-reason {
  font-style: italic;
  color: var(--teal-dark);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}
.ahc-video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
}
.ahc-video-embed iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
  border-radius: var(--radius-sm);
}
.ahc-video-locked {
  opacity: 0.45;
  pointer-events: none;
  user-select: none;
}

/* ── Community voices ───────────────────────────────────────────────────────── */
.ahc-voice-card {
  background: var(--warm-grey);
  border-left: 4px solid var(--amber);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}
.ahc-voice-card__text { font-style: italic; color: var(--text-mid); margin-bottom: 0.5rem; }
.ahc-voice-card__meta { font-size: 0.78rem; color: var(--text-soft); }

/* ── Alerts & notices ───────────────────────────────────────────────────────── */
.ahc-alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}
.ahc-alert--success { background: #d1fae5; color: #065f46; border-left: 4px solid #059669; }
.ahc-alert--error   { background: #fee2e2; color: #991b1b; border-left: 4px solid #dc2626; }
.ahc-alert--info    { background: var(--teal-light); color: var(--teal-dark); border-left: 4px solid var(--teal); }
.ahc-alert--warning { background: #fef3c7; color: #92400e; border-left: 4px solid var(--amber-dark); }

/* ── Page wrapper ───────────────────────────────────────────────────────────── */
.ahc-page { padding: 2rem 0 4rem; }
.ahc-page__title { margin-bottom: 0.5rem; }
.ahc-page__subtitle { color: var(--text-soft); margin-bottom: 2rem; }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .ahc-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .ahc-header__nav { display: flex; flex-wrap: wrap; gap: 0.5rem; }
  .ahc-header__nav a { margin-left: 0; }
  .ahc-milestone-grid { grid-template-columns: repeat(2, 1fr); }
  .ahc-pathway-grid   { grid-template-columns: repeat(2, 1fr); }
  .ahc-table th, .ahc-table td { padding: 0.5rem 0.65rem; font-size: 0.82rem; }
}
@media (max-width: 480px) {
  .ahc-milestone-grid { grid-template-columns: repeat(2, 1fr); }
  .ahc-pathway-grid   { grid-template-columns: 1fr 1fr; }
}
