/* SocialBoost Pro Frontend Styles */

/* Desktop/Mobile visibility classes */
.sbp-desktop-only {
  display: block;
}

.sbp-mobile-only {
  display: none;
}

@media (max-width: 767px) {
  .sbp-desktop-only {
    display: none;
  }

  .sbp-mobile-only {
    display: block;
  }
}

/* Floating Buttons */
.sbp-floating-buttons {
  position: fixed;
  z-index: 9999;
  display: flex;
  gap: 10px;
}

/* Group buttons (WhatsApp & Telegram) - Always on right */
.sbp-group-buttons {
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  flex-direction: column;
}

/* Mobile positioning for group buttons */
@media (max-width: 767px) {
  .sbp-group-buttons {
    top: auto;
    bottom: 30vh; /* 30% above from bottom */
    right: 20px;
  }
}

/* Floating share buttons */
.sbp-floating-share-buttons {
  position: fixed;
  z-index: 9998;
  display: flex;
  gap: 10px;
}

/* Desktop positioning for floating share */
@media (min-width: 768px) {
  .sbp-floating-share-buttons {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    flex-direction: column;
  }
}

/* Mobile positioning for floating share */
@media (max-width: 767px) {
  .sbp-floating-share-buttons {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: row;
  }
}

.sbp-floating-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 25px;
  text-decoration: none;
  color: white;
  font-weight: bold;
  font-size: 14px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 50px;
  text-align: center;
  gap: 8px;
}

.sbp-floating-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  text-decoration: none;
  color: white;
  font-weight: bold;
  font-size: 14px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  text-align: center;
}

.sbp-floating-btn:hover,
.sbp-floating-share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  text-decoration: none;
  color: white;
}

.sbp-whatsapp-btn {
  background-color: #25d366;
}

.sbp-telegram-btn {
  background-color: #0088cc;
}

/* Mobile adjustments for join buttons - keep text visible */
@media (max-width: 767px) {
  .sbp-floating-btn {
    padding: 10px 14px;
    font-size: 12px;
    min-width: auto;
  }

  .sbp-floating-btn .sbp-btn-text {
    display: block; /* Keep text visible on mobile */
  }

  .sbp-floating-share-btn {
    width: 40px;
    height: 40px;
  }
}

/* Key Points */
.sbp-key-points {
  margin: 20px 0;
  padding: 20px;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  background-color: #f8f9fa;
  clear: both;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

.sbp-key-points h3 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 18px;
  font-weight: bold;
}

.sbp-key-points ul {
  margin: 0;
  padding-left: 20px;
}

.sbp-key-points li {
  margin-bottom: 8px;
  line-height: 1.5;
}

/* Social Share Buttons */
.sbp-social-share {
  margin: 20px 0;
  text-align: center;
  clear: both;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

.sbp-share-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sbp-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 5px;
  text-decoration: none;
  color: white;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.sbp-share-btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
  color: white;
}

.sbp-facebook {
  background-color: #1877f2;
}

.sbp-twitter {
  background-color: #1da1f2;
}

.sbp-linkedin {
  background-color: #0077b5;
}

.sbp-whatsapp {
  background-color: #25d366;
}

.sbp-telegram {
  background-color: #0088cc;
}

