/* FMP Community Control — Theme bridge (Fitness Power Ranking styles)
   This file makes Classified/Marketplace pages match the Fitness Power Ranking theme
   and adds styling for the Trainer Power Ranking card injected into listings.
*/

:root {
    /* Primary Color Palette */
    --primary-blue: #1A5FED;
    --primary-blue-dark: #0F4BC9;
    --primary-blue-light: #4D8BF0;
    
    /* Secondary Colors */
    --secondary-gold: #FFB800;
    --secondary-silver: #C0C0C0;
    --secondary-bronze: #CD7F32;
    
    /* Neutral Colors */
    --neutral-white: #FFFFFF;
    --neutral-off-white: #F8F9FA;
    --neutral-light-gray: #E9ECEF;
    --neutral-gray: #6C757D;
    --neutral-dark-gray: #343A40;
    --neutral-black: #121212;
    
    /* Status Colors */
    --success-green: #28A745;
    --warning-orange: #FFC107;
    --error-red: #DC3545;
    --info-blue: #17A2B8;
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-secondary: 'Poppins', sans-serif;
    
    /* Spacing Scale */
    --space-xxs: 0.25rem;    /* 4px */
    --space-xs: 0.5rem;      /* 8px */
    --space-sm: 0.75rem;     /* 12px */
    --space-md: 1rem;        /* 16px */
    --space-lg: 1.5rem;      /* 24px */
    --space-xl: 2rem;        /* 32px */
    --space-2xl: 3rem;       /* 48px */
    --space-3xl: 4rem;       /* 64px */
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-round: 50%;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
    
    /* Z-index Layers */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* Base helpers (scoped to FMP / Classified content) */
.fmp-card {
  background: var(--neutral-white);
  border: 1px solid var(--neutral-light-gray);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.fmp-card--hover {
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.fmp-card--hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(26, 95, 237, 0.25);
}

.fmp-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--neutral-gray);
}

.fmp-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.8rem;
  background: rgba(26, 95, 237, 0.10);
  color: var(--primary-blue-dark);
  border: 1px solid rgba(26, 95, 237, 0.18);
}

.fmp-badge--gold { background: rgba(255, 184, 0, 0.12); border-color: rgba(255, 184, 0, 0.30); color: #6b4d00; }
.fmp-badge--silver { background: rgba(192, 192, 192, 0.18); border-color: rgba(192, 192, 192, 0.35); color: #3b3b3b; }
.fmp-badge--bronze { background: rgba(205, 127, 50, 0.16); border-color: rgba(205, 127, 50, 0.35); color: #5a3314; }

.fmp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-lg);
  font-weight: 800;
  text-decoration: none !important;
  border: 1px solid transparent;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease;
}
.fmp-btn:focus { outline: none; box-shadow: 0 0 0 3px rgba(26,95,237,0.22); }

.fmp-btn--primary {
  background: var(--gradient-primary);
  color: white !important;
  box-shadow: var(--shadow-sm);
}
.fmp-btn--primary:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.fmp-btn--ghost {
  background: var(--neutral-off-white);
  color: var(--primary-blue-dark) !important;
  border-color: var(--neutral-light-gray);
}
.fmp-btn--ghost:hover { background: rgba(26, 95, 237, 0.08); border-color: rgba(26, 95, 237, 0.22); }

/* Trainer Power Ranking block (injected into listings) */
.fmp-trainer-power {
  margin: 1.25rem 0;
}

.fmp-trainer-power .fmp-trainer-power__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-lg);
}

.fmp-trainer-power__top {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
}

.fmp-rank-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.25rem;
  height: 3.25rem;
  padding: 0 0.75rem;
  border-radius: 999px;
  font-weight: 900;
  font-size: 1.15rem;
  color: white;
  background: var(--primary-blue);
  box-shadow: var(--shadow-sm);
}

