/* ─────────────────────────────────────────
   RESET, THEME VARIABLES & GLOBAL
───────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --text-main: #0f172a;
  --text-muted: #334155;
  --text-light: #64748b;
  --accent-color: #0ea5e9;
  --accent-hover: #0284c7;
  --border-color: #e2e8f0;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.05);
  --shadow-md: 0 10px 25px -5px rgba(0,0,0,0.1);
  --font-family: 'Plus Jakarta Sans', sans-serif;
}

html, body {
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
}

body {
  background: var(--bg-body);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 18px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

::selection { background: var(--accent-color); color: #ffffff; }
a { text-decoration: none; color: inherit; transition: color 0.2s ease; }

/* ─────────────────────────────────────────
   GLASSMORPHISM NAVBAR & DROPDOWN
───────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  z-index: 2000;
  padding: 15px 5%;
}

.nav-content {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.5px; }
.brand span { color: var(--accent-color); }

.nav-links { display: flex; align-items: center; gap: 15px; }
.nav-link { font-size: 1rem; font-weight: 700; color: var(--text-main); transition: color 0.3s ease; display: inline-block; padding: 5px 0; }
.nav-link:hover, .nav-link.active { color: var(--accent-color); }
.nav-divider { color: #cbd5e1; font-weight: 400; user-select: none; }

.dropdown { position: relative; display: inline-block; }
.dropdown-trigger { font-size: 1rem; font-weight: 700; color: var(--text-main); cursor: pointer; transition: color 0.3s ease; padding: 5px 0; display: flex; align-items: center; gap: 4px; }
.dropdown-trigger.active, .dropdown:hover .dropdown-trigger { color: var(--accent-color); }
.dropdown-trigger::after { content: '▾'; font-size: 0.8rem; transition: transform 0.2s ease; }
.dropdown:hover .dropdown-trigger::after { transform: rotate(180deg); }

.dropdown-content {
  opacity: 0;
  visibility: hidden;
  position: absolute;
  right: 0;
  top: 100%;
  background-color: var(--bg-surface);
  min-width: 180px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  z-index: 2500;
  padding: 6px 0;
  margin-top: 8px;
  transform: translateY(10px);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.dropdown-content::before { content: ''; position: absolute; left: 0; right: 0; top: -12px; height: 12px; background: transparent; }
.dropdown-content a { color: var(--text-main); padding: 10px 16px; display: block; font-size: 0.95rem; font-weight: 600; text-align: left; transition: all 0.2s ease; }
.dropdown-content a:hover { background-color: #f8fafc; color: var(--accent-color); padding-left: 20px; }
.dropdown:hover .dropdown-content { opacity: 1; visibility: visible; transform: translateY(0); }

/* Hamburger */
.hamburger {
  display: none; flex-direction: column; gap: 5px; background: #fff; border: none; cursor: pointer; padding: 8px; border-radius: 8px; position: fixed; top: 18px; right: 18px; z-index: 10001;
}
.hamburger span { display: block; width: 24px; height: 3px; background: #111827; border-radius: 3px; transition: .3s; }

/* ─────────────────────────────────────────
   LIVE SEARCH COMPONENT
───────────────────────────────────────── */
.search-btn { background: none; border: none; font-size: 20px; cursor: pointer; padding: 6px; color: var(--text-main); transition: color 0.3s; }
.search-btn:hover { color: var(--accent-color); }
.search-bar-wrapper { display: none; background: #fff; padding: 20px 5%; border-bottom: 1px solid var(--border-color); box-shadow: 0 1px 3px rgba(0,0,0,.05); position: relative; z-index: 1500; }
.search-bar-wrapper.active { display: block; animation: slideDown 0.3s ease-out forwards; }
@keyframes slideDown { from { transform: translateY(-10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.search-container { max-width: 800px; margin: 0 auto; position: relative; }
.search-container input { width: 100%; padding: 15px 20px; font-size: 1rem; border: 2px solid var(--border-color); border-radius: 8px; outline: none; transition: .3s; }
.search-container input:focus { border-color: var(--accent-color); box-shadow: 0 0 0 4px rgba(14,165,233,.12); }

.live-results {
  position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid var(--border-color); border-top: none; border-radius: 0 0 8px 8px; box-shadow: var(--shadow-md); max-height: 350px; overflow-y: auto; display: none; z-index: 2000;
}
.result-item { display: flex; flex-direction: column; padding: 12px 20px; border-bottom: 1px solid #f1f5f9; transition: background 0.2s; }
.result-item:hover { background: #f8fafc; }
.result-title { font-weight: 700; font-size: 0.95rem; color: var(--text-main); }
.result-meta { font-size: 0.8rem; color: #64748b; margin-top: 4px; }
.no-results { padding: 15px 20px; text-align: center; color: #64748b; font-size: 0.95rem; }

/* ─────────────────────────────────────────
   LIVE MARKET TICKER
───────────────────────────────────────── */
.market-ticker-wrapper { background: rgba(255, 255, 255, 0.95); border-bottom: 1px solid var(--border-color); overflow: hidden; white-space: nowrap; padding: 10px 0; display: flex; align-items: center; font-size: 0.85rem; position: relative; z-index: 990; box-shadow: 0 1px 3px rgba(0,0,0,0.02); }
.market-ticker-track { display: inline-flex; gap: 30px; padding-left: 100%; animation: tickerScroll 35s linear infinite; }
.market-ticker-wrapper:hover .market-ticker-track { animation-play-state: paused; }
.ticker-item { display: inline-flex; align-items: center; gap: 8px; background: #f8fafc; padding: 5px 14px; border-radius: 30px; border: 1px solid var(--border-color); }
.ticker-name { color: var(--text-light); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.ticker-price { color: var(--text-main); font-weight: 800; }
.ticker-up { color: #10b981; font-weight: 800; }
.ticker-down { color: #ef4444; font-weight: 800; }
.ticker-neutral { color: #64748b; font-weight: 600; }
.ticker-loading { color: var(--text-light); font-weight: 600; padding-left: 20px; }
@keyframes tickerScroll { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }

/* ─────────────────────────────────────────
   ADSENSE & BANNERS
───────────────────────────────────────── */
.ad-banner-top { width: 100%; max-width: 1280px; margin: 20px auto 40px; padding: 0 5%; overflow: hidden; display: block; }
.ad-box { width: 100%; min-height: 320px; display: flex; flex-direction: column; justify-content: center; align-items: center; background: #fafafa; border: 1px solid #e5e7eb; border-radius: 12px; margin: 30px 0; padding: 18px; }
.ad-label { font-size: 12px; font-weight: 700; color: #888; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 12px; }
.ad-box ins.adsbygoogle { display: block; width: 100%; max-width: 100%; }
.mobile-footer-ad { width: 100%; background: var(--bg-surface); border-top: 1px solid var(--border-color); padding: 20px 5%; text-align: center; margin-top: auto; overflow: hidden; }

/* ─────────────────────────────────────────
   MAIN LAYOUT & ARTICLE
───────────────────────────────────────── */
.main-layout { max-width: 1280px; width: 100%; margin: 0 auto 60px; padding: 0 5%; display: grid; grid-template-columns: 1fr 320px; gap: 50px; align-items: start; flex-grow: 1; overflow: hidden; }
article { width: 100%; max-width: 100%; overflow: hidden; }

.category-badge { display: inline-flex; align-items: center; gap: 6px; background: #0ea5e9; color: #fff; padding: 8px 18px; border-radius: 50px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 18px; transition: .25s; }
.category-badge:hover { background: #0284c7; transform: translateY(-2px); color: #fff; }

.article-header { margin-bottom: 30px; }
.article-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; margin-bottom: 22px; font-size: 14px; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: .4px; }
.article-meta .author { display: flex; align-items: center; color: #111827; font-weight: 700; }
.article-meta .badge { background: #eef6ff; color: #0284c7; padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: 13px; }
.article-meta time { color: #6b7280; font-weight: 600; }
.article-meta > *:not(:last-child)::after { content: "•"; color: #cbd5e1; margin-left: 18px; font-weight: 400; }
.article-meta .badge::after { content: none !important; }

.article-title { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.2; color: var(--text-main); margin-bottom: 30px; }
.article-summary { font-size: 1.15rem; line-height: 1.8; color: #555; margin-bottom: 30px; }
.article-image { width: 100%; height: auto; border-radius: var(--radius-lg); border: 1px solid var(--border-color); box-shadow: var(--shadow-md); margin-bottom: 40px; display: block; }

/* Post Body Consolidated */
.post-body { color: var(--text-muted); font-size: 1.1rem; width: 100%; max-width: 100%; overflow: hidden; overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; }
.post-body p { margin-bottom: 1.8em; }
.post-body h2, .post-body h3, .post-body h4 { color: var(--text-main); margin-top: 2em; margin-bottom: 0.8em; font-weight: 800; line-height: 1.3; letter-spacing: -0.02em; }
.post-body h2 { font-size: 1.8rem; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; }
.post-body h3 { font-size: 1.4rem; }
.post-body a { color: var(--accent-color); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.post-body a:hover { color: var(--accent-hover); }
.post-body ul, .post-body ol { margin-bottom: 1.8em; padding-left: 1.5em; }
.post-body li { margin-bottom: 0.5em; }
.post-body blockquote { border-left: 4px solid var(--accent-color); background: var(--bg-surface); padding: 20px 24px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 2em 0; font-style: italic; font-size: 1.15rem; color: var(--text-main); box-shadow: 0 2px 5px rgba(0,0,0,0.02); }
.post-body img { max-width: 100%; height: auto; border-radius: var(--radius-sm); margin: 2em 0; display: block; }
.post-body iframe, .post-body video { max-width: 100%; }
.post-body pre { background: #1e293b; padding: 20px; border-radius: var(--radius-sm); overflow-x: auto; margin: 2em 0; color: #f8fafc; font-size: 0.95rem; max-width: 100%; white-space: pre; }
.post-body code { font-family: monospace; background: #f1f5f9; padding: 2px 6px; border-radius: 4px; color: #e11d48; font-size: 0.9em; word-break: break-word; }
.post-body pre code { background: transparent; padding: 0; color: inherit; word-break: normal; }
.post-body table { width: 100%; border-collapse: collapse; margin: 2em 0; font-size: 0.95rem; display: block; overflow-x: auto; max-width: 100%; }
.post-body th, .post-body td { padding: 12px 15px; border: 1px solid var(--border-color); text-align: left; min-width: 120px; }
.post-body th { background: #f1f5f9; color: var(--text-main); font-weight: 700; }

/* Responsive Tables */
.table-responsive { width: 100%; max-width: 100%; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; margin: 25px 0; border-radius: 10px; }
.table-responsive table { width: max-content; min-width: 100%; border-collapse: collapse; }
.table-responsive th, .table-responsive td { border: 1px solid #ddd; padding: 10px; white-space: nowrap; }

/* ─────────────────────────────────────────
   SIDEBAR & RELATED POSTS
───────────────────────────────────────── */
.sidebar { position: sticky; top: 100px; display: flex; flex-direction: column; gap: 30px; }
.related-section { border-top: 1px solid var(--border-color); background: var(--bg-surface); padding: 60px 5%; }
.related-inner { max-width: 1280px; margin: 0 auto; }
.related-inner h2 { font-size: 1.8rem; font-weight: 800; margin-bottom: 30px; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px; }

.related-card { border: 1px solid var(--border-color); border-radius: var(--radius-md); overflow: hidden; transition: all 0.3s ease; display: flex; flex-direction: column; background: var(--bg-body); width: 100%; }
.related-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: #cbd5e1; }
.related-thumb { width: 100%; aspect-ratio: 16/10; overflow: hidden; background: var(--border-color); display: block; }
.related-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.related-card:hover .related-thumb img { transform: scale(1.05); }

.related-content { padding: 20px; display: flex; flex-direction: column; flex-grow: 1; }
.related-content a { font-size: 1.15rem; font-weight: 700; line-height: 1.4; margin-bottom: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.related-content a:hover { color: var(--accent-color); }
.read-btn { margin-top: auto; font-size: 0.9rem; font-weight: 700; color: var(--accent-color); text-transform: uppercase; }

/* ─────────────────────────────────────────
   PROMO BANNER
───────────────────────────────────────── */
.aatistic-promo { position: relative; overflow: hidden; background: linear-gradient(135deg, #0f0f0f, #1a1a1a); border: 1px solid rgba(255,255,255,.08); border-radius: 18px; padding: 30px; margin: 20px 0; text-align: center; color: #fff; }
.aatistic-promo::before { content: ''; position: absolute; width: 250px; height: 250px; background: #8b5cf6; filter: blur(100px); opacity: .25; top: -100px; right: -50px; }
.aatistic-promo::after { content: ''; position: absolute; width: 200px; height: 200px; background: #ff00ff; filter: blur(90px); opacity: .15; bottom: -80px; left: -60px; }
.promo-badge { display: inline-block; background: rgba(139,92,246,.2); border: 1px solid rgba(139,92,246,.4); color: #c4b5fd; padding: 6px 14px; border-radius: 30px; font-size: 12px; font-weight: 600; margin-bottom: 15px; }
.aatistic-promo h2 { font-size: 30px; margin-bottom: 12px; font-weight: 800; }
.aatistic-promo h2 i { color: #8b5cf6; }
.aatistic-promo p { color: #cfcfcf; max-width: 600px; margin: 0 auto 25px; line-height: 1.7; }
.promo-stats { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin-bottom: 25px; }
.stat { background: rgba(255,255,255,.05); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 15px 20px; min-width: 120px; }
.stat i { color: #8b5cf6; font-size: 22px; margin-bottom: 8px; display: block; }
.stat span { display: block; font-size: 24px; font-weight: 700; }
.stat small { color: #bdbdbd; }
.promo-features { display: flex; justify-content: center; flex-wrap: wrap; gap: 15px; margin-bottom: 25px; }
.promo-features span { background: rgba(255,255,255,.05); padding: 10px 15px; border-radius: 30px; font-size: 14px; }
.promo-features i { color: #22c55e; }
.promo-btn { display: inline-flex; align-items: center; gap: 10px; background: linear-gradient(135deg, #8b5cf6, #ff00ff); color: #fff; padding: 14px 28px; border-radius: 12px; font-weight: 700; transition: .3s; }
.promo-btn:hover { transform: translateY(-3px); box-shadow: 0 10px 25px rgba(139,92,246,.4); }

/* ─────────────────────────────────────────
   ADBLOCK & INTERSTITIAL OVERLAYS
───────────────────────────────────────── */
body.adblock-locked { overflow: hidden !important; width: 100vw; height: 100vh; }
body.adblock-locked .navbar, body.adblock-locked .search-bar-wrapper, body.adblock-locked .market-ticker-wrapper, body.adblock-locked .ad-banner-top, body.adblock-locked .main-layout, body.adblock-locked .related-section, body.adblock-locked .mobile-footer-ad, body.adblock-locked footer { display: none !important; pointer-events: none !important; }

#custom-ad-overlay, #welcomeAdOverlay { position: fixed; inset: 0; width: 100%; height: 100%; background: rgba(0,0,0,.82); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: flex; justify-content: center; align-items: center; z-index: 2147483647; padding: 25px; }
#custom-ad-overlay { opacity: 0; visibility: hidden; pointer-events: none; transition: .25s; }
#custom-ad-overlay.show-overlay { opacity: 1; visibility: visible; pointer-events: auto; }
.custom-ad-modal { position: relative; width: 95vw; max-width: 1100px; background: #fff; border-radius: 14px; padding: 25px; box-shadow: 0 20px 70px rgba(0,0,0,.35); }

#overlay-timer-wrapper { position: absolute; top: 18px; right: 20px; display: flex; align-items: center; gap: 10px; background: #111827; color: #fff; padding: 8px 15px; border-radius: 30px; font-size: 14px; font-weight: 700; }
#overlay-close-btn { display: none; background: #ef4444; color: #fff; border: none; padding: 7px 16px; border-radius: 20px; cursor: pointer; font-size: 13px; font-weight: 700; }
#overlay-close-btn:hover { background: #dc2626; }
#overlay-title { text-align: center; font-size: 30px; font-weight: 800; margin-bottom: 25px; color: #111827; }
#overlay-ad-wrapper { width: 100%; text-align: center; overflow: visible; }
#overlay-ad-wrapper ins.adsbygoogle { display: block !important; width: 100% !important; max-width: 100% !important; }

#overlay-adblock-warning { display: none; text-align: center; padding: 25px; }
#overlay-adblock-warning h3 { font-size: 28px; margin-bottom: 15px; }
#overlay-adblock-warning p { margin: 10px 0; }

/* Welcome Ad Specific Fixes */
.welcome-ad-header { position: fixed; top: 20px; right: 20px; z-index: 2147483647; }
#closeWelcomeAd { width: 48px; height: 48px; border: none; border-radius: 50%; background: #fff; color: #111; font-size: 22px; font-weight: 700; cursor: pointer; box-shadow: 0 5px 20px rgba(0,0,0,.25); transition: .2s; }
#closeWelcomeAd:hover { transform: scale(1.08); background: #f3f3f3; }
.welcome-ad-content { position: relative; width: 100%; max-width: 970px; text-align: center; z-index: 1; display: flex; justify-content: center; align-items: center; }
.welcome-ad-link { display: block; text-decoration: none; width: 100%; display: flex; justify-content: center; }

/* FIX: Image Zoom/Size */
.welcome-ad-image { display: block; width: 100%; max-width: 250px; height: auto; max-height: 70vh; object-fit: contain; border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.35); transition: .25s; }
.welcome-ad-image:hover { transform: scale(1.02); }

#overlay-ad { display: inline-block; max-width: 100%; background: transparent; overflow: visible; }
#overlay-ad .adsbygoogle { display: block !important; width: 100% !important; min-width: 300px !important; margin: 0 auto !important; }

/* ─────────────────────────────────────────
   RESPONSIVE QUERIES
───────────────────────────────────────── */
@media (max-width: 1100px) {
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 992px) {
  .main-layout { grid-template-columns: 1fr; gap: 20px; }
  .sidebar { display: none !important; }
}

@media (max-width: 768px) {
  .hamburger { display: flex; }
  .hamburger.active span { background: #111827 !important; }
  .nav-divider { display: none; }
  .nav-links { position: fixed; top: 0; right: -100%; width: 300px; max-width: 85%; height: 100vh; overflow-y: auto; background: #fff; display: flex; flex-direction: column; align-items: stretch; padding: 80px 24px 30px; gap: 0; box-shadow: -15px 0 35px rgba(0,0,0,.12); transition: right .35s ease; z-index: 9999; }
  .nav-links.active { right: 0; }
  .nav-link, .dropdown-trigger { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 16px 0; font-size: 17px; font-weight: 700; border-bottom: 1px solid var(--border-color); }
  .dropdown { width: 100%; }
  .dropdown-content { position: static !important; display: none; margin: 8px 0 15px; padding: 0; background: transparent; border: none; box-shadow: none; border-radius: 0; opacity: 1 !important; visibility: visible !important; transform: none !important; }
  .dropdown.open-mobile .dropdown-content { display: block; }
  .dropdown-content a { padding: 12px 16px; margin-bottom: 8px; background: #f8fafc; border-radius: 8px; font-size: 15px; font-weight: 600; }
  .dropdown-content a:last-child { margin-bottom: 0; }
  
  .hamburger.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .hamburger.active span:nth-child(2) { opacity: 0; }
  .hamburger.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
  
  .custom-ad-modal { width: 96vw; padding: 18px; }
  #overlay-title { font-size: 22px; margin-top: 25px; }
  #overlay-timer-wrapper { top: 12px; right: 12px; font-size: 12px; padding: 6px 10px; }
  
  .article-meta { gap: 10px; font-size: 12px; }
  .article-meta > *:not(:last-child)::after { margin-left: 10px; }
  .article-meta .badge { padding: 6px 10px; font-size: 12px; }
  
  .aatistic-promo h2 { font-size: 24px; }
  .promo-stats { flex-direction: column; }
  .stat { width: 100%; }
  
  #welcomeAdOverlay { padding: 15px; }
  .welcome-ad-content { max-width: 100%; }
  .welcome-ad-image { max-width: 200px; max-height: 60vh; }
  #closeWelcomeAd { width: 44px; height: 44px; font-size: 20px; }
}

@media (max-width: 600px) {
  .main-layout { padding: 0 15px; }
  .post-body { font-size: 1rem; }
  .article-title { font-size: 1.8rem; }
  .related-section { padding: 40px 15px; }
  .related-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .related-content { padding: 12px; }
  .related-content a { font-size: 0.9rem; line-height: 1.3; margin-bottom: 10px; }
  .read-btn { font-size: 0.75rem; }
}

@media (max-width: 480px) {
  #welcomeAdOverlay { padding: 12px; }
  .welcome-ad-image { max-width: 180px; max-height: 55vh; border-radius: 14px; }
  #closeWelcomeAd { width: 42px; height: 42px; font-size: 18px; }
}