/* Clients Section - Interactive Cards with Scan Effect */

.clients-section {
  padding: 24px 20px 60px;
  background: transparent;
  position: relative;
  overflow: visible;
  z-index: 10;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.clients-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  pointer-events: none;
  z-index: 0;
}

.clients-header {
  text-align: center;
  margin-bottom: 60px;
  position: relative;
  z-index: 1;
}

.clients-title {
  font-size: 42px;
  font-weight: 700;
  color: var(--st-ink, #e8f7ff);
  margin: 0 0 16px 0;
  letter-spacing: -0.5px;
}

.clients-subtitle {
  font-size: 18px;
  color: var(--st-muted, #9bb3d4);
  margin: 0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.clients-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  z-index: 10;
  pointer-events: auto;
}

@media (min-width: 768px) {
  .clients-section {
    padding-top: 28px;
  }

  .clients-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .clients-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1200px) {
  .clients-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.client-case {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.client-case .client-card,
.client-case .audio-module {
  width: 100%;
}

.client-case .audio-module {
  max-height: 0;
  min-height: 0;
  margin-top: 0;
  padding: 18px;
  gap: 12px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateY(-10px);
  transition: max-height 0.3s ease, margin-top 0.3s ease, opacity 0.25s ease, transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.client-case:hover .audio-module,
.client-case:focus-within .audio-module {
  max-height: 220px;
  margin-top: 16px;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.client-case .audio-controls {
  gap: 8px;
  margin-top: 0;
}

.client-case .play-btn {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
}

.client-case .progress {
  min-width: 48px;
}

.client-case .progress-wave {
  gap: 1px;
}

.client-case .progress-wave-bar {
  min-width: 1px;
}

.client-case .time {
  min-width: 72px;
  font-size: 11px;
}

.client-case .wave {
  display: none;
}

.client-case .audio-h5 {
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
}

.client-case .audio-bottom-h5 {
  font-size: 18px;
}

.client-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  padding: 24px 16px;
  background: rgba(6, 25, 54, 0.4);
  backdrop-filter: blur(12px);
  border: 1px solid var(--st-line, rgba(140, 247, 255, 0.14));
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 20px rgba(11, 99, 246, 0.1);
  align-self: stretch;
  z-index: 10;
  pointer-events: auto;
}

.client-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: linear-gradient(to bottom, rgba(140, 247, 255, 0.15) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.6s ease-out;
  pointer-events: none;
}

.client-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    linear-gradient(180deg, 
      rgba(11, 99, 246, 0) 0%,
      rgba(11, 99, 246, 0.05) 50%,
      rgba(11, 99, 246, 0) 100%);
  opacity: 0;
  transition: opacity 0.4s ease-out;
  pointer-events: none;
}

.client-card:hover {
  border-color: var(--st-cyan, #8cf7ff);
  box-shadow: 
    0 0 30px rgba(140, 247, 255, 0.3),
    0 0 60px rgba(11, 99, 246, 0.2),
    inset 0 0 20px rgba(140, 247, 255, 0.05);
  transform: translateY(-4px) scale(1.02);
}

.client-card:hover::before {
  opacity: 1;
  animation: scan-effect 0.8s ease-out;
}

.client-card:hover::after {
  opacity: 1;
}

@keyframes scan-effect {
  0% {
    top: -100%;
  }
  100% {
    top: 100%;
  }
}

.card-logo-wrapper {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 180px);
  height: 92px;
  padding: 14px 20px;
  margin-bottom: 20px;
  background: #ffffff;
  border: 1px solid rgba(232, 247, 255, 0.8);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(2, 10, 24, 0.18);
  transition: filter 0.4s ease-out, box-shadow 0.4s ease-out;
}

.client-card:hover .card-logo-wrapper {
  box-shadow: 0 14px 34px rgba(2, 10, 24, 0.26);
}

.client-case[data-client-id="agentstvo-svyazi"] .card-logo-wrapper {
  background: #010101;
  border-color: rgba(1, 1, 1, 0.85);
}

.client-case[data-client-id="bizmall"] .card-logo-wrapper {
  background: #3e4861;
  border-color: rgba(62, 72, 97, 0.85);
}

.client-case[data-client-id="cherkizovo"] .card-logo-wrapper {
  background: #d50037;
  border-color: rgba(213, 0, 55, 0.85);
}

.card-logo {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 4px rgba(140, 247, 255, 0.1));
  transition: filter 0.4s ease-out;
}

.client-card:hover .card-logo {
  filter: drop-shadow(0 0 8px rgba(140, 247, 255, 0.2));
}

.card-company-name {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--st-cyan, #8cf7ff);
  background: linear-gradient(120deg, #e8fbff 0%, #8cf7ff 42%, #b9a6ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
  text-align: center;
  position: relative;
  z-index: 2;
  margin-bottom: 20px;
  text-shadow:
    0 0 10px rgba(140, 247, 255, 0.45),
    0 0 22px rgba(123, 92, 255, 0.28);
  transition: filter 0.3s ease-out, letter-spacing 0.3s ease-out, text-shadow 0.3s ease-out;
}

.client-card:hover .card-company-name {
  letter-spacing: 0.11em;
  filter: brightness(1.12);
  text-shadow:
    0 0 14px rgba(140, 247, 255, 0.72),
    0 0 30px rgba(123, 92, 255, 0.45);
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(2, 10, 24, 0.5);
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.4s ease-out;
  z-index: 3;
  pointer-events: none;
  border-radius: 12px;
}

.client-card:hover .card-overlay {
  opacity: 1;
}

.card-overlay-content {
  text-align: center;
  animation: overlay-fade-in 0.5s ease-out forwards;
}

@keyframes overlay-fade-in {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-solution-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--st-cyan, #8cf7ff);
  margin: 0 0 20px 0;
  letter-spacing: -0.3px;
}

.card-metrics {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.card-metric {
  font-size: 13px;
  color: var(--st-ink, #e8f7ff);
  margin: 0;
  padding: 8px 12px;
  background: rgba(11, 99, 246, 0.1);
  border-left: 2px solid var(--st-cyan, #8cf7ff);
  border-radius: 4px;
  text-align: left;
  transition: all 0.3s ease-out;
  animation: metric-slide-in 0.4s ease-out backwards;
}

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

@keyframes metric-slide-in {
  0% {
    opacity: 0;
    transform: translateX(-12px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

.client-card:hover .card-metric {
  background: rgba(11, 99, 246, 0.15);
  border-left-color: var(--st-blue, #0b63f6);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .clients-title {
    font-size: 36px;
  }
  
  .clients-subtitle {
    font-size: 16px;
  }
  
  .client-card {
    min-height: 300px;
    padding: 24px 20px;
  }
}

@media (max-width: 768px) {
  .clients-section {
    padding: 40px 16px;
  }
  
  .clients-header {
    margin-bottom: 40px;
  }
  
  .clients-title {
    font-size: 28px;
  }
  
  .clients-subtitle {
    font-size: 14px;
  }
  
  .clients-grid {
    gap: 16px;
  }
  
  .client-card {
    min-height: 280px;
    padding: 20px 16px;
  }

  .client-case .audio-module {
    padding: 16px;
  }
  
  .card-solution-title {
    font-size: 14px;
  }
  
  .card-metric {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .clients-section {
    padding: 30px 12px;
  }

  .clients-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .clients-title {
    font-size: 24px;
    margin-bottom: 12px;
  }
  
  .clients-subtitle {
    font-size: 13px;
  }
  
  .client-card {
    min-height: 240px;
    padding: 16px 12px;
  }
  
  .card-logo-wrapper {
    width: min(100%, 156px);
    height: 74px;
    padding: 12px 16px;
    margin-bottom: 12px;
  }
}

/* Ensure proper text rendering */
.clients-section * {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Accessibility: prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .client-card,
  .card-logo-wrapper,
  .card-overlay,
  .card-metric,
  .card-logo {
    transition: none !important;
    animation: none !important;
  }
}
