/* ============================================================
   Mail Security Gateway - LIGHT 테마 오버라이드
   File: /opt/mail-gateway/web_ui/static/css/theme.css

   템플릿 전반에 하드코딩된 다크 유틸리티(.bg-dark/.text-white/
   .table-dark/.navbar-dark/.dropdown-menu-dark 등)를
   html[data-bs-theme="light"] 일 때 라이트 팔레트로 재정의한다.
   style.css(또는 각 페이지 인라인 :root)보다 나중에 로드할 것.
   ============================================================ */

[data-bs-theme="light"] {
  --bg-dark:   #f6f8fa;
  --bg-card:   #ffffff;
  --border:    #d0d7de;
  --fg:        #1f2328;
  --fg-muted:  #57606a;
  --bg-active: #eaeef2;
}

/* ── 다크 유틸리티 재정의 ── */
[data-bs-theme="light"] .text-white       { color: var(--fg) !important; }
[data-bs-theme="light"] .text-light      { color: var(--fg) !important; }
[data-bs-theme="light"] .bg-dark          { background-color: var(--bg-card) !important; }
[data-bs-theme="light"] .border-secondary { border-color: var(--border) !important; }
[data-bs-theme="light"] .btn-close-white  { filter: none; }

/* pre 코드 블록: 흰 카드 위에서 구분되도록 옅은 회색 배경 */
[data-bs-theme="light"] pre.bg-dark { background-color: var(--bg-dark) !important; }

/* 콘솔 스타일 블록(.bg-black)은 양 테마 모두 다크 유지 — 내부 밝은 텍스트 복원 */
[data-bs-theme="light"] .bg-black.text-white,
[data-bs-theme="light"] .bg-black .text-white { color: #ffffff !important; }
[data-bs-theme="light"] .bg-black.text-light,
[data-bs-theme="light"] .bg-black .text-light { color: #f8f9fa !important; }

[data-bs-theme="light"] .navbar-dark {
  --bs-navbar-color:              rgba(31, 35, 40, 0.65);
  --bs-navbar-hover-color:        rgba(31, 35, 40, 0.85);
  --bs-navbar-active-color:       #1f2328;
  --bs-navbar-brand-color:        #1f2328;
  --bs-navbar-brand-hover-color:  #1f2328;
  --bs-navbar-disabled-color:     rgba(31, 35, 40, 0.3);
  --bs-navbar-toggler-border-color: rgba(31, 35, 40, 0.15);
}

[data-bs-theme="light"] .table-dark {
  --bs-table-color:        var(--fg);
  --bs-table-bg:           var(--bg-card);
  --bs-table-border-color: var(--border);
  --bs-table-striped-bg:   #f6f8fa;
  --bs-table-striped-color: var(--fg);
  --bs-table-active-bg:    var(--bg-active);
  --bs-table-active-color: var(--fg);
  --bs-table-hover-bg:     rgba(0, 0, 0, 0.04);
  --bs-table-hover-color:  var(--fg);
}

[data-bs-theme="light"] .dropdown-menu-dark {
  --bs-dropdown-bg:                var(--bg-card);
  --bs-dropdown-color:             var(--fg);
  --bs-dropdown-border-color:      var(--border);
  --bs-dropdown-link-color:        var(--fg);
  --bs-dropdown-link-hover-color:  var(--fg);
  --bs-dropdown-link-hover-bg:     #f3f4f6;
  --bs-dropdown-link-active-color: #ffffff;
  --bs-dropdown-link-active-bg:    #0d6efd;
  --bs-dropdown-divider-bg:        var(--border);
  --bs-dropdown-header-color:      var(--fg-muted);
}

/* ── 관리자 사이드바 / 공통 컴포넌트 (style.css 대응) ── */
[data-bs-theme="light"] .sidebar .nav-link:hover  { background: rgba(0, 0, 0, 0.05); }
[data-bs-theme="light"] .sidebar .nav-link.active {
  background: rgba(13, 110, 253, 0.12);
  color: #0d6efd !important;
}
[data-bs-theme="light"] .nav-group-btn              { color: var(--fg-muted); }
[data-bs-theme="light"] .nav-group-btn:hover        { color: var(--fg); }
[data-bs-theme="light"] .nav-group-btn.active-group { color: #0d6efd; }
[data-bs-theme="light"] .card-header                { background: rgba(0, 0, 0, 0.02); }
[data-bs-theme="light"] .table th                   { color: var(--fg-muted); }
[data-bs-theme="light"] .pagination .page-link      { color: var(--fg-muted); }
[data-bs-theme="light"] ::-webkit-scrollbar-thumb:hover { background: #afb8c1; }

/* ── 로그인 페이지 CAPTCHA (라이트 배경 대비 확보) ── */
[data-bs-theme="light"] .captcha-question { color: #9a6700; }
