/* ===================================
   장학금정보센터 - 커스텀 스타일
   =================================== */

/* 폰트 기본 설정 */
:root {
  --font-base: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans KR", sans-serif;
  --color-primary: #1a56db;
  --color-success: #057a55;
  --radius-card: 12px;
  --shadow-card: 0 2px 12px rgba(0,0,0,.08);
  --transition: .2s ease;
}

* { box-sizing: border-box; }
body {
  font-family: var(--font-base);
  font-size: 15px;
  color: #1a202c;
  line-height: 1.7;
  background: #f8fafc;
}

/* ── 네비게이션 ── */
#mainNav {
  border-bottom: 1px solid #e2e8f0;
  transition: box-shadow var(--transition);
}
#mainNav.scrolled { box-shadow: 0 4px 20px rgba(0,0,0,.08) !important; }
#mainNav .navbar-brand { font-size: 1rem; }
#mainNav .nav-link {
  font-weight: 500;
  color: #374151;
  padding: .5rem .8rem;
  border-radius: 6px;
  transition: background var(--transition), color var(--transition);
}
#mainNav .nav-link:hover,
#mainNav .nav-link.active {
  color: var(--color-primary) !important;
  background: #eff6ff;
}

/* ── 상단 알림바 ── */
.top-bar { font-size: 12px; letter-spacing: .02em; }

/* ── 히어로 ── */
.hero-section {
  background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fd 50%, #f0f7f4 100%);
  border-bottom: 1px solid #e2e8f0;
}
.hero-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.02em;
}
.hero-desc { font-size: 1rem; max-width: 540px; }
.hero-search .form-control { font-size: 1rem; padding: .65rem 1rem; }
.hero-illustration { opacity: .08; }

/* ── 통계 카드 ── */
.stat-card {
  border-radius: var(--radius-card) !important;
  transition: transform var(--transition), box-shadow var(--transition);
  background: #fff;
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}

/* ── 장학금 카드 ── */
.scholarship-card {
  border-radius: var(--radius-card) !important;
  transition: transform var(--transition), box-shadow var(--transition);
  background: #fff;
}
.scholarship-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0,0,0,.12) !important;
}
.scholarship-card .card-title {
  font-size: .95rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.scholarship-card .content-preview {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #6b7280;
}

/* ── 배지 커스텀 ── */
.bg-primary-soft { background: #eff6ff !important; }
.bg-success-soft { background: #f0fdf4 !important; }
.opacity-60 { opacity: .6; }

/* ── 섹션 헤더 ── */
.section-title {
  font-size: 1.4rem;
  font-weight: 700;
}

/* ── 풋터 ── */
.footer {
  background: #1e293b;
  color: #cbd5e1;
  font-size: 13.5px;
}
.footer p,
.footer li,
.footer small,
.footer .text-muted { color: #cbd5e1 !important; }
.footer .fw-semibold,
.footer h6 { color: #f1f5f9 !important; font-size: 13px; }
.footer-link {
  color: #cbd5e1;
  text-decoration: none;
  transition: color var(--transition);
}
.footer-link:hover { color: #ffffff; }
.footer hr { border-color: #475569; }

/* ── 페이지네이션 (STEP 11: 터치 타겟 44px 보장) ── */
.pagination .page-link {
  border-radius: 8px !important;
  margin: 0 2px;
  border-color: #e2e8f0;
  color: #374151;
  font-size: 14px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pagination .page-item.active .page-link {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

/* ── 테이블 ── */
.table th { font-weight: 600; font-size: 13.5px; }
.table-hover tbody tr:hover { background: #f8faff; }

/* ── 상세 페이지 ── */
.policy-content h5 { color: #1e293b; }
.policy-content ul { padding-left: 1.4rem; }
.policy-content li { margin-bottom: .4rem; }

/* ── 검색 폼 ── */
.card .form-control:focus,
.card .form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 .2rem rgba(26,86,219,.15);
}

/* ── 브레드크럼 ── */
.breadcrumb { font-size: 13px; }
.breadcrumb-item a { color: var(--color-primary); text-decoration: none; }
.breadcrumb-item a:hover { text-decoration: underline; }

/* ── 아코디언(FAQ) ── */
.accordion-button:not(.collapsed) {
  background: #eff6ff;
  color: var(--color-primary);
  box-shadow: none;
}
.accordion-button:focus { box-shadow: none; }

/* ── 반응형 테이블 ── */
@media (max-width: 768px) {
  .table-responsive-stack thead { display: none; }
  .table-responsive-stack tr {
    display: block;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
  }
  .table-responsive-stack td {
    display: flex;
    justify-content: space-between;
    padding: .6rem 1rem;
    font-size: 13px;
  }
  .table-responsive-stack td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #374151;
    margin-right: 1rem;
    flex-shrink: 0;
  }
}

/* ── 스크롤 애니메이션 ── */
.fade-in-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .5s ease, transform .5s ease;
}
.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── 모바일 최적화 ── */
@media (max-width: 576px) {
  .hero-title { font-size: 1.6rem; }
  .hero-search .input-group { flex-direction: column; gap: .5rem; }
  .scholarship-card .card-body { padding: 1rem !important; }
  .section-title { font-size: 1.2rem; }
}

/* ── STEP 11: 모바일 버튼 최소 크기 보장 ── */
@media (max-width: 768px) {
  .btn-sm {
    min-height: 40px;
    padding: .4rem .9rem;
    font-size: 14px;
  }
}

/* ── skip-to-content 링크 ── */
.skip-link:focus {
  position: fixed !important;
  top: 0;
  left: 0;
  z-index: 9999;
  padding: .5rem 1rem;
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  border-radius: 0 0 8px 0;
}

/* ── 소셜 공유 버튼 ── */
.share-buttons .btn {
  border-radius: 20px;
}

/* ── 버튼 ── */
.btn { font-weight: 500; border-radius: 8px; }
.btn-primary { background: var(--color-primary); border-color: var(--color-primary); }
.btn-primary:hover { background: #1648c3; border-color: #1648c3; }

/* ── 카드 공통 ── */
.card { border-radius: var(--radius-card) !important; }

/* ── 스크롤바 ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
