html {
  color-scheme: light dark;
}

:root {
  --edu-blue: #003d7a;
  --edu-light: #0066cc;
  --edu-accent: #e8f4fd;

  /* 라이트 테마 변수 (기존 색상 그대로) */
  --bg: #f4f6f9;
  --card-bg: #ffffff;
  --card-border: transparent;
  --card-shadow: 0 2px 12px rgba(0,0,0,0.08);
  --card-shadow-hover: 0 6px 20px rgba(0,0,0,0.12);
  --card-shadow-sm: 0 1px 8px rgba(0,0,0,0.07);
  --card-text: #222;
  --card-subtext: #888;

  --header-card-bg: #ffffff;
  --header-card-border: var(--edu-accent);
  --header-card-text: var(--edu-blue);

  --list-border: #f0f0f0;
  --list-hover-bg: var(--edu-accent);
  --list-date: #aaa;

  --section-divider: #f5f5f5;
  --tab-inactive-bg: #f8f9fa;
  --tab-inactive-text: #555;

  --faq-text: #555;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220;
    --card-bg: #1a2538;
    --card-border: #2a3a55;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --card-shadow-hover: 0 4px 14px rgba(0, 0, 0, 0.45);
    --card-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --card-text: #e5e9f0;
    --card-subtext: #94a3b8;

    --header-card-bg: #1a2538;
    --header-card-border: #2a3a55;
    --header-card-text: #93c5fd;

    --list-border: #2a3a55;
    --list-hover-bg: #243149;
    --list-date: #6b7a91;
  }
}

body { font-family: 'Noto Sans KR', sans-serif; background: var(--bg); color: var(--card-text); transition: background 0.3s ease, color 0.3s ease; }

/* AdminLTE의 .wrapper / .content-wrapper가 자체 배경을 박아두므로 변수로 덮어씀 */
.wrapper,
.content-wrapper,
body.layout-top-nav { background: var(--bg) !important; transition: background 0.3s ease; }

/* ── Navbar ── */
.main-header.navbar {
  background: var(--edu-blue) !important;
  border-bottom: 3px solid var(--edu-light);
}
.main-header .navbar-brand {
  color: #fff !important;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.3px;
}
.main-header .navbar-brand .brand-edu { color: #7ec8f7; }
.navbar-nav .nav-link {
  color: rgba(255,255,255,0.85) !important;
  font-size: 0.88rem;
  padding: 0.5rem 0.9rem !important;
  border-radius: 4px;
  transition: background 0.15s;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  background: rgba(255,255,255,0.15) !important;
  color: #fff !important;
}
.navbar-nav .nav-link i { margin-right: 4px; }
.navbar-nav .nav-link { white-space: nowrap; }

/* ── Navbar 드롭다운 (테마/언어) ── */
.main-header .dropdown-menu {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border, rgba(0,0,0,0.08));
  box-shadow: var(--card-shadow-sm);
}
.main-header .dropdown-item {
  color: var(--card-text);
  font-size: 0.88rem;
}
.main-header .dropdown-item:hover,
.main-header .dropdown-item:focus {
  background-color: var(--list-hover-bg);
  color: var(--card-text);
}
.main-header .dropdown-item.active,
.main-header .dropdown-item:active {
  background-color: var(--edu-light);
  color: #fff;
}

/* ── Hero ── */
.hero-section {
  background: linear-gradient(135deg, var(--edu-blue) 0%, #0055aa 60%, #0080cc 100%);
  color: #fff;
  padding: 52px 0 44px;
  text-align: center;
}
.hero-section .eduroam-logo {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -1px;
}
.hero-section .eduroam-logo span { color: #7ec8f7; }
.hero-section .sub {
  font-size: 1rem;
  opacity: 0.85;
  margin-top: 6px;
}
.hero-section .hero-btn {
  margin-top: 22px;
  background: #fff;
  color: var(--edu-blue);
  border: none;
  border-radius: 24px;
  padding: 10px 32px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(0,0,0,0.15);
  transition: transform 0.15s, box-shadow 0.15s;
  text-decoration: none;
  display: inline-block;
}
.hero-section .hero-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
  color: var(--edu-blue);
  text-decoration: none;
}

/* ── Page Hero (sub pages) ── */
.page-hero {
  background: linear-gradient(135deg, var(--edu-blue) 0%, #0055aa 100%);
  color: #fff;
  padding: 36px 0 30px;
}
.page-hero h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 6px;
}
.page-hero .page-sub {
  font-size: 0.9rem;
  opacity: 0.8;
  margin: 0;
}

/* ── 퀵 카드 ── */
.quick-cards {
  /* Bootstrap 5 gutter 패턴 — 값을 바꾸면 카드 사이 좌우 여백이 조정됨
     https://getbootstrap.com/docs/5.0/layout/gutters/ */
  --bs-gutter-x: 1.45rem;
  margin-top: -28px;
  margin-left: calc(var(--bs-gutter-x) * -0.5);
  margin-right: calc(var(--bs-gutter-x) * -0.5);
}
.quick-cards > [class*="col-"] {
  padding-left: calc(var(--bs-gutter-x) * 0.5);
  padding-right: calc(var(--bs-gutter-x) * 0.5);
}
.quick-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  padding: 22px 16px;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.15s, background 0.3s ease, border-color 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  display: block;
  color: inherit;
}
.quick-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-hover);
  text-decoration: none;
  color: inherit;
}
.quick-card .icon { font-size: 1.9rem; color: var(--edu-light); margin-bottom: 10px; }
.quick-card .title { font-weight: 700; font-size: 0.9rem; color: var(--card-text); }
.quick-card .desc { font-size: 0.76rem; color: var(--card-subtext); margin-top: 4px; line-height: 1.4; }

