/* 기본 레이아웃 */
body {
  background-color: #f5f5f7;
}

.compare-wrapper {
  max-width: 960px;
  margin: 30px auto;
}

.compare-card {
  background-color: #ffffff;
  border-radius: 18px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  padding: 24px 28px 30px;
}

/* 스크롤바 */
.compare-card,
#leftMajorSelect,
#rightMajorSelect {
  scrollbar-width: thin;
  scrollbar-color: #cbd5f5 transparent;
}

.compare-card::-webkit-scrollbar,
#leftMajorSelect::-webkit-scrollbar,
#rightMajorSelect::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.compare-card::-webkit-scrollbar-track,
#leftMajorSelect::-webkit-scrollbar-track,
#rightMajorSelect::-webkit-scrollbar-track {
  background: transparent;
}

.compare-card::-webkit-scrollbar-thumb,
#leftMajorSelect::-webkit-scrollbar-thumb,
#rightMajorSelect::-webkit-scrollbar-thumb {
  background: #cbd5f5;
  border-radius: 999px;
  border: 2px solid #f9fafb;
}

.compare-card::-webkit-scrollbar-thumb:hover,
#leftMajorSelect::-webkit-scrollbar-thumb:hover,
#rightMajorSelect::-webkit-scrollbar-thumb:hover {
  background: #b8c7ee;
}

.compare-description {
  font-size: 0.85rem;
  color: #9ca3af;
  margin-top: 4px;
  line-height: 1.45;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-title {
  font-weight: 700;
  font-size: 1.1rem;
}

/* 전공 선택 */
.major-selector-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.major-selector-box .major-select-btn {
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent-text);
}

.major-selector-box .major-select-btn:hover {
  background: var(--accent);
  color: #fff;
}

.selected-major-text {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #f1fef5;
  text-align: center;
  font-size: 12px;
  color: #6b7280;
}

.major-dropdown-menu {
  min-width: 220px;
  border-radius: 12px;
  padding: 8px 0;

  max-height: 380px; /* 대략 10개 정도 보이게 */
  overflow-y: auto;
}

.major-dropdown-menu .dropdown-item {
  padding: 10px 18px;
  font-size: 15px;
}

.major-dropdown-menu .dropdown-item:hover,
.major-dropdown-menu .dropdown-item:focus,
.major-dropdown-menu .dropdown-item:active {
  background-color: #ecfdf5;
  color: #065f46;
}

/* 비교 카드 내부 */
.compare-hero {
  background-color: #f8fafc;
  border-radius: 18px;
  border: 1px solid #eceff4;
  padding: 20px 24px 28px;
  margin-bottom: 28px;
}

/* 교체 버튼 */
.swap-btn {
  width: 60px;
  height: 60px;
  margin-top: 100px;
  border-radius: 999px;
  border: 1px solid #d0d7e2;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #ffffff;
  cursor: pointer;
}

.swap-btn:hover {
  background-color: #ecfdf5;
  transform: translateY(-1px);
}

/* 로고 영역 */
.uni-logo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4rem;
}

.uni-logo-lg {
  width: 250px;
  height: 250px;
  object-fit: contain;
  border-radius: 50%;
  display: block;
  margin: 0 auto;
}

/* 매치업 점수 */
.score-pill {
  font-size: 2.4rem;
  font-weight: 800;
  color: #111;
  background: none;
  border: none;
  width: auto;
  height: auto;
  border-radius: 0;
  padding: 0;
}

/* 지표 테이블 */
.metric-row {
  padding: 12px 0;
  border-bottom: 1px solid #edf0f6;
  font-size: 0.95rem;
  background-color: #ffffff;
}

#metricRows > .metric-row:nth-of-type(odd) {
  background-color: #f3f6ff !important;
}

#metricRows > .metric-row:nth-of-type(even) {
  background-color: #ffffff !important;
}

.metric-row:last-child {
  border-bottom: none;
}

.metric-label {
  font-weight: 600;
}

.metric-value {
  font-weight: 500;
  display: flex;
  justify-content: center;
  align-items: center;
}

