/* ═══════════════════════════════════════════════════════════════
   Study Plan Generator — specific styles
═══════════════════════════════════════════════════════════════ */

.spg-hero {
  background: linear-gradient(135deg, var(--color-brand) 0%, #0d4031 100%);
  color: #fff;
  border-radius: 14px;
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}

.spg-hero__top {
  display: flex; align-items: center; gap: 18px; margin-bottom: var(--space-3);
  flex-wrap: wrap;
}

.spg-hero__text { min-width: 0; flex: 1; }
.spg-hero__text h3,
.spg-hero__text p { word-wrap: break-word; }

.spg-hero__num {
  font-family: var(--font-heading);
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
}

.spg-hero__text h3 {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: 4px;
}

.spg-hero__text p {
  font-size: var(--text-sm);
  opacity: 0.85;
  line-height: 1.5;
}

.spg-hero__stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid rgba(255,255,255,0.15);
}

@media (max-width: 600px) { .spg-hero__stats { grid-template-columns: repeat(2, 1fr); } }

.spg-hero__stat-value {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
}

.spg-hero__stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.7;
  margin-top: 2px;
}

/* Phase blocks */
.spg-phases {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-bottom: var(--space-4);
  border-radius: 10px;
  overflow: hidden;
  background: var(--color-bg-alt);
  padding: 4px;
}

@media (max-width: 700px) { .spg-phases { grid-template-columns: 1fr; } }

.spg-phase {
  padding: var(--space-3);
  text-align: center;
  border-radius: 8px;
  background: var(--color-surface);
  position: relative;
}

.spg-phase__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: var(--font-semibold);
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.spg-phase__name {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
}

.spg-phase__weeks {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.spg-phase__dates {
  font-size: 11px;
  color: var(--color-brand);
  font-weight: var(--font-semibold);
  font-family: var(--font-mono);
}

.spg-phase--foundation { border-top: 3px solid #16a34a; }
.spg-phase--intensive { border-top: 3px solid #d97706; }
.spg-phase--revision { border-top: 3px solid #dc2626; }

/* Weekly schedule table */
.spg-schedule {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.spg-schedule th {
  background: var(--color-bg-alt);
  padding: 8px 10px;
  text-align: left;
  font-weight: var(--font-semibold);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
}

.spg-schedule td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-border-light);
}

.spg-schedule tr:last-child td { border-bottom: none; }
.spg-schedule tr:hover td { background: var(--color-bg-alt); }

.spg-schedule__subject {
  font-weight: var(--font-semibold);
}

.spg-schedule__bar-cell {
  width: 40%;
  padding: 6px 10px;
}

.spg-schedule__bar {
  height: 16px;
  background: var(--color-bg-alt);
  border-radius: 3px;
  overflow: hidden;
}

.spg-schedule__bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent) 0%, #b8860b 100%);
  border-radius: 3px;
}

.spg-schedule__hours {
  font-family: var(--font-mono);
  font-weight: var(--font-semibold);
  text-align: right;
  white-space: nowrap;
}

/* Daily routine */
.spg-routine {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.spg-routine-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 80px;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-radius: 7px;
  transition: background 0.12s;
  max-width: 100%;
}

.spg-routine-row__task { word-wrap: break-word; min-width: 0; }
.spg-routine { max-width: 720px; }

.spg-routine-row:hover { background: var(--color-bg-alt); }

@media (max-width: 600px) {
  .spg-routine-row {
    grid-template-columns: 80px 1fr;
    grid-template-rows: auto auto;
  }
  .spg-routine-row__duration { grid-column: 2; grid-row: 2; text-align: left; font-size: 11px; }
}

.spg-routine-row__time {
  font-family: var(--font-mono);
  font-weight: var(--font-semibold);
  font-size: var(--text-sm);
  color: var(--color-brand);
}

.spg-routine-row__task {
  font-size: var(--text-sm);
  color: var(--color-text);
}

.spg-routine-row__icon { margin-right: 6px; }

.spg-routine-row__duration {
  font-size: 11px;
  color: var(--color-text-muted);
  text-align: right;
}

.spg-routine-row--break { background: rgba(212,160,23,0.05); border-color: rgba(212,160,23,0.2); }
.spg-routine-row--break .spg-routine-row__task { color: var(--color-text-secondary); font-style: italic; }
.spg-routine-row--meal { background: rgba(34,197,94,0.04); border-color: rgba(34,197,94,0.15); }

/* Milestones */
.spg-milestone {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border-light);
  max-width: 100%;
}

.spg-milestone__goal { word-wrap: break-word; min-width: 0; }

.spg-milestone:last-child { border-bottom: none; }

.spg-milestone__month {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-brand);
}

.spg-milestone__goal {
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: 1.5;
}

.spg-milestone__goal strong { color: var(--color-text); }

/* Comprehensive mobile fixes (matches other tools) */
@media (max-width: 500px) {
  .spg-hero { padding: var(--space-3); }
  .spg-hero__top { gap: 12px; }
  .spg-hero__num { font-size: 36px; }
  .spg-hero__text h3 { font-size: var(--text-base); }
  .spg-hero__text p { font-size: 12px; }
  .spg-hero__stats { grid-template-columns: repeat(2, 1fr); gap: var(--space-2); }
  .spg-hero__stat-value { font-size: var(--text-base); }
  .spg-hero__stat-label { font-size: 9px; }

  .spg-phase { padding: var(--space-2); }
  .spg-phase__name { font-size: var(--text-sm); }
  .spg-phase__weeks, .spg-phase__dates { font-size: 10px; }

  .spg-schedule { font-size: 11px; }
  .spg-schedule th, .spg-schedule td { padding: 6px 8px; }
  .spg-schedule__bar { height: 12px; }
  .spg-schedule__bar-cell { width: 35%; }

  .spg-routine-row { padding: 8px 12px; }
  .spg-routine-row__time { font-size: 12px; }
  .spg-routine-row__task { font-size: 12px; line-height: 1.35; }

  .spg-milestone { grid-template-columns: 70px 1fr; gap: 10px; padding: 10px 12px; }
  .spg-milestone__month { font-size: 11px; }
  .spg-milestone__goal { font-size: 12px; line-height: 1.45; }
}
