/* === Global Reset & Base =============================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #f3f4f6;
  color: #111827;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* === Top Nav =========================================================== */

.dp-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 7vw;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.9);
}

.dp-nav-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dp-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dp-logo {
  width: 30px;
  height: 30px;
}

.dp-brand {
  font-weight: 700;
  font-size: 1.05rem;
}

.dp-nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}

.dp-user-email {
  color: #4b5563;
}

/* === Buttons =========================================================== */

.dp-btn {
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease, box-shadow 0.12s ease,
    transform 0.12s ease, color 0.12s ease;
}

.dp-btn:active {
  transform: translateY(1px);
}

/* Primary action */
.dp-btn-primary {
  background: #f97316;
  color: #ffffff;
  box-shadow: 0 10px 25px rgba(249, 115, 22, 0.35);
}

.dp-btn-primary:hover {
  background: #ea580c;
}

/* Secondary outline */
.dp-btn-secondary {
  background: #ffffff;
  color: #111827;
  border: 1px solid #e5e7eb;
}

.dp-btn-secondary:hover {
  background: #f9fafb;
}

/* Ghost */
.dp-btn-ghost {
  background: transparent;
  color: #4b5563;
  border: 1px solid transparent;
}

.dp-btn-ghost:hover {
  border-color: #e5e7eb;
  background: #f9fafb;
}

/* Disabled state */
.dp-btn[disabled] {
  opacity: 0.6;
  cursor: default;
  box-shadow: none;
}

/* Small button */
.dp-btn-small {
  padding: 6px 12px;
  font-size: 13px;
}

/* === Main Layout ======================================================= */

.dp-main {
  max-width: 1120px;
  margin: 28px auto 40px;
  padding: 0 7vw;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* === Cards ============================================================= */

.dp-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 18px 18px 20px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.08);
}

.dp-card-header {
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.1);
}

.dp-card h1,
.dp-card h2 {
  margin-top: 0;
}

/* Header card */

.dp-card-header h1 {
  font-size: 1.8rem;
  margin-bottom: 4px;
}

.dp-subtitle {
  margin: 0 0 14px;
  font-size: 0.98rem;
  color: #4b5563;
}

.dp-context-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 8px;
}

.dp-context-item {
  min-width: 180px;
}

.dp-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
  margin-bottom: 4px;
}

.dp-value {
  font-size: 0.95rem;
  font-weight: 600;
}

.dp-select {
  width: 100%;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  font-size: 0.9rem;
  background: #f9fafb;
}

.dp-select:focus {
  outline: none;
  border-color: #f97316;
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.16);
}

.dp-note {
  margin: 8px 0 0;
  font-size: 0.85rem;
  color: #6b7280;
}

/* Upload card */

.dp-card-upload h2 {
  font-size: 1.2rem;
}

.dp-help {
  margin-top: 0;
  margin-bottom: 14px;
  font-size: 0.9rem;
  color: #4b5563;
}

.dp-file-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 0;
  cursor: pointer;
}

.dp-file-label input[type="file"] {
  display: none;
}

.dp-file-button {
  background: #111827;
  color: #ffffff;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
}

.dp-file-button:hover {
  background: #020617;
}

.dp-file-name {
  font-size: 0.9rem;
  color: #6b7280;
}

/* Upload progress */

.dp-upload-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.dp-upload-hidden {
  display: none;
}

.dp-upload-bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.dp-upload-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f97316, #facc15);
  transition: width 0.2s ease;
}

.dp-upload-percent {
  font-size: 0.8rem;
  color: #4b5563;
}

/* Status text */

.dp-status-text {
  margin-top: 8px;
  font-size: 0.87rem;
  color: #6b7280;
}

/* Actions card */

.dp-card-actions h2 {
  font-size: 1.2rem;
}

.dp-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

/* === Results grid ====================================================== */