.fmp-rank-pill--1 { background: linear-gradient(135deg, var(--secondary-gold), #ffcf4d); color: #3a2a00; }
.fmp-rank-pill--2 { background: linear-gradient(135deg, var(--secondary-silver), #e7e7e7); color: #222; }
.fmp-rank-pill--3 { background: linear-gradient(135deg, var(--secondary-bronze), #f0b079); color: #2a1407; }

.fmp-trainer-power__title h3 {
  margin: 0.2rem 0 0.35rem;
  font-size: 1.35rem;
  line-height: 1.25;
}

.fmp-trainer-power__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.fmp-trainer-power__stats {
  color: var(--neutral-gray);
  font-weight: 600;
}

.fmp-delta {
  font-weight: 900;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--neutral-light-gray);
  background: var(--neutral-off-white);
  color: var(--neutral-gray);
}
.fmp-delta--up { color: #0a7a2f; border-color: rgba(10,122,47,0.25); background: rgba(10,122,47,0.08); }
.fmp-delta--down { color: #b00020; border-color: rgba(176,0,32,0.25); background: rgba(176,0,32,0.08); }

/* ====== Classified Listing (rtcl) — Card theme ======
   We scope hard styling behind body class 'fmp-rtcl-theme' so it won't affect other pages.
*/
.fmp-rtcl-theme :where(.rtcl-listings, .rtcl-listing-items, .rtcl-grid-view, ul.rtcl-listings) {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-lg);
  padding: 0 !important;
  margin: 0 !important;
}

.fmp-rtcl-theme :where(.rtcl-listing-item, .rtcl-listing, .rtcl-loop-item, li.rtcl-listing-item) {
  list-style: none;
  background: var(--neutral-white);
  border: 1px solid var(--neutral-light-gray);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.fmp-rtcl-theme :where(.rtcl-listing-item, .rtcl-listing, .rtcl-loop-item, li.rtcl-listing-item):hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(26, 95, 237, 0.25);
}

.fmp-rtcl-theme :where(.rtcl-listing-item a, .rtcl-listing a, .rtcl-loop-item a) {
  text-decoration: none;
}

.fmp-rtcl-theme :where(.rtcl-listing-item .rtcl-title, .rtcl-listing-item .listing-title, .rtcl-listing-title, .rtcl-loop-item .rtcl-title) {
  font-weight: 900;
  color: var(--neutral-black);
}

.fmp-rtcl-theme :where(.rtcl-listing-item .rtcl-price, .rtcl-price, .rtcl-price-amount) {
  font-weight: 900;
  color: var(--primary-blue-dark);
}

.fmp-rtcl-theme :where(.rtcl-listing-item .rtcl-meta, .rtcl-meta, .rtcl-listing-meta) {
  color: var(--neutral-gray);
  font-weight: 600;
}

.fmp-rtcl-theme :where(.rtcl-listing-item .rtcl-badge, .rtcl-badge, .rtcl-badges span) {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.8rem;
  background: rgba(26, 95, 237, 0.10);
  color: var(--primary-blue-dark);
  border: 1px solid rgba(26, 95, 237, 0.18);
}

.fmp-rtcl-theme :where(.rtcl-listing-item img, .rtcl-thumbnail img) {
  width: 100%;
  height: auto;
  display: block;
}

/* If the theme/plugin outputs classic list layout wrappers, make sure inner spacing feels like cards */
.fmp-rtcl-theme :where(.rtcl-listing-item .rtcl-listing-content, .rtcl-listing-item .rtcl-content, .rtcl-listing-item .listing-content, .rtcl-loop-item .rtcl-content) {
  padding: var(--space-lg);
}

.fmp-rtcl-theme :where(.rtcl-listing-item .rtcl-thumbnail, .rtcl-listing-item .listing-thumb, .rtcl-thumbnail) {
  background: var(--neutral-off-white);
}

/* Rank badge inside listing cards (optional if injected by template/hooks) */
.fmp-rtcl-theme .fmp-inline-rank {
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  z-index: 2;
}