.metric-highlight {
  display: inline-block;
  padding: 4px 30px;
  border-radius: 999px;
  background-color: #8ddf9a;
}

.light-divider {
  border-bottom: 1px solid #f1f2f6;
  margin: 12px 0;
}

/* 대학 선택 드롭다운 */
.uni-select-wrapper {
  width: 100%;
  max-width: 360px;
}

/* 대학 선택 버튼 */
.uni-select-btn {
  width: 100%;
  border-radius: 16px;
  border: 1px solid #d5d9e0;
  background-color: #ffffff;
  font-size: 14px;
  padding: 10px 14px;
  padding-right: 40px;
  color: #111827;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.04);
  text-align: center;
  position: relative;
  cursor: pointer;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 커스텀 화살표 */
.uni-select-btn::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  margin-top: -3px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid #6b7280;
}

/* 라이트 테마 hover */
.uni-select-btn:hover {
  background-color: #ecfdf5;
  border-color: #cbd5e1;
  transition: all 0.18s ease;
}

/* 라이트 테마 active */
.uni-select-btn:active,
.uni-select-btn:focus {
  border-color: #b8c4d4;
  box-shadow: 0 0 0 2px rgba(184, 196, 212, 0.35);
  outline: none;
}

/* 대학 선택 드롭다운 메뉴 */
.uni-dropdown-menu {
  width: 100%;
  min-width: 100%;
  margin-top: 6px;
  border-radius: 14px;
  padding: 4px 0;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);

  max-height: 380px; /* 항목 10개 정도 */
  overflow-y: auto;
}

/* 내부 항목 */
.uni-dropdown-menu .dropdown-item {
  font-size: 14px;
  padding: 6px 14px;
}

/* hover 색상 */
.uni-dropdown-menu .dropdown-item:hover,
.uni-dropdown-menu .dropdown-item:focus,
.uni-dropdown-menu .dropdown-item:active {
  background-color: #ecfdf5;
  color: #065f46;
}

/* 다크 모드 */
html[data-theme='dark'] body {
  background-color: #020617;
}

