/* ============================================
   BestHomeSecuritySystem.com — Display Arb Site
   ============================================ */

:root {
  --primary: #1A3A5C;
  --primary-light: #2B5E91;
  --primary-dark: #0E2240;
  --accent: #D4432F;
  --accent-hover: #B8351F;
  --bg: #F7F8FA;
  --bg-card: #FFFFFF;
  --text: #1A1A2E;
  --text-secondary: #5A5A72;
  --text-muted: #8E8EA0;
  --border: #E2E4E9;
  --border-light: #EDEEF2;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --max-w: 1100px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-light); text-decoration: none; }
a:hover { color: var(--primary); text-decoration: underline; }

/* ---- Header ---- */
.site-header {
  background: var(--primary-dark);
  color: white;
  padding: 0 24px;
  border-bottom: 3px solid var(--accent);
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.logo {
  font-size: 20px;
  font-weight: 700;
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo span { color: var(--accent); }
.nav { display: flex; gap: 20px; }
.nav a { color: rgba(255,255,255,0.8); font-size: 14px; font-weight: 500; text-decoration: none; }
.nav a:hover { color: white; text-decoration: none; }

@media (max-width: 600px) {
  .nav { display: none; }
  .header-inner { height: 44px; }
  .logo { font-size: 17px; }
  .search-hero { padding: 20px 16px 18px; }
  .search-hero h1 { font-size: 20px; margin-bottom: 4px; }
  .search-hero p { font-size: 13px; margin-bottom: 12px; }
  .search-bar input { padding: 10px 14px; font-size: 14px; }
  .search-bar button { padding: 10px 16px; font-size: 14px; }
  .main-content { padding: 12px 12px; }
  .ad-top-banner { min-height: 50px; margin-bottom: 10px; }
  .engagement-cta { padding: 10px 14px; margin-bottom: 12px; }
  .engagement-cta .cta-text h3 { font-size: 14px; }
  .engagement-cta .cta-text p { font-size: 12px; }
  .engagement-cta .cta-btn { padding: 8px 14px; font-size: 13px; }
  .results-section h2 { margin-bottom: 8px; }
  .result-card { padding: 12px 14px; margin-bottom: 8px; }
}

/* ---- Ad Slots ---- */
.ad-slot {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  text-align: center;
  overflow: hidden;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-slot-label {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

/* ---- Page 1: Search / Landing ---- */
.search-hero {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: white;
  padding: 40px 24px 36px;
  text-align: center;
}
.search-hero h1 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 6px;
}
.search-hero p {
  font-size: 15px;
  opacity: 0.8;
  margin-bottom: 20px;
}
.search-bar {
  max-width: 540px;
  margin: 0 auto;
  display: flex;
  background: white;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.search-bar input {
  flex: 1;
  border: none;
  padding: 14px 20px;
  font-size: 16px;
  outline: none;
  color: var(--text);
}
.search-bar button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.search-bar button:hover { background: var(--accent-hover); }

.main-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 24px;
}

/* Top banner ad */
.ad-top-banner {
  margin-bottom: 20px;
  min-height: 90px;
  max-width: 100%;
  overflow: hidden;
}

/* Interstitial / engagement CTA */
.engagement-cta {
  background: linear-gradient(135deg, #FFF0EE, #FFE4E0);
  border: 1px solid #F0B0A8;
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.engagement-cta .cta-text h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.engagement-cta .cta-text p {
  font-size: 13px;
  color: var(--text-secondary);
}
.engagement-cta .cta-btn {
  background: var(--accent);
  color: white;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}
.engagement-cta .cta-btn:hover { background: var(--accent-hover); text-decoration: none; }

/* Article results list */
.results-section h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
  display: block;
  text-decoration: none;
}
.result-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow);
  text-decoration: none;
}
.result-card h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-light);
  margin-bottom: 4px;
}
.result-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.result-card .url {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Mid-page ad */
.ad-mid {
  margin: 20px 0;
  min-height: 250px;
}

/* ---- Page 2: Article ---- */
.article-layout {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 24px;
  display: flex;
  gap: 28px;
}
.article-main { flex: 1; min-width: 0; }
.article-sidebar { width: 300px; flex-shrink: 0; }

@media (max-width: 800px) {
  .article-layout { flex-direction: column; }
  .article-sidebar { width: 100%; }
}

/* RSOC widget */
.rsoc-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 20px;
}
.rsoc-widget .rsoc-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 10px;
}
.rsoc-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: #F0F7FF;
  border-radius: 6px;
  margin-bottom: 6px;
  text-decoration: none;
  transition: background 0.15s;
}
.rsoc-link:hover { background: #E0EEFF; text-decoration: none; }
.rsoc-link .kw { font-size: 14px; color: var(--primary); font-weight: 500; }
.rsoc-link .arrow { font-size: 13px; color: var(--primary-light); font-weight: 600; }

/* Article content */
.article-header { margin-bottom: 24px; }
.article-header h1 { font-size: 28px; font-weight: 700; line-height: 1.3; margin-bottom: 8px; }
.article-meta { font-size: 13px; color: var(--text-muted); }
.article-body { font-size: 16px; color: var(--text-secondary); line-height: 1.75; }
.article-body h2 { font-size: 22px; font-weight: 600; color: var(--text); margin: 28px 0 12px; }
.article-body h3 { font-size: 18px; font-weight: 600; color: var(--text); margin: 24px 0 10px; }
.article-body p { margin-bottom: 16px; }
.article-body ul, .article-body ol { margin: 0 0 16px 24px; }
.article-body li { margin-bottom: 6px; }

/* Native ads */
.native-ads {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 24px 0;
}
.native-ads .native-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 12px;
}
.native-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.native-card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  display: block;
  transition: box-shadow 0.15s;
}
.native-card:hover { box-shadow: var(--shadow); text-decoration: none; }
.native-card .thumb {
  height: 100px;
  background: linear-gradient(135deg, #E8EDF2, #D4DBE4);
}
.native-card .caption {
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  line-height: 1.4;
}
.native-card .sponsor {
  padding: 0 12px 10px;
  font-size: 11px;
  color: var(--text-muted);
}

/* Recirculation */
.recirculation {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.recirculation h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.recirc-link {
  display: block;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--primary-light);
  text-decoration: none;
  transition: border-color 0.15s;
}
.recirc-link:hover { border-color: var(--primary-light); text-decoration: none; }

/* Sidebar */
.sidebar-ad {
  margin-bottom: 20px;
  min-height: 250px;
}
.sidebar-sticky {
  position: sticky;
  top: 20px;
}

/* Footer */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.6);
  padding: 24px;
  margin-top: 40px;
  text-align: center;
  font-size: 13px;
}
.site-footer a { color: rgba(255,255,255,0.8); }

