/* Self-Promotion Ad Styles */
.self-promo-ad {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  max-width: 280px;
  background: linear-gradient(135deg, #2b409a 0%, #764ba2 100%);
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.self-promo-ad.show {
  transform: translateY(0);
  opacity: 1;
}

.self-promo-ad.hide {
  transform: translateY(100px);
  opacity: 0;
}

.ad-content {
  position: relative;
  padding: 15px;
  color: white;
}

.close-ad-container {
  position: absolute;
  display: flex;
  justify-content: end;
  z-index: 99999;
  right: 10px;
}

.ad-close {
  position: relative;
  cursor: pointer;
  font-size: 1.5em;
  width: 30px;
  height: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  padding-bottom: 2px;
  transition: all 0.15s;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.ad-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.ad-loading-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: rgba(255, 255, 255, 0.685);
  overflow: hidden;
}

.loading-progress {
  height: 100%;
  background: linear-gradient(90deg, #4ade80 0%, #22c55e 100%);
  width: 0%;
  transition: width 0.1s linear;
  border-radius: 0 2px 2px 0;
}

.ad-icon {
  margin-bottom: 8px;
  color: #ffd700;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-5px);
  }
}

.ad-text h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.2;
}

.ad-text p {
  font-size: 0.8rem;
  opacity: 0.9;
  margin-bottom: 12px;
  line-height: 1.3;
}

.ad-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
  color: white;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
  box-shadow: 0 4px 15px rgba(70, 70, 70, 0.525);
  border: 1px solid rgba(255, 255, 255, 0.2);
  /* border: none; */
  cursor: pointer;
  position: relative;
  overflow: hidden;
  width: 100%;
}

.ad-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s;
}

.ad-button:hover::before {
  left: 100%;
}

.ad-button:hover {
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.3);
}

.ad-button:active {
  transform: translateY(0);
}

.ad-button svg {
  transition: transform 0.3s ease;
}

/* Responsive Design */

/* Desktop (1024px and up) */
@media (min-width: 1024px) {
  .self-promo-ad {
    max-width: 300px;
    bottom: 25px;
    right: 25px;
  }

  .ad-content {
    padding: 20px;
  }

  .ad-text h3 {
    font-size: 1.3rem;
  }

  .ad-text p {
    font-size: 0.9rem;
  }
}

/* Tablet (768px to 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .self-promo-ad {
    max-width: 280px;
    bottom: 20px;
    right: 20px;
  }

  .ad-content {
    padding: 15px;
  }

  .ad-text h3 {
    font-size: 1.2rem;
  }

  .ad-text p {
    font-size: 0.85rem;
  }

  .client-website header h1 {
    font-size: 2.5rem;
  }
}

/* Mobile Landscape (481px to 767px) */
@media (min-width: 481px) and (max-width: 767px) {
  .self-promo-ad {
    bottom: 15px;
    right: 15px;
    left: 15px;
    max-width: none;
  }

  .ad-content {
    padding: 12px;
  }

  .ad-text h3 {
    font-size: 1.1rem;
  }

  .ad-text p {
    font-size: 0.8rem;
  }

  .client-website header h1 {
    font-size: 2.2rem;
  }
}

/* Mobile Portrait (320px to 480px) */
@media (max-width: 480px) {
  .self-promo-ad {
    bottom: 0;
    right: 0;
    left: 0;
    max-width: none;
    border-radius: 0;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
  }

  .ad-content {
    padding: 20px 30px 15px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .ad-icon {
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .ad-icon svg {
    width: 30px;
    height: 30px;
  }

  .ad-text {
    flex: 1;
    margin-bottom: 0;
  }

  .ad-text h3 {
    font-size: 0.9rem;
    margin-bottom: 2px;
  }

  .ad-text p {
    font-size: 0.7rem;
    margin-bottom: 0;
  }

  .ad-button {
    padding: 8px 16px;
    font-size: 0.75rem;
    flex-shrink: 0;
    width: auto;
  }

  .close-ad-container {
    position: absolute;
    top: 8px;
    right: 8px;
  }

  .ad-close {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .client-website header h1 {
    font-size: 2rem;
  }
}

/* Extra small devices (below 320px) */
@media (max-width: 320px) {
  .self-promo-ad {
    bottom: 0;
    right: 0;
    left: 0;
    border-radius: 0;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
  }

  .ad-content {
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .ad-icon {
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .ad-icon svg {
    width: 25px;
    height: 25px;
  }

  .ad-text {
    flex: 1;
    margin-bottom: 0;
  }

  .ad-text h3 {
    font-size: 0.8rem;
    margin-bottom: 2px;
  }

  .ad-text p {
    font-size: 0.65rem;
    margin-bottom: 0;
  }

  .ad-button {
    padding: 6px 12px;
    font-size: 0.65rem;
    flex-shrink: 0;
    width: auto;
  }

  .close-ad-container {
    position: absolute;
    top: 6px;
    right: 6px;
  }

  .ad-close {
    width: 20px;
    height: 20px;
    font-size: 10px;
  }
}

/* Animation for ad appearance */
@keyframes slideInUp {
  from {
    transform: translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideOutDown {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(100px);
    opacity: 0;
  }
}
