/* ssuport.kr 디자인 기반 (인디고 블루 #2C4FFF, 핑크 #FF1A66, 라이트 그레이 #F6F6FC) */
:root {
  --primary: #2c4fff;
  --primary-hover: #4967fe;
  --primary-soft: #e5eaff;
  --primary-faint: #f2f4ff;
  --pink: #ff1a66;
  --pink-soft: #ffe5ee;
  --green: #27724b;
  --green-soft: #dff8eb;
  --bg: #f6f6fc;
  --card: #ffffff;
  --text: #383840;
  --text-strong: #1a1a20;
  --muted: #7d7d8e;
  --muted-2: #9e9eb0;
  --border: #e0e0eb;
  --border-strong: #b7b7c9;
  --radius: 12px;
  --shadow: 0 4px 14px rgba(44, 79, 255, 0.06);
  --shadow-hover: 0 8px 24px rgba(44, 79, 255, 0.12);
}

* {
  box-sizing: border-box;
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  font-family:
    "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo",
    sans-serif;
  color: var(--text);
  background: var(--bg);
  word-break: keep-all;
  line-height: 1.6;
  overflow-x: hidden;
}

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

/* ---------- 상단 바 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-text strong {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text-strong);
  letter-spacing: -0.01em;
}

.brand-text em {
  font-style: normal;
  font-size: 0.68rem;
  color: var(--muted-2);
  letter-spacing: 0.04em;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #4a4a54;
}

.top-nav a:hover {
  color: var(--primary);
}

.top-nav .link-btn {
  padding: 7px 14px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  transition: background 0.15s ease;
}

.top-nav .link-btn:hover {
  background: var(--primary-hover);
  color: #fff;
}

/* ---------- 히어로 ---------- */
.hero {
  background: var(--primary-faint);
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 46px 20px 40px;
  text-align: center;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  font-weight: 800;
  color: var(--text-strong);
  letter-spacing: -0.02em;
}

.hero-desc {
  max-width: 560px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- 레이아웃 ---------- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

/* ---------- 검색 카드 ---------- */
.search-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 24px;
  position: sticky;
  top: 72px;
  z-index: 30;
}

.search-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.search-card-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-strong);
  padding-left: 10px;
  border-left: 3px solid var(--primary);
}

.btn-reset {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 16px;
  background: #fff;
  color: #4a4a54;
  font-size: 0.84rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-reset:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-faint);
}

.search-row {
  margin-bottom: 16px;
}

.search-row input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 16px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.search-row input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(44, 79, 255, 0.12);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px 16px;
}

.field.span-2 {
  grid-column: span 2;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #4a4a54;
}

.field select {
  width: 100%;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 8px;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(44, 79, 255, 0.1);
}

.field select:disabled {
  background: var(--bg);
  color: var(--muted-2);
  cursor: not-allowed;
}

.target-checks {
  display: flex;
  flex-direction: column;
  gap: 7px;
  justify-content: center;
  min-height: 38px;
}

.check-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  color: #4a4a54;
  cursor: pointer;
}

.check-item input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.check-note {
  font-size: 0.72rem;
  color: var(--muted-2);
}

.target-inputs {
  display: flex;
  gap: 6px;
}

.target-inputs select {
  flex: 1;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 6px;
  font-size: 0.82rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  cursor: pointer;
  outline: none;
}

.target-inputs .combobox {
  flex: 1;
}

.target-inputs .combo-trigger {
  height: 34px;
  font-size: 0.82rem;
}

.target-inputs select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(44, 79, 255, 0.1);
}

/* ---------- 검색 가능한 콤보박스 ---------- */
.combobox {
  position: relative;
}

.combo-trigger {
  width: 100%;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 0 10px 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.combo-trigger:hover {
  border-color: var(--primary);
}

.combobox.open .combo-trigger {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(44, 79, 255, 0.1);
}

.combo-trigger:disabled {
  background: var(--bg);
  color: var(--muted-2);
  cursor: not-allowed;
}

.combo-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combo-caret {
  color: var(--muted-2);
  font-size: 0.7rem;
  flex-shrink: 0;
}

.combo-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-hover);
  overflow: hidden;
}

.combo-search {
  width: 100%;
  height: 34px;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 0 10px;
  font-size: 0.84rem;
  font-family: inherit;
  outline: none;
}

