/* ═══════════════════════════════════════
   INFLUENCER FILTER v1.0
   All colors are hardcoded — no theme defaults
   ═══════════════════════════════════════ */

/* ── RESET for wrapper — isolate from theme ── */
#inf-filter-wrapper,
#inf-filter-wrapper * {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

/* ══════════════════════════════════════
   FILTER BAR
   ══════════════════════════════════════ */
.inf-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1.5px solid #ebebf0;
  border-radius: 18px;
  padding: 14px 18px;
  margin-bottom: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
  position: relative;
  z-index: 100;
}

/* ── Filter group (trigger + dropdown) ── */
.inf-filter-group {
  position: relative;
}

/* ── Trigger button ── */
.inf-filter-trigger {
  all: unset;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f5f5fa;
  border: 1.5px solid #e8e8f5;
  border-radius: 50px;
  padding: 9px 16px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #2d2d4e;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  user-select: none;
}

.inf-filter-trigger:hover {
  background: #ebebff;
  border-color: #c8c8f0;
  color: #3949ab;
}

.inf-filter-trigger.active {
  background: #3949ab;
  border-color: #3949ab;
  color: #ffffff;
}

.inf-filter-trigger .inf-trigger-arrow {
  font-size: 10px;
  transition: transform 0.2s ease;
}

.inf-filter-trigger.open .inf-trigger-arrow {
  transform: rotate(180deg);
}

.inf-filter-trigger i:first-child {
  font-size: 13px;
  opacity: 0.8;
}

/* ── Badge count on trigger ── */
.inf-trigger-count {
  background: #ffffff;
  color: #3949ab;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
}

.inf-filter-trigger.active .inf-trigger-count {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

/* ── Dropdown panel ── */
.inf-filter-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 240px;
  background: #ffffff;
  border: 1.5px solid #e8e8f5;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
  z-index: 9999;
  overflow: hidden;
}

.inf-filter-dropdown.open {
  display: block;
  animation: infDropIn 0.18s ease;
}

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

/* ── Search inside dropdown ── */
.inf-dropdown-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f8;
}

.inf-dropdown-search i {
  color: #aaa;
  font-size: 13px;
  flex-shrink: 0;
}

.inf-dropdown-search input {
  all: unset;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  color: #333;
  width: 100%;
}

.inf-dropdown-search input::placeholder {
  color: #bbb;
}

/* ── List inside dropdown ── */
.inf-dropdown-list {
  max-height: 240px;
  overflow-y: auto;
  padding: 6px 0;
  scrollbar-width: thin;
  scrollbar-color: #e0e0f0 transparent;
}

.inf-dropdown-list::-webkit-scrollbar {
  width: 4px;
}

.inf-dropdown-list::-webkit-scrollbar-thumb {
  background: #e0e0f0;
  border-radius: 4px;
}

/* ── Item row ── */
.inf-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background 0.15s;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  color: #333;
}

.inf-dropdown-item:hover {
  background: #f5f5ff;
}

.inf-dropdown-item input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: #3949ab;
  cursor: pointer;
  flex-shrink: 0;
}

.inf-item-flag {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.inf-item-label {
  flex: 1;
  font-size: 13px;
  color: #333;
}

.inf-dropdown-item.hidden {
  display: none;
}

/* ══════════════════════════════════════
   POPUP (Niche & Platform only)
   Country dropdown above is untouched.
   Pure CSS: a box-shadow trick dims the
   screen behind the popup — no extra
   markup or JS required.
   ══════════════════════════════════════ */
.inf-filter-dropdown[data-type="modal"] {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.97);
  width: 92%;
  max-width: 400px;
  min-width: 0;
  max-height: 78vh;
  box-shadow:
    0 0 0 9999px rgba(20, 20, 35, 0.45),
    0 20px 60px rgba(0, 0, 0, 0.2);
}

.inf-filter-dropdown[data-type="modal"].open {
  animation: infPopupIn 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes infPopupIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.94); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.inf-filter-dropdown[data-type="modal"] .inf-dropdown-list {
  max-height: 60vh;
}

@media (max-width: 640px) {
  .inf-filter-dropdown[data-type="modal"].open {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    transform: none;
    max-height: 74vh;
    border-radius: 16px 16px 0 0;
    animation: infSheetUp 0.22s cubic-bezier(0.19, 1, 0.22, 1);
  }

  .inf-filter-dropdown[data-type="modal"].open::before {
    content: '';
    display: block;
    width: 38px;
    height: 4px;
    background: #d8d8ea;
    border-radius: 10px;
    margin: 10px auto 2px;
  }

  @keyframes infSheetUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }

  .inf-filter-dropdown[data-type="modal"] .inf-dropdown-list {
    max-height: 56vh;
  }
}

/* ══════════════════════════════════════
   ACTIVE FILTER TAGS
   ══════════════════════════════════════ */
