/**
 * Ad Styles - Professional Advertising Layout
 * Optimized for Google AdSense and Direct Advertising
 */

/* === BASE AD STYLES === */
.ad-container {
  width: 100%;
  text-align: center;
  margin: 0 auto;
  padding: 1rem 0;
}

.ad-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 0.5rem;
  display: block;
  font-weight: 500;
  letter-spacing: 0.05em;
}

/* === TOP BANNER AD === */
#top-banner {
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  position: relative;
  z-index: 10;
}

#top-banner .ad-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
}

/* AdSense responsive banner */
#top-banner .adsbygoogle {
  display: block !important;
  margin: 0 auto;
}

/* Direct ad banner */
#top-banner img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* === SIDEBAR ADS === */
.sidebar-ad {
  background: #ffffff;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  margin-bottom: 1.5rem;
  border: 1px solid #e5e7eb;
}

.sidebar-ad .ad-label {
  color: #9ca3af;
  font-size: 0.7rem;
  margin-bottom: 1rem;
}

/* AdSense 300x250 */
.sidebar-ad .adsbygoogle[data-ad-slot*="300"] {
  width: 300px !important;
  height: 250px !important;
  margin: 0 auto;
}

/* Direct sidebar ads */
.sidebar-ad img {
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
  transition: transform 0.2s ease;
}

.sidebar-ad img:hover {
  transform: scale(1.02);
}

/* === IN-CONTENT ADS === */
.content-ad {
  margin: 2rem 0;
  padding: 1.5rem;
  background: #f9fafb;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  text-align: center;
}

.content-ad .ad-label {
  color: #6b7280;
  margin-bottom: 1rem;
}

/* AdSense in content */
.content-ad .adsbygoogle {
  display: block !important;
  margin: 0 auto;
  max-width: 100%;
}

/* Direct content ads */
.content-ad img {
  max-width: 336px;
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin: 0 auto;
}

/* === FOOTER ADS === */
.footer-ad {
  background: #f3f4f6;
  border-top: 1px solid #d1d5db;
  border-bottom: 1px solid #d1d5db;
  padding: 2rem 0;
  text-align: center;
}

.footer-ad .ad-label {
  color: #6b7280;
  margin-bottom: 1rem;
}

/* AdSense footer */
.footer-ad .adsbygoogle {
  display: block !important;
  margin: 0 auto;
}

/* Direct footer ads */
.footer-ad img {
  max-width: 728px;
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
}

/* === RESPONSIVE AD STYLES === */

/* Mobile - 320px and up */
@media (max-width: 640px) {
  #top-banner .ad-container {
    padding: 0.75rem 1rem;
  }
  
  .sidebar-ad {
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  .content-ad {
    margin: 1.5rem 0;
    padding: 1rem;
  }
  
  .footer-ad {
    padding: 1.5rem 0;
  }
  
  /* Responsive AdSense */
  .adsbygoogle {
    max-width: 100% !important;
    height: auto !important;
  }
  
  #top-banner .adsbygoogle {
    width: 320px !important;
    height: 100px !important;
  }
  
  .footer-ad .adsbygoogle {
    width: 320px !important;
    height: 100px !important;
  }
}

/* Tablet - 641px to 1024px */
@media (min-width: 641px) and (max-width: 1024px) {
  #top-banner .adsbygoogle {
    width: 728px !important;
    height: 90px !important;
  }
  
  .footer-ad .adsbygoogle {
    width: 728px !important;
    height: 90px !important;
  }
  
  .content-ad .adsbygoogle {
    width: 336px !important;
    height: 280px !important;
  }
}

/* Desktop - 1025px and up */
@media (min-width: 1025px) {
  #top-banner .adsbygoogle {
    width: 970px !important;
    height: 90px !important;
  }
  
  .footer-ad .adsbygoogle {
    width: 728px !important;
    height: 90px !important;
  }
  
  .content-ad .adsbygoogle {
    width: 336px !important;
    height: 280px !important;
  }
}

/* Large Desktop - 1200px and up */
@media (min-width: 1200px) {
  #top-banner .adsbygoogle {
    width: 970px !important;
    height: 250px !important;
  }
}

/* === AD BLOCKER STYLES === */
.ad-blocker-detected .ad-container,
.ad-blocker-detected .sidebar-ad,
.ad-blocker-detected .content-ad,
.ad-blocker-detected .footer-ad {
  background: #fef3c7;
  border: 2px dashed #f59e0b;
  padding: 2rem;
  text-align: center;
  border-radius: 0.75rem;
}

.ad-blocker-detected .ad-container::before,
.ad-blocker-detected .sidebar-ad::before,
.ad-blocker-detected .content-ad::before,
.ad-blocker-detected .footer-ad::before {
  content: "🚫";
  font-size: 2rem;
  margin-bottom: 1rem;
  display: block;
}

.ad-blocker-detected .ad-container::after,
.ad-blocker-detected .sidebar-ad::after,
.ad-blocker-detected .content-ad::after,
.ad-blocker-detected .footer-ad::after {
  content: "Por favor, desative seu AdBlocker para nos apoiar. A publicidade ajuda a manter este site gratuito.";
  font-size: 0.875rem;
  color: #92400e;
  line-height: 1.4;
  display: block;
  margin-top: 0.5rem;
}

/* === AD ANIMATIONS === */
@keyframes adFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ad-container,
.sidebar-ad,
.content-ad,
.footer-ad {
  animation: adFadeIn 0.5s ease-out;
}

/* === AD HOVER EFFECTS === */
.sidebar-ad:hover,
.content-ad:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
  transition: all 0.2s ease;
}

/* === DARK MODE AD STYLES === */
.dark .ad-container {
  background: #1f2937;
  border-color: #374151;
}

.dark .sidebar-ad {
  background: #1f2937;
  border-color: #374151;
}

.dark .content-ad {
  background: #1f2937;
  border-color: #374151;
}

.dark .footer-ad {
  background: #111827;
  border-color: #374151;
}

.dark .ad-label {
  color: #9ca3af;
}

/* === AD PERFORMANCE OPTIMIZATIONS === */
.adsbygoogle {
  will-change: transform;
  contain: layout style paint;
}

/* Prevent layout shift */
.ad-container {
  min-height: 90px;
}

.sidebar-ad {
  min-height: 280px;
}

.content-ad {
  min-height: 300px;
}

.footer-ad {
  min-height: 110px;
}

/* === CUSTOM AD TEMPLATES === */
.ad-template-premium {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem;
  border-radius: 1rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.ad-template-premium::before {
  content: "PATROCINADO";
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.ad-template-minimal {
  background: white;
  border: 1px solid #e5e7eb;
  padding: 1.5rem;
  border-radius: 0.5rem;
  text-align: center;
}

.ad-template-minimal .ad-label {
  color: #d1d5db;
  font-size: 0.625rem;
}

/* === ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {
  .ad-container,
  .sidebar-ad,
  .content-ad,
  .footer-ad {
    animation: none;
  }
  
  .sidebar-ad:hover,
  .content-ad:hover {
    transform: none;
  }
}

/* Screen reader support */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
