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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f4f0;
  min-height: 100vh;
  color: #1a1a18;
}

/* ── Top nav ── */
.topnav {
  background: #8C1515;
  color: #fff;
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.topnav .logo { font-size: 15px; font-weight: 600; letter-spacing: .01em; }
.topnav .tabs { display: flex; gap: 4px; margin-left: 16px; }
.topnav .tab {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  color: rgba(255,255,255,.75);
  border: 1px solid transparent;
  transition: all .15s;
}
.topnav .tab.active {
  background: rgba(255,255,255,.18);
  color: #fff;
  border-color: rgba(255,255,255,.25);
}
.topnav .student { margin-left: auto; font-size: 13px; opacity: .8; }

/* ── Main layout ── */
.main { padding: 20px 24px; max-width: 1100px; margin: 0 auto; }
.hidden { display: none !important; }
.section-label {
  font-size: 11px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 10px;
}

/* ── Student banner ── */
.student-bar {
  background: #fff;
  border: 0.5px solid #e0dfd8;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 18px;
  display: flex;
  gap: 28px;
  align-items: center;
}
.s-name  { font-weight: 600; font-size: 14px; }
.s-meta  { font-size: 12px; color: #666; }
.s-tags  { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }

.tag {
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
}
.tag.cs   { background: #E6F1FB; color: #0C447C; border: 0.5px solid #B5D4F4; }
.tag.way  { background: #EAF3DE; color: #27500A; border: 0.5px solid #C0DD97; }
.tag.done { background: #f0f0ec; color: #555;    border: 0.5px solid #ddd; }

/* ── Quarter planner ── */
.quarters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.quarter {
  background: #fff;
  border: 0.5px solid #e0dfd8;
  border-radius: 10px;
  overflow: hidden;
}
.q-head {
  padding: 9px 12px;
  background: #faf9f6;
  border-bottom: 0.5px solid #e8e7e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.q-title { font-size: 12px; font-weight: 600; color: #333; }
.q-units { font-size: 11px; color: #999; }

.q-slots {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 140px;
}

/* ── Course pills ── */
.course-pill {
  padding: 7px 9px;
  border-radius: 7px;
  font-size: 12px;
  cursor: grab;
  border: 0.5px solid;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  transition: opacity .15s;
  user-select: none;
}
.course-pill:active { opacity: .6; cursor: grabbing; }
.course-pill.dragging { opacity: .4; }

/* Course type colors */
.course-pill.cs   { background: #E6F1FB; border-color: #B5D4F4; color: #042C53; }
.course-pill.math { background: #EAF3DE; border-color: #C0DD97; color: #173404; }
.course-pill.hum  { background: #FAEEDA; border-color: #FAC775; color: #412402; }
.course-pill.engr { background: #FBEAF0; border-color: #F4C0D1; color: #4B1528; }

.pill-title { font-weight: 500; line-height: 1.3; }
.pill-sub   { font-size: 10px; opacity: .65; line-height: 1.2; }
.pill-units { font-size: 10px; opacity: .6; flex-shrink: 0; margin-top: 1px; }

/* Empty drop slots */
.empty-slot {
  border: 1px dashed #ddd;
  border-radius: 7px;
  padding: 8px;
  font-size: 11px;
  color: #bbb;
  text-align: center;
  cursor: default;
  background: #fafaf8;
}

/* ── Suggestions bank ── */
.suggestions-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.sug-pill {
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  background: #fff;
  border: 0.5px solid #ddd;
  color: #444;
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: 5px;
}
.sug-pill:hover { border-color: #378ADD; color: #185FA5; background: #E6F1FB; }
.sug-plus { font-size: 14px; line-height: 1; color: #aaa; }

/* ── 4-year view ── */
.fouryear { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.yr-col {
  background: #fff;
  border: 0.5px solid #e0dfd8;
  border-radius: 10px;
  overflow: hidden;
}
.yr-head {
  padding: 8px 12px;
  background: #faf9f6;
  border-bottom: 0.5px solid #e8e7e0;
  font-size: 12px;
  font-weight: 600;
  color: #333;
  text-align: center;
}
.yr-quarters { padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.mini-q { font-size: 10px; }
.mini-q-label { color: #999; margin-bottom: 3px; font-weight: 500; }
.mini-pills { display: flex; flex-direction: column; gap: 3px; }

.mini-pill {
  padding: 3px 7px;
  border-radius: 5px;
  font-size: 10px;
  border: 0.5px solid;
}
.mini-pill.cs      { background: #E6F1FB; border-color: #B5D4F4; color: #042C53; }
.mini-pill.math    { background: #EAF3DE; border-color: #C0DD97; color: #173404; }
.mini-pill.hum     { background: #FAEEDA; border-color: #FAC775; color: #412402; }
.mini-pill.neutral { background: #f0f0ec; border-color: #ddd;    color: #555; }

/* ── Floating advisor ── */
.advisor-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
}

.advisor-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #8C1515;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s;
}
.advisor-btn:hover { transform: scale(1.07); }
.advisor-btn svg   { width: 22px; height: 22px; fill: #fff; }

.advisor-badge {
  position: absolute;
  top: -2px; right: -2px;
  width: 14px; height: 14px;
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid #f5f4f0;
}

/* Chat window */
.chat-window {
  position: absolute;
  bottom: 60px; right: 0;
  width: 320px;
  background: #fff;
  border: 0.5px solid #e0dfd8;
  border-radius: 14px;
  overflow: hidden;
  display: none;
  flex-direction: column;
}
.chat-window.open { display: flex; }

.chat-head {
  padding: 12px 14px;
  background: #8C1515;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}
.chat-head-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.chat-head-info .title { font-size: 13px; font-weight: 600; }
.chat-head-info .sub   { font-size: 11px; opacity: .75; }

.chat-msgs {
  height: 280px;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-msgs::-webkit-scrollbar { width: 3px; }
.chat-msgs::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

.cmsg {
  font-size: 12.5px;
  line-height: 1.55;
  max-width: 88%;
}
.cmsg.advisor {
  background: #f5f4f0;
  border-radius: 4px 10px 10px 10px;
  padding: 7px 10px;
  color: #1a1a18;
}
.cmsg.user {
  align-self: flex-end;
  background: #8C1515;
  border-radius: 10px 4px 10px 10px;
  padding: 7px 10px;
  color: #fff;
}
.cmsg.typing {
  background: #f5f4f0;
  border-radius: 4px 10px 10px 10px;
  padding: 9px 12px;
  color: #999;
  font-style: italic;
  font-size: 12px;
}

.quick-replies {
  padding: 0 10px 8px;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.qr {
  padding: 4px 9px;
  border-radius: 20px;
  font-size: 11px;
  cursor: pointer;
  border: 0.5px solid #e0dfd8;
  background: #faf9f6;
  color: #555;
  transition: all .12s;
}
.qr:hover { border-color: #8C1515; color: #8C1515; }

.chat-input-row {
  padding: 10px;
  border-top: 0.5px solid #eee;
  display: flex;
  gap: 7px;
}
.chat-input-row input {
  flex: 1;
  font-size: 12.5px;
  padding: 7px 10px;
  border: 0.5px solid #ddd;
  border-radius: 8px;
  outline: none;
  color: #1a1a18;
  background: #fff;
}
.chat-input-row input:focus { border-color: #8C1515; }
.chat-input-row button {
  padding: 7px 11px;
  border-radius: 8px;
  background: #8C1515;
  border: none;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
}

/* Pill trash icon — hidden by default, revealed on hover */
.pill-trash {
  display: none;
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.12);
  color: #555;
  font-size: 14px;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  user-select: none;
}
 
.course-pill {
  position: relative; /* needed for absolute trash icon */
}
 
.course-pill:hover .pill-trash {
  display: block;
}
 
.pill-trash:hover {
  background: rgba(180, 30, 30, 0.15);
  color: #b41e1e;
}
 
/* Hide the units span when pill is hovered (so × doesn't overlap) */
.course-pill:hover .pill-units {
  opacity: 0;
}
 
/* ── TRASH ZONE — invisible until drag starts ────────────────────────────── */
#trash-zone {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border: 1.5px dashed #ccc;
  color: #999;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s, color 0.2s, background 0.2s;
  z-index: 1000;
  white-space: nowrap;
}
 
/* Shown when dragging */
body.is-dragging #trash-zone {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}
 
/* Highlight when hovering over trash zone with a dragged pill */
#trash-zone.drag-over {
  border-color: #b41e1e;
  color: #b41e1e;
  background: rgba(180, 30, 30, 0.06);
}