/* 메인 카드 */
html[data-theme='dark'] .compare-card {
  background: linear-gradient(135deg, #0b0e12, #101317);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7);
}

/* 헤더 텍스트 / 설명 */
html[data-theme='dark'] .section-title {
  color: #e5e7eb;
}

html[data-theme='dark'] .compare-description {
  color: #9ca3af;
}

/* 전공 선택 버튼 & pill */
html[data-theme='dark'] .major-selector-box .major-select-btn {
  background: rgba(34, 197, 94, 0.12);
  border-color: #22c55e;
  color: #bbf7d0;
}

html[data-theme='dark'] .major-selector-box .major-select-btn:hover {
  background: #22c55e;
  color: #022c22;
}

html[data-theme='dark'] .selected-major-text {
  background: #2e4239;
  border-color: #505f75;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* 전공 드롭다운 */
html[data-theme='dark'] .major-dropdown-menu {
  background-color: #181a23;
  border-color: #1f2937;
}

html[data-theme='dark'] .major-dropdown-menu .dropdown-item {
  color: #e5e7eb;
}

html[data-theme='dark'] .major-dropdown-menu .dropdown-item:hover,
html[data-theme='dark'] .major-dropdown-menu .dropdown-item:focus,
html[data-theme='dark'] .major-dropdown-menu .dropdown-item:active {
  background-color: rgba(34, 197, 94, 0.16);
  color: #bbf7d0;
}

html[data-theme='dark'] .compare-hero {
  background: #232529;
  border-color: #1f2937;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

/* 다크 모드: 대학 선택 버튼 */
html[data-theme='dark'] .uni-select-btn {
  background-color: #393a3c;
  border-color: #909ba9;
  color: #e5e7eb;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}

html[data-theme='dark'] .uni-select-btn::after {
  border-top-color: #cbd5e1;
}

html[data-theme='dark'] .uni-select-btn:hover {
  background-color: #4c4c4e !important;
  border-color: #3b4f65 !important;
  transition: all 0.18s ease;
}

html[data-theme='dark'] .uni-select-btn:focus,
html[data-theme='dark'] .uni-select-btn:active {
  border-color: #4b5563;
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.4);
}

/* 다크 모드: 대학 선택 드롭다운 메뉴 */
html[data-theme='dark'] .uni-dropdown-menu {
  background-color: #181a23;
  border-color: #1f2937;
}

html[data-theme='dark'] .uni-dropdown-menu .dropdown-item {
  color: #e5e7eb;
}

html[data-theme='dark'] .uni-dropdown-menu .dropdown-item:hover,
html[data-theme='dark'] .uni-dropdown-menu .dropdown-item:focus,
html[data-theme='dark'] .uni-dropdown-menu .dropdown-item:active {
  background-color: rgba(34, 197, 94, 0.16);
  color: #bbf7d0;
}

/* 스왑 버튼 다크 */
html[data-theme='dark'] .swap-btn {
  background-color: #393a3c;
  border-color: #909ba9;
  color: #e5e7eb;
}

html[data-theme='dark'] .swap-btn:hover {
  background-color: #4c4c4e;
}

/* 로고 아래 텍스트 */
html[data-theme='dark'] #leftNameMajor .text-muted,
html[data-theme='dark'] #rightNameMajor .text-muted {
  color: #f9fafb !important;
}

/* 매치업 점수 */
html[data-theme='dark'] .score-pill {
  color: #f9fafb;
}

/* 지표 테이블 */
html[data-theme='dark'] .metric-row {
  border-bottom: 1px solid #141a25 !important;
}

html[data-theme='dark'] #metricRows > .metric-row:nth-of-type(odd) {
  background: linear-gradient(135deg, #0b0e12, #101317) !important;
}

html[data-theme='dark'] #metricRows > .metric-row:nth-of-type(even) {
  background-color: #1a1b1f !important;
}

html[data-theme='dark'] .metric-label,
html[data-theme='dark'] .metric-value {
  color: #e5e7eb;
}

html[data-theme='dark'] .metric-highlight {
  background-color: #15803d !important;
  color: #d1fae5 !important;
  padding: 4px 28px;
  border-radius: 999px;
}

/* 반응형 */
@media (max-width: 768px) {
  .compare-card {
    padding: 20px 12px 24px;
  }

  .compare-description {
    max-width: 80%;
  }

  .uni-logo-lg {
    width: 34vw;
    max-width: 140px;
    height: auto;
  }

  .score-pill {
    font-size: 1.6rem;
  }

  .compare-hero {
    background: transparent;
    border: none;
    box-shadow: none;
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 0px;
    margin-bottom: 0;
  }

  .logo-row {
    margin-bottom: 0 !important;
  }

  .row.align-items-center.text-center.mb-4 {
    margin-top: 0 !important;
    margin-bottom: 0.3rem !important;
  }

  .uni-select-wrapper {
    width: 100%;
    max-width: none;
  }

  .uni-select-btn {
    padding-left: 5px;
    padding-right: 5px;
  }

  .uni-select-btn::after {
    display: none;
  }

  .uni-dropdown-menu {
    width: max-content;
    min-width: 100%;
    max-width: calc(100vw - 32px);
    white-space: nowrap;
  }

  .uni-dropdown-menu::-webkit-scrollbar {
    width: 6px;
  }

  .uni-dropdown-menu::-webkit-scrollbar-thumb {
    background: #cfd6e4;
    border-radius: 8px;
  }

  .uni-dropdown-menu .dropdown-item {
    white-space: nowrap;
  }

  .swap-btn {
    margin-top: 50px;
  }

  html[data-theme='dark'] .compare-hero {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }

  .metric-row {
    position: relative;
  }

  .metric-label {
    font-size: 0.85rem;
    white-space: nowrap;
    text-align: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    padding-left: 0;
    padding-right: 0;
    width: auto;
  }

  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }
}

/* 매치업/지표 이름 줄바꿈 방지 */
.metric-row-title,
.row.align-items-center.text-center.mb-4 .col-2 {
  white-space: nowrap;
}
