/* P88 Content Injector Styles */

*:focus {
  outline: none;
}

/* Basic Slot Styles */
.p88-slot {
  margin: 20px 0;
  text-align: center;
}

.p88-slot img {
  max-width: 100%;
  height: auto;
}

.p88-slot-bottom {
  margin-top: 0;
}

.p88-slot-inpost {
  margin: 24px 0;
}

/* Full-Width Sticky Bottom Ad Styles */
.p88-sticky-bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #fff;
  border-top: 1px solid #ddd;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  transform: translateY(100%);
  transition: transform 0.3s ease-in-out;
  display: none; /* Hidden by default, shown only on desktop */
  max-width: 100%;
  max-height: 75px;
}

.p88-sticky-bottom.show {
  transform: translateY(0);
}

.p88-sticky-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin: 0 auto;
  position: relative;
}

.p88-sticky-ad {
  flex: 1;
  text-align: center;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.p88-sticky-ad img {
  max-width: 100%;
  height: 100%;
  max-height: 75px;
  object-fit: contain;
  border-radius: 4px;
}

.p88-sticky-close {
  background: none;
  border: none;
  font-size: 18px;
  color: #666;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  flex-shrink: 0;
  position: absolute;
  top: 8px;
  right: 12px;
}

.p88-sticky-close:hover {
  color: #333;
}

.p88-sticky-close {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px 0 0;
  position: absolute;
  right: 0;
  top: -30px;
  background-color: #fefefe;
  box-shadow: 0 -6px 18px 0 rgba(9, 32, 76, 0.08);
}

.p88-sticky-close svg {
  width: 22px;
  height: 22px;
  fill: #000;
}

/* Desktop Only */
@media (min-width: 769px) {
  .p88-sticky-bottom {
    display: block;
  }
}

/* Mobile/Tablet - Responsive layout */
@media (max-width: 768px) {
  .p88-sticky-bottom {
    display: block;
    padding: 8px 12px;
    max-height: 80px;
  }

  .p88-sticky-content {
    flex-direction: column;
    gap: 8px;
  }

  .p88-sticky-ad {
    width: 100%;
  }

  .p88-sticky-ad img {
    max-height: 64px;
    height: 100%;
    object-fit: contain;
  }

  .p88-sticky-close {
    position: absolute;
    top: -25px;
    right: 0;
    font-size: 16px;
  }
}

/* Prevent content overlap */
body.p88-sticky-active {
  padding-bottom: 80px;
}

@media (max-width: 768px) {
  body.p88-sticky-active {
    padding-bottom: 100px;
  }
}

/* More-like-this styles */
.p88-mlt {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.p88-mlt h4 {
  margin: 0 0 10px !important;
  font-size: 14px;
  color: #555;
}

.p88-mlt-list {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.p88-mlt-card {
  display: flex;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  border-radius: 12px;
  overflow: hidden;
  background: #fafafa;
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 8px;
}

.p88-mlt-thumb {
  width: 96px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
  background: #eee;
  flex: 0 0 96px;
}

.p88-mlt-title {
  font-size: 13px;
  line-height: 1.35;
  color: #111;
  margin: 0;
}

.p88-mlt-card:hover .p88-mlt-title {
  text-decoration: underline;
}

@media (min-width: 980px) {
  .p88-mlt.float-right {
    float: right;
    width: 320px;
    margin: 0 0 12px 16px;
  }
}

/* Responsive Sidebar Popup Styles */

/* Desktop: Show sidebar normally, hide mobile trigger */
@media (min-width: 1025px) {
  .p88-sidebar-desktop {
    display: block;
  }

  .p88-sidebar-mobile-trigger {
    display: none;
  }

  .p88-sidebar-popup-overlay {
    display: none !important;
  }
}

/* Mobile/Tablet: Hide sidebar, show popup trigger */
@media (max-width: 1024px) {
  .p88-sidebar-desktop {
    display: none;
  }

  .p88-sidebar-mobile-trigger {
    display: block;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
  }

  .p88-sidebar-popup-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: p88-pulse 2s infinite;
  }

  .p88-sidebar-popup-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  }

  .p88-popup-icon {
    font-size: 16px;
    animation: p88-bounce 1s infinite;
  }

  @keyframes p88-pulse {
    0%,
    100% {
      transform: scale(1);
    }
    50% {
      transform: scale(1.05);
    }
  }

  @keyframes p88-bounce {
    0%,
    100% {
      transform: translateY(0);
    }
    50% {
      transform: translateY(-3px);
    }
  }
}

/* Popup Modal Styles */
.p88-sidebar-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  z-index: 10000;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.p88-sidebar-popup-overlay.show {
  opacity: 1;
}

.p88-sidebar-popup-modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: white;
  border-radius: 15px;
  max-width: 90vw;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease;
  position: relative;
}

.p88-sidebar-popup-overlay.show .p88-sidebar-popup-modal {
  transform: translate(-50%, -50%) scale(1);
}

.p88-sidebar-popup-content {
  padding: 20px;
  max-height: 80vh;
  overflow-y: auto;
  text-align: center;
}

.p88-sidebar-popup-content img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

.p88-sidebar-popup-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(0, 0, 0, 0.1);
  border: none;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  font-size: 20px;
  color: #333;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 1;
}

.p88-sidebar-popup-close:hover {
  background: rgba(0, 0, 0, 0.2);
  color: #000;
}

/* Mobile specific adjustments */
@media (max-width: 768px) {
  .p88-sidebar-popup-modal {
    max-width: 95vw;
    margin: 10px;
  }

  .p88-sidebar-popup-content {
    padding: 15px;
  }

  .p88-sidebar-mobile-trigger {
    bottom: 15px;
    right: 15px;
  }

  .p88-sidebar-popup-btn {
    padding: 10px 16px;
    font-size: 13px;
  }

  .p88-mlt {
    margin-bottom: 10px;
  }
}
