/**
 * TypingRise - Centralized Ads System Stylesheet
 * 
 * Provides responsive, clean, and seamless container styling
 * for all ad placements across TypingRise without any background
 * tints, side highlights, or borders.
 */

/* Ad Slot Main Container */
.ad-slot-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 1.5rem auto;
  text-align: center;
  position: relative;
  clear: both;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* Compliance Disclaimer Label - Hidden as requested */
.ad-disclaimer {
  display: none !important;
}

/* Responsive Outer Wrapper (Seamless, zero background tint) */
.ad-responsive-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: auto;
  max-width: 100%;
  overflow: hidden;
  position: relative;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  transition: height 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scaler Container (Applies CSS transform on mobile/tablet) */
.ad-scaler {
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  will-change: transform;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* The Sandboxed Ad Iframe */
.ad-iframe {
  border: none !important;
  outline: none !important;
  overflow: hidden !important;
  display: block !important;
  margin: 0 auto !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Specific Slot Preset Sizes */
.ad-type-banner_728x90 .ad-scaler {
  width: 728px;
  height: 90px;
}

.ad-type-banner_300x250 .ad-scaler {
  width: 300px;
  height: 250px;
}

.ad-type-banner_468x60 .ad-scaler {
  width: 468px;
  height: 60px;
}

.ad-type-banner_160x600 .ad-scaler {
  width: 160px;
  height: 600px;
}

.ad-type-banner_320x50 .ad-scaler {
  width: 320px;
  height: 50px;
}

/* Keyboard Tester Specific Placement Styling */
#ad-keyboard-test-banner {
  margin: 1.5rem auto 2rem;
  max-width: 100%;
  padding: 0 0.5rem;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* Lesson & Typing Test Side Gutters (160x600 Wide Skyscraper Placement) */
.lesson-drill-outer-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 1.5rem;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  position: relative;
  box-sizing: border-box;
}

.lesson-drill-content {
  flex: 1 1 820px;
  max-width: 820px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.lesson-side-gutter {
  width: 160px;
  min-width: 160px;
  max-width: 160px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 600px;
  box-sizing: border-box;
  background: transparent !important;
}

/* While practicing drill (single ad), stick the gutter to top */
.lesson-drill-outer-wrapper:not(.showing-results) .lesson-side-gutter {
  position: sticky;
  top: 85px;
}

.lesson-side-gutter .ad-slot-container {
  margin: 0 !important;
  width: 160px !important;
  min-height: 600px;
  background: transparent !important;
  border: none !important;
}

/* Results-only additional lower skyscraper ad (specifically scoped to side gutters) */
.lesson-side-gutter .results-only-ad {
  display: none !important;
  margin-top: 1.5rem !important;
  width: 160px !important;
  min-height: 600px;
  background: transparent !important;
  border: none !important;
}

.lesson-drill-outer-wrapper.showing-results .lesson-side-gutter .results-only-ad {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: sticky;
  top: 85px;
  z-index: 10;
}

/* Zero extra space: empty ad slots collapse to 0px */
.ad-slot-container:empty,
#ad-results-video-box:empty {
  display: none !important;
  min-height: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}

#ad-results-video-wrapper:not(:has(video)) {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* 100% Strict Typing Focus Shield: Zero Video Ads & Zero Overlays While Typing */
.lesson-drill-outer-wrapper:not(.showing-results) video:not(.tutorial-video),
.lesson-drill-outer-wrapper:not(.showing-results) [class*="slider"],
.lesson-drill-outer-wrapper:not(.showing-results) [class*="aclib"],
.lesson-drill-outer-wrapper:not(.showing-results) [id*="aclib"],
.lesson-drill-outer-wrapper:not(.showing-results) .adcash-video-wrapper,
.lesson-drill-outer-wrapper:not(.showing-results) .adcash-video-box,
body.typing-active video:not(.tutorial-video),
body.typing-active [class*="slider"],
body.typing-active [class*="aclib"],
body.typing-active [id*="aclib"],
body.typing-active .adcash-video-wrapper,
body.typing-active .adcash-video-box,
body.typing-active iframe[src*="acscdn.com"],
body.typing-active iframe[src*="adcash.com"],
body.typing-active iframe[src*="youradexchange.com"] {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  max-width: 0 !important;
  max-height: 0 !important;
  position: absolute !important;
  left: -9999px !important;
  z-index: -999 !important;
}

/* On wide screens (>= 1240px), show both side gutters flanking the central drill */
@media (min-width: 1240px) {
  .lesson-gutter-left,
  .lesson-gutter-right {
    display: flex !important;
  }
}

/* On medium desktop screens (1024px to 1239px), keep right gutter and collapse left gutter */
@media (max-width: 1239px) and (min-width: 1024px) {
  .lesson-gutter-left {
    display: none !important;
  }
  .lesson-gutter-right {
    display: flex !important;
  }
}

/* On tablets & mobile (< 1024px), hide side gutters to preserve 100% full screen for typing */
@media (max-width: 1023px) {
  .lesson-side-gutter {
    display: none !important;
  }
  .lesson-drill-outer-wrapper {
    display: block;
    max-width: 100%;
  }
  .lesson-drill-content {
    max-width: 100%;
  }
}

/* Lesson & Test Bottom Dual 300x250 Banner Placement (Highlighted Area) */
.lesson-bottom-ads-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  width: 100%;
  max-width: 820px;
  margin: 1.5rem auto 1rem;
  padding: 0 0.5rem;
  box-sizing: border-box;
  background: transparent !important;
}

