/**
 * NetSpeedCheck - Google AdSense Responsive Stylesheet
 * Publisher ID: ca-pub-9883727835588657
 * Fully responsive, accessible, and compliant with Google AdSense Policies.
 */

/* Ad Wrappers & Placement Containers */
.ad-wrapper {
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--container-gutter, 16px);
  box-sizing: border-box;
}

.ad-container {
  display: none; /* Safely hidden by default when ADS_ENABLED is false */
  position: relative;
  margin: 0 auto;
  text-align: center;
  overflow: hidden;
  box-sizing: border-box;
}

/* Activated Ad Container (when ADS_ENABLED = true & slot configured) */
.ad-container.ad-active {
  display: block;
}

/* Google Policy Compliant Subtle Ad Label */
.ad-label {
  display: block;
  font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 6px;
  user-select: none;
}

/* Placement A: Header Leaderboard (below navigation) */
.ad-slot-header {
  max-width: 970px;
  margin: 16px auto 20px auto;
  min-height: 50px;
}

/* Placement B: Main Content Top (below hero, above speed test / main tool) */
.ad-slot-main-top {
  max-width: 970px;
  margin: 20px auto 24px auto;
  min-height: 50px;
}

/* Placement C: Desktop & Laptop Sidebar */
.ad-slot-sidebar {
  width: 300px;
  max-width: 100%;
  margin: 20px auto;
}

/* Placement D: Speed Test Results Ad (below results dashboard) */
.ad-slot-results {
  max-width: 728px;
  margin: 28px auto 0 auto;
  padding-top: 20px;
  border-top: 1px dashed var(--border-color, #334155);
}

/* Placement E: Bottom Ad (above footer) */
.ad-slot-bottom {
  max-width: 970px;
  margin: 40px auto 20px auto;
}

/* Placement F: In-Article / Guide Sections */
.ad-slot-article {
  max-width: 728px;
  margin: 32px auto;
  padding: 16px 0;
}

/* Development / Test Placeholder Box (Only visible if SHOW_PLACEHOLDERS is true) */
.ad-placeholder-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border-color, #334155);
  background: var(--bg-card, rgba(15, 23, 42, 0.6));
  border-radius: var(--radius-sm, 8px);
  padding: 16px 20px;
  color: var(--text-secondary, #94a3b8);
  font-size: 0.85rem;
  min-height: 90px;
}

.ad-placeholder-box strong {
  color: var(--accent-cyan, #00e5ff);
  margin-bottom: 4px;
}

/* ==========================================================================
   Responsive Design & Breakpoints
   ========================================================================== */

/* Desktop & Large Screen Displays (min-width: 1200px) */
@media (min-width: 1200px) {
  .ad-slot-header {
    min-height: 90px;
  }
}

/* Laptop & Tablet Landscape (992px to 1199px) */
@media (max-width: 1199px) and (min-width: 992px) {
  .ad-slot-header,
  .ad-slot-main-top,
  .ad-slot-bottom {
    max-width: 100%;
  }
}

/* Tablet (768px to 991px) */
@media (max-width: 991px) {
  /* Strictly hide desktop-only sidebar ads on tablet & mobile */
  .ad-slot-sidebar,
  .ad-container[data-ad-placement="SIDEBAR"] {
    display: none !important;
  }

  .ad-slot-header,
  .ad-slot-main-top,
  .ad-slot-bottom,
  .ad-slot-results,
  .ad-slot-article {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Mobile Devices (max-width: 767px) */
@media (max-width: 767px) {
  /* Never show sidebar ads on mobile */
  .ad-slot-sidebar,
  .ad-container[data-ad-placement="SIDEBAR"] {
    display: none !important;
  }

  /* Full-width responsive container without horizontal scrolling */
  .ad-wrapper {
    padding: 0 12px;
    width: 100%;
    overflow-x: hidden;
  }

  .ad-container {
    width: 100%;
    max-width: 100%;
    margin: 14px auto;
  }

  .ad-slot-header {
    margin: 12px auto;
    min-height: 50px;
  }

  .ad-slot-main-top {
    margin: 16px auto;
  }

  .ad-slot-results {
    margin-top: 20px;
    padding-top: 16px;
  }

  .ad-slot-bottom {
    margin: 24px auto 12px auto;
  }

  .ad-slot-article {
    margin: 20px auto;
  }
}
