/**
 * Harga Kami Beli – Table Plugin Stylesheet
 * Brand: Raja Emas Indonesia
 * Colors: Royal Purple #421A40, Gold #D4AF37
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  --hkb-primary:       #421A40;
  --hkb-primary-dark:  #2F102D;
  --hkb-primary-light: #5A2757;
  --hkb-gold:          #D4AF37;
  --hkb-gold-light:    #F7F1DF;
  --hkb-gold-hover:    #B8860B;
  --hkb-accent-bg:     #FAF9F6;
  --hkb-border:        #E5E7EB;
  --hkb-text-dark:     #1E293B;
  --hkb-text-muted:    #64748B;
  --hkb-text-light:    #94A3B8;
  --hkb-success:       #10B981;
  --hkb-shadow-sm:     0 2px 8px rgba(0,0,0,0.04);
  --hkb-shadow-md:     0 10px 25px -5px rgba(66,26,64,0.08),0 8px 10px -6px rgba(0,0,0,0.04);
  --hkb-radius-sm:     8px;
  --hkb-radius-md:     14px;
  --hkb-radius-lg:     20px;
}

/* ── Widget Container ── */
.hkb-price-widget {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  max-width: 960px;
  margin: 30px auto;
  background: #fff;
  border: 1px solid var(--hkb-border);
  border-radius: var(--hkb-radius-lg);
  box-shadow: var(--hkb-shadow-md);
  padding: 32px 28px;
  box-sizing: border-box;
  color: var(--hkb-text-dark);
  line-height: 1.5;
}

.hkb-price-widget * {
  box-sizing: border-box;
}

/* ── Tabs Nav ── */
.hkb-tabs-container {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.hkb-tabs-nav {
  display: inline-flex;
  background: #F1F5F9;
  padding: 6px;
  border-radius: 9999px;
  gap: 6px;
  width: 100%;
  max-width: 900px;
  border: 1px solid #E2E8F0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.hkb-tabs-nav::-webkit-scrollbar { display: none; }

.hkb-region-select {
  display: none;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--hkb-border);
  border-radius: var(--hkb-radius-sm);
  background: #fff;
  color: var(--hkb-text-dark);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%2364748B'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.hkb-region-select:focus {
  border-color: var(--hkb-primary);
  box-shadow: 0 0 0 3px rgba(66,26,64,0.1);
}

.hkb-tab-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border: none;
  background: transparent;
  color: var(--hkb-text-muted);
  font-size: 13px;
  font-weight: 600;
  border-radius: 9999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  outline: none;
  font-family: inherit;
}

.hkb-tab-btn:hover {
  color: var(--hkb-primary);
  background: rgba(255,255,255,0.6);
}

.hkb-tab-btn.is-active {
  background: var(--hkb-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(66,26,64,0.25);
}

.hkb-tab-btn.is-active .hkb-tab-icon svg {
  stroke: var(--hkb-gold);
}

.hkb-tab-icon {
  display: inline-flex;
  align-items: center;
}

.hkb-tab-icon svg {
  stroke: currentColor;
  transition: stroke 0.2s;
}

/* ── Toolbar ── */
.hkb-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
  background: var(--hkb-accent-bg);
  padding: 16px 20px;
  border-radius: var(--hkb-radius-md);
  border: 1px solid #F1E9DA;
}

.hkb-search-box {
  position: relative;
  width: 100%;
}

.hkb-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--hkb-text-light);
  display: flex;
  align-items: center;
  pointer-events: none;
}

.hkb-search-input {
  width: 100%;
  padding: 11px 40px 11px 42px;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: var(--hkb-radius-sm);
  font-size: 14px;
  color: var(--hkb-text-dark);
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
}

.hkb-search-input:focus {
  border-color: var(--hkb-primary);
  box-shadow: 0 0 0 3px rgba(66,26,64,0.1);
}

.hkb-search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: #E2E8F0;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #64748B;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  transition: background 0.15s;
}

.hkb-search-clear:hover {
  background: #CBD5E1;
  color: var(--hkb-text-dark);
}

.hkb-quick-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
}

.hkb-chip-title {
  font-weight: 600;
  color: var(--hkb-text-muted);
}