.dp-results-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dp-card-results h2 {
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.dp-results-help {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 0.88rem;
  color: #6b7280;
}

/* Pills */

.dp-pill-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dp-pill-list li {
  margin: 0;
}

.dp-pill-list span {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
}

/* satisfied pill */
.dp-pill-satisfied {
  background: #dcfce7;
  color: #166534;
}

/* needed pill */
.dp-pill-needed {
  background: #f3f4f6;
  color: #111827;
}

/* info pill (for non-course items like language guidance text) */
.dp-pill-info {
  background: #eef2ff; /* subtle indigo tint */
  color: #3730a3;
}

.dp-empty-text {
  margin-top: 4px;
  font-size: 0.85rem;
  color: #9ca3af;
}

/* === NEW: Requirement Sections (sectioned rendering) =================== */

/* Container that stacks section blocks (inside each results card) */
.dp-req-sections {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* One requirement section block */
.dp-req-section {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 12px 12px 10px;
  background: #ffffff;
}

/* Header row within a section block */
.dp-req-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.dp-req-section-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #111827;
}

.dp-req-section-meta {
  font-size: 0.82rem;
  color: #6b7280;
  white-space: nowrap;
}

/* Bucket labels inside full breakdown */
.dp-req-bucket-label {
  margin-top: 10px;
  margin-bottom: 6px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
}

/* Hint text (used by JS in empty section breakdown) */
.dp-hint {
  margin-top: 8px;
  font-size: 0.86rem;
  color: #6b7280;
}

/* "Requirement sections" card header layout (matches other card header style) */
.dp-card-headrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dp-card-title {
  font-weight: 700;
  font-size: 1.1rem;
}

/* AI Summary */

.dp-card-summary h2 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.dp-summary-text {
  margin: 0;
  font-size: 0.92rem;
  color: #374151;
  white-space: pre-wrap;
}

/* AI Plan */

.dp-card-plan h2 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.dp-plan-list {
  margin: 4px 0 0 1.2rem;
  padding: 0;
  font-size: 0.95rem;
}

.dp-plan-list li {
  margin-bottom: 8px;
}

.dp-plan-course {
  font-weight: 600;
}

.dp-plan-section {
  font-style: italic;
  color: #6b7280;
}

.dp-plan-reason {
  font-size: 0.88rem;
  color: #374151;
  margin-top: 2px;
}

.dp-plan-notes {
  margin-top: 14px;
}

.dp-plan-notes h3 {
  font-size: 1rem;
  margin: 0 0 6px;
}

.dp-plan-notes ul {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.9rem;
  color: #4b5563;
}

/* === Electives / Other Courses ======================================== */

.dp-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dp-card-other {
  margin-top: 24px;
}

.dp-other-wrapper {
  margin-top: 12px;
}

#dpOtherList {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dp-pill-other {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f3f4f6;
  font-size: 13px;
  color: #111827;
}

#dpOtherEmpty {
  margin-top: 4px;
  font-size: 13px;
  color: #6b7280;
}

/* === Footer ============================================================ */

.dp-footer {
  padding: 22px 7vw 26px;
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.84rem;
  color: #6b7280;
}

.dp-footer-links {
  display: flex;
  gap: 14px;
}

.dp-footer-links a {
  color: #6b7280;
}

.dp-footer-links a:hover {
  color: #111827;
}

/* === Responsive ======================================================== */

@media (max-width: 900px) {
  .dp-main {
    padding-inline: 16px;
  }
}

@media (max-width: 768px) {
  .dp-nav {
    padding-inline: 16px;
  }

  .dp-nav-right {
    font-size: 0.85rem;
  }

  .dp-results-grid {
    grid-template-columns: 1fr;
  }

  .dp-card {
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  }
}

@media (max-width: 520px) {
  .dp-nav-right {
    display: none; /* keep mobile nav simple; login handled elsewhere */
  }

  .dp-context-row {
    flex-direction: column;
  }

  .dp-actions-row {
    flex-direction: column;
  }

  .dp-actions-row .dp-btn {
    width: 100%;
  }
}
