/* =====================================================
   KORTEX SYSTEM - DEMO SECTION
   Inline demo with YouTube player + CTAs
   ===================================================== */

/* Demo Grid Layout */
.demo-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  align-items: start;
}

/* Video Container */
.demo-video-container {
  display: flex;
  flex-direction: column;
}

.video-wrapper {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s, box-shadow 0.3s;
}

/* Autoplay videos - no hover effect, looks embedded */
.video-wrapper.video-autoplay {
  cursor: default;
  box-shadow: 0 8px 24px rgba(3, 78, 162, 0.2);
}

.video-wrapper.video-autoplay:hover {
  transform: none;
}

.video-wrapper:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.video-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s;
}

.video-wrapper:hover .video-thumbnail {
  opacity: 0.85;
}

.video-play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  background: rgba(3, 78, 162, 0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(3, 78, 162, 0.5);
}

.video-wrapper:hover .video-play-button {
  transform: translate(-50%, -50%) scale(1.15);
  background: rgba(3, 78, 162, 1);
}

.video-play-button::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 24px solid white;
  border-top: 15px solid transparent;
  border-bottom: 15px solid transparent;
  margin-left: 6px;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Loading State */
.video-wrapper.loading {
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-wrapper.loading::after {
  content: "";
  width: 50px;
  height: 50px;
  border: 4px solid rgba(3, 78, 162, 0.3);
  border-top-color: #034EA2;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* CTA Container */
.demo-cta-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* CTA Cards */
.demo-cta-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #034EA2 0%, #09182F 100%);
  border: 2px solid rgba(3, 78, 162, 0.3);
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.3s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.demo-cta-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
  opacity: 0;
  transition: opacity 0.3s;
}

.demo-cta-card:hover::before {
  opacity: 1;
}

.demo-cta-card:hover {
  transform: translateX(8px);
  border-color: rgba(3, 78, 162, 0.6);
  box-shadow: 0 8px 24px rgba(3, 78, 162, 0.3);
}

.demo-cta-card strong {
  display: block;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  z-index: 1;
  position: relative;
}

.demo-cta-card span {
  display: block;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  line-height: 1.5;
  z-index: 1;
  position: relative;
}

.demo-cta-card .arrow {
  position: absolute;
  bottom: 1.5rem;
  right: 1.5rem;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.75rem;
  transition: all 0.3s;
  z-index: 1;
}

.demo-cta-card:hover .arrow {
  color: #fff;
  transform: translateX(4px);
}

/* Tablet & Mobile Styles */
@media (max-width: 968px) {
  .demo-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .demo-cta-container {
    order: -1;
  }

  .video-play-button {
    width: 70px;
    height: 70px;
  }

  .video-play-button::after {
    border-left: 20px solid white;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
  }
}

@media (max-width: 640px) {
  .demo-grid {
    gap: 1.5rem;
  }

  .demo-cta-card {
    padding: 1.25rem;
  }

  .demo-cta-card strong {
    font-size: 1rem;
  }

  .demo-cta-card span {
    font-size: 0.85rem;
  }

  .video-play-button {
    width: 60px;
    height: 60px;
  }

  .video-play-button::after {
    border-left: 18px solid white;
    border-top: 11px solid transparent;
    border-bottom: 11px solid transparent;
    margin-left: 5px;
  }
}

/* Accessibility */
.video-wrapper:focus {
  outline: 3px solid #034EA2;
  outline-offset: 4px;
}

.demo-cta-card:focus {
  outline: 3px solid #034EA2;
  outline-offset: 4px;
}

/* Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
