/* ─── Shared btn styles (same pattern as resources.css) ──────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(180deg, #d4753a 0%, #c0622a 60%, #a8501f 100%);
  color: #fff0e4;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.14s ease, transform 0.12s ease, box-shadow 0.14s ease;
  box-shadow: 0 3px 12px rgba(192, 98, 42, 0.32), inset 0 1px 0 rgba(255,255,255,0.22);
  white-space: nowrap;
}
.btn-primary svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-primary:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-1px); }
.btn-primary:active:not(:disabled) { transform: translateY(0); filter: brightness(0.96); }
.btn-primary:disabled { opacity: 0.50; cursor: not-allowed; }
.btn-primary:focus-visible { outline: 2px solid rgba(192, 98, 42, 0.55); outline-offset: 2px; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 20px;
  border-radius: 999px;
  border: 1.5px solid rgba(201, 138, 46, 0.42);
  background: rgba(255, 255, 255, 0.62);
  color: #5c4033;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}
.btn-secondary:hover:not(:disabled) { background: rgba(201, 138, 46, 0.12); color: #c0622a; border-color: rgba(192, 98, 42, 0.40); }
.btn-secondary:disabled { opacity: 0.50; cursor: not-allowed; }

/* ─── State wrapper ────────────────────────────────────────────────────────── */
.pw-state { animation: pw-fade-in 0.22s ease; }

@keyframes pw-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0);   }
}

/* ─── Upload state ─────────────────────────────────────────────────────────── */

/* Drop zone */
.pw-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 36px 24px;
  border-radius: 18px;
  border: 2px dashed rgba(201, 138, 46, 0.40);
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
  text-align: center;
  user-select: none;
}

.pw-dropzone:hover,
.pw-dropzone:focus-visible {
  border-color: rgba(192, 98, 42, 0.65);
  background: rgba(255, 255, 255, 0.62);
  transform: translateY(-2px);
  outline: none;
}

.pw-dropzone.is-dragging {
  border-color: #c0622a;
  background: rgba(192, 98, 42, 0.07);
  transform: scale(1.01);
}

.pw-dropzone.is-loaded {
  border-style: solid;
  border-color: rgba(110, 140, 112, 0.65);
  background: rgba(110, 140, 112, 0.06);
}

.pw-dropzone.is-loading { opacity: 0.65; pointer-events: none; }

.pw-dropzone-icon { font-size: 2.8rem; line-height: 1; }

.pw-dropzone-title {
  font-size: 1rem;
  font-weight: 800;
  color: #2b2213;
  margin: 0;
}

.pw-dropzone-sub {
  font-size: 0.8rem;
  color: rgba(43, 34, 19, 0.50);
  margin: 0;
}

.pw-dropzone-btn {
  margin-top: 6px;
  display: inline-block;
  padding: 7px 18px;
  border-radius: 999px;
  border: 1.5px solid rgba(201, 138, 46, 0.40);
  background: rgba(255, 255, 255, 0.70);
  font-size: 0.82rem;
  font-weight: 700;
  color: #5c4033;
  pointer-events: none;
}

/* Divider */
.pw-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: rgba(43, 34, 19, 0.38);
  font-size: 0.8rem;
  font-weight: 600;
}
.pw-divider::before,
.pw-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(201, 138, 46, 0.22);
}

/* Paste area */
.pw-paste-area {
  width: 100%;
  min-height: 160px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1.5px solid rgba(201, 138, 46, 0.30);
  background: rgba(255, 255, 255, 0.55);
  font-family: inherit;
  font-size: 0.875rem;
  color: #2b2213;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.pw-paste-area:focus {
  border-color: rgba(192, 98, 42, 0.60);
  box-shadow: 0 0 0 3px rgba(192, 98, 42, 0.10);
}
.pw-paste-area::placeholder { color: rgba(43, 34, 19, 0.35); }

/* Error */
.pw-error {
  margin-top: 10px;
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(176, 37, 0, 0.08);
  border: 1px solid rgba(176, 37, 0, 0.20);
  color: #b02500;
  font-size: 0.86rem;
  font-weight: 600;
}

/* Parse row */
.pw-parse-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.pw-parse-btn { padding: 11px 28px; font-size: 0.9rem; }

.pw-parse-hint {
  font-size: 0.78rem;
  color: rgba(43, 34, 19, 0.45);
  margin: 0;
  font-style: italic;
}