.sbp-instagram {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.sbp-youtube {
  background-color: #ff0000;
}

.sbp-copy {
  background-color: #6c757d;
}

.sbp-copy:hover {
  background-color: #5a6268;
}

/* Mobile adjustments for share buttons */
@media (max-width: 767px) {
  .sbp-share-buttons {
    flex-direction: row; /* Change from column to row */
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
  }

  .sbp-share-btn {
    width: auto;
    max-width: none;
    justify-content: center;
    padding: 12px 16px;
    font-size: 16px;
  }

  /* Mobile share icons styling - horizontal layout */
  .sbp-mobile-share {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    flex-direction: row;
  }
}

/* Related Posts */
.sbp-related-posts {
  margin: 30px 0;
  padding: 20px;
  border-top: 2px solid #eee;
  clear: both;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
  border-radius: 8px;
}

.sbp-related-posts h3 {
  margin-bottom: 20px;
  font-size: 18px;
  font-weight: bold;
}

.sbp-related-posts-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.sbp-related-post-item {
  display: flex;
  gap: 15px;
  padding: 15px;
  border: 1px solid #eee;
  border-radius: 8px;
  transition: all 0.3s ease;
  background-color: #ffffff;
}

.sbp-related-post-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sbp-related-thumbnail {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  overflow: hidden;
  border-radius: 5px;
}

.sbp-related-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sbp-related-content {
  flex: 1;
}

.sbp-related-content h4 {
  margin: 0 0 8px 0;
  font-size: 16px;
  line-height: 1.3;
}

.sbp-related-content h4 a {
  text-decoration: none;
  color: #333;
  transition: color 0.3s ease;
}

.sbp-related-content h4 a:hover {
  color: #007cba;
}

.sbp-related-content p {
  margin: 0;
  font-size: 14px;
  color: #666;
  line-height: 1.4;
}

/* Mobile layout for related posts */
@media (max-width: 767px) {
  .sbp-related-posts-list .sbp-related-post-item {
    flex-direction: row !important; /* Force row direction on mobile */
  }

  .sbp-related-posts-list .sbp-related-thumbnail {
    width: 80px !important;
    height: 80px !important;
    flex-shrink: 0;
  }

  .sbp-related-posts-list.sbp-mobile-column .sbp-related-thumbnail {
    width: 80px !important;
    height: 80px !important;
    align-self: flex-start;
  }

  .sbp-related-posts-list.sbp-mobile-column .sbp-related-post-item {
    text-align: left;
  }
}

/* Ensure proper spacing */
.sbp-share-top {
  margin-bottom: 20px;
}

.sbp-share-bottom {
  margin-top: 20px;
}

/* Copy button animation */
.sbp-copy.copied {
  background-color: #28a745 !important;
  transform: scale(0.95);
}

.sbp-copy.copied::after {
  content: " ✓";
}

/* Create default thumbnail image */
.sbp-default-thumbnail {
  background-color: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 24px;
  border-radius: 5px;
}

/* Platform-specific colors for floating share buttons */
.sbp-facebook,
.sbp-floating-share-btn.sbp-facebook {
  background-color: #1877f2 !important;
}

.sbp-twitter,
.sbp-floating-share-btn.sbp-twitter {
  background-color: #1da1f2 !important;
}

.sbp-whatsapp,
.sbp-floating-share-btn.sbp-whatsapp,
.sbp-whatsapp-btn {
  background-color: #25d366 !important;
}

.sbp-telegram,
.sbp-floating-share-btn.sbp-telegram,
.sbp-telegram-btn {
  background-color: #0088cc !important;
}

.sbp-linkedin,
.sbp-floating-share-btn.sbp-linkedin {
  background-color: #0077b5 !important;
}

.sbp-instagram,
.sbp-floating-share-btn.sbp-instagram {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%) !important;
}

.sbp-youtube,
.sbp-floating-share-btn.sbp-youtube {
  background-color: #ff0000 !important;
}

.sbp-copy,
.sbp-floating-share-btn.sbp-copy {
  background-color: #6c757d !important;
}

/* SVG icons styling */
.sbp-share-btn svg,
.sbp-floating-btn svg,
.sbp-floating-share-btn svg {
  flex-shrink: 0;
}

/* Responsive text sizing */
@media (max-width: 480px) {
  .sbp-key-points {
    padding: 15px;
    margin: 15px 0;
  }

  .sbp-related-posts {
    padding: 15px;
    margin: 20px 0;
  }

  .sbp-social-share {
    margin: 15px 0;
  }
}

/* Mobile/Desktop text switching for join buttons */
.sbp-desktop-text {
  display: inline;
}

.sbp-mobile-text {
  display: none;
}

@media (max-width: 767px) {
  .sbp-desktop-text {
    display: none;
  }

  .sbp-mobile-text {
    display: inline;
  }
}

/* Desktop/Mobile share button switching */
.sbp-desktop-share {
  display: flex;
}

.sbp-mobile-share {
  display: none;
}

@media (max-width: 767px) {
  .sbp-desktop-share {
    display: none;
  }

  .sbp-mobile-share {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
  }
}

/* Mobile share icons styling */
.sbp-share-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  text-decoration: none;
  color: white;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sbp-share-icon:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  text-decoration: none;
  color: white;
}

.sbp-share-icon svg {
  width: 20px;
  height: 20px;
}

/* Platform colors for mobile icons */
.sbp-share-icon.sbp-facebook {
  background-color: #1877f2;
}

.sbp-share-icon.sbp-twitter {
  background-color: #1da1f2;
}

.sbp-share-icon.sbp-whatsapp {
  background-color: #25d366;
}

.sbp-share-icon.sbp-telegram {
  background-color: #0088cc;
}

.sbp-share-icon.sbp-linkedin {
  background-color: #0077b5;
}

.sbp-share-icon.sbp-instagram {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.sbp-share-icon.sbp-youtube {
  background-color: #ff0000;
}

.sbp-share-icon.sbp-copy {
  background-color: #6c757d;
}

/* Dynamic sizing for mobile share icons and floating buttons */
@media (max-width: 767px) {
  .sbp-floating-share-btn {
    width: var(--mobile-bottom-share-size, 45px);
    height: var(--mobile-bottom-share-size, 45px);
  }

  .sbp-share-icon {
    width: var(--mobile-share-icon-size, 40px);
    height: var(--mobile-share-icon-size, 40px);
  }

  .sbp-share-icon svg {
    width: calc(var(--mobile-share-icon-size, 40px) * 0.5);
    height: calc(var(--mobile-share-icon-size, 40px) * 0.5);
  }

  .sbp-floating-share-btn svg {
    width: calc(var(--mobile-bottom-share-size, 45px) * 0.45);
    height: calc(var(--mobile-bottom-share-size, 45px) * 0.45);
  }
}
