/**
 * ProRank Standard Tab Navigation
 *
 * Unified, premium tab navigation with toggles below labels.
 * Clean, modern design consistent across all pages.
 *
 * @since 3.0.0
 */

/* ============================================
   TAB NAVIGATION CONTAINER
   ============================================ */

.prorank-tab-navigation {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
  border-radius: 26px;
  padding: 14px;
  box-shadow:
    0 28px 54px -40px rgba(15, 23, 42, 0.34),
    0 16px 28px -24px rgba(15, 23, 42, 0.18);
  margin-bottom: 28px;
  border: 1px solid rgba(226, 232, 240, 0.96);
  position: relative;
  overflow: hidden;
}

.prorank-tab-navigation::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 107, 53, 0) 0%, rgba(255, 145, 77, 0.5) 50%, rgba(255, 107, 53, 0) 100%);
  pointer-events: none;
}

/* ============================================
   TAB LIST - Horizontal scrollable container
   ============================================ */

.prorank-tab-navigation .prorank-tab-list {
  display: flex;
  flex-wrap: nowrap !important;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  align-items: stretch;
  justify-content: flex-start;
}

.prorank-tab-navigation .prorank-tab-list::-webkit-scrollbar {
  display: none;
}

/* ============================================
   TAB ITEM - Vertical stack: label + toggle
   ============================================ */

.prorank-tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: auto;
  flex: 1 1 156px;
  min-width: 150px;
  position: relative;
  padding: 0;
  min-height: 76px;
  text-align: center;
}

/* ============================================
   TAB BUTTON - The clickable label
   ============================================ */

.prorank-tab-button {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  padding: 16px 18px;
  margin: 0;
  width: 100%;
  min-height: 60px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 800;
  color: #475569;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
  word-break: normal;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  line-height: 1.3;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 10px 18px -16px rgba(15, 23, 42, 0.18);
}

.prorank-tab-button:hover:not(.disabled) {
  color: #0f172a;
  border-color: rgba(255, 145, 77, 0.28);
  box-shadow:
    0 18px 28px -22px rgba(15, 23, 42, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  transform: translateY(-1px);
}

/* Active state - Orange accent */
.prorank-tab-button.active,
.prorank-tab-button.is-active {
  color: #f8fafc;
  font-weight: 700;
  border-color: rgba(255, 145, 77, 0.46);
  background:
    radial-gradient(circle at top right, rgba(255, 161, 97, 0.42), transparent 34%),
    linear-gradient(135deg, #10203a 0%, #18335e 58%, #24497c 100%);
  box-shadow:
    0 24px 34px -24px rgba(15, 23, 42, 0.86),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.prorank-tab-button.active:hover,
.prorank-tab-button.is-active:hover {
  color: #f8fafc;
  border-color: rgba(255, 161, 97, 0.54);
  background:
    radial-gradient(circle at top right, rgba(255, 161, 97, 0.42), transparent 34%),
    linear-gradient(135deg, #10203a 0%, #18335e 58%, #24497c 100%);
  box-shadow:
    0 26px 40px -24px rgba(15, 23, 42, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.prorank-tab-button:disabled,
.prorank-tab-button.disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

/* ============================================
   TAB LABEL CONTENT
   ============================================ */

.prorank-tab-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 6px;
  flex-wrap: nowrap;
  position: static;
  padding-right: 0;
  max-width: 100%;
}

.prorank-tab-name {
  display: inline-block;
  width: 100%;
  font-size: inherit;
  line-height: inherit;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prorank-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  color: #475569;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.prorank-tab-button.active .prorank-tab-count,
.prorank-tab-button.is-active .prorank-tab-count {
  background: rgba(255, 255, 255, 0.14);
  color: #f8fafc;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Pro/Tier Badge - Tiny badge at top-right corner */
.prorank-tab-navigation .prorank-tab-item .prorank-pro-badge {
  position: absolute;
  top: 8px;
  right: 10px;
  padding: 2px 7px;
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.25px;
  border-radius: 999px;
  line-height: 1;
  background: linear-gradient(135deg, #24152f 0%, #402044 100%);
  color: #ffd166;
  box-shadow: 0 8px 14px -10px rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 209, 102, 0.26);
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
}

/* ============================================
   TAB TOGGLE - Centered below label
   ============================================ */

.prorank-tab-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: -2px;
  text-decoration: none !important;
}

/* Remove any inherited text decoration */
.prorank-tab-toggle,
.prorank-tab-toggle *,
.prorank-tab-toggle button,
.prorank-tab-toggle button * {
  text-decoration: none !important;
  border-bottom: none !important;
}

/* Make the toggle smaller for tabs */
.prorank-tab-toggle .prorank-toggle-slider {
  transform: scale(0.8);
  transform-origin: center;
}

/* Style the toggle button when inside tabs */
.prorank-tab-toggle button[role="switch"] {
  background-color: #d1d5db !important;
  border-radius: 12px !important;
  text-decoration: none !important;
}

.prorank-tab-toggle button[role="switch"][aria-checked="true"] {
  background-color: #ff6b35 !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .prorank-tab-navigation {
    padding: 12px;
    border-radius: 22px;
  }

  .prorank-tab-navigation .prorank-tab-list {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    gap: 10px;
    scroll-snap-type: x proximity;
    padding-bottom: 4px;
  }

  .prorank-tab-navigation .prorank-tab-list::-webkit-scrollbar {
    height: 6px;
  }

  .prorank-tab-navigation .prorank-tab-list::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 999px;
  }

  .prorank-tab-item {
    flex: 0 0 auto;
    min-width: 164px;
    min-height: 74px;
    scroll-snap-align: start;
  }

  .prorank-tab-button {
    font-size: 12px;
    min-height: 58px;
  }
}

/* ============================================
   LEGACY SUPPORT / WORDPRESS COMPAT
   ============================================ */

.prorank-tab-content,
.prorank-tab-panel-content,
.prorank-tab-panel__tab-content {
  padding: 24px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  border: 1px solid #e5e7eb;
  animation: fadeIn 0.3s ease;
}

/* Dashboard tab panel */
.prorank-tab-panel {
  margin-bottom: 24px;
}

.prorank-tab-panel__tabs {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 6px 10px;
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  overflow-x: auto;
}

.prorank-tab-panel__tabs::-webkit-scrollbar {
  display: none;
}

.prorank-tab-panel__tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  color: #6b7280;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.prorank-tab-panel__tab:hover {
  color: #374151;
}

.prorank-tab-panel__tab.is-active {
  color: #ff6b35;
  background: #fff7ed;
}

.prorank-tab-panel__tab:focus-visible {
  outline: 2px solid rgba(255, 107, 53, 0.35);
  outline-offset: 2px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hide WordPress nav tabs when using our navigation */
.prorank-page .nav-tab-wrapper:not(.prorank-tabs),
.prorank-page .nav-tab {
  display: none;
}
