/* ================================================================
   Shared Directory Styles — used by all product directories.
   Loaded from CDN: https://cdn.opstimal.ai/css/directory.css
   ================================================================ */

:root {
  --dir-card-border: var(--colors--light, #dedede);
  --dir-card-bg: var(--colors--white, #fff);
  --dir-muted: var(--colors--black-059, #00000096);
  --dir-title: var(--colors--darkest, #262626);
  --dir-chip-bg: rgba(255, 255, 255, 0.22);
  --dir-chip-border: rgba(255, 255, 255, 0.38);
  --dir-chip-ink: #ffffff;
  --dir-risk: #fe6c1a;
  --dir-map-idle: #dbe0ea;
  --dir-map-stroke: #aeb9cc;
  --dir-map-hover: #aec9ff;
  --dir-map-selected: #7c8cff;
  --dir-skeleton-base: #e8e8e8;
  --dir-skeleton-shine: #f5f5f5;
}

* {
  box-sizing: border-box;
}

body.directory-body {
  background: var(--colors--lightest, #f7f7f7);
}

/* ── Skeleton loading animation ── */
@keyframes dir-shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.dir-skeleton {
  background: linear-gradient(90deg,
    var(--dir-skeleton-base) 0%,
    var(--dir-skeleton-shine) 40%,
    var(--dir-skeleton-base) 80%
  );
  background-size: 800px 100%;
  animation: dir-shimmer 1.4s ease-in-out infinite;
  border-radius: 0.5rem;
}

.dir-skeleton-card {
  background: var(--dir-card-bg);
  border: 1px solid var(--dir-card-border);
  border-radius: 1rem;
  padding: 1rem;
  min-height: 10rem;
}

.dir-skeleton-card .dir-skeleton-line {
  height: 0.9rem;
  margin-bottom: 0.65rem;
  border-radius: 0.35rem;
}

.dir-skeleton-card .dir-skeleton-line:first-child {
  width: 70%;
  height: 1.15rem;
}

.dir-skeleton-card .dir-skeleton-line:nth-child(2) {
  width: 45%;
  height: 0.75rem;
}

.dir-skeleton-card .dir-skeleton-line:nth-child(3) {
  width: 90%;
  margin-top: 0.5rem;
}

.dir-skeleton-card .dir-skeleton-line:last-child {
  width: 65%;
}

.dir-skeleton-stat {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.9rem;
}

.dir-skeleton-stat .dir-skeleton-line {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.12) 0%,
    rgba(255,255,255,0.22) 40%,
    rgba(255,255,255,0.12) 80%
  );
  background-size: 800px 100%;
  animation: dir-shimmer 1.4s ease-in-out infinite;
  border-radius: 0.35rem;
}

.dir-skeleton-stat .dir-skeleton-line:first-child {
  width: 60%;
  height: 0.7rem;
  margin-bottom: 0.5rem;
}

.dir-skeleton-stat .dir-skeleton-line:last-child {
  width: 40%;
  height: 1.6rem;
}

.dir-skeleton-detail-row {
  display: flex;
  gap: 0.6rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(38, 38, 38, 0.06);
}

.dir-skeleton-detail-row .dir-skeleton-line:first-child {
  width: 6rem;
  height: 0.8rem;
  flex-shrink: 0;
}

.dir-skeleton-detail-row .dir-skeleton-line:last-child {
  flex: 1;
  height: 0.8rem;
}

/* ── Layout ── */
.directory-main-section {
  padding-top: 2.5rem;
  padding-bottom: 1.25rem;
}

.dir-shell {
  max-width: 1120px;
}

/* ── Hero ── */
.dir-hero {
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  color: #fff;
}

.dir-hero.footer-cta-section {
  text-align: left;
  box-shadow: none;
}

.dir-hero .heading-style-h2 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: #fff;
  font-size: clamp(1.75rem, 2.7vw, 2.85rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.dir-hero .text-color-white-059 {
  margin: 0;
  max-width: 48rem;
  font-size: 1rem;
  line-height: 1.45;
}

/* ── Back link ── */
.dir-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 0.86rem;
  line-height: 1;
  text-decoration: none;
}

.dir-back-link:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  text-decoration: none;
}

.dir-back-link i {
  width: 0.9rem;
  height: 0.9rem;
}

/* ── Summary stats ── */
.dir-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1.3rem;
}

.dir-stat {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.15);
  padding: 0.9rem;
  box-shadow: inset 0 0 0 1px #ffffff1f, inset 0 1px 1px -0.5px #ffffff21;
}

