:root {
  --primary: #2563eb;
  --bg-light: #f8fafc;
  --text-dark: #1e293b;
  --text-gray: #64748b;
  --border: #e2e8f0;
  --green-badge: #dcfce7;
  --green-text: #166534;
  --radius: 12px;
  --shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
  --hero-bg: #23022e;
  --carousel-bg: #23022e;
  --panel-bg: #f5f7fb;
  --card-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  color: var(--text-dark);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: var(--hero-bg);
}

.page-hero {
  padding: 80px 20px 40px;
  color: #fff;
}

.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.85rem;
  color: #ffad75;
  margin-bottom: 16px;
}

.page-hero h1 {
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  line-height: 1.15;
  margin-bottom: 16px;
}

.hero-subtitle {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.05rem;
  margin-bottom: 28px;
}

.hero-trust {
  font-size: 1rem;
  margin-bottom: 18px;
}

.hero-logos {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.customer-success-section {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 32px 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: transparent;
}

.section-header {
  text-align: center;
  margin-bottom: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 20px;
}

.section-title {
  color: #fff;
  font-size: clamp(1.9rem, 2.8vw, 3rem);
  margin: 0;
  text-align: center;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.04em;
  max-width: 700px;
}

.experience-container {
  display: flex;
  width: 100%;
  height: 620px;
  gap: 10px;
  overflow: hidden;
}

.hover-card {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100%;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  background: #111;
  transition: flex 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s ease;
}

.hover-card:hover {
  flex: 5;
}

.thumbnail-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  z-index: 2;
  opacity: 1;
  transition: opacity 0.4s ease;
}

.hover-card:hover .thumbnail-img {
  opacity: 0;
}

.hover-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  border: 0;
  z-index: 1;
  background: #000;
}

.hover-video-direct {
  object-fit: cover;
}

.description-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.82) 58%, rgba(0, 0, 0, 0.96) 100%);
  padding: 42px 22px 24px;
  z-index: 4;
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.5s ease 0.15s, opacity 0.5s ease 0.15s;
}

.hover-card:hover .description-bar {
  transform: translateY(0);
  opacity: 1;
}

.desc-text {
  color: #fff;
}

.desc-text h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
}

.desc-text p {
  margin: 6px 0 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.4;
}

.directory-section {
  background: var(--bg-light);
  padding: 70px 20px 90px;
}

.directory-header {
  max-width: 1200px;
  margin: 0 auto 32px;
  text-align: left;
}

.directory-header h2 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.directory-header p {
  color: var(--text-gray);
}

.directory-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
  align-items: start;
}

.sidebar {
  background: var(--panel-bg);
  border: 1px solid rgba(15, 23, 42, 0.06);
  padding: 26px;
  border-radius: 18px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.35);
  border-radius: 999px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.55);
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.sidebar-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.reset-btn {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 14px;
}

.filter-group {
  margin-bottom: 30px;
}

.filter-group h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-gray);
  margin-bottom: 12px;
  font-weight: 600;
}

.search-box {
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 10px 10px 10px 35px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 10px;
  color: var(--text-gray);
  font-size: 14px;
}

.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-dark);
}

.checkbox-item input {
  margin-right: 10px;
  accent-color: var(--primary);
  transform: scale(1.1);
}

.highlight-group {
  background: #eef4ff;
  padding: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked+.slider {
  background-color: var(--primary);
}

input:checked+.slider:before {
  transform: translateX(18px);
}

.toggle-label {
  font-size: 13px;
  line-height: 1.4;
}

.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-tag {
  background: white;
  border: 1px solid rgba(15, 23, 42, 0.08);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-tag:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-tag.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.directory-content {
  min-width: 0;
}

.directory-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-gray);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

#count-badge {
  color: var(--text-gray);
  font-weight: 600;
  font-size: 1rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.pagination button {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-dark);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination button:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination .is-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.directory-section .card {
  background: white;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.directory-section .card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow);
  border-color: var(--primary);
}

/* .directory-section .card-image {
  height: 160px;
  background-color: #e2e8f0;
  position: relative;
  background-size: cover;
  background-position: center;
} */

.directory-section .card-image {
  height: 160px;
  background-color: var(--primary);
  /* Uses your existing #2563eb blue */
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  overflow: hidden;
}

/* New class for the text sitting on top of the blue background */
.card-image-text {
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  text-wrap: balance;
  /* Prevents awkward orphans on new lines */
  z-index: 1;
}

/* Optional: Add a subtle pattern to make it look less flat, keeping the modern SaaS feel */
.directory-section .card-image::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at top right, rgba(255, 255, 255, 0.1), transparent 50%);
  pointer-events: none;
}

.directory-section .roi-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--green-badge);
  color: var(--green-text);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.directory-section .card-body {
  padding: 20px;
  flex-grow: 1;
  color: var(--text-dark);
}

.directory-section .card-title {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.3;
}

.directory-section .card-summary {
  font-size: 14px;
  color: var(--text-gray);
  margin-bottom: 16px;
  line-height: 1.45;
}

.spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: var(--bg-light);
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.spec-item {
  font-size: 12px;
}

.spec-label {
  display: block;
  color: var(--text-gray);
  margin-bottom: 2px;
  font-size: 10px;
  text-transform: uppercase;
}

.spec-value {
  font-weight: 600;
  color: var(--text-dark);
}

.directory-section .card-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-dark);
}

.client-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-gray);
}

.client-logo img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.read-btn {
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

.read-btn:hover {
  text-decoration: underline;
}

#no-results,
#load-error {
  text-align: center;
  padding: 60px;
  grid-column: 1 / -1;
  color: var(--text-gray);
}

.no-results-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.hidden {
  display: none;
}

@media (max-width: 980px) {
  .directory-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .timeline-nav {
    flex-wrap: wrap;
    gap: 18px;
  }
}

@media (max-width: 768px) {
  .section-title {
    font-size: 2rem;
    max-width: 540px;
  }

  .customer-success-section {
    padding: 24px 20px 64px;
  }

  .experience-container {
    flex-direction: column;
    height: 920px;
  }

  .hover-card {
    min-height: 88px;
  }

  .hover-card:hover {
    flex: 2.2;
  }
}
