/**
 * Mobile Sticky Ad CSS
 * Displays a fixed ad at the bottom of the screen on mobile devices
 * Only shows on screens ≤ 768px width
 */

/* Mobile sticky ad container */
#mobile-sticky-ad {
  display: none; /* Hidden by default */
  position: fixed;
  bottom: 50px; /* 50px above safe area */
  left: 50%;
  transform: translateX(-50%);
  z-index: 9998; /* Below ad blocker wall (9999) but above content */
  width: 320px;
  height: 100px;
  max-width: calc(100vw - 20px); /* Prevent overflow on very small screens */
}

#mobile-sticky-ad-inner {
  width: 100%;
  height: 100%;
  background-color: #f3f4f6; /* Light gray */
  border: 1px solid #d1d5db;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-center;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  #mobile-sticky-ad-inner {
    background-color: #1f2937; /* Dark gray */
    border-color: #374151;
  }
}

/* Show only on mobile */
@media (max-width: 768px) {
  #mobile-sticky-ad {
    display: block;
  }

  /* Add padding to body to prevent content from being hidden */
  body {
    padding-bottom: 160px; /* 100px ad + 50px bottom offset + 10px extra */
  }
}

/* Extra small screens */
@media (max-width: 375px) {
  #mobile-sticky-ad {
    width: 300px;
    height: 90px;
  }
}

/* Tablet and up - hide completely */
@media (min-width: 769px) {
  #mobile-sticky-ad {
    display: none !important;
  }

  body {
    padding-bottom: 0 !important;
  }
}

/* Animation for entrance */
@keyframes slideUp {
  from {
    bottom: -100px;
    opacity: 0;
  }
  to {
    bottom: 50px;
    opacity: 1;
  }
}

#mobile-sticky-ad.animated {
  animation: slideUp 0.3s ease-out;
}

/* Close button for sticky ad (optional) */
.mobile-sticky-ad-close {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 24px;
  height: 24px;
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-center;
  font-size: 14px;
  cursor: pointer;
  border: 2px solid white;
  font-weight: bold;
  line-height: 1;
  z-index: 1;
}

.mobile-sticky-ad-close:hover {
  background-color: rgba(0, 0, 0, 0.8);
}