.dir-stat small {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.2rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.82rem;
  line-height: 1.25;
}

.dir-stat small i {
  width: 0.95rem;
  height: 0.95rem;
}

.dir-stat strong {
  font-size: 1.8rem;
  line-height: 1;
  color: #fff;
}

/* ── Sections & grids ── */
.dir-section {
  margin-bottom: 1.5rem;
}

.dir-section .heading-style-h4,
.dir-section .heading-style-h5 {
  margin-bottom: 0.8rem;
}

.dir-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

body[data-directory-page="state"] .dir-shell,
body[data-directory-page="industry"] .dir-shell {
  min-height: calc(100dvh - 11.5rem);
  display: flex;
  flex-direction: column;
}

body[data-directory-page="state"] .directory-main-section,
body[data-directory-page="industry"] .directory-main-section {
  padding-bottom: 0;
}

body[data-directory-page="state"] #listing-grid,
body[data-directory-page="industry"] #listing-grid {
  width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
}

/* ── Cards & panels ── */
.dir-card,
.dir-panel,
.dir-loading,
.dir-empty,
.dir-error {
  background: var(--dir-card-bg);
  border: 1px solid var(--dir-card-border);
  border-radius: 1rem;
  padding: 1rem;
}

.dir-card {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.dir-card:hover {
  border-color: var(--colors--brand-prime, #4b3de3);
  box-shadow: 0 12px 24px rgba(75, 61, 227, 0.14);
  transform: translateY(-1px);
  text-decoration: none;
}

.dir-card h3 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.3;
  min-height: 3.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dir-card-icon .dir-card-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}

.dir-card-icon .dir-card-head i {
  width: 1rem;
  height: 1rem;
  color: var(--colors--brand-prime, #4b3de3);
}

.dir-card h3 a {
  color: var(--dir-title);
  text-decoration: none;
}

.dir-card h3 a:hover {
  color: var(--colors--brand-prime, #4b3de3);
}

/* ── Chips & badges ── */
.dir-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.65rem 0;
  min-height: 2.2rem;
}

.dir-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  border: 1px solid rgba(38, 38, 38, 0.08);
  border-radius: 100rem;
  padding: 0.24rem 0.58rem;
  background: rgba(38, 38, 38, 0.05);
  color: var(--dir-title);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.2;
}

.dir-chip i {
  width: 0.86rem;
  height: 0.86rem;
}

.dir-hero .dir-chip {
  border-color: var(--dir-chip-border);
  background: var(--dir-chip-bg);
  color: var(--dir-chip-ink);
}

.dir-hero .dir-badge-violation,
.dir-hero .dir-badge-violation[class*="--"] {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.38);
}

.dir-hero .dir-badge-status,
.dir-hero .dir-badge-status[class*="--"] {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.38);
}

/* Category badges (violation type, industry, etc.) */
.dir-badge-violation {
  display: inline-flex;
  align-items: center;
  border-radius: 100rem;
  padding: 0.24rem 0.62rem;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.02em;
  /* Fallback colors for unknown types */
  background: rgba(107, 114, 128, 0.1);
  color: #4b5563;
  border: 1px solid rgba(107, 114, 128, 0.16);
}

