/**
 * Client Spotlight Widget CSS
 * Widget-specific styles only - common styles are in bugloos-design-system.css
 * 
 * Dependencies: 
 *   - bugloos-design-system.css must be loaded first
 *   - bugloos-parallax.js for parallax effects
 */

/* ===== CLIENT SPOTLIGHT SECTION ===== */
.client-spotlight {
  position: relative;
  padding: var(--spacing-20) 0;
  background: linear-gradient(to bottom right, var(--bugloos-gray-50), var(--bugloos-white));
  overflow: hidden;
}

@media (min-width: 1024px) {
  .client-spotlight {
    padding: var(--spacing-32) 0;
  }
}

/* Background pattern */
.client-spotlight__bg-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  z-index: 0;
  pointer-events: none;
}

.client-spotlight__bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
}

.client-spotlight__bg-blob--1 {
  top: 5rem;
  left: 2.5rem;
  width: 8rem;
  height: 8rem;
  background-color: var(--bugloos-primary);
}

.client-spotlight__bg-blob--2 {
  bottom: 5rem;
  right: 2.5rem;
  width: 10rem;
  height: 10rem;
  background-color: var(--bugloos-secondary);
}

.client-spotlight__bg-blob--3 {
  top: 50%;
  left: 33.333%;
  width: 6rem;
  height: 6rem;
  background-color: var(--bugloos-dark);
}

/* Container */
.client-spotlight__container {
  position: relative;
  max-width: var(--container-7xl);
  margin: 0 auto;
  padding: 0 var(--spacing-4);
  z-index: 1;
}

@media (min-width: 640px) {
  .client-spotlight__container {
    padding: 0 var(--spacing-6);
  }
}

@media (min-width: 1024px) {
  .client-spotlight__container {
    padding: 0 var(--spacing-8);
  }
}

/* Grid Layout */
.client-spotlight__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-16);
  align-items: center;
}

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

/* Image Column */
.client-spotlight__image-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-2xl);
}

.client-spotlight__image-container {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.client-spotlight__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.client-spotlight__image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(99, 195, 209, 0.2),
    rgba(124, 110, 176, 0.2)
  );
  pointer-events: none;
}

/* Content Column */
.client-spotlight__content {
  display: flex;
  flex-direction: column;
}

/* Badge */
.client-spotlight__badge {
  display: inline-block;
  align-self: flex-start;
  padding: var(--spacing-2) var(--spacing-4);
  background-color: rgba(99, 195, 209, 0.1);
  color: var(--bugloos-primary);
  border-radius: var(--radius-full);
  font-family: var(--font-family-primary);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  margin-bottom: var(--spacing-4);
}

/* Title */
.client-spotlight__title {
  font-family: var(--font-family-primary);
  font-size: var(--text-3xl);
  font-weight: var(--font-weight-bold);
  color: var(--bugloos-dark);
  line-height: var(--leading-tight);
  margin: 0 0 var(--spacing-6) 0;
}

@media (min-width: 1024px) {
  .client-spotlight__title {
    font-size: var(--text-5xl);
  }
}

.client-spotlight__title-accent {
  color: var(--bugloos-primary);
}

/* Description */
.client-spotlight__description {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-6);
}

.client-spotlight__paragraph {
  font-family: var(--font-family-primary);
  font-size: var(--text-lg);
  color: var(--bugloos-gray-600);
  line-height: var(--leading-relaxed);
  margin: 0;
}

/* Mobile: Image first */
.client-spotlight__image-wrapper {
  order: -1;
}

@media (min-width: 1024px) {
  .client-spotlight__image-wrapper {
    order: 0;
  }
  
  .client-spotlight__content {
    order: 0;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .client-spotlight__badge {
    border: 2px solid var(--bugloos-primary);
  }
  
  .client-spotlight__image-overlay {
    opacity: 0.5;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .client-spotlight__image-wrapper {
    transition: none;
  }
}

/* ===== SHOW MORE FUNCTIONALITY ===== */

/* Content wrapper for truncation */
.client-spotlight__content-wrapper {
  position: relative;
}

.client-spotlight__content-wrapper--truncated .client-spotlight__description {
  position: relative;
}

.client-spotlight__content-wrapper--truncated .client-spotlight__description::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to bottom, transparent, var(--bugloos-white));
  pointer-events: none;
  z-index: 1;
}

/* Remove fade when expanded */
.client-spotlight__content-wrapper--expanded .client-spotlight__description::after {
  display: none;
}

/* Overflow content section (appears below grid when expanded) */
.client-spotlight__overflow {
  width: 100%;
  margin: 0;
  padding: 0;
}

.client-spotlight__overflow-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-6);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.3s ease;
}

.client-spotlight__overflow--visible .client-spotlight__overflow-content {
  max-height: 5000px;
  opacity: 1;
  padding: var(--spacing-8) 0 0;
}

/* Show More/Less Button Container */
.client-spotlight__toggle-container {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: var(--spacing-6);
  padding: 0 var(--spacing-4);
}

@media (min-width: 640px) {
  .client-spotlight__toggle-container {
    padding: 0 var(--spacing-6);
  }
}

@media (min-width: 1024px) {
  .client-spotlight__toggle-container {
    padding: 0 var(--spacing-8);
  }
  
  .client-spotlight__image-wrapper {
    margin-bottom: 0;
  }
}

/* When overflow is visible, button goes inside overflow section */
.client-spotlight__overflow--visible .client-spotlight__toggle-container {
  margin-top: var(--spacing-8);
  padding: var(--spacing-6) var(--spacing-4) 0;
}

/* Show More/Less Button */
.client-spotlight__toggle-btn {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
  padding: var(--spacing-1) var(--spacing-4);
  background-color: transparent;
  border: 2px solid var(--bugloos-primary);
  border-radius: var(--radius-md);
  color: var(--bugloos-primary);
  font-family: var(--font-family-primary);
  font-size: var(--text-base);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.client-spotlight__toggle-btn:hover {
  background-color: var(--bugloos-primary);
  color: var(--bugloos-white);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 195, 209, 0.3);
}

.client-spotlight__toggle-btn:active {
  transform: translateY(0);
}

.client-spotlight__toggle-text {
  display: block;
}

.client-spotlight__toggle-icon {
  width: 20px;
  height: 20px;
  transition: transform var(--transition-normal);
}

/* Rotate icon when expanded */
.client-spotlight__overflow--visible .client-spotlight__toggle-icon {
  transform: rotate(180deg);
}

/* Print styles */
@media print {
  .client-spotlight {
    background: var(--bugloos-white);
    padding: var(--spacing-8) 0;
  }
  
  .client-spotlight__bg-pattern {
    display: none;
  }
  
  .client-spotlight__image-container {
    height: 20rem;
  }
  
  .client-spotlight__toggle-container {
    display: none;
  }
  
  .client-spotlight__overflow-content {
    max-height: none;
    opacity: 1;
  }
}

/* Reduced motion for Show More */
@media (prefers-reduced-motion: reduce) {
  .client-spotlight__toggle-btn,
  .client-spotlight__toggle-icon,
  .client-spotlight__overflow-content {
    transition: none;
  }
  
  .client-spotlight__toggle-btn:hover {
    transform: none;
  }
  
  .client-spotlight__overflow--visible .client-spotlight__overflow-content {
    max-height: none;
  }
}