.inf-active-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.inf-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ebebff;
  border: 1px solid #d0d4f5;
  border-radius: 50px;
  padding: 5px 10px 5px 12px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #3949ab;
  white-space: nowrap;
}

.inf-tag-remove {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: #c8ccf0;
  border-radius: 50%;
  font-size: 9px;
  color: #3949ab;
  transition: all 0.15s;
}

.inf-tag-remove:hover {
  background: #3949ab;
  color: #fff;
}

/* ── Reset all button ── */
.inf-reset-btn {
  all: unset;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #dc2626;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 50px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  white-space: nowrap;
  transition: all 0.15s;
}

.inf-reset-btn:hover {
  background: #fee2e2;
}

/* ══════════════════════════════════════
   RESULTS INFO
   ══════════════════════════════════════ */
.inf-results-info {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  color: #888;
  margin-bottom: 20px;
}

.inf-results-info #inf-count {
  font-weight: 700;
  color: #3949ab;
}

/* ══════════════════════════════════════
   GRID
   ══════════════════════════════════════ */
.inf-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  position: relative;
  min-height: 200px;
  transition: opacity 0.2s;
}

.inf-grid.loading {
  opacity: 0.4;
  pointer-events: none;
}

.inf-grid-item {
  display: flex;
}

.inf-grid-item .ilc-card-wrap {
  width: 100%;
}

/* ── No results ── */
.inf-no-results {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 12px;
  color: #ccc;
}

.inf-no-results i {
  font-size: 48px;
}

.inf-no-results p {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  color: #aaa;
  margin: 0;
}

/* ══════════════════════════════════════
   LOADING SPINNER
   ══════════════════════════════════════ */
.inf-loading {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.7);
  z-index: 50;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
}

.inf-loading.active {
  display: flex;
}

.inf-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e0e0f5;
  border-top-color: #3949ab;
  border-radius: 50%;
  animation: infSpin 0.7s linear infinite;
}

@keyframes infSpin {
  to { transform: rotate(360deg); }
}

/* ══════════════════════════════════════
   LOAD MORE BUTTON
   ══════════════════════════════════════ */
.inf-load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 36px;
}

.inf-load-more-btn {
  all: unset;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #5c6bc0, #3949ab);
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  font-weight: 700;
  padding: 14px 36px;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(92,107,192,0.3);
  transition: all 0.25s;
}

.inf-load-more-btn:hover {
  background: linear-gradient(135deg, #3949ab, #5c6bc0);
  box-shadow: 0 8px 24px rgba(92,107,192,0.45);
  transform: translateY(-2px);
}

.inf-load-more-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ══════════════════════════════════════
   LOOP CARD (copied from Loop Card Plugin
   so this plugin is self-contained)
   ══════════════════════════════════════ */
.ilc-card-wrap {
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #eeeef8;
  box-shadow: 0 4px 20px rgba(0,0,0,0.07);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none !important;
  color: inherit !important;
  height: 100%;
}

.ilc-card-wrap:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(92,107,192,0.16);
}

.ilc-card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  flex-shrink: 0;
  background: #f0f0f5;
}

.ilc-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 0.4s ease;
}

.ilc-card-wrap:hover .ilc-card-img-wrap img {
  transform: scale(1.05);
}

.ilc-card-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 60px;
  color: #cccccc;
  background: #f5f5f5;
}

.ilc-card-niche-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  pointer-events: none;
}

.ilc-card-niche-tag {
  display: inline-block;
  background: rgba(26,26,46,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space: nowrap;
  border-radius: 20px;
  padding: 5px 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.15);
}

.ilc-card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.ilc-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ilc-card-name {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: #1a1a2e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
  line-height: 1.2;
}

.ilc-card-country {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f0f0ff;
  border: 1px solid #e0e0f5;
  border-radius: 20px;
  padding: 4px 11px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #5c6bc0;
  white-space: nowrap;
  flex-shrink: 0;
}

.ilc-card-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: linear-gradient(135deg, #5c6bc0, #3949ab);
  color: #ffffff;
  border-radius: 50px;
  padding: 11px 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 14px rgba(92,107,192,0.25);
  transition: all 0.25s;
}

.ilc-card-wrap:hover .ilc-card-btn {
  background: linear-gradient(135deg, #3949ab, #5c6bc0);
  box-shadow: 0 8px 22px rgba(92,107,192,0.4);
}

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */
@media (max-width: 992px) {
  .inf-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }
}

@media (max-width: 640px) {
  .inf-filter-bar {
    padding: 12px 14px;
    gap: 8px;
  }

  .inf-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .inf-filter-trigger {
    padding: 8px 13px;
    font-size: 12px;
  }

  .ilc-card-name { font-size: 15px; }
  .ilc-card-body { padding: 12px 14px 14px; }
}

@media (max-width: 420px) {
  .inf-grid {
    grid-template-columns: 1fr;
  }
}
