@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700;900&family=Pretendard:wght@300;400;500;600;700;800&display=swap');

/* ==========================================
   CSS Variables (Dark Theme)
========================================== */
:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-card: #1a1a1a;
  --bg-card-hover: #222222;
  --bg-glass: rgba(255,255,255,0.05);
  --bg-glass-hover: rgba(255,255,255,0.09);
  --border-color: rgba(255,255,255,0.08);
  --border-hover: rgba(251,191,36,0.4);
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #52525b;
  --accent-yellow: #fbbf24;
  --accent-yellow-dim: rgba(251,191,36,0.15);
  --accent-yellow-glow: rgba(251,191,36,0.3);
  --glow-blue: rgba(59,130,246,0.15);
  --glow-purple: rgba(147,51,234,0.15);
  --radius-card: 20px;
  --radius-pill: 50px;
  --shadow-card: 0 2px 16px rgba(0,0,0,0.6);
  --shadow-hover: 0 8px 40px rgba(0,0,0,0.8), 0 0 0 1px rgba(251,191,36,0.2);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   Reset & Base
========================================== */
*, *::before, *::after { box-sizing: border-box; }

html, body, div, ul, li, dl, dt, dd, ol, p, form {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Pretendard', 'Noto Sans KR', 'malgun gothic', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  /* Subtle radial glow background */
  background-image:
    radial-gradient(ellipse 80% 50% at 20% -10%, var(--glow-blue), transparent),
    radial-gradient(ellipse 60% 40% at 80% -5%, var(--glow-purple), transparent);
  background-attachment: fixed;
}

a { color: var(--text-secondary); text-decoration: none !important; transition: var(--transition); }
a:hover { color: var(--accent-yellow); text-decoration: none !important; }
img { border: 0; vertical-align: top; max-width: 100%; }
ul, li, ol { list-style: none; }


/* ==========================================
   Layout Wrap
========================================== */
#wrap {
  position: relative;
  margin: 0 auto;
  max-width: 1280px;
  padding: 0 20px 60px;
}


/* ==========================================
   Float Banner (우측 고정)
========================================== */
#r_bn {
  position: absolute;
  right: 10px !important;
  top: 60px;
  left: auto !important;
  z-index: 200;
}


/* ==========================================
   Top Area (Header)
========================================== */
#toparea {
  position: relative;
  text-align: center;
  margin: 0 0 40px 0;
  padding: 24px 0 20px;
  /* Glass nav feel */
  border-bottom: 1px solid var(--border-color);
}

#bn_top {
  position: relative;
  margin: 0 0 16px 0;
  text-align: center;
}

#top {
  position: relative;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

#toparea li { display: inline; }

/* Logo */
#logo {
  position: relative;
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
}

/* Search Bar — Yellow glow style */
#search {
  position: relative;
  margin: 0 auto;
  width: 42%;
  height: 56px;
  border-radius: var(--radius-pill);
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: var(--transition);
}

#search:focus-within {
  border-color: var(--border-hover);
  box-shadow: 0 0 0 3px var(--accent-yellow-dim), 0 4px 24px rgba(251,191,36,0.12);
}

#search form {
  height: 100%;
  width: 94%;
  margin: 0 auto;
  display: flex;
  align-items: center;
}

#search form input { border: 0; outline: none; background: transparent; }

#search form input.search-text {
  flex: 1;
  height: 100%;
  font-size: 15px;
  color: var(--text-primary);
  padding-left: 20px;
  font-family: inherit;
}

#search form input.search-text::placeholder { color: var(--text-muted); }

#search form input.search-icon {
  background: url(../img/search-icon.png) center center no-repeat;
  background-size: 20px;
  width: 36px;
  height: 36px;
  font-size: 0;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.2s;
  flex-shrink: 0;
  filter: invert(1);
}

#search form input.search-icon:hover { opacity: 0.9; }

/* Popular Keywords */
#best {
  position: relative;
  margin: 8px auto;
  padding: 0 10px;
  font-size: 13px;
  color: var(--text-muted);
}

#top_div {
  position: relative;
  height: 30px;
}


/* ==========================================
   Section Separator / Category Title
   (applied by tab_title inside tab_bg)
========================================== */
.section-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 4px;
  padding: 16px 0 4px;
  border-top: 1px solid var(--border-color);
}


/* ==========================================
   Data Section
========================================== */
#data {
  position: relative;
  clear: both;
  z-index: 100;
}

#data > .row > [class*="col-"] {
  margin-bottom: 20px;
}


/* ==========================================
   Tab Card Box (뉴스 목록 카드)
========================================== */
.tab_box {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-card);
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 22px 20px;
  transition: var(--transition);
  box-shadow: var(--shadow-card);
}

.tab_box:hover {
  background: var(--bg-glass-hover);
  border-color: rgba(251,191,36,0.25);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

/* Title bar with yellow left accent */
.tab_title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.3px;
}

