/* Ad Revenue Optimization CSS */
/* Ensures maximum ad visibility and engagement for $8000+ monthly target */

/* Video Ad Styling - Higher RPM than display ads */
.video-ad {
  margin: 30px 0;
  background: linear-gradient(135deg, #1a1f2e 60%, #2d1e4a 100%);
  border-radius: 16px;
  overflow: hidden;
}

.video-ad.ad-loaded {
  min-height: 200px;
  max-height: 400px;
}

/* Native Ad Container - Blends with content */
.native-ad-container {
  margin: 40px 0;
  padding: 25px;
  background: linear-gradient(135deg, #232b3a 60%, #2d1e4a 100%);
  border-radius: 16px;
  border: 1px solid #43e97b33;
  opacity: 0;
  display: none;
  transition: all 0.3s ease;
}

.native-ad-container.ad-loaded {
  opacity: 1;
  display: block;
}

.native-ad-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 15px;
}

/* Enhanced Ad Container Styling */
.ad-container {
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  text-align: center;
  opacity: 0;
  height: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
  display: none;
}

.ad-container.ad-loaded {
  display: block;
  opacity: 1;
  height: auto;
  max-height: none;
  min-height: 90px;
  margin: 25px 0;
  padding: 15px;
  background: linear-gradient(135deg, #232b3a 60%, #2d1e4a 100%);
  border-radius: 12px;
  border: 1px solid #a259ff33;
}

.ad-container .ad-label {
  color: #a259ff;
  font-size: 0.9rem;
  margin-bottom: 10px;
  opacity: 0;
  display: none;
}

.ad-container.ad-loaded .ad-label {
  opacity: 1;
  display: block;
}

/* Hide unfilled or empty ads completely */
.adsbygoogle:empty {
  display: none !important;
}

.adsbygoogle[data-ad-status="unfilled"] {
  display: none !important;
}

.adsbygoogle {
  border-radius: 8px;
  transition: opacity 0.3s ease;
  background: rgba(26, 31, 46, 0.5);
  border: 1px solid rgba(162, 89, 255, 0.2);
  margin: 10px 0;
}

.adsbygoogle:hover {
  opacity: 0.95;
  border-color: rgba(162, 89, 255, 0.4);
}

/* Responsive Ad Containers */
@media (max-width: 768px) {
  .adsbygoogle {
    min-height: 250px;
    max-width: 100%;
  }
  
  /* Mobile-specific ad spacing */
  .mobile-ad-container {
    margin: 20px -10px;
    padding: 15px 10px;
  }
}

/* Sidebar ads - hidden by default */
.sidebar-ad {
  position: fixed;
  width: 160px;
  z-index: 100;
  opacity: 0;
  transform: translateX(-200px);
  transition: all 0.3s ease;
  display: none;
}

.sidebar-ad.ad-loaded {
  opacity: 1;
  transform: translateX(0);
  display: block;
}

.sidebar-ad.left {
  left: 10px;
  top: 50%;
  transform: translateY(-50%) translateX(-200px);
}

.sidebar-ad.right {
  right: 10px;
  top: 50%;
  transform: translateY(-50%) translateX(200px);
}

.sidebar-ad.ad-loaded.left {
  transform: translateY(-50%) translateX(0);
}

.sidebar-ad.ad-loaded.right {
  transform: translateY(-50%) translateX(0);
}

/* Floating mobile ad - hidden by default */
.floating-ad {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 9999;
  background: rgba(24,28,43,0.95);
  padding: 10px 0;
  text-align: center;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  display: none;
}

.floating-ad.ad-loaded {
  transform: translateY(0);
  display: block;
}

.floating-ad .close-btn {
  position: absolute;
  top: 5px;
  right: 10px;
  background: none;
  border: none;
  color: #a259ff;
  font-size: 1.2rem;
  cursor: pointer;
}

@media (min-width: 1200px) {
  /* Desktop sidebar ad positioning */
  .desktop-sidebar-ad {
    position: fixed;
    width: 160px;
    height: 600px;
    z-index: 999;
  }
  
  .desktop-sidebar-ad.left {
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
  }
  
  .desktop-sidebar-ad.right {
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
  }
}

/* Ad Loading Animation */
.adsbygoogle:empty {
  position: relative;
  min-height: 250px;
  background: linear-gradient(90deg, #1a1f2e 25%, #232b3a 50%, #1a1f2e 75%);
  background-size: 200% 100%;
  animation: adLoading 1.5s infinite;
}

.adsbygoogle:empty::after {
  content: 'Loading...';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #a259ff;
  font-size: 0.9rem;
}

@keyframes adLoading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* High-Converting Ad Positions */
.premium-ad-container {
  background: linear-gradient(135deg, #232b3a 60%, #2d1e4a 100%);
  border-radius: 12px;
  padding: 20px;
  margin: 30px 0;
  border: 1px solid rgba(67, 233, 123, 0.2);
  text-align: center;
  position: relative;
}

.premium-ad-container::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  background: linear-gradient(45deg, #43e97b, #a259ff, #19e3ff);
  border-radius: 12px;
  z-index: -1;
  opacity: 0.1;
}

.ad-label {
  color: #a259ff;
  font-size: 0.9rem;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Floating Ad Styling */
.floating-ad {
  position: fixed;
  z-index: 9999;
  background: rgba(24, 28, 43, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.5s ease;
}

.floating-ad.bottom {
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 10px 0;
}

.floating-ad .close-btn {
  position: absolute;
  top: 5px;
  right: 10px;
  background: none;
  border: none;
  color: #a259ff;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 10000;
}

@keyframes slideIn {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* In-Content Ad Integration */
.content-ad {
  margin: 30px 0;
  padding: 20px;
  background: #1a1f2e;
  border-radius: 8px;
  border-left: 4px solid #43e97b;
}

.content-ad .ad-heading {
  color: #43e97b;
  font-size: 1.1rem;
  margin-bottom: 15px;
  font-weight: 600;
}

/* Ad Performance Optimization */
.high-value-ad {
  border: 2px solid rgba(67, 233, 123, 0.3);
  box-shadow: 0 0 20px rgba(67, 233, 123, 0.1);
}

.premium-placement {
  background: radial-gradient(circle at center, rgba(162, 89, 255, 0.1) 0%, transparent 70%);
}

/* Revenue Maximization Styles */
@media (min-width: 1400px) {
  .main-content {
    margin: 0 180px; /* Space for sidebar ads */
  }
}

/* Mobile Ad Optimization */
@media (max-width: 767px) {
  .mobile-only-ad {
    display: block;
  }
  
  .desktop-only-ad {
    display: none;
  }
  
  .sticky-mobile-ad {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(24, 28, 43, 0.95);
    padding: 10px;
    z-index: 9999;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.3);
  }

  /* Enhanced Mobile Ad Containers */
  .ad-container.ad-loaded {
    margin: 15px 0;
    padding: 12px;
    border-radius: 8px;
    min-height: 70px;
    max-width: 100%;
    overflow: hidden;
  }

  .video-ad.ad-loaded {
    min-height: 180px;
    max-height: 280px;
    margin: 20px 0;
  }

  .native-ad-container {
    margin: 25px 0;
    padding: 16px;
    border-radius: 12px;
  }

  .native-ad-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  /* Hide sidebar ads on mobile */
  .sidebar-ad, .left, .right {
    display: none !important;
  }

  /* Mobile floating ad positioning */
  .floating-ad {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    max-height: 120px;
    background: #181c2b;
    border-top: 2px solid #a259ff;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.4);
    padding: 8px;
  }

  .floating-ad.ad-loaded {
    display: block;
  }

  .close-btn {
    position: absolute;
    top: 5px;
    right: 10px;
    background: #a259ff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    font-size: 14px;
    cursor: pointer;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Content ad mobile optimization */
  .content-ad {
    margin: 20px 0;
    padding: 15px;
    border-radius: 8px;
  }

  /* Ad labels on mobile */
  .ad-label {
    font-size: 0.8rem;
    margin-bottom: 8px;
  }
}

@media (min-width: 768px) {
  .mobile-only-ad {
    display: none;
  }
  
  .desktop-only-ad {
    display: block;
  }
}

/* Ad Refresh Indicators */
.ad-refreshing {
  opacity: 0.7;
  transform: scale(0.98);
  transition: all 0.3s ease;
}

/* Revenue Tracking Classes */
.high-ctr-position {
  /* Positions that typically get high click-through rates */
  position: relative;
}

.above-fold {
  /* Above the fold positioning for maximum visibility */
  z-index: 10;
}

.content-integrated {
  /* Seamlessly integrated with content */
  margin: 1.5rem 0;
}
