.company-video-section {
  padding: 20px 0px 100px 0px;
  background-color: #ffffff;
  overflow: hidden;
}

.cv-header {
  margin-bottom: 50px;
}

.cv-title {
  font-size: 3rem;
  font-weight: 800;
  color: #1a1a1a;
  margin-bottom: 15px;
}

.cv-gradient-text {
  background: linear-gradient(90deg, #ff1b6b, #ff7e5f, #ffbf00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent; /* Fallback */
}

.cv-subtitle {
  font-size: 1.1rem;
  color: #6c757d;
  max-width: 600px;
  margin: 0 auto;
}

/* Grid Layout */
.cv-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr 1fr; /* Slightly wider center for more cinematic look */
  gap: 24px;
  align-items: stretch;

  margin: 0 auto;
}

/* Gradient Border Wrapper */
.cv-gradient-border {
  position: relative;
  border-radius: 20px;
  padding: 2px; /* Slimmer premium border */
  background: conic-gradient(
    from 83.41deg at 50.24% 50.24%,
    rgb(37, 193, 111) -36.7deg,
    rgb(239, 199, 94) 13.28deg,
    rgb(255, 156, 35) 57.71deg,
    rgb(255, 73, 44) 98.29deg,
    rgb(189, 99, 196) 135.43deg,
    rgb(133, 18, 224) 172.9deg,
    rgb(69, 164, 236) 207.19deg,
    rgb(89, 241, 245) 244.06deg,
    rgb(37, 193, 111) 291.15deg,
    rgb(37, 193, 111) 323.3deg,
    rgb(239, 199, 94) 373.28deg
  );
  height: 100%;
  display: flex;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cv-gradient-border:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.cv-inner {
  border-radius: 18px;
  overflow: hidden;
  width: 100%;
  height: 100%;
  position: relative;
  background-color: #f8f9fa; /* Light gray background to look better if image fails */
  display: flex;
  align-items: center;
  justify-content: center;
}

.cv-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
}

.cv-gradient-border:hover .cv-img {
  transform: scale(1.08);
}

/* Center Video Column */
.cv-main-video {
  position: relative;
  height: 100%;
}

.cv-video-iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 180%; /* Significantly larger to crop out black bars effectively */
  height: 180%;
  transform: translate(-50%, -50%); /* Centers the zoomed iframe */
  pointer-events: none; /* Prevents user interaction, hiding YouTube overlays/pausing */
  border: none;
  filter: saturate(1.1); /* Slight boost for vibrance */
}

/* Side Column Stacks */
.cv-col-left,
.cv-col-right {
  display: flex;
  height: 100%;
  flex-direction: column;
  gap: 20px;
}

.cv-col-center {
  height: 500px; /* Cinematic height for video */
}

.cv-col-left .cv-gradient-border,
.cv-col-right .cv-gradient-border {
  height: auto;
  flex: 1; /* Automatically balances the height between top and bottom images or spans 100% if 1 item */
  min-height: 0;
}

/* Responsive */
@media (max-width: 991px) {
  .company-video-section {
    padding: 60px 0;
  }

  .section-heading h2 {
    font-size: 2.2rem !important; /* Increased mobile heading size */
    line-height: 1.2;
  }

  .cv-grid {
    grid-template-columns: 1fr;
    height: auto; /* Allow stacking without fixed height */
    gap: 30px;
  }

  .cv-main-video {
    height: 240px; /* Reduced fixed height for a more compact mobile look */
    order: 2; /* Move video below the first image column */
  }

  .cv-col-center {
    height: 300px;
    order: 1; /* Video first on mobile */
  }

  .cv-col-left {
    order: 1;
  }

  .cv-col-right {
    display: none; /* Hide the third column on mobile for simplicity */
  }

  .cv-col-left .cv-gradient-border {
    height: 240px; /* Shortened to match video height exactly */
  }
}

@media (max-width: 767px) {
  .section-heading h2 {
    font-size: 1.8rem !important; /* Robust size for small phones */
  }

  .cv-col-left {
    flex-direction: column;
  }
}