/* ─── Spinner ──────────────────────────────────────────────────────────────── */
.pw-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 240, 228, 0.40);
  border-top-color: rgba(255, 240, 228, 0.90);
  border-radius: 50%;
  animation: pw-spin 0.65s linear infinite;
  flex-shrink: 0;
}
@keyframes pw-spin { to { transform: rotate(360deg); } }

/* ─── Review state ─────────────────────────────────────────────────────────── */

.pw-review-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1.5px solid rgba(201, 138, 46, 0.15);
}

.pw-review-degree {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #2b2213;
  letter-spacing: -0.02em;
}

.pw-review-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(43, 34, 19, 0.50);
  display: block;
  margin-top: 2px;
}

.pw-review-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.pw-select-btn { padding: 7px 14px; font-size: 0.8rem; }

/* Semester group */
.pw-semester-list { display: flex; flex-direction: column; gap: 22px; }

.pw-semester-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.pw-semester-name {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c0622a;
}

.pw-semester-count {
  font-size: 0.75rem;
  color: rgba(43, 34, 19, 0.40);
  font-weight: 600;
}

/* Course grid */
.pw-course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

/* Course card (label acts as clickable area) */
.pw-course-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 12px 12px 14px;
  border-radius: 14px;
  border: 1.5px solid rgba(201, 138, 46, 0.28);
  background: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s, opacity 0.18s, transform 0.14s;
}

.pw-course-card:hover { border-color: rgba(192, 98, 42, 0.50); transform: translateY(-1px); }

.pw-course-card.is-deselected {
  opacity: 0.40;
  background: rgba(255, 255, 255, 0.30);
}

/* Hide native checkbox */
.pw-course-check { position: absolute; opacity: 0; width: 0; height: 0; }

.pw-course-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pw-course-code {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #c0622a;
  text-transform: uppercase;
}

.pw-course-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: #2b2213;
  line-height: 1.35;
}

.pw-course-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.pw-course-credits {
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(43, 34, 19, 0.50);
  background: rgba(201, 138, 46, 0.12);
  border-radius: 999px;
  padding: 2px 8px;
}

.pw-course-type {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-radius: 999px;
  padding: 2px 8px;
}
.pw-course-type--required { background: rgba(192, 98, 42, 0.12); color: #c0622a; }
.pw-course-type--elective  { background: rgba(110, 140, 112, 0.15); color: #4e6650; }
.pw-course-type--core      { background: rgba(201, 138, 46, 0.15); color: #a8711f; }

/* Checkmark indicator (top-right corner) */
.pw-course-check-indicator {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid rgba(110, 140, 112, 0.55);
  background: rgba(110, 140, 112, 0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4e6650;
  transition: background 0.12s, border-color 0.12s;
}
.pw-course-check-indicator svg { width: 12px; height: 12px; }

.pw-course-card.is-deselected .pw-course-check-indicator {
  border-color: rgba(43, 34, 19, 0.20);
  background: transparent;
  color: transparent;
}

/* Import bar */
.pw-import-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1.5px solid rgba(201, 138, 46, 0.15);
}

.pw-import-hint {
  font-size: 0.82rem;
  color: rgba(43, 34, 19, 0.50);
  margin: 0;
  max-width: 380px;
  line-height: 1.5;
}

.pw-import-btn { padding: 12px 28px; font-size: 0.95rem; }

/* ─── Success state ────────────────────────────────────────────────────────── */
.pw-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 56px 32px;
  gap: 16px;
}

.pw-success-icon { font-size: 3.5rem; line-height: 1; animation: pw-pop 0.4s cubic-bezier(0.34,1.56,0.64,1); }

@keyframes pw-pop {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.pw-success-title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
  color: #2b2213;
  letter-spacing: -0.03em;
}

.pw-success-body {
  font-size: 0.95rem;
  color: rgba(43, 34, 19, 0.65);
  margin: 0;
  line-height: 1.6;
}

.pw-success-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
}

/* ─── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 540px) {
  .pw-course-grid { grid-template-columns: 1fr; }
  .pw-review-header { flex-direction: column; }
  .pw-import-bar { flex-direction: column; align-items: stretch; }
  .pw-import-btn { width: 100%; justify-content: center; }
  .pw-parse-row  { flex-direction: column; align-items: stretch; }
  .pw-parse-btn  { width: 100%; justify-content: center; }
}