.tab_title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: var(--accent-yellow);
  flex-shrink: 0;
}

.tab_title a,
.tab_title a:link,
.tab_title a:visited {
  color: var(--text-primary) !important;
  text-decoration: none !important;
}

.tab_title a:hover {
  color: var(--accent-yellow) !important;
  text-decoration: none !important;
}

.tab_box ul { padding: 6px 0 0; }

.tab_box li {
  width: 100%;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.tab_box li:last-child { border-bottom: none; }

.tab_box li a:link,
.tab_box li a:visited {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: var(--transition);
}

.tab_box li a:link::before {
  content: '▸';
  color: var(--text-muted);
  font-size: 10px;
  flex-shrink: 0;
  transition: var(--transition);
}

.tab_box li a:hover {
  color: var(--accent-yellow);
  padding-left: 4px;
}

.tab_box li a:hover::before { color: var(--accent-yellow); }


/* ==========================================
   Tab Background Cards (카테고리 카드)
========================================== */
.tab_bg {
  width: 100%;
  padding: 20px 18px;
  border-radius: var(--radius-card);
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: var(--transition);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

/* Subtle colored gradient per card (via pseudo-element) */
.tab_bg::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-card);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

.tab_bg > * { position: relative; z-index: 1; }

.tab_bg:hover {
  border-color: rgba(251,191,36,0.3);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.tab_bg:hover::before { opacity: 1; }

.tab_bg table { width: 100%; text-align: center; }
.tab_bg table td { background: none !important; color: var(--text-primary); }

/* Per-card accent tint (light color wash on dark) */
.tab_bg-1  .tab_bg::before { background: radial-gradient(circle at top left, rgba(250,233,130,0.08), transparent 70%); }
.tab_bg-2  .tab_bg::before { background: radial-gradient(circle at top left, rgba(96,165,250,0.1), transparent 70%); }
.tab_bg-3  .tab_bg::before { background: radial-gradient(circle at top left, rgba(52,211,153,0.1), transparent 70%); }
.tab_bg-4  .tab_bg::before { background: radial-gradient(circle at top left, rgba(248,113,113,0.1), transparent 70%); }
.tab_bg-5  .tab_bg::before { background: radial-gradient(circle at top left, rgba(134,239,172,0.1), transparent 70%); }
.tab_bg-6  .tab_bg::before { background: radial-gradient(circle at top left, rgba(167,243,208,0.08), transparent 70%); }
.tab_bg-7  .tab_bg::before { background: radial-gradient(circle at top left, rgba(253,224,71,0.10), transparent 70%); }
.tab_bg-8  .tab_bg::before { background: radial-gradient(circle at top left, rgba(74,222,128,0.10), transparent 70%); }
.tab_bg-9  .tab_bg::before { background: radial-gradient(circle at top left, rgba(167,139,250,0.12), transparent 70%); }
.tab_bg-10 .tab_bg::before { background: radial-gradient(circle at top left, rgba(94,234,212,0.10), transparent 70%); }
.tab_bg-11 .tab_bg::before { background: radial-gradient(circle at top left, rgba(200,200,200,0.07), transparent 70%); }
.tab_bg-12 .tab_bg::before { background: radial-gradient(circle at top left, rgba(125,211,252,0.10), transparent 70%); }
.tab_bg-13 .tab_bg::before { background: radial-gradient(circle at top left, rgba(216,180,254,0.12), transparent 70%); }
.tab_bg-14 .tab_bg::before { background: radial-gradient(circle at top left, rgba(96,165,250,0.12), transparent 70%); }
.tab_bg-15 .tab_bg::before { background: radial-gradient(circle at top left, rgba(52,211,153,0.12), transparent 70%); }
.tab_bg-16 .tab_bg::before { background: radial-gradient(circle at top left, rgba(134,239,172,0.12), transparent 70%); }
.tab_bg-17 .tab_bg::before { background: radial-gradient(circle at top left, rgba(253,186,116,0.12), transparent 70%); }
.tab_bg-18 .tab_bg::before { background: radial-gradient(circle at top left, rgba(216,180,254,0.15), transparent 70%); }
.tab_bg-19 .tab_bg::before { background: radial-gradient(circle at top left, rgba(148,163,184,0.08), transparent 70%); }
.tab_bg-20 .tab_bg::before { background: radial-gradient(circle at top left, rgba(103,232,249,0.12), transparent 70%); }
.tab_bg-21 .tab_bg::before { background: radial-gradient(circle at top left, rgba(129,140,248,0.12), transparent 70%); }
.tab_bg-22 .tab_bg::before { background: radial-gradient(circle at top left, rgba(74,222,128,0.12), transparent 70%); }
.tab_bg-23 .tab_bg::before { background: radial-gradient(circle at top left, rgba(251,191,36,0.12), transparent 70%); }
.tab_bg-24 .tab_bg::before { background: radial-gradient(circle at top left, rgba(248,113,113,0.12), transparent 70%); }
.tab_bg-25 .tab_bg::before { background: radial-gradient(circle at top left, rgba(167,139,250,0.15), transparent 70%); }
.tab_bg-26 .tab_bg::before { background: radial-gradient(circle at top left, rgba(148,163,184,0.10), transparent 70%); }
.tab_bg-27 .tab_bg::before { background: radial-gradient(circle at top left, rgba(163,230,53,0.10), transparent 70%); }
.tab_bg-28 .tab_bg::before { background: radial-gradient(circle at top left, rgba(200,200,200,0.08), transparent 70%); }
.tab_bg-29 .tab_bg::before { background: radial-gradient(circle at top left, rgba(192,132,252,0.12), transparent 70%); }
.tab_bg-30 .tab_bg::before { background: radial-gradient(circle at top left, rgba(52,211,153,0.12), transparent 70%); }
.tab_bg-31 .tab_bg::before { background: radial-gradient(circle at top left, rgba(251,191,36,0.12), transparent 70%); }
.tab_bg-32 .tab_bg::before { background: radial-gradient(circle at top left, rgba(96,165,250,0.12), transparent 70%); }


/* ==========================================
   Banner Box
========================================== */
.bn { position: relative; float: left; clear: both; width: 100%; text-align: center; }
.bn li { float: left; display: inline; }
.bn_box {
  margin: 4px 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}


/* ==========================================
   Footer
========================================== */
#footer {
  position: relative;
  text-align: center;
  clear: both;
  margin-top: 60px;
  padding-top: 32px;
  border-top: 1px solid var(--border-color);
}

#copyright {
  position: relative;
  padding: 20px 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 2;
}


