/* ============================================================
   KSA COMMUNITY — CARI.CSS
   Halaman Pencarian (User + Postingan)
   ============================================================ */

/* ============================================================
   1. BODY
   ============================================================ */
body.kc-cr-body {
  background: var(--c-bg);
  padding-top: 56px;
  padding-bottom: 24px;
}

/* ============================================================
   2. HEADER
   ============================================================ */
.kc-cr-hdr {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  z-index: 100;
  background: #FFFFFF;
  border-bottom: 1px solid var(--c-line);
  display: flex;
  align-items: center;
  padding: 0 6px;
  gap: 4px;
}

.kc-cr-hdr-back {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--c-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: background .15s;
}
.kc-cr-hdr-back:active { background: var(--c-bg-soft); }
.kc-cr-hdr-back svg { width: 22px; height: 22px; }

.kc-cr-hdr-title {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  color: var(--c-text);
  margin: 0;
}

.kc-cr-hdr-spacer { width: 42px; flex-shrink: 0; }

/* ============================================================
   3. WRAPPER
   ============================================================ */
.kc-cr-wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 12px;
}

/* ============================================================
   4. SEARCH BAR
   ============================================================ */
.kc-cr-search {
  position: relative;
  margin-bottom: 12px;
}

.kc-cr-search input {
  width: 100%;
  padding: 12px 46px 12px 44px;
  border: 1.5px solid var(--c-line);
  border-radius: var(--r-full);
  background: #FFFFFF;
  font-size: 14px;
  font-family: inherit;
  color: var(--c-text);
  outline: none;
  transition: .15s;
  box-sizing: border-box;
}
.kc-cr-search input:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(26,58,143,.08);
}
.kc-cr-search input::placeholder { color: var(--c-text-3); }

.kc-cr-search-ico {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  pointer-events: none;
  color: var(--c-text-2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.kc-cr-search-ico svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.kc-cr-search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--c-text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.kc-cr-search-clear:active { background: var(--c-bg-soft); }
.kc-cr-search-clear svg { width: 16px; height: 16px; }

/* ============================================================
   5. TAB: PENGGUNA / POSTINGAN
   ============================================================ */
.kc-cr-tabs {
  display: flex;
  gap: 4px;
  background: #FFFFFF;
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: 4px;
  margin-bottom: 12px;
}

.kc-cr-tab {
  flex: 1;
  padding: 10px 8px;
  border-radius: var(--r-sm);
  border: none;
  background: transparent;
  color: var(--c-text-2);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.kc-cr-tab svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.kc-cr-tab.active {
  background: var(--c-primary);
  color: #FFFFFF;
}
.kc-cr-tab:active { transform: scale(.97); }

/* ============================================================
   6. FILTER (Server + Tipe)
   ============================================================ */
.kc-cr-filter {
  margin-bottom: 12px;
}

.kc-cr-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.kc-cr-filter-row:last-child { margin-bottom: 0; }

.kc-cr-filter-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--c-text-3);
  text-transform: uppercase;
  letter-spacing: .6px;
  flex-shrink: 0;
  width: 52px;
}

.kc-cr-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  padding-bottom: 2px;
}
.kc-cr-chips::-webkit-scrollbar { display: none; }

.kc-cr-chip {
  flex: 0 0 auto;
  padding: 6px 14px;
  border-radius: var(--r-full);
  background: #FFFFFF;
  border: 1px solid var(--c-line);
  color: var(--c-text-2);
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: .15s;
  white-space: nowrap;
}
.kc-cr-chip:active { transform: scale(.95); }
.kc-cr-chip.active {
  background: var(--c-primary);
  color: #FFFFFF;
  border-color: var(--c-primary);
}
.kc-cr-chip.active.buy  { background: #1565C0; border-color: #1565C0; }
.kc-cr-chip.active.sell { background: #2E7D32; border-color: #2E7D32; }

/* ============================================================
   7. INFO JUMLAH
   ============================================================ */
.kc-cr-info {
  font-size: 11.5px;
  color: var(--c-text-2);
  font-weight: 700;
  margin: 4px 0 10px;
  padding-left: 2px;
}
.kc-cr-info b { color: var(--c-primary); }

/* ============================================================
   8. HASIL
   ============================================================ */
.kc-cr-hasil {
  min-height: 200px;
}

/* ===== Kartu User ===== */
.kc-cr-user {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #FFFFFF;
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: 10px 12px;
  margin-bottom: 8px;
}

.kc-cr-user-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-primary-light), var(--c-primary));
  color: #FFFFFF;
  font-size: 17px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
}
.kc-cr-user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.kc-cr-user-info { flex: 1; min-width: 0; }

.kc-cr-user-nama {
  font-size: 14px;
  font-weight: 800;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.kc-cr-user-nama:hover { color: var(--c-primary); }

.kc-cr-user-sub {
  font-size: 11.5px;
  color: var(--c-text-2);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kc-cr-user-badge {
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.kc-cr-user-badge.staf    { background: #FFF7D6; color: #8B6508; }
.kc-cr-user-badge.develop { background: #FFE4E4; color: #C62828; }

.kc-cr-user-aksi { flex-shrink: 0; }

.kc-cr-btn {
  padding: 8px 14px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: .15s;
  white-space: nowrap;
}
.kc-cr-btn:active { transform: scale(.95); }
.kc-cr-btn:disabled { opacity: .5; cursor: not-allowed; }

.kc-cr-btn.primary { background: var(--c-primary); color: #FFFFFF; }
.kc-cr-btn.success { background: #2E7D32; color: #FFFFFF; }
.kc-cr-btn.ghost   { background: var(--c-bg-soft); color: var(--c-text); }

/* ============================================================
   9. EMPTY STATE
   ============================================================ */
.kc-cr-empty {
  text-align: center;
  padding: 50px 20px;
  color: var(--c-text-2);
}
.kc-cr-empty-ico {
  width: 60px;
  height: 60px;
  margin: 0 auto 12px;
  opacity: .35;
  display: flex;
  align-items: center;
  justify-content: center;
}
.kc-cr-empty-ico svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.kc-cr-empty strong {
  display: block;
  color: var(--c-text);
  font-size: 15px;
  margin-bottom: 5px;
}

/* ============================================================
   10. LOAD MORE
   ============================================================ */
.kc-cr-loadmore-wrap {
  padding: 12px 0 8px;
}

.kc-cr-loadmore {
  width: 100%;
  padding: 13px;
  border-radius: var(--r-md);
  background: #FFFFFF;
  border: 1.5px solid var(--c-line);
  color: var(--c-primary);
  font-size: 13px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: .15s;
}
.kc-cr-loadmore:active { background: var(--c-bg); }
.kc-cr-loadmore:disabled { opacity: .5; cursor: not-allowed; }

/* ============================================================
   11. RESPONSIVE
   ============================================================ */
@media (max-width: 380px) {
  .kc-cr-wrap { padding: 10px; }
  .kc-cr-user-avatar {
    width: 42px;
    height: 42px;
    font-size: 15px;
  }
  .kc-cr-tab {
    font-size: 12.5px;
    padding: 9px 6px;
  }
  .kc-cr-btn {
    padding: 7px 11px;
    font-size: 11.5px;
  }
}