/* ================================================================
   Ad Placement Demo/Testing Styles
   ================================================================

   This stylesheet is for TESTING ONLY - visualizing ad placements
   before implementing real Google AdSense code.

   Ad placements based on strategy:
   1. Desktop Sidebar (right side, display ads)
   2. In-Card Native (after Quick Context)
   3. In-Feed (between cards, configurable ratio)
   4. Desktop Banners (horizontal/vertical)

   ================================================================ */

/* ================================================================
   Base Ad Demo Styles
   ================================================================ */

.ad-demo-container {
  margin: 1rem 0;
  padding: 0.5rem;
  border-radius: 8px;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.ad-demo-container.ad-demo-hidden {
  opacity: 0.2;
  transform: scale(0.95);
}

.ad-demo-box {
  border: 3px dashed;
  border-radius: 6px;
  padding: 1rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.05);
}

.ad-demo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.ad-demo-label {
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ad-demo-size {
  font-family: 'Courier New', monospace;
  opacity: 0.7;
}

.ad-demo-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}

.ad-demo-text {
  font-size: 1.125rem;
  font-weight: 500;
  margin: 0;
}

.ad-demo-meta {
  font-size: 0.75rem;
  opacity: 0.6;
  margin: 0;
}

.ad-demo-toggle {
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  border-radius: 4px;
  border: 1px solid currentColor;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease;
}

.ad-demo-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ================================================================
   Placement-Specific Colors (for easy identification)
   ================================================================ */

/* Desktop Sidebar - Blue */
.ad-demo-sidebar {
  background: rgba(59, 130, 246, 0.1);
}

.ad-demo-sidebar .ad-demo-box {
  border-color: #3b82f6;
  color: #3b82f6;
}

/* In-Card Native - Realistic Google Ad Styling */
.ad-demo-in-card {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 12px;
  margin: 16px 0;
}

.ad-demo-in-card .ad-demo-box {
  border: none;
  padding: 0;
  background: transparent;
  text-align: left;
}

/* Realistic Google Ad Structure */
.ad-demo-in-card .ad-label {
  font-size: 10px;
  color: #5f6368;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 8px;
  display: inline-block;
  border: 1px solid #dadce0;
  padding: 2px 6px;
  border-radius: 2px;
  background: #fff;
}

.ad-demo-in-card .ad-headline {
  font-size: 16px;
  font-weight: 600;
  color: #1a73e8;
  margin: 8px 0 4px 0;
  line-height: 1.3;
  cursor: pointer;
}

.ad-demo-in-card .ad-headline:hover {
  text-decoration: underline;
}

.ad-demo-in-card .ad-description {
  font-size: 14px;
  color: #5f6368;
  line-height: 1.5;
  margin: 4px 0 8px 0;
}

.ad-demo-in-card .ad-url {
  font-size: 12px;
  color: #5f6368;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ad-demo-in-card .ad-domain {
  color: #202124;
  font-weight: 500;
}

.ad-demo-in-card .ad-breadcrumb {
  color: #5f6368;
}

/* In-Feed (Between Cards) - Purple */
.ad-demo-in-feed {
  background: rgba(168, 85, 247, 0.1);
}

.ad-demo-in-feed .ad-demo-box {
  border-color: #a855f7;
  color: #a855f7;
}

/* Desktop Banner Top - Orange */
.ad-demo-banner-top {
  background: rgba(249, 115, 22, 0.1);
}

.ad-demo-banner-top .ad-demo-box {
  border-color: #f97316;
  color: #f97316;
}

/* Desktop Banner Bottom - Red */
.ad-demo-banner-bottom {
  background: rgba(239, 68, 68, 0.1);
}

.ad-demo-banner-bottom .ad-demo-box {
  border-color: #ef4444;
  color: #ef4444;
}

/* ================================================================
   Responsive Size Simulation
   ================================================================ */

/* Sidebar Ad - 300x250 (Desktop only) */
.ad-demo-sidebar .ad-demo-box {
  width: 300px;
  height: 250px;
  margin: 0 auto;
}

/* In-Card Native - Flexible (fills container) */
.ad-demo-in-card .ad-demo-box {
  min-height: 100px;
  max-width: 100%;
}

/* In-Feed - 300x250 or responsive */
.ad-demo-in-feed .ad-demo-box {
  min-height: 200px;
  max-width: 100%;
}

/* Banner Top - 728x90 (Desktop) / 320x50 (Mobile) */
.ad-demo-banner-top .ad-demo-box {
  height: 90px;
  max-width: 728px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .ad-demo-banner-top .ad-demo-box {
    height: 50px;
    max-width: 320px;
  }
}

/* Banner Bottom - Same as top */
.ad-demo-banner-bottom .ad-demo-box {
  height: 90px;
  max-width: 728px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .ad-demo-banner-bottom .ad-demo-box {
    height: 50px;
    max-width: 320px;
  }
}