/* ── 카드 공통 ── */
.card {
  background: var(--card-bg);
  border-radius: 8px;
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow-sm);
  transition: background 0.3s ease, border-color 0.3s ease;
}
.card-header {
  background: var(--header-card-bg);
  border-bottom: 2px solid var(--header-card-border);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--header-card-text);
  padding: 12px 18px;
  border-radius: 8px 8px 0 0 !important;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
.card-header i { margin-right: 6px; color: var(--edu-light); }

/* ── 공지 리스트 ── */
.notice-list { list-style: none; margin: 0; padding: 0; }
.notice-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 18px;
  font-size: 0.83rem;
  border-bottom: 1px solid var(--list-border);
  color: var(--card-text);
  cursor: pointer;
  transition: background 0.12s, border-color 0.3s ease;
}
.notice-list li:last-child { border-bottom: none; }
.notice-list li:hover { background: var(--list-hover-bg); }
.notice-list .badge-new {
  background: var(--edu-light);
  color: #fff;
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 10px;
  margin-right: 6px;
}
.notice-list .date { color: var(--list-date); font-size: 0.75rem; flex-shrink: 0; margin-left: 8px; }

/* ── 도움말 리스트 ── */
.help-list { list-style: none; margin: 0; padding: 0; }
.help-list li {
  padding: 9px 18px;
  font-size: 0.83rem;
  border-bottom: 1px solid var(--list-border);
  color: var(--card-text);
  cursor: pointer;
  transition: background 0.12s, border-color 0.3s ease;
}
.help-list li:last-child { border-bottom: none; }
.help-list li:hover { background: var(--list-hover-bg); }
.help-list li i { font-size: 0.7rem; color: var(--list-date); margin-right: 6px; }

/* ── 콘텐츠 섹션 ── */
.content-section { padding: 32px 0; }
.section-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  box-shadow: var(--card-shadow-sm);
  padding: 28px 32px;
  margin-bottom: 20px;
  transition: background 0.3s ease, border-color 0.3s ease;
}
.section-card h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--header-card-text);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--header-card-border);
}
.section-card h2 i { margin-right: 8px; color: var(--edu-light); }
.step-list { list-style: none; padding: 0; margin: 0; }
.step-list li {
  display: flex;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--section-divider);
  color: var(--card-text);
  font-size: 0.88rem;
}
.step-list li:last-child { border-bottom: none; }
.step-num {
  background: var(--edu-light);
  color: #fff;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 12px;
  margin-top: 1px;
}
.os-tab .nav-link {
  color: var(--tab-inactive-text) !important;
  font-size: 0.85rem;
  padding: 8px 18px !important;
  background: var(--tab-inactive-bg);
  border-radius: 0 !important;
  transition: background 0.3s ease, color 0.3s ease;
}
.os-tab .nav-link.active {
  background: var(--edu-blue) !important;
  color: #fff !important;
}
.faq-item {
  border-bottom: 1px solid var(--list-border);
  padding: 14px 0;
}
.faq-item:last-child { border-bottom: none; }
.faq-q {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--header-card-text);
  margin-bottom: 6px;
}
.faq-q i { margin-right: 6px; color: var(--edu-light); }
.faq-a {
  font-size: 0.83rem;
  color: var(--faq-text);
  line-height: 1.6;
  padding-left: 22px;
}

/* ── Footer ── */
.main-footer {
  background: var(--edu-blue);
  color: rgba(255,255,255,0.6);
  font-size: 0.78rem;
  padding: 14px 24px;
  text-align: center;
}
.main-footer a { color: rgba(255,255,255,0.7); text-decoration: none; }
.main-footer a:hover { color: #fff; }
.main-footer .divider { margin: 0 8px; }

/* ============================================================
   다크 미드나잇 테마
   - 시스템 다크모드(prefers-color-scheme)에 자동 반응
   - [data-theme="light"]/[data-theme="dark"]로 수동 오버라이드 가능
   ============================================================ */
[data-theme="dark"] {
  --bg: #0b1220;
  --card-bg: #1a2538;
  --card-border: #2a3a55;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.3);
  --card-shadow-hover: 0 4px 14px rgba(0,0,0,0.45);
  --card-shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --card-text: #e5e9f0;
  --card-subtext: #94a3b8;

  --header-card-bg: #1a2538;
  --header-card-border: #2a3a55;
  --header-card-text: #93c5fd;

  --list-border: #2a3a55;
  --list-hover-bg: #243149;
  --list-date: #6b7a91;

  --section-divider: #243149;
  --tab-inactive-bg: #1a2538;
  --tab-inactive-text: #94a3b8;

  --faq-text: #c9d1de;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220;
    --card-bg: #1a2538;
    --card-border: #2a3a55;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.3);
    --card-shadow-hover: 0 4px 14px rgba(0,0,0,0.45);
    --card-shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --card-text: #e5e9f0;
    --card-subtext: #94a3b8;

    --header-card-bg: #1a2538;
    --header-card-border: #2a3a55;
    --header-card-text: #93c5fd;

    --list-border: #2a3a55;
    --list-hover-bg: #243149;
    --list-date: #6b7a91;

    --section-divider: #243149;
    --tab-inactive-bg: #1a2538;
    --tab-inactive-text: #94a3b8;

    --faq-text: #c9d1de;
  }
}
