/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   UX Enhancements — April 2026
   Skeleton loaders, filter sidebar, improved cards, trust signals, mobile
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* ── Skeleton Loader Cards ────────────────────────────────────── */
.skeleton-results {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.skeleton-card {
  background: #fff;
  border: 1px solid var(--border-light, #eeecea);
  border-radius: 8px;
  padding: 1.1rem 1.25rem;
  animation: skeletonPulse 1.8s ease-in-out infinite;
}

.skeleton-card .sk-title {
  height: 16px;
  width: 70%;
  background: linear-gradient(90deg, #e8e6e1 25%, #f2f0eb 50%, #e8e6e1 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
  border-radius: 4px;
  margin-bottom: 0.6rem;
}

.skeleton-card .sk-meta {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.skeleton-card .sk-badge {
  height: 12px;
  width: 80px;
  background: linear-gradient(90deg, #e8e6e1 25%, #f2f0eb 50%, #e8e6e1 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
  border-radius: 10px;
}

.skeleton-card .sk-badge:nth-child(2) { width: 60px; animation-delay: 0.15s; }
.skeleton-card .sk-badge:nth-child(3) { width: 90px; animation-delay: 0.3s; }

.skeleton-card .sk-snippet {
  height: 11px;
  width: 95%;
  background: linear-gradient(90deg, #e8e6e1 25%, #f2f0eb 50%, #e8e6e1 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
  border-radius: 3px;
  margin-bottom: 0.35rem;
}

.skeleton-card .sk-snippet:last-child { width: 60%; }

.skeleton-card:nth-child(2) { animation-delay: 0.1s; }
.skeleton-card:nth-child(3) { animation-delay: 0.2s; }
.skeleton-card:nth-child(4) { animation-delay: 0.3s; }
.skeleton-card:nth-child(5) { animation-delay: 0.4s; }

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

@keyframes skeletonPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ── Progressive Loading Status ───────────────────────────────── */
.search-status-enhanced {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: #5a6c7d;
  margin-bottom: 0.75rem;
  min-height: 24px;
}

.search-status-enhanced .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #b8952e;
  animation: statusPulse 1s ease-in-out infinite;
}

.search-status-enhanced.done .status-dot {
  background: #2e7d32;
  animation: none;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.search-status-enhanced .status-text {
  flex: 1;
}

.search-status-enhanced .result-count {
  font-weight: 700;
  color: #1a2332;
}

/* ── Filter Sidebar ───────────────────────────────────────────── */
.results-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.25rem;
  align-items: start;
}

.filter-sidebar {
  background: #fff;
  border: 1px solid var(--border-light, #eeecea);
  border-radius: 8px;
  padding: 1rem;
  position: sticky;
  top: 5rem;
}

.filter-sidebar h3 {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8a9bae;
  margin: 0 0 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-light, #eeecea);
}

.filter-sidebar h3:not(:first-child) {
  margin-top: 1rem;
}

.filter-group-inline {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
}

.filter-check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: #2c3e50;
  cursor: pointer;
  padding: 0.15rem 0;
  user-select: none;
}

.filter-check input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: #b8952e;
  cursor: pointer;
  flex-shrink: 0;
}

.filter-check .filter-count {
  margin-left: auto;
  font-size: 0.72rem;
  color: #8a9bae;
  font-weight: 600;
}

.filter-date-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.filter-date-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.filter-date-field > span {
  font-size: 0.7rem;
  color: #7a8799;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
}

.filter-date-inputs input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.35rem 0.4rem;
  border: 1px solid var(--border-light, #eeecea);
  border-radius: 4px;
  font-size: 0.78rem;
  font-family: inherit;
  color: #2c3e50;
  min-width: 0;
}

.filter-date-inputs input:focus {
  outline: none;
  border-color: #b8952e;
}

.filter-date-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.4rem;
}

.filter-date-quick button {
  background: #f5f3ef;
  border: 1px solid var(--border-light, #eeecea);
  border-radius: 12px;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  cursor: pointer;
  color: #5a6c7d;
  font-family: inherit;
  transition: all 0.15s;
}

.filter-date-quick button:hover,
.filter-date-quick button.active {
  background: #b8952e;
  color: #fff;
  border-color: #b8952e;
}

.filter-reset-btn {
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.4rem;
  background: none;
  border: 1px solid var(--border-light, #eeecea);
  border-radius: 4px;
  font-size: 0.78rem;
  color: #8a9bae;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.filter-reset-btn:hover {
  color: #c0392b;
  border-color: #c0392b;
}

/* Active filter chips (shown above results) */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.active-filters:empty { display: none; }

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #f5f3ef;
  border: 1px solid #e0ddd8;
  border-radius: 12px;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  color: #5a6c7d;
}

.filter-chip .chip-remove {
  cursor: pointer;
  font-size: 0.85rem;
  color: #8a9bae;
  line-height: 1;
}

.filter-chip .chip-remove:hover { color: #c0392b; }

/* ── Improved Result Cards ────────────────────────────────────── */
.result-item {
  background: #fff;
  border: 1px solid var(--border-light, #eeecea);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.6rem;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  cursor: pointer;
  position: relative;
}

.result-item:hover {
  border-color: #d4d1cc;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}

.result-item.selected {
  border-color: #b8952e;
  box-shadow: 0 0 0 2px rgba(184, 149, 46, 0.15);
}

/* Court badge in result card */
.court-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  white-space: nowrap;
}

.court-badge.supreme { background: #1a2332; color: #fff; }
.court-badge.appeal { background: #2e5ea3; color: #fff; }
.court-badge.high { background: #185FA5; color: #fff; }
.court-badge.tribunal { background: #6b4c9a; color: #fff; }
.court-badge.other { background: #6b7280; color: #fff; }

.year-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  color: #8a9bae;
  background: #f5f3ef;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}

/* Section titles for result groups */
.result-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8a9bae;
  margin: 1.25rem 0 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border-light, #eeecea);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.result-section-title:first-child { margin-top: 0; }

.result-section-title .section-count {
  background: #f5f3ef;
  color: #5a6c7d;
  font-size: 0.68rem;
  padding: 0.1rem 0.4rem;
  border-radius: 8px;
}

/* Save button in result card */
.save-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  color: #8a9bae;
  cursor: pointer;
  opacity: 0;
  transition: all 0.15s;
  font-family: inherit;
}

.result-item:hover .save-btn {
  opacity: 1;
}

.save-btn:hover {
  border-color: #b8952e;
  color: #b8952e;
  background: rgba(184, 149, 46, 0.05);
}

/* ── Trust Signals Section ────────────────────────────────────── */
.trust-signals-section {
  padding: 2.5rem 1.25rem;
  background: #fff;
  border-top: 1px solid var(--border-light, #eeecea);
}

.trust-signals-inner {
  max-width: 900px;
  margin: 0 auto;
}

.trust-signals-section .section-label {
  text-align: center;
}

.trust-signals-section h2 {
  text-align: center;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.3rem;
  font-weight: 400;
  color: #1a2332;
  margin-bottom: 1.75rem;
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.trust-card {
  background: var(--bg, #fafaf7);
  border: 1px solid var(--border-light, #eeecea);
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
  transition: box-shadow 0.2s;
}

.trust-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.trust-card .trust-icon {
  font-size: 1.5rem;
  margin-bottom: 0.6rem;
}

.trust-card h3 {
  font-size: 0.88rem;
  font-weight: 600;
  color: #1a2332;
  margin-bottom: 0.3rem;
}

.trust-card p {
  font-size: 0.8rem;
  color: #5a6c7d;
  line-height: 1.45;
}

/* Data sources transparency bar */
.data-sources-bar {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--bg, #fafaf7);
  border: 1px solid var(--border-light, #eeecea);
  border-radius: 8px;
  text-align: center;
}

.data-sources-bar .ds-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8a9bae;
  margin-bottom: 0.5rem;
}

.data-sources-bar .ds-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1rem;
  font-size: 0.8rem;
  color: #5a6c7d;
}

.data-sources-bar .ds-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.data-sources-bar .ds-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #2e7d32;
  flex-shrink: 0;
}

/* ── Mobile Filter Drawer ─────────────────────────────────────── */
.filter-drawer-toggle {
  display: none;
  align-items: center;
  gap: 0.4rem;
  background: #fff;
  border: 1px solid var(--border-light, #eeecea);
  border-radius: 6px;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-family: inherit;
  color: #5a6c7d;
  cursor: pointer;
  margin-bottom: 0.75rem;
  transition: border-color 0.15s;
}

.filter-drawer-toggle:hover { border-color: #b8952e; }

.filter-drawer-toggle svg {
  width: 14px;
  height: 14px;
}

/* ── Responsive: Mobile ───────────────────────────────────────── */
@media (max-width: 768px) {
  .results-layout {
    grid-template-columns: 1fr;
  }

  .filter-sidebar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    z-index: 500;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
    max-height: 70vh;
    overflow-y: auto;
    padding: 1.25rem;
    animation: slideUp 0.25s ease-out;
  }

  .filter-sidebar.open {
    display: block;
  }

  .filter-drawer-toggle {
    display: inline-flex;
  }

  .filter-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 499;
  }

  .filter-overlay.open {
    display: block;
  }

  .trust-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

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

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

  .search-status-enhanced {
    font-size: 0.8rem;
  }

  .filter-date-quick { gap: 0.25rem; }
  .filter-date-quick button { font-size: 0.7rem; padding: 0.15rem 0.4rem; }
}