.hkb-chip {
  padding: 4px 12px;
  border-radius: 9999px;
  border: 1px solid #E2E8F0;
  background: #fff;
  color: var(--hkb-text-dark);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.hkb-chip:hover {
  border-color: var(--hkb-primary);
  color: var(--hkb-primary);
}

.hkb-chip.is-active {
  background: var(--hkb-gold-light);
  border-color: var(--hkb-gold);
  color: #855800;
}

/* ── Status Bar ── */
.hkb-status-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 12px;
}

.hkb-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16,185,129,0.10);
  color: #059669;
  border: 1px solid rgba(16,185,129,0.25);
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.hkb-pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--hkb-success);
  border-radius: 50%;
  position: relative;
  display: inline-block;
}

.hkb-pulse-dot::after {
  content: '';
  position: absolute;
  top: -2px; left: -2px; right: -2px; bottom: -2px;
  border-radius: 50%;
  background-color: var(--hkb-success);
  opacity: 0.7;
  animation: hkbPulse 2s infinite;
}

@keyframes hkbPulse {
  0%   { transform: scale(0.9); opacity: 0.8; }
  70%  { transform: scale(2);   opacity: 0;   }
  100% { transform: scale(2);   opacity: 0;   }
}

.hkb-sync-time {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--hkb-text-muted);
  font-size: 12px;
  font-weight: 500;
}

/* ── Skeleton Loading ── */
.hkb-skeleton-wrap {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(66,26,64,0.08);
}

.hkb-skeleton-row {
  display: flex;
  gap: 2px;
  padding: 4px;
  background: #fff;
  border-bottom: 1px solid #F1F5F9;
}

.hkb-skeleton-row:first-child {
  background: var(--hkb-primary);
}

.hkb-skeleton-cell {
  flex: 1;
  height: 40px;
  border-radius: 6px;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: hkbShimmer 1.4s ease-in-out infinite;
}

.hkb-skeleton-row:first-child .hkb-skeleton-cell {
  background: linear-gradient(90deg, rgba(255,255,255,0.1) 25%, rgba(255,255,255,0.25) 50%, rgba(255,255,255,0.1) 75%);
  background-size: 200% 100%;
  animation: hkbShimmer 1.4s ease-in-out infinite;
}

@keyframes hkbShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Tab Panes ── */
.hkb-tab-pane {
  display: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.hkb-tab-pane.is-active {
  display: block;
  opacity: 1;
}

/* ── Table Card ── */
.hkb-table-card {
  background: #fff;
  border: 1px solid rgba(66,26,64,0.08);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(66,26,64,0.04),0 1px 4px rgba(0,0,0,0.03);
}

.hkb-table-responsive {
  width: 100%;
  overflow-x: auto;
}

.hkb-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  margin: 0;
}

.hkb-table thead {
  background: var(--hkb-primary);
  color: #fff;
}

.hkb-table th {
  padding: 20px 16px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.2px;
  border: none;
  text-align: center;
  color: #fff;
  line-height: 1.3;
}

.hkb-table tbody tr {
  background-color: #fff;
  transition: background-color 0.15s ease;
  border-bottom: 1px solid #F8F9FA;
}

.hkb-table tbody tr:last-child {
  border-bottom: none;
}

.hkb-table tbody tr:hover {
  background-color: #FAF5FA;
}

.hkb-table td {
  padding: 18px 16px;
  font-size: 17px;
  font-weight: 600;
  color: #1A1A1A;
  vertical-align: middle;
  border: none;
  text-align: center;
  line-height: 1.3;
}

/* Harga (kolom terakhir) tampil dalam gold */
.hkb-table td.hkb-col-price {
  color: var(--hkb-primary);
  font-weight: 700;
}

/* ── No Match State ── */
.hkb-no-match {
  padding: 40px 20px;
  text-align: center;
  color: var(--hkb-text-muted);
}

.hkb-no-match p {
  margin: 0;
  font-size: 14px;
}

/* ── Footer ── */
.hkb-widget-footer {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--hkb-border);
}

.hkb-footer-info {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hkb-info-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--hkb-text-muted);
  font-weight: 500;
}

.hkb-info-item svg { flex-shrink: 0; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .hkb-price-widget {
    padding: 20px 14px;
    margin: 15px auto;
    border-radius: var(--hkb-radius-md);
  }

  .hkb-tabs-nav {
    display: none;
  }

  .hkb-region-select {
    display: block;
  }

  .hkb-table th,
  .hkb-table td {
    padding: 14px 10px;
    font-size: 14px;
  }
}
