/* AdManager Styles */

/* Base Ad Zone Styles */
.ad-zone {
  margin: 10px 0;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
}

.ad-zone-visible {
  display: block !important;
  opacity: 1;
}

.ad-zone-hidden {
  display: none !important;
  opacity: 0;
}

/* Banner Ad Zone (Top) */
.ad-zone-banner {
  text-align: center;
  margin-bottom: 20px;
}

.ad-zone-banner .adsbygoogle {
  max-width: 100%;
  margin: 0 auto;
}

/* Sidebar Ad Zone - REMOVED for Google AdSense compliance */
/* Fixed positioned ads violate AdSense floating box policy */

/* Footer Ad Zone */
.ad-zone-footer {
  text-align: center;
  margin-top: 30px;
  padding: 20px 0;
  border-top: 1px solid #e0e0e0;
}

/* Mobile Ad Zone */
.ad-zone-mobile {
  display: none;
  text-align: center;
  margin: 15px 0;
}

/* In-content Ad Zone */
.ad-zone-content {
  margin: 30px auto;
  text-align: center;
  max-width: 336px;
}

/* Test Ad Styling (for development) */
.ad-zone.test-mode {
  background: linear-gradient(45deg, #ffeb3b, #ffc107);
  color: #333;
  padding: 15px;
  text-align: center;
  border: 2px dashed #f57c00;
  font-weight: bold;
}

.ad-zone.test-mode::before {
  content: "🎯 TEST AD: ";
  font-size: 0.9em;
}

/* Loading State */
.ad-zone.loading {
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  color: #999;
}

.ad-zone.loading::after {
  content: "Loading advertisement...";
  font-size: 0.9em;
}

/* Error State */
.ad-zone.error {
  background: #ffebee;
  border: 1px solid #ffcdd2;
  color: #c62828;
  padding: 10px;
  text-align: center;
  font-size: 0.8em;
}

.ad-zone.error::before {
  content: "⚠️ ";
}

/* Premium User - Ad-Free Experience */
.premium-user .ad-zone {
  display: none !important;
}

/* Google AdSense Responsive */
.adsbygoogle {
  border-radius: 8px;
  overflow: hidden;
}

/* Size-specific styles */
.ad-zone[data-ad-size="728x90"] {
  min-height: 90px;
  max-width: 728px;
  margin: 0 auto;
}

.ad-zone[data-ad-size="300x250"] {
  min-height: 250px;
  max-width: 300px;
  margin: 0 auto;
}

.ad-zone[data-ad-size="160x600"] {
  min-height: 600px;
  max-width: 160px;
}

.ad-zone[data-ad-size="320x50"] {
  min-height: 50px;
  max-width: 320px;
  margin: 0 auto;
}

/* Mobile Responsive */
/* Sidebar ad CSS removed - violated Google AdSense floating box policy */

@media (max-width: 768px) {
  .ad-zone-mobile {
    display: block;
  }

  .ad-zone-banner {
    margin-bottom: 15px;
  }

  .ad-zone-banner .adsbygoogle {
    max-width: 320px;
    height: 50px;
  }

  .ad-zone[data-ad-size="728x90"] {
    max-width: 320px;
    min-height: 50px;
  }
}

@media (max-width: 480px) {
  .ad-zone {
    margin: 5px 0;
  }

  .ad-zone-footer {
    padding: 15px 0;
  }

  .ad-zone-content {
    margin: 20px auto;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .ad-zone.loading {
    background: #333;
    color: #ccc;
  }

  .ad-zone.error {
    background: #2d1b1b;
    border-color: #5c2626;
    color: #ff8a80;
  }

  .ad-zone.test-mode {
    background: linear-gradient(45deg, #ffc107, #ff9800);
    color: #000;
  }
}

/* Animation for ad loading */
@keyframes adFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Hover effects for interactive ads */
.ad-zone:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Ad refresh indicator */
.ad-zone.refreshing::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  animation: adRefreshProgress 2s ease-in-out;
}

@keyframes adRefreshProgress {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Accessibility */
.ad-zone[aria-hidden="true"] {
  display: none !important;
}

/* Print styles - hide ads when printing */
@media print {
  .ad-zone {
    display: none !important;
  }
}