/* =================================================================== */
/* ========= OPTIMIZED ADS CSS FOR LUMNIX ========= */
/* =================================================================== */

/* Ad fade-in animation with delay */
@keyframes delayedFadeIn {
  0%, 50% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Main layout container */
.main-layout-container {
  display: block;
  padding: 0 15px;
  margin: 20px auto;
  max-width: 1400px;
}

/* Skyscraper Otimizado */
.ad-skyscraper-left,
.ad-skyscraper-right {
  border: 1px solid #e9ecef;
  border-radius: 8px;
  background: white;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.ad-skyscraper-left,
.ad-skyscraper-right {
  width: 180px;
  height: 650px;
  flex-shrink: 0;
  position: sticky;
  top: 100px;
  z-index: 1;
}

/* Main content column */
.main-content-column {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
  z-index: 50;
  padding: 0 15px;
  box-sizing: border-box;
}

.ad-mobile-banner,
.ad-mobile-between-posts {
  width: 100%;
  max-width: 320px;
  margin: 20px auto;
  text-align: center;
  z-index: 1;
  position: relative;
}

/* Post content centering for desktop */
.modal-content {
  margin: 0 auto;
  max-width: 800px;
}

/* Layout responsivo */
@media (min-width: 993px) {
  .main-layout-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    padding: 0 20px;
  }
  
  .main-content-column {
    max-width: 1000px;
    flex: 1;
  }
  
  /* Mostrar ads desktop, esconder mobile */
  .ad-skyscraper-left,
  .ad-skyscraper-right {
    display: block !important;
  }
  
  .ad-mobile-banner,
  .ad-mobile-between-posts {
    display: none;
  }
}

@media (max-width: 992px) {
  .main-layout-container {
    display: block;
  }
  
  /* Esconder ads desktop, mostrar apenas quadrados mobile */
  .ad-skyscraper-left,
  .ad-skyscraper-right {
    display: none !important;
  }
  
  .ad-mobile-banner,
  .ad-mobile-between-posts {
    display: block;
  }
}

/* Card text centering */
.card {
  text-align: center;
}

.card h3,
.card p {
  text-align: center;
}

.card .icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

/* Ad placeholders and loading states */
.ad-placeholder {
  animation: delayedFadeIn 1s ease-out forwards;
  margin: 10px 0;
}

.ad-loading {
  position: relative;
  overflow: hidden;
}

.ad-loading::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Banner Header */
.ad-header-banner {
  text-align: center;
  margin: 15px auto;
  padding: 10px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 8px;
  border: 1px solid #0078D4;
  box-shadow: 0 2px 8px rgba(0,120,212,0.1);
}

@media (max-width: 768px) {
  .ad-header-banner { display: none; }
}

/* Native Ads */
.ad-native-content {
  margin: 30px auto;
  width: 100%;
  max-width: 350px;
  text-align: center;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 15px;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.ad-label {
  font-size: 11px;
  color: #6c757d;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
  text-align: center;
  width: 100%;
}

/* Mobile Sticky */
/* Banner Middle */
.ad-banner-middle {
  text-align: center;
  margin: 25px auto;
  padding: 12px;
  background: linear-gradient(135deg, #f1f3f4 0%, #e8eaed 100%);
  border-radius: 8px;
  border: 1px solid #dadce0;
}

@media (max-width: 768px) {
  .ad-banner-middle { display: none; }
}

/* Mobile Alt */
.ad-mobile-alt {
  text-align: center;
  margin: 20px auto;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 8px;
  display: none;
}

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

.ad-mobile-sticky {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: white;
  border-top: 1px solid #dee2e6;
  text-align: center;
  padding: 5px;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  display: none;
}

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

/* Mobile Interstitial */
.ad-mobile-interstitial {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.9);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.ad-mobile-interstitial .ad-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 20px;
  cursor: pointer;
}

/* Mobile Native Optimized */
@media (max-width: 768px) {
  .ad-native-content {
    margin: 15px auto;
    max-width: 350px;
    padding: 15px;
    display: block;
  }
  
  .ad-banner-middle,
  .ad-desktop-banner {
    display: none !important;
  }
  
  .ad-mobile-banner {
    margin: 15px auto;
    max-width: 350px;
    display: block;
  }
}

/* Desktop Banner */
@media (min-width: 769px) {
  .ad-banner-middle {
    display: block !important;
  }
  
  .ad-native-content {
    display: block !important;
  }
  
  .ad-mobile-banner {
    display: none !important;
  }
  
  .ad-skyscraper-left,
  .ad-skyscraper-right {
    display: block !important;
  }
}



/* Mobile Floating Ad */
.ad-mobile-floating {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  background: white;
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  display: none;
}

.ad-mobile-floating .ad-close {
  position: absolute;
  top: -10px;
  right: -10px;
  background: #ff4444;
  color: white;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 16px;
  cursor: pointer;
}

/* Ad status indicators */
[data-ad-status="loaded"] {
  opacity: 1;
}

[data-ad-status="error"] .ad-placeholder {
  border-color: #ddd;
  background: linear-gradient(135deg, #f8f8f8, #f0f0f0);
}

[data-ad-status="loading"] {
  opacity: 0.7;
}

/* Performance Optimizations */
.ad-container {
  contain: layout style;
  will-change: transform;
}

/* Accessibility Improvements */
.ad-label {
  font-size: 0.75rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
  display: block;
}

/* Mobile Performance */
@media (max-width: 768px) {
  .ad-container {
    transform: translateZ(0);
  }
}