/* ==========================================
   Font Utilities
========================================== */
.sp-1        { letter-spacing: -1px; }
.ft_bold     { font-weight: 700; }
.ft11        { font-size: 11px; }
.ft12        { font-size: 12px; }
.ft15        { font-size: 15px; }
.ft_000000   { color: var(--text-primary); }
.ft_000000 a { color: var(--text-primary); }
.ft_line18   { line-height: 18px; }
.link_deco:hover { text-decoration: underline; color: var(--accent-yellow); }
.dot         { width: 100%; }

.line_e7e7e7 { position: relative; background: #2a2a2a; }
.line_2b2b2b { position: relative; background: #2b2b2b; }
.line_dddddd { position: relative; background: #2a2a2a; }
.line_e0e0e0 { position: relative; background: #262626; }


/* ==========================================
   Scrollbar Styling (Dark)
========================================== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #555; }


/* ==========================================
   Responsive Breakpoints
========================================== */

/* Tablet (~991px) */
@media (max-width: 991px) {
  #search { width: 65%; }
  .tab_box { padding: 18px 16px; }
  .tab_title { font-size: 15px; }
  .tab_box li a:link,
  .tab_box li a:visited { font-size: 13px; }
}

/* Mobile (~767px) */
@media (max-width: 767px) {
  #wrap { padding: 0 10px 40px; }
  #r_bn { display: none !important; }
  #toparea { margin: 0 0 16px; padding: 16px 0 12px; }
  #search { width: 94%; height: 48px; }
  #search form input.search-text { font-size: 14px; }
  #top_div { display: none; }

  /* Bootstrap grid (col-12) will handle columns */
  #data > .row > [class*="col-"] { margin-bottom: 0px; }

  .tab_box { padding: 18px 16px; border-radius: 16px; }
  .tab_title { font-size: 18px; margin-bottom: 10px; }
  .tab_box li { padding: 10px 0; }
  .tab_box li a:link, .tab_box li a:visited { font-size: 15px; }
  .tab_bg { padding: 18px 16px; border-radius: 16px; }
}

/* Small Mobile (~480px) */
@media (max-width: 480px) {
  #search { width: 100%; height: 50px; }
  #logo img { max-height: 52px; width: auto; }
  
  .tab_box { padding: 16px 14px; border-radius: 14px; }
  .tab_bg { padding: 16px 14px; border-radius: 14px; }
  .tab_title { font-size: 18px; gap: 8px; margin-bottom: 10px; }
  .tab_title::before { height: 16px; width: 3px; }
  .tab_box li { padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.03); }
  .tab_box li a:link, .tab_box li a:visited { font-size: 15px; padding-left: 2px; }
  .bn_box { border-radius: 12px; }
}

/* ==========================================
   New Utils for Bootstrap Enhancement
========================================== */
.hover-scale { transition: transform 0.3s ease; }
.hover-scale:hover { transform: scale(1.05); }

#search form input.search-text::placeholder { color: var(--text-muted); }
#search form input.search-icon {
  background: url(../img/search-icon.png) center center no-repeat;
  background-size: 22px;
}
#search form input.search-icon:hover { opacity: 0.8 !important; }