.lesson-bottom-ads-wrapper .ad-slot-container {
  margin: 0 !important;
  width: 300px !important;
  min-height: 250px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

@media (max-width: 680px) {
  .lesson-bottom-ads-wrapper {
    gap: 1rem;
    margin: 1rem auto;
  }
}

/* Dark Theme Adjustments - Seamless transparent background */
[data-theme="dark"] .ad-slot-container,
[data-theme="dark"] .ad-responsive-wrapper,
[data-theme="dark"] .ad-scaler,
[data-theme="dark"] .lesson-side-gutter,
[data-theme="dark"] .lesson-bottom-ads-wrapper,
[data-theme="dark"] .home-faq-gutter,
[data-theme="midnight"] .ad-slot-container,
[data-theme="midnight"] .ad-responsive-wrapper,
[data-theme="midnight"] .ad-scaler,
[data-theme="midnight"] .lesson-side-gutter,
[data-theme="midnight"] .lesson-bottom-ads-wrapper,
[data-theme="midnight"] .home-faq-gutter,
[data-theme="cyberpunk"] .ad-slot-container,
[data-theme="cyberpunk"] .ad-responsive-wrapper,
[data-theme="cyberpunk"] .ad-scaler,
[data-theme="cyberpunk"] .lesson-side-gutter,
[data-theme="cyberpunk"] .lesson-bottom-ads-wrapper,
[data-theme="cyberpunk"] .home-faq-gutter {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* Home Page CTA Promo Banner with Embedded 300x250 Adsterra Placement */
.home-cta-promo-banner {
  margin-top: var(--space-xxl);
  background: linear-gradient(135deg, var(--primary) 0%, hsl(280, 85%, 55%) 100%);
  border-radius: var(--radius-lg);
  padding: 2.2rem 2.5rem;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.home-cta-promo-banner .promo-text-content {
  z-index: 10;
  flex: 1 1 360px;
  min-width: 280px;
}

.home-cta-promo-banner .promo-ad-wrapper {
  z-index: 10;
  flex: 0 0 300px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
}

.home-cta-promo-banner .promo-ad-wrapper .ad-slot-container {
  margin: 0 !important;
  width: 300px !important;
  min-height: 250px;
  background: rgba(255, 255, 255, 0.08) !important;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
}

@media (max-width: 860px) {
  .home-cta-promo-banner {
    padding: 1.8rem 1.25rem;
    justify-content: center;
    text-align: center;
  }
  .home-cta-promo-banner .promo-text-content {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .home-cta-promo-banner .promo-text-content div {
    justify-content: center;
  }
}

/* Home Page FAQ Side Gutters (160x600 Wide Skyscraper Placement) */
.home-faq-outer-wrapper {
  display: flex !important;
  flex-direction: row !important;
  justify-content: center !important;
  align-items: flex-start !important;
  gap: 1.5rem !important;
  width: 100% !important;
  max-width: 1240px !important;
  margin: var(--space-xxl) auto 2.5rem auto !important;
  position: relative !important;
  box-sizing: border-box !important;
}

.home-faq-content {
  flex: 1 1 800px !important;
  max-width: 800px !important;
  min-width: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.home-faq-gutter {
  width: 160px !important;
  min-width: 160px !important;
  max-width: 160px !important;
  flex: 0 0 160px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  min-height: 600px !important;
  box-sizing: border-box !important;
  background: transparent !important;
  position: sticky !important;
  top: 90px !important;
}

.home-faq-gutter .ad-slot-container {
  margin: 0 !important;
  width: 160px !important;
  min-height: 600px !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* On wide screens (>= 1024px), display BOTH left & right gutters */
@media (min-width: 1024px) {
  .home-faq-gutter-left,
  .home-faq-gutter-right {
    display: flex !important;
  }
}

/* On screens < 1024px (tablets & mobile), hide gutters completely so they NEVER stack vertically above or below */
@media (max-width: 1023px) {
  .home-faq-gutter,
  .home-faq-gutter-left,
  .home-faq-gutter-right {
    display: none !important;
  }
  .home-faq-outer-wrapper {
    display: block !important;
    max-width: 100% !important;
    margin-top: var(--space-xl) !important;
  }
  .home-faq-content {
    max-width: 100% !important;
  }
}

/* Mobile Media Queries */
@media (max-width: 768px) {
  .ad-slot-container,
  #ad-keyboard-test-banner {
    margin: 1rem auto 1.5rem;
    padding: 0 0.25rem;
  }
}

/* ==========================================================================
   TYPING FOCUS SHIELD: Strict suppression of Adcash video & floating ads
   Protects typing tests and lessons against any video or intrusive overlays
   ========================================================================== */
body.typing-active div[class*="aclib"],
body.typing-active div[id*="aclib"],
body.typing-active div[class*="ac_"],
body.typing-active div[id*="ac_"],
body.typing-active iframe[src*="acscdn.com"],
body.typing-active iframe[src*="adcash.com"],
body.typing-active iframe[src*="youradexchange.com"],
body.typing-active .adcash-video-wrapper,
body.typing-active .adcash-video-box,
body.typing-active video,
.lesson-drill-outer-wrapper:not(.showing-results) ~ div[class*="aclib"],
.lesson-drill-outer-wrapper:not(.showing-results) ~ iframe[src*="acscdn.com"],
.lesson-drill-outer-wrapper:not(.showing-results) ~ iframe[src*="youradexchange.com"] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  opacity: 0 !important;
  position: absolute !important;
  left: -9999px !important;
}

