/* AiOrbit Ad Slots - Tasteful, Responsive Advertising */

/* ===========================================
   AD CONTAINER STYLES
   =========================================== */

.ad-slot {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-base);
}

.ad-slot:hover {
  border-color: var(--border-hover);
}

/* Sponsored Label */
.ad-label {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  padding: 2px 8px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  border-radius: var(--radius-sm);
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 10;
}

/* ===========================================
   BANNER AD (728x90 / 970x250)
   Top of catalog/search results
   =========================================== */

.ad-banner-container {
  max-width: 1400px;
  margin: 0 auto var(--space-xl);
  padding: 0 var(--space-xl);
}

.ad-banner {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Responsive banner - 970x250 on desktop, 728x90 on tablet, 320x100 on mobile */
.ad-banner-inner {
  width: 100%;
  max-width: 970px;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Placeholder state (before ad loads or for direct sales) */
.ad-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  color: var(--text-muted);
  text-align: center;
  min-height: inherit;
}

.ad-placeholder-icon {
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-sm);
  opacity: 0.5;
}

.ad-placeholder-text {
  font-size: 0.8rem;
  opacity: 0.7;
}

/* Direct ad creative (clickable) */
.ad-creative {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.ad-creative img {
  width: 100%;
  height: auto;
  display: block;
}

/* ===========================================
   SIDEBAR AD (300x250 / 300x600)
   Skill detail page sidebar
   =========================================== */

.ad-sidebar-container {
  position: sticky;
  top: calc(80px + var(--space-xl));
}

.ad-sidebar {
  width: 300px;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ad-sidebar-inner {
  width: 300px;
}

/* Support for tall sidebar ads (300x600) */
.ad-sidebar.ad-sidebar-tall {
  min-height: 600px;
}

.ad-sidebar-tall .ad-sidebar-inner {
  height: 600px;
}

/* ===========================================
   ADSENSE INTEGRATION
   =========================================== */

/* AdSense responsive container */
.adsbygoogle {
  display: block;
  width: 100%;
}

/* Ensure AdSense ads don't overflow */
.ad-slot ins.adsbygoogle {
  width: 100% !important;
}

/* ===========================================
   SKILL DETAIL PAGE LAYOUT WITH AD
   =========================================== */

.skill-detail-with-ads {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--space-2xl);
  max-width: 1200px;
  margin: 0 auto;
  padding: calc(80px + var(--space-2xl)) var(--space-xl) var(--space-2xl);
}

.skill-detail-main {
  min-width: 0; /* Prevent overflow */
}

.skill-detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

/* ===========================================
   RESPONSIVE BREAKPOINTS
   =========================================== */

@media (max-width: 1024px) {
  /* Hide sidebar ads on tablets */
  .skill-detail-with-ads {
    grid-template-columns: 1fr;
  }
  
  .skill-detail-sidebar {
    display: none;
  }
  
  /* Switch banner to leaderboard size */
  .ad-banner-inner {
    max-width: 728px;
  }
}

@media (max-width: 768px) {
  .ad-banner-container {
    padding: 0 var(--space-md);
  }
  
  /* Mobile banner (320x100) */
  .ad-banner-inner {
    max-width: 320px;
  }
  
  .ad-banner {
    min-height: 100px;
  }
  
  /* Show mobile-friendly sidebar ad at bottom of skill page */
  .skill-detail-sidebar {
    display: block;
    margin-top: var(--space-xl);
  }
  
  .ad-sidebar {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
  }
  
  .ad-sidebar-inner {
    width: 100%;
    max-width: 320px;
  }
}

/* ===========================================
   ANIMATION & LOADING STATES
   =========================================== */

.ad-loading {
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 25%,
    var(--glass-hover) 50%,
    var(--bg-tertiary) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* AdSense unfilled state */
.ad-slot.ad-unfilled .ad-placeholder {
  display: flex;
}

/* ===========================================
   DARK/LIGHT THEME COMPATIBILITY
   =========================================== */

/* Ensure ads are visible on both themes */
.ad-slot {
  background-color: var(--bg-card);
}

/* Subtle highlight effect for ads */
.ad-slot::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary-glow), transparent);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.ad-slot:hover::before {
  opacity: 1;
}