/* ================================================================
   Dark Mode / Theater Mode Compatibility
   ================================================================ */

.theme-dark .ad-demo-box,
.theme-device .ad-demo-box {
  background: rgba(0, 0, 0, 0.3);
}

.theme-dark .ad-demo-toggle,
.theme-device .ad-demo-toggle {
  border-color: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.7);
}

.theme-dark .ad-demo-toggle:hover,
.theme-device .ad-demo-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ================================================================
   Mobile Landscape - Hide sidebar ads
   ================================================================ */

@media (max-height: 500px) and (orientation: landscape) {
  .ad-demo-sidebar {
    display: none;
  }

  .ad-demo-in-card .ad-demo-box {
    min-height: 60px;
  }
}

/* ================================================================
   Deck Sidebar Layout (Desktop Only)
   ================================================================ */

.deck-with-sidebar {
  display: flex;
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.reference-carousel {
  flex: 1;
  min-width: 0;
}

.desktop-sidebar {
  width: 320px;
  flex-shrink: 0;
  position: sticky;
  top: 80px;
  align-self: flex-start;
}

@media (max-width: 1024px) {
  .deck-with-sidebar {
    flex-direction: column;
  }

  .desktop-sidebar {
    display: none !important;
  }
}

/* ================================================================
   Banner Ad Styles (Realistic Google Ads)
   ================================================================ */

.banner-top-container,
.banner-bottom-container {
  max-width: 728px;
  margin: 1rem auto;
  text-align: center;
}

.ad-demo-banner-top,
.ad-demo-banner-bottom {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 8px;
  margin: 8px 0;
}

.ad-demo-banner-top .ad-demo-box,
.ad-demo-banner-bottom .ad-demo-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  height: auto;
  min-height: 70px;
  border: none;
  background: transparent;
}

@media (max-width: 768px) {
  .banner-top-container,
  .banner-bottom-container {
    max-width: 320px;
  }
}

/* ================================================================
   Test Controls Panel
   ================================================================ */

.ad-test-controls {
  position: fixed;
  top: 80px;
  right: 20px;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 1rem;
  border-radius: 8px;
  z-index: 10000;
  max-width: 300px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.ad-test-controls h3 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 0.5rem;
}

.ad-test-controls label {
  display: block;
  margin: 0.5rem 0;
  font-size: 0.875rem;
  cursor: pointer;
  user-select: none;
}

.ad-test-controls input[type="checkbox"] {
  margin-right: 0.5rem;
}

.ad-test-controls button {
  width: 100%;
  padding: 0.5rem;
  margin-top: 1rem;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.875rem;
}

.ad-test-controls button:hover {
  background: #2563eb;
}

.ad-test-controls .ratio-control {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.ad-test-controls input[type="range"] {
  width: 100%;
  margin-top: 0.5rem;
}

.ad-test-controls .ratio-value {
  text-align: center;
  font-weight: 600;
  color: #3b82f6;
}

/* ================================================================
   Interstitial Ad Overlay (Navigation-Based)
   ================================================================ */

.ad-interstitial-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-in-out;
}

.ad-interstitial-overlay.active {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.ad-interstitial-card {
  max-width: 800px;
  width: 90%;
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  position: relative;
  animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.ad-interstitial-header {
  padding: 2rem;
  text-align: center;
  background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
  color: white;
}

.ad-interstitial-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.ad-interstitial-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
}

.ad-interstitial-body {
  padding: 3rem 2rem;
  text-align: center;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ad-interstitial-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #5f6368;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.ad-interstitial-tagline {
  font-size: 1.5rem;
  color: #333;
  margin: 1.5rem 0 2rem 0;
  line-height: 1.4;
}

.ad-interstitial-cta {
  background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
  color: white;
  border: none;
  padding: 1rem 3rem;
  border-radius: 8px;
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ad-interstitial-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.4);
}

.ad-interstitial-footer {
  padding: 1.5rem 2rem;
  background: #f5f5f5;
  text-align: center;
  border-top: 1px solid #e0e0e0;
}

.ad-interstitial-skip {
  background: transparent;
  color: #666;
  border: 2px solid #ddd;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ad-interstitial-skip:hover {
  background: #666;
  color: white;
  border-color: #666;
}

.ad-interstitial-timer {
  font-size: 0.875rem;
  color: #999;
  margin-top: 1rem;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .ad-interstitial-card {
    width: 95%;
    max-width: none;
  }

  .ad-interstitial-header {
    padding: 1.5rem 1rem;
  }

  .ad-interstitial-icon {
    font-size: 3rem;
  }

  .ad-interstitial-title {
    font-size: 1.5rem;
  }

  .ad-interstitial-body {
    padding: 2rem 1.5rem;
    min-height: 200px;
  }

  .ad-interstitial-tagline {
    font-size: 1.25rem;
  }

  .ad-interstitial-cta {
    padding: 0.875rem 2rem;
    font-size: 1rem;
  }
}