.combo-options {
  list-style: none;
  margin: 0;
  padding: 4px;
  max-height: 220px;
  overflow-y: auto;
}

.combo-option {
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.combo-option:hover,
.combo-option.selected {
  background: var(--primary-faint);
  color: var(--primary);
}

.combo-group {
  padding: 9px 10px 3px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--muted-2);
}

.combo-empty {
  padding: 14px 10px;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}

.day-chips {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.day-chips::-webkit-scrollbar {
  display: none;
}

.day-chip {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: #4a4a54;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.day-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-faint);
}

.day-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 3px 8px rgba(44, 79, 255, 0.3);
}

.time-range {
  display: flex;
  align-items: center;
  gap: 6px;
}

.time-range select {
  flex: 1;
}

.time-sep {
  color: var(--muted-2);
}

/* ---------- 상태/결과 ---------- */
.status {
  min-height: 1.4rem;
  margin: 12px 4px 4px;
  font-size: 0.84rem;
  color: var(--muted);
}

.status.error {
  color: var(--pink);
}

.result-count {
  margin: 18px 4px 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}

.result-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.result-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: all 0.18s ease;
}

.result-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.card-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.card-title {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text-strong);
}

.card-code {
  color: var(--muted-2);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meta-item {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg);
  color: #4a4a54;
  font-size: 0.74rem;
  font-weight: 600;
}

.meta-item.classification {
  background: var(--primary);
  color: #fff;
}

.meta-item.classification.general {
  background: var(--primary-soft);
  color: var(--primary);
}

.meta-item.classification.chapel {
  background: var(--pink-soft);
  color: var(--pink);
}

.card-schedule {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 2px 0 0;
  font-size: 0.86rem;
  color: #4a4a54;
}

.schedule-line {
  display: flex;
  gap: 10px;
  margin: 0;
}

.schedule-day {
  min-width: 24px;
  font-weight: 800;
  color: var(--primary);
}

.schedule-time {
  min-width: 100px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.schedule-room {
  color: var(--muted);
}

.card-professor {
  margin: 0;
  font-size: 0.82rem;
  color: #4a4a54;
}

.card-target {
  margin: 0;
  font-size: 0.74rem;
  color: var(--muted-2);
}

.empty-state {
  padding: 48px 16px;
  text-align: center;
  color: var(--muted);
  background: var(--card);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

/* ---------- 푸터 ---------- */
.footer {
  background: #fff;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 26px 20px;
  display: flex;
  gap: 44px;
  flex-wrap: wrap;
  align-items: center;
}

.footer-inner p {
  margin: 0;
}

.footer-inner a:hover {
  color: var(--primary);
}

.footer-sep {
  margin: 0 8px;
  color: var(--border-strong);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 12px 20px;
  text-align: center;
  font-size: 0.74rem;
}

.footer-bottom p {
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 태블릿 ---------- */
@media (max-width: 900px) {
  .filter-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-inner {
    padding: 36px 16px 30px;
  }

  .search-card {
    padding: 18px;
  }

  .container {
    padding: 22px 14px 48px;
  }

  .topbar-inner,
  .footer-inner {
    padding-left: 14px;
    padding-right: 14px;
  }
}

/* ---------- 모바일 ---------- */
@media (max-width: 640px) {
  .topbar-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
  }

  .top-nav {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 0.86rem;
    border-top: 1px solid var(--border);
    padding-top: 10px;
  }

  .brand-text strong {
    font-size: 0.95rem;
  }

  .hero-inner {
    padding: 30px 14px 26px;
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  .hero-desc {
    font-size: 0.88rem;
  }

  .search-card {
    position: static;
    padding: 16px 14px;
  }

  .filter-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .field.span-2 {
    grid-column: span 1;
  }

  .day-chips {
    gap: 4px;
  }

  .day-chip {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    font-size: 0.8rem;
  }

  .target-inputs {
    flex-direction: column;
    gap: 6px;
  }

  .target-inputs select,
  .target-inputs .combobox {
    width: 100%;
  }

  .time-range {
    gap: 4px;
  }

  .result-card {
    padding: 14px;
  }

  .card-title {
    font-size: 0.96rem;
  }

  .search-row input {
    height: 44px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 18px;
  }
}

@media (max-width: 400px) {
  .top-nav .link-btn {
    flex: 1;
    text-align: center;
  }

  .schedule-time {
    min-width: 90px;
  }
}