/* ---- Video Interstitial Overlay ---- */
.video-interstitial {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vi-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}

/* Step 1: Gate screen */
.vi-gate {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 16px;
  padding: 36px 28px 24px;
  margin: 0 20px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.vi-gate-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.7;
}
.vi-gate h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.vi-gate p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}
.vi-gate-img {
  font-size: 48px;
  margin-bottom: 20px;
}
.vi-watch-btn {
  display: block;
  width: 100%;
  background: var(--primary-dark);
  color: #fff;
  border: none;
  padding: 16px 24px;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.3px;
}
.vi-watch-btn:hover { background: var(--primary); }
.vi-gate-links {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 16px;
}
.vi-gate-links a {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
}

/* Step 2: Video player */
.vi-player {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 16px;
}
.vi-player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: rgba(0,0,0,0.6);
  border-radius: var(--radius) var(--radius) 0 0;
}
.vi-label {
  color: #ccc;
  font-size: 13px;
}
.vi-reward-label {
  color: #999;
  font-size: 13px;
  font-weight: 500;
}
.vi-skip {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 6px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.vi-skip:hover { background: var(--accent-hover); }
.vi-content {
  position: relative;
  width: 100%;
  padding-top: 75%;
  background: #000;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}
.vi-content video,
.vi-content #vi-ad-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.vi-content::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: vi-spin 0.8s linear infinite;
  z-index: 0;
}
@keyframes vi-spin {
  to { transform: rotate(360deg); }
}

/* Fallback display ad view */
.vi-fb-reward {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-weight: 500;
}
.vi-fb-ad {
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  background: var(--bg);
  border-radius: var(--radius);
  overflow: hidden;
}
.vi-fb-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
}
.vi-fb-bar-track {
  width: 180px;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.vi-fb-bar {
  height: 100%;
  width: 100%;
  background: var(--primary-light);
  border-radius: 3px;
  transition: width 1s linear;
}