.dir-badge-violation--cipa { background: rgba(59, 130, 246, 0.12); color: #2563eb; border: 1px solid rgba(59, 130, 246, 0.2); }
.dir-badge-violation--tcpa { background: rgba(249, 115, 22, 0.12); color: #c2410c; border: 1px solid rgba(249, 115, 22, 0.2); }
.dir-badge-violation--ada,
.dir-badge-violation--wcag { background: rgba(139, 92, 246, 0.12); color: #7c3aed; border: 1px solid rgba(139, 92, 246, 0.2); }
.dir-badge-violation--ccpa { background: rgba(34, 197, 94, 0.12); color: #15803d; border: 1px solid rgba(34, 197, 94, 0.2); }
.dir-badge-violation--dark-patterns { background: rgba(244, 63, 94, 0.12); color: #be123c; border: 1px solid rgba(244, 63, 94, 0.2); }
.dir-badge-violation--cookie { background: rgba(234, 179, 8, 0.12); color: #a16207; border: 1px solid rgba(234, 179, 8, 0.2); }
.dir-badge-violation--vppa { background: rgba(14, 165, 233, 0.12); color: #0369a1; border: 1px solid rgba(14, 165, 233, 0.2); }

/* Status badges */
.dir-badge-status {
  display: inline-flex;
  align-items: center;
  border-radius: 100rem;
  padding: 0.24rem 0.58rem;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
}

.dir-badge-status--settled { background: rgba(34, 197, 94, 0.12); color: #15803d; border: 1px solid rgba(34, 197, 94, 0.18); }
.dir-badge-status--pending { background: rgba(234, 179, 8, 0.12); color: #a16207; border: 1px solid rgba(234, 179, 8, 0.18); }
.dir-badge-status--dismissed { background: rgba(107, 114, 128, 0.1); color: #6b7280; border: 1px solid rgba(107, 114, 128, 0.16); }
.dir-badge-status--judgment { background: rgba(239, 68, 68, 0.12); color: #dc2626; border: 1px solid rgba(239, 68, 68, 0.18); }

/* ── Detail page ── */
.case-details-grid {
  margin-top: 1rem;
  display: grid;
  gap: 0.5rem;
}

.case-detail-row {
  display: flex;
  gap: 0.6rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(38, 38, 38, 0.06);
  font-size: 0.92rem;
}

.case-detail-label {
  min-width: 6.5rem;
  color: var(--dir-muted);
  font-weight: 500;
  flex-shrink: 0;
}

.case-detail-settlement {
  font-weight: 700;
  color: var(--colors--brand-prime, #4b3de3);
}

/* Case detail content sections */
.case-content-section {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(38, 38, 38, 0.08);
}

.case-section-heading {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--dir-title);
}

.case-section-body {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.65;
  color: var(--dir-muted);
}

.case-key-facts-list {
  margin: 0.5rem 0 0 1.2rem;
  padding: 0;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--dir-muted);
}

.case-key-facts-list li {
  margin-bottom: 0.3rem;
}

/* ── Typography helpers ── */
.dir-snippet {
  margin: 0;
  color: var(--dir-muted);
  flex: 1 1 auto;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dir-meta {
  margin-top: auto;
  padding-top: 0.65rem;
  color: var(--dir-muted);
  font-size: 0.9rem;
}

.dir-meta a {
  color: var(--colors--brand-prime, #4b3de3);
  text-decoration: none;
}

.dir-meta a:hover {
  text-decoration: underline;
}

.dir-badge-risk {
  color: var(--dir-risk);
  font-weight: 700;
}

.dir-loading,
.dir-empty,
.dir-error {
  color: var(--dir-muted);
  border-style: dashed;
}

/* ── Two-column layout (detail) ── */
.dir-two-col {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr);
  gap: 0.85rem;
}

.dir-panel .heading-style-h4,
.dir-panel .heading-style-h5 {
  margin-top: 0;
}

/* ── Form ── */
.dir-form {
  display: grid;
  gap: 0.8rem;
}

.dir-label {
  margin-bottom: 0.3rem;
  display: inline-block;
  color: var(--dir-muted);
  font-size: 0.88rem;
}

.dir-input {
  width: 100%;
  height: 2.85rem;
  border: 1px solid var(--dir-card-border);
  border-radius: 0.75rem;
  padding: 0.65rem 0.8rem;
  background: #fff;
  color: var(--dir-title);
  font-size: 0.95rem;
}

.dir-input:focus {
  border-color: var(--colors--brand-prime, #4b3de3);
  outline: none;
  box-shadow: 0 0 0 2px rgba(75, 61, 227, 0.14);
}

.dir-submit-btn {
  width: 100%;
  justify-content: center;
}

.dir-form-status {
  min-height: 1.25rem;
  font-size: 0.88rem;
}

.dir-form-status.ok { color: var(--colors--success-green, #138b41); }
.dir-form-status.err { color: var(--colors--error-red, #c33d3d); }

/* ── Footer note ── */
.dir-footer-note {
  margin-top: 1rem;
  font-size: 0.86rem;
  line-height: 1.45;
}

body[data-directory-page="state"] .dir-footer-note,
body[data-directory-page="industry"] .dir-footer-note {
  margin-top: auto;
  margin-bottom: 0.6rem;
  padding: 0.72rem 0.9rem;
  border: 1px solid rgba(38, 38, 38, 0.12);
  border-radius: 0.9rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  color: rgba(38, 38, 38, 0.72);
}

/* ── State map ── */
.dir-map-card {
  border: 1px solid var(--dir-card-border);
  border-radius: 1rem;
  background: var(--dir-card-bg);
  box-shadow: inset 0 0 0 1px #4141410f, inset 0 1px 1px -0.5px #33333314, inset 0 2px 2px -1px #33333314, 0 0.5px 0.5px #fff, 0 1px 2px #ffffffa3;
}

.state-map-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-height: 500px;
  overflow: hidden;
  margin: 0.8rem 0 0;
  padding: 1rem;
}

.state-map-container svg {
  width: min(100%, 920px);
  height: auto;
  max-height: 460px;
  display: block;
  margin: 0 auto;
}

.us-map-state {
  fill: var(--dir-map-idle);
  stroke: var(--dir-map-stroke);
  stroke-width: 1;
  transition: fill 0.2s ease;
}

.us-map-state:hover { fill: var(--dir-map-hover); }
.us-map-state.selected { fill: var(--dir-map-selected); }

.state-tooltip {
  position: fixed;
  background: var(--dir-title);
  color: #fff;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 10001;
  white-space: nowrap;
}

.state-tooltip.visible { opacity: 1; }

.state-selector-helper {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--dir-muted);
}

/* ── Load More button ── */
.dir-load-more-wrapper {
  display: flex;
  justify-content: center;
  padding: 1.5rem 0 0.5rem;
}

.dir-load-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 14rem;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--dir-card-border);
  border-radius: 0.75rem;
  background: var(--dir-card-bg);
  color: var(--dir-title);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.dir-load-more-btn:hover {
  border-color: var(--colors--brand-prime, #4b3de3);
  box-shadow: 0 4px 12px rgba(75, 61, 227, 0.12);
  background: rgba(75, 61, 227, 0.04);
}

.dir-load-more-btn:disabled {
  opacity: 0.55;
  cursor: default;
  box-shadow: none;
}

/* ── Responsive ── */
@media screen and (max-width: 991px) {
  .dir-summary,
  .dir-grid,
  .dir-two-col {
    grid-template-columns: 1fr;
  }

  .directory-main-section {
    padding-top: 1.5rem;
    padding-bottom: 0.9rem;
  }

  .dir-hero {
    padding: 1.2rem;
  }

  .dir-hero .heading-style-h2 {
    font-size: clamp(1.55rem, 6vw, 2.15rem);
  }

  .state-map-container {
    padding: 0.75rem;
  }

  .case-detail-row {
    flex-direction: column;
    gap: 0.15rem;
  }
}
