/* AdSense Styling */

.adsense-container {
  max-width: 100%;
  overflow: hidden;
  border-radius: 8px;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  transition: all 0.2s ease-in-out;
}

.adsense-container:hover {
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

/* Responsive ad containers */
.adsense-container .adsbygoogle {
  display: block !important;
  margin: 0 auto;
  text-align: center;
}

/* Development mode placeholder styling */
.adsense-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  position: relative;
}

.adsense-placeholder::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(255, 255, 255, 0.1) 10px,
    rgba(255, 255, 255, 0.1) 20px
  );
  pointer-events: none;
}

/* Mobile-specific styling */
@media (max-width: 768px) {
  .adsense-container {
    margin: 1rem 0;
  }
  
  .adsense-container .adsbygoogle {
    min-height: 100px;
  }
}

/* Desktop sidebar ad styling */
@media (min-width: 1024px) {
  .adsense-container.sidebar-ad {
    width: 300px;
    max-width: 300px;
  }
  
  .adsense-container.sidebar-ad .adsbygoogle {
    width: 300px;
    height: 250px;
  }
}

/* Content banner styling */
.adsense-container.content-banner {
  width: 100%;
  max-width: 728px;
  margin: 0 auto;
}

.adsense-container.content-banner .adsbygoogle {
  width: 100%;
  min-height: 90px;
}

/* Footer ad styling */
.adsense-container.footer-ad {
  width: 100%;
  max-width: 970px;
  margin: 0 auto;
}

.adsense-container.footer-ad .adsbygoogle {
  width: 100%;
  min-height: 90px;
}

/* Hide ads on admin pages */
body[data-controller*="admin"] .adsense-container {
  display: none !important;
}

/* Ensure ads don't interfere with page layout */
.adsense-container {
  clear: both;
  position: relative;
  z-index: 1;
}

/* Advertisement label styling */
.adsense-container .text-xs {
  font-size: 0.75rem;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .adsense-container.content-banner,
  .adsense-container.footer-ad {
    max-width: 320px;
  }
  
  .adsense-container.content-banner .adsbygoogle,
  .adsense-container.footer-ad .adsbygoogle {
    min-height: 100px;
  }
}

/* Animation for ad loading */
.adsense-container .adsbygoogle {
  opacity: 0;
  animation: fadeInAd 0.5s ease-in-out 0.3s forwards;
}

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

/* Prevent layout shift during ad loading */
.adsense-container .adsbygoogle[data-ad-status="unfilled"] {
  display: none !important;
}

/* Ensure proper spacing around ads */
.adsense-container + .adsense-container {
  margin-top: 2rem;
}

/* Print media - hide ads */
@media print {
  .adsense-container {
    display: none !important;
  }
}
