/* Compare colleges: /compare-colleges, "Add to compare" buttons and the compare tray
   (theme colours: navy #18254a / #233055, purple #5824b0, orange #f4621a) */

/* "Add to compare" on college cards and college pages */
.college-compare-toggle { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 6px 12px; border: 1px dashed #5824b0; border-radius: 8px; background: #fff; color: #5824b0; font-size: .85rem; font-weight: 600; cursor: pointer; }
.college-compare-toggle:hover, .college-compare-toggle:focus { background: #f3f0fc; outline: none; box-shadow: 0 0 0 3px rgba(88, 36, 176, .18); }
.college-compare-toggle.is-added { border-style: solid; background: #5824b0; color: #fff; }

/* Tray at the bottom of the screen */
.compare-tray { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; background: #18254a; color: #fff; box-shadow: 0 -6px 20px rgba(0, 0, 0, .18); padding: 10px 0; }
.compare-tray-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-right: 90px; }
.compare-tray-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.compare-tray-title { margin-right: 4px; }
.compare-tray-chip { display: inline-flex; align-items: center; max-width: 260px; background: rgba(255, 255, 255, .12); border-radius: 20px; padding: 3px 4px 3px 12px; font-size: .85rem; }
.compare-tray-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compare-tray-remove { border: 0; background: transparent; color: #fff; font-size: 1.1rem; line-height: 1; padding: 2px 8px; cursor: pointer; }
.compare-tray-actions { display: flex; align-items: center; gap: 8px; }
.compare-tray-clear { color: #cfd5e6 !important; }
.compare-tray-hint { font-size: .85rem; color: #cfd5e6; }
.compare-tray-note { flex-basis: 100%; margin: 0; font-size: .8rem; color: #ffd2bb; }
body.has-compare-tray { padding-bottom: 76px; }

/* Picker */
.compare-picker { background: #fff; border-radius: 10px; box-shadow: 0 2px 10px rgba(0, 0, 0, .06); padding: 22px; margin-bottom: 25px; }
.compare-picker-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.compare-picker-tools { display: flex; gap: 8px; }
.compare-picker-tools select.form-control { width: auto; min-width: 170px; }
.compare-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.compare-slot { position: relative; min-height: 76px; border: 2px dashed #d5d9e4; border-radius: 10px; padding: 12px; display: flex; align-items: center; gap: 10px; }
.compare-slot.is-filled { border-style: solid; border-color: #5824b0; background: #faf8ff; }
.compare-slot-text { min-width: 0; flex: 1; }
.compare-slot-name { display: block; font-weight: 700; color: #18254a; line-height: 1.3; overflow-wrap: anywhere; }
.compare-slot-meta { display: block; font-size: .8rem; color: #5c6275; }
.compare-slot-remove { border: 0; background: #fff; color: #5c6275; width: 30px; height: 30px; border-radius: 50%; font-size: 1.2rem; line-height: 1; flex: 0 0 30px; cursor: pointer; box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.compare-slot-remove:hover, .compare-slot-remove:focus { color: #d9530f; }
.compare-search { position: relative; width: 100%; }
.compare-search .form-control { height: 48px; padding: 0 44px 0 14px !important; }
.compare-search-toggle { position: absolute; top: 4px; right: 4px; width: 40px; height: 40px; border: 0; border-radius: 6px; background: transparent; color: #5824b0; cursor: pointer; }
.compare-search-toggle:hover { background: #f3f0fc; }
.compare-search-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); max-height: 320px; overflow-y: auto; margin: 0; padding: 4px; list-style: none; background: #fff; border: 1px solid #dfe3e8; border-radius: 8px; box-shadow: 0 10px 24px rgba(0, 0, 0, .12); }
.compare-search-list[hidden] { display: none; }
.compare-search-option { padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.compare-search-option:hover, .compare-search-option.is-active { background: #f3f0fc; }
.compare-search-name { display: block; font-weight: 600; color: #18254a; line-height: 1.3; }
.compare-search-meta { display: block; font-size: .78rem; color: #5c6275; }
.compare-search-message { padding: 8px 10px; color: #5c6275; font-size: .9rem; }

/* Logo / initials */
.compare-logo { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 8px; object-fit: contain; background: #fff; }
.compare-logo-placeholder { display: inline-flex; align-items: center; justify-content: center; background: #18254a; color: #fff; font-weight: 700; font-size: .9rem; }

/* Result */
#compareResult.is-loading { opacity: .55; pointer-events: none; transition: opacity .15s; }
.compare-empty { text-align: center; background: #fff; border-radius: 10px; padding: 40px 20px; color: #5c6275; }
.compare-empty .fa { font-size: 2.2rem; color: #5824b0; margin-bottom: 10px; }
.compare-note { background: #eef3ff; border-radius: 8px; padding: 10px 14px; color: #233055; }
.compare-note-warn { background: #fff4ec; color: #8a3a0d; }
.compare-lead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; background: #fff; border-left: 4px solid #f4621a; border-radius: 8px; box-shadow: 0 2px 10px rgba(0, 0, 0, .06); padding: 12px 16px; margin-bottom: 16px; }

/* Table: scrolls inside its own box, so the college row (top) and the labels (left) stay in view */
.compare-table-wrap { overflow: auto; max-height: calc(100vh - 140px); background: #fff; border-radius: 10px; box-shadow: 0 2px 10px rgba(0, 0, 0, .06); }
.compare-table-wrap:focus { outline: 2px solid #5824b0; outline-offset: 2px; }
.compare-table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.compare-table.compare-cols-1 { min-width: 420px; }
.compare-table.compare-cols-2 { min-width: 640px; }
.compare-table.compare-cols-3 { min-width: 860px; }
.compare-table th, .compare-table td { padding: 12px 14px; border-bottom: 1px solid #edf0f5; vertical-align: top; text-align: left; font-size: .92rem; color: #233055; overflow-wrap: anywhere; }
.compare-table thead th { position: sticky; top: 0; z-index: 2; background: #18254a; color: #fff; border-bottom: 0; }
.compare-table thead th a { color: #fff; font-weight: 700; }
.compare-table thead th a:hover { text-decoration: underline; }
.compare-table th[scope="row"], .compare-table .compare-corner { position: sticky; left: 0; width: 180px; background: #f5f6fa; font-weight: 600; z-index: 1; }
.compare-table .compare-corner { z-index: 3; background: #18254a; }
.compare-head { display: flex; align-items: center; gap: 10px; }
.compare-section th { position: sticky; left: 0; background: #ece7f8 !important; color: #5824b0 !important; font-size: .8rem !important; letter-spacing: .04em; text-transform: uppercase; }
.compare-list { margin: 0; padding-left: 18px; }
.compare-list li { margin-bottom: 3px; }
.compare-missing, .compare-muted { color: #8a90a2; }
.compare-table td.is-best { background: #ecf8f0; }
.compare-best { display: inline-block; margin-top: 6px; padding: 2px 8px; border-radius: 20px; background: #1e7b45; color: #fff; font-size: .72rem; font-weight: 700; }
.compare-actions .btn { margin-bottom: 6px; white-space: normal; }
.compare-disclaimer { font-size: .8rem; color: #5c6275; margin-top: 12px; }
.compare-popular { columns: 2; column-gap: 30px; margin: 0; padding-left: 18px; }
.compare-popular li { margin-bottom: 6px; break-inside: avoid; }
.compare-popular a { color: #5824b0; }

@media (max-width: 991px) {
  .compare-slots { grid-template-columns: 1fr; }
  .compare-popular { columns: 1; }
}
@media (max-width: 575px) {
  .compare-picker { padding: 16px; }
  .compare-picker-tools { width: 100%; }
  .compare-picker-tools select.form-control { flex: 1; min-width: 0; }
  .compare-table th[scope="row"], .compare-table .compare-corner { width: 120px; }
  .compare-table th, .compare-table td { padding: 10px; font-size: .85rem; }
  .compare-tray-inner { padding-right: 15px; padding-bottom: 54px; }
  body.has-compare-tray { padding-bottom: 140px; }
}
