/* Post an ad – tabbed dropdown (short, reliable) */

.post-ad-dropdown {
  position: relative;
  z-index: 1060;
}

/* Button always on top so it stays clickable when menu is open */
.post-ad-btn {
  position: relative;
  z-index: 1062;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 100%);
  border: none;
  border-radius: 9999px;
  box-shadow: 0 2px 12px rgba(91, 33, 182, 0.35);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.post-ad-btn:hover,
.post-ad-btn:focus {
  color: #fff;
  background: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 100%);
  box-shadow: 0 4px 20px rgba(91, 33, 182, 0.45);
  transform: translateY(-1px);
  outline: none;
  border: none;
}

.post-ad-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.4);
}

.post-ad-arrow {
  font-size: 10px;
  opacity: 0.9;
  transition: transform 0.2s ease;
}

.post-ad-dropdown.show .post-ad-arrow {
  transform: rotate(180deg);
}

/* Menu panel – below button; when closed don’t block clicks */
.post-ad-menu {
  display: none;
  min-width: 300px;
  max-width: 340px;
  padding: 0;
  margin-top: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
  background: #fff;
  z-index: 1061;
  animation: post-ad-in 0.2s ease;
  position: absolute;
}
.post-ad-menu.show {
  display: block;
}
.post-ad-menu:not(.show) {
  pointer-events: none !important;
}

@keyframes post-ad-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Tabs */
.post-ad-tabs {
  display: flex;
  padding: 10px 10px 0;
  gap: 4px;
  border-bottom: 1px solid #f3f4f6;
  background: #fafafa;
  border-radius: 14px 14px 0 0;
}

.post-ad-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.post-ad-tab i {
  font-size: 13px;
}

.post-ad-tab:hover {
  color: #374151;
  background: rgba(124, 58, 237, 0.08);
}

.post-ad-tab.active {
  color: #7c3aed;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* Panels – one visible, fixed height */
.post-ad-panels {
  position: relative;
  max-height: 320px;
  overflow: hidden;
}

.post-ad-panel {
  display: none;
  flex-direction: column;
  padding: 12px 14px 14px;
  overflow-y: auto;
  max-height: 320px;
}

.post-ad-panel.active {
  display: flex;
  animation: post-ad-panel-in 0.2s ease;
}

@keyframes post-ad-panel-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.post-ad-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: 13px;
  color: #374151;
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}

.post-ad-link i {
  font-size: 13px;
  width: 18px;
  text-align: center;
  color: #7c3aed;
  opacity: 0.9;
  flex-shrink: 0;
}

/* Explicitly guard label text against any page-level span overrides */
.post-ad-menu .post-ad-link span,
.post-ad-menu .post-ad-tab span {
  display: inline !important;
  visibility: visible !important;
  opacity: 1 !important;
  color: inherit !important;
  font-size: inherit !important;
  font-weight: inherit !important;
}

.post-ad-link:hover {
  background: #f5f3ff;
  color: #5b21b6;
}

.post-ad-link:hover i {
  color: #6d28d9;
}

.post-ad-menu-footer {
  padding: 10px 14px;
  border-top: 1px solid #f3f4f6;
  text-align: center;
  background: #fafafa;
  border-radius: 0 0 14px 14px;
}

.post-ad-menu-footer a {
  font-size: 12px;
  font-weight: 500;
  color: #7c3aed;
  text-decoration: none;
}

.post-ad-menu-footer a:hover {
  text-decoration: underline;
}

/* Ensure Bootstrap doesn’t hide menu under other elements */
.header-blue .post-ad-dropdown .dropdown-menu {
  z-index: 1061 !important;
}

@media (max-width: 991px) {
  .post-ad-menu {
    min-width: 280px;
    max-width: calc(100vw - 24px);
  }
}
