/* ========================================
   ADVERTISING & AD PLACEMENT STYLES
   Sophisticated ad integration for multiple providers
   ======================================== */

/* Ad Container Wrapper */
.ad-container {
  background: white;
  border-radius: 10px;
  padding: 1rem;
  margin: 1.5rem 0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  border-top: 3px solid var(--saffron);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100px;
  transition: all 0.3s ease;
}

.ad-container:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

/* Ad Label */
.ad-label {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 0.75rem;
  color: #999;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Header Ad Placement */
.ad-header {
  background: linear-gradient(135deg, rgba(255,217,179,0.1) 0%, rgba(19,136,8,0.05) 100%);
  padding: 2rem 1rem;
  text-align: center;
  border-radius: 10px;
  margin: 1.5rem 0;
}

/* Sidebar Ad Placement */
.ad-sidebar {
  background: var(--cream);
  padding: 1.5rem;
  border-radius: 10px;
  border-left: 4px solid var(--gold);
  margin: 1.5rem 0;
}

/* Content Ad Placement */
.ad-inline {
  background: white;
  padding: 1rem;
  border-radius: 10px;
  margin: 2rem 0;
  border: 1px solid #eee;
}

/* Footer Ad Placement */
.ad-footer {
  background: linear-gradient(135deg, rgba(139,58,98,0.05) 0%, rgba(255,153,51,0.05) 100%);
  padding: 2rem 1rem;
  border-radius: 10px;
  margin-top: 2rem;
}

/* Between-Section Ads */
.ad-between-sections {
  background: white;
  padding: 1.5rem;
  text-align: center;
  border-radius: 10px;
  margin: 2.5rem 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Google AdSense Container */
.adsbygoogle {
  display: inline-block;
  min-height: 100px;
  width: 100%;
}

/* Ad Placeholder (for development) */
.ad-placeholder {
  background: linear-gradient(135deg, #f0f0f0 0%, #fafafa 100%);
  border: 2px dashed #ddd;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  color: #999;
  font-size: 0.9rem;
  font-weight: 500;
}

.ad-placeholder::before {
  content: '📢';
  display: block;
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

/* ========================================
   RESPONSIVE AD SIZING
   ======================================== */

/* Desktop Ads (1200px+) */
@media (min-width: 1200px) {
  /* Leaderboard: 728x90 */
  .ad-leaderboard {
    width: 728px;
    height: 90px;
    margin: 0 auto;
  }

  /* Medium Rectangle: 300x250 */
  .ad-medium-rect {
    width: 300px;
    height: 250px;
    margin: 0 auto;
  }

  /* Wide Skyscraper: 160x600 */
  .ad-wide-skyscraper {
    width: 160px;
    height: 600px;
    float: right;
    margin-left: 1.5rem;
  }

  /* Half Page: 300x600 */
  .ad-half-page {
    width: 300px;
    height: 600px;
    margin: 0 auto;
  }

  /* Large Leaderboard: 970x90 */
  .ad-large-leaderboard {
    width: 970px;
    height: 90px;
    margin: 0 auto;
  }
}

/* Tablet Ads (768px - 1199px) */
@media (min-width: 768px) and (max-width: 1199px) {
  /* Leaderboard: 728x90 */
  .ad-leaderboard {
    width: 100%;
    max-width: 728px;
    height: 90px;
    margin: 0 auto;
  }

  /* Medium Rectangle: 300x250 */
  .ad-medium-rect {
    width: 300px;
    height: 250px;
    margin: 0 auto;
  }

  /* Half Page: 300x600 */
  .ad-half-page {
    width: 300px;
    height: 600px;
    margin: 0 auto;
  }

  /* Mobile Leaderboard: 468x60 */
  .ad-mobile-leaderboard {
    width: 468px;
    height: 60px;
    margin: 0 auto;
  }
}

/* Mobile Ads (480px - 767px) */
@media (min-width: 480px) and (max-width: 767px) {
  /* Mobile Leaderboard: 468x60 */
  .ad-leaderboard,
  .ad-mobile-leaderboard {
    width: 100%;
    max-width: 468px;
    height: 60px;
    margin: 0 auto;
  }

  /* Mobile Medium Rectangle: 300x250 */
  .ad-medium-rect {
    width: 100%;
    max-width: 300px;
    height: 250px;
    margin: 0 auto;
  }

  /* Hide desktop-only ads */
  .ad-wide-skyscraper {
    display: none;
  }
}

/* Small Mobile Ads (< 480px) */
@media (max-width: 479px) {
  /* Mobile Banner: 320x50 */
  .ad-mobile-banner,
  .ad-leaderboard {
    width: 100%;
    max-width: 320px;
    height: 50px;
    margin: 0 auto;
  }

  /* Mobile Rectangle: 300x250 */
  .ad-medium-rect {
    width: 100%;
    max-width: 300px;
    height: 250px;
    margin: 0 auto;
  }

  /* Hide all large ads */
  .ad-wide-skyscraper,
  .ad-half-page,
  .ad-large-leaderboard,
  .ad-mobile-leaderboard {
    display: none;
  }

  .ad-container {
    padding: 0.75rem;
    margin: 1rem 0;
    min-height: 60px;
  }
}

/* ========================================
   AD CONTENT WRAPPER
   ======================================== */

.ad-content {
  width: 100%;
  text-align: center;
  overflow: hidden;
}

/* Native Ads */
.native-ad {
  background: white;
  border-radius: 10px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  border: 1px solid #eee;
}

.native-ad-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--saffron);
  margin-bottom: 0.5rem;
}

.native-ad-description {
  color: #666;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.native-ad-cta {
  display: inline-block;
  background: var(--saffron);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.native-ad-cta:hover {
  background: var(--green);
  transform: translateY(-2px);
}

/* ========================================
   AD DENSITY CONTROL
   ======================================== */

/* Hide ads on certain pages/sections to maintain good UX */
.no-ads {
  display: none !important;
}

/* Limit ads per page */
.ad-container:nth-of-type(n+5) {
  display: none;
}

@media (max-width: 768px) {
  /* Show fewer ads on mobile */
  .ad-container:nth-of-type(n+3) {
    display: none;
  }
}

/* ========================================
   AD ANIMATION & EFFECTS
   ======================================== */

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

.ad-container {
  animation: adFadeIn 0.5s ease-out;
}

/* ========================================
   GDPR & PRIVACY COMPLIANCE
   ======================================== */

.ad-privacy-notice {
  font-size: 0.75rem;
  color: #999;
  margin-top: 0.5rem;
  text-align: right;
}

.ad-privacy-notice a {
  color: var(--saffron);
  text-decoration: none;
}

.ad-privacy-notice a:hover {
  text-decoration: underline;
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
  .ad-container,
  .ad-header,
  .ad-sidebar,
  .ad-inline,
  .ad-footer,
  .ad-between-sections {
    display: none !important;
  }
}
