/**
 * EmpiricQuest — Component Styles
 *
 * Button variants, interactive component styling, and form elements.
 * Enqueue order: 2nd (after app.css)
 */

/* ============================================
   BUTTONS
   ============================================ */

/* Reset default WordPress button styles */
.wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.4;
  white-space: nowrap;
}

.wp-block-button__link:hover {
  text-decoration: none;
}

/* Primary button */
.eq-btn-primary .wp-block-button__link {
  background-color: #2947D1;
  color: #FFFFFF;
  padding: 12px 24px;
  min-height: 44px;
}

.eq-btn-primary .wp-block-button__link:hover {
  background-color: #1E3296;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(41, 71, 209, 0.25);
}

.eq-btn-primary .wp-block-button__link:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Secondary / Outline button */
.eq-btn-secondary .wp-block-button__link {
  background-color: transparent;
  color: #2947D1;
  border: 1.5px solid #2947D1;
  padding: 11px 24px;
  min-height: 44px;
}

.eq-btn-secondary .wp-block-button__link:hover {
  background-color: #DCE6FF;
  color: #1E3296;
  border-color: #1E3296;
}

/* Ghost button */
.eq-btn-ghost .wp-block-button__link {
  background-color: transparent;
  color: #2947D1;
  border: none;
  padding: 12px 16px;
  min-height: 44px;
}

.eq-btn-ghost .wp-block-button__link:hover {
  background-color: #DCE6FF;
  color: #1E3296;
}

/* Light button (on dark backgrounds) */
.eq-btn-light .wp-block-button__link {
  background-color: #FFFFFF;
  color: #2947D1;
  padding: 12px 24px;
  min-height: 44px;
  font-weight: 600;
}

.eq-btn-light .wp-block-button__link:hover {
  background-color: #F7F9FC;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Ghost light button (on dark backgrounds) */
.eq-btn-ghost-light .wp-block-button__link {
  background-color: transparent;
  color: #F8FAFC;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  padding: 11px 24px;
  min-height: 44px;
}

.eq-btn-ghost-light .wp-block-button__link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Full-width button */
.eq-btn-full .wp-block-button__link {
  width: 100%;
}

/* Icon button */
.eq-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: #122033;
  cursor: pointer;
  transition: all 0.15s ease;
}

.eq-btn-icon:hover {
  background-color: #DCE6FF;
  color: #2947D1;
}

.eq-btn-icon:focus-visible {
  outline: 2px solid #2947D1;
  outline-offset: 2px;
}

/* ============================================
   SEARCH INPUT
   ============================================ */
.eq-search-field {
  width: 100%;
  max-width: 800px;
}

.eq-search-field .wp-block-search__inside-wrapper {
  background: #FFFFFF;
  border: 1px solid #D9E2F0;
  border-radius: 10px;
  padding: 4px;
}

.eq-search-field .wp-block-search__input {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: #122033;
}

.eq-search-field .wp-block-search__input:focus {
  outline: none;
}

.eq-search-field .wp-block-search__input::placeholder {
  color: #6E7B91;
}

/* ============================================
   CARDS (Generic)
   ============================================ */
.eq-card {
  background: #FFFFFF;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(18, 32, 51, 0.05);
  transition: all 0.2s ease;
  overflow: hidden;
}

.eq-card:hover {
  box-shadow: 0 4px 12px rgba(18, 32, 51, 0.06);
  transform: translateY(-1px);
}

.eq-card-body {
  padding: 20px;
}

/* ============================================
   FILTER CHIPS
   ============================================ */
.eq-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  background: #FFFFFF;
  border: 1px solid #D9E2F0;
  color: #122033;
  user-select: none;
}

.eq-chip:hover {
  border-color: #2947D1;
  color: #2947D1;
}

.eq-chip--active {
  background: #2947D1;
  color: #FFFFFF;
  border-color: #2947D1;
}

/* ============================================
   PATHWAY STAGE INDICATORS
   ============================================ */
.eq-stage-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
}

.eq-stage-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #D9E2F0;
  transition: all 0.2s ease;
}

.eq-stage-dot--completed {
  background: #1F8A5B;
}

.eq-stage-dot--active {
  background: #2947D1;
  box-shadow: 0 0 0 3px #DCE6FF;
}

/* ============================================
   CHECKLIST
   ============================================ */
.eq-checklist {
  list-style: none;
  padding: 0;
  margin: 0;
}

.eq-checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #F7F9FC;
  font-size: 14px;
  color: #122033;
}

.eq-checklist-item:last-child {
  border-bottom: none;
}

.eq-checklist-item::before {
  content: '';
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #D9E2F0;
  flex-shrink: 0;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.eq-checklist-item--checked::before {
  background: #1F8A5B;
  border-color: #1F8A5B;
  content: '\2713';
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
}

/* ============================================
   ACCORDION
   ============================================ */
.eq-accordion-item {
  border: 1px solid #D9E2F0;
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.eq-accordion-item:hover {
  border-color: #B9C7DC;
}

.eq-accordion-item.is-open {
  border-color: #2947D1;
}

.eq-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  cursor: pointer;
  user-select: none;
}

.eq-accordion-icon {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.eq-accordion-item.is-open .eq-accordion-icon {
  transform: rotate(180deg);
}

.eq-accordion-body {
  padding: 0 24px 20px;
  font-size: 14px;
  line-height: 1.65;
  color: #4B5B73;
  display: none;
}

.eq-accordion-item.is-open .eq-accordion-body {
  display: block;
}

/* ============================================
   COMPARISON TABLE
   ============================================ */
.eq-table-wrap {
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid #D9E2F0;
}

.eq-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: #FFFFFF;
}

.eq-table-wrap thead th {
  background: #F7F9FC;
  padding: 16px 20px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: #122033;
  border-bottom: 1px solid #D9E2F0;
  white-space: nowrap;
}

.eq-table-wrap tbody td {
  padding: 16px 20px;
  border-bottom: 1px solid #F7F9FC;
  color: #4B5B73;
}

.eq-table-wrap tbody tr:last-child td {
  border-bottom: none;
}

.eq-table-wrap tbody tr:hover td {
  background: #F7F9FC;
}

/* Check/cross indicators in tables */
.eq-check {
  color: #1F8A5B;
  font-weight: 700;
}

.eq-dash {
  color: #D9E2F0;
}

/* ============================================
   NAVIGATION
   ============================================ */
.eq-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #122033;
  text-decoration: none;
  transition: all 0.15s ease;
}

.eq-nav-link:hover {
  background: #F7F9FC;
  color: #2947D1;
  text-decoration: none;
}

.eq-nav-link--active {
  background: #DCE6FF;
  color: #2947D1;
  font-weight: 600;
}

.eq-nav-link svg {
  flex-shrink: 0;
}

/* ============================================
   NOTIFICATION BADGE
   ============================================ */
.eq-notify-badge {
  position: relative;
}

.eq-notify-badge::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 8px;
  background: #C24141;
  border-radius: 50%;
  border: 2px solid #FFFFFF;
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.eq-progress-bar {
  height: 8px;
  background: #F7F9FC;
  border-radius: 4px;
  overflow: hidden;
}

.eq-progress-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, #2947D1, #6C4CCF);
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* ============================================
   TOOLTIP
   ============================================ */
.eq-tooltip {
  position: relative;
}

.eq-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 12px;
  background: #122033;
  color: #F8FAFC;
  font-size: 12px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.15s ease;
  z-index: 50;
}

.eq-tooltip:hover::after {
  opacity: 1;
  visibility: visible;
}

/* ============================================
   FOCUS STYLES (Accessibility)
   ============================================ */
a:focus-visible,
button:focus-visible,
.wp-block-button__link:focus-visible,
.eq-field-input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #2947D1;
  outline-offset: 2px;
}

/* ============================================
   SMOOTH SCROLLING
   ============================================ */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
