/* ============================================
   SERVICES PAGE STYLES
   ============================================ */

/* ===================
   PAGE HERO
   =================== */
.page-hero {
  position: relative;
  padding: calc(var(--header-height) + var(--space-3xl)) 0 var(--space-3xl);
  background: var(--gradient-radial);
  text-align: center;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(var(--color-primary-rgb), 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.page-hero__content {
  position: relative;
  z-index: 1;
}

.page-hero__title {
  margin-bottom: var(--space-md);
}

.page-hero__subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* ===================
   SERVICES FILTER
   =================== */
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-3xl);
  padding: var(--space-lg);
  background: rgba(var(--color-bg-rgb), 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-2xl);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.filter-tab {
  position: relative;
  padding: var(--space-md) var(--space-xl);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.02em;
  color: var(--color-text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  z-index: 1;
}

/* Subtle background on non-active */
.filter-tab::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.03) 0%,
    rgba(255, 255, 255, 0.01) 100%
  );
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.filter-tab:hover::before {
  opacity: 1;
}

.filter-tab:hover {
  color: var(--color-text-primary);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

/* Active state - Premium gradient */
.filter-tab--active {
  color: white;
  background: linear-gradient(
    135deg,
    var(--color-primary) 0%,
    color-mix(in srgb, var(--color-primary) 80%, #000) 100%
  );
  border-color: transparent;
  box-shadow:
    0 4px 20px rgba(var(--color-primary-rgb), 0.4),
    0 0 40px rgba(var(--color-primary-rgb), 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.filter-tab--active:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 8px 30px rgba(var(--color-primary-rgb), 0.5),
    0 0 60px rgba(var(--color-primary-rgb), 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* Shine effect on active */
.filter-tab--active::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.6s ease;
}

.filter-tab--active:hover::after {
  left: 100%;
}

/* Focus state for accessibility */
.filter-tab:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .filter-tabs {
    gap: var(--space-sm);
    padding: var(--space-md);
  }

  .filter-tab {
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--text-xs);
  }
}

/* ===================
   SERVICES GRID
   =================== */
.services-page__grid {
  display: grid;
  gap: var(--space-xl);
}

@media (min-width: 640px) {
  .services-page__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

/* Service Detail Card */
.service-detail-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition-normal);
}

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

.service-detail-card__image {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.service-detail-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.service-detail-card:hover .service-detail-card__image img {
  transform: scale(1.1);
}

.service-detail-card__badge {
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
}

.service-detail-card__content {
  padding: var(--space-lg);
}

.service-detail-card__title {
  font-size: var(--text-xl);
  margin-bottom: var(--space-sm);
}

.service-detail-card__description {
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-lg);
}

.service-detail-card__features {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
}

.service-detail-card__feature {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.service-detail-card__feature svg {
  width: 16px;
  height: 16px;
  color: var(--color-success);
  flex-shrink: 0;
}

/* ===================
   PROCESS SECTION
   =================== */
.process-section {
  background: var(--color-bg-secondary);
}

.process-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  position: relative;
  padding-left: var(--space-2xl);
}

@media (min-width: 768px) {
  .process-timeline {
    flex-direction: row;
    justify-content: space-between;
    padding-left: 0;
    gap: 0;
  }
}

.process-timeline::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-border);
}

@media (min-width: 768px) {
  .process-timeline::before {
    left: 0;
    right: 0;
    top: 20px;
    bottom: auto;
    width: auto;
    height: 2px;
  }
}

.process-step {
  position: relative;
  flex: 1;
  text-align: left;
}

@media (min-width: 768px) {
  .process-step {
    text-align: center;
  }
}

.process-step__number {
  position: absolute;
  left: calc(-1 * var(--space-2xl));
  top: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: white;
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  border-radius: var(--radius-full);
  z-index: 1;
}

@media (min-width: 768px) {
  .process-step__number {
    position: relative;
    left: auto;
    width: 40px;
    height: 40px;
    margin: 0 auto var(--space-md);
    font-size: var(--text-sm);
  }
}

.process-step__title {
  font-size: var(--text-lg);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-xs);
}

.process-step__description {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  max-width: 200px;
}

@media (min-width: 768px) {
  .process-step__description {
    margin: 0 auto;
  }
}

/* ===================
   SERVICES GRID (New)
   =================== */
.services-grid {
  display: grid;
  gap: var(--space-xl);
}

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

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

/* ===================
   SERVICE CARD
   =================== */
.service-card {
  display: flex;
  flex-direction: column;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  transition: all var(--transition-normal);
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: var(--color-primary);
}

.service-card__image {
  position: relative;
  height: 200px;
  background: linear-gradient(135deg, rgba(var(--color-primary-rgb), 0.1), rgba(var(--color-primary-rgb), 0.05));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  perspective: 1000px;
  transform-style: preserve-3d;
}

/* 3D Model Viewer in Image Area */
.service-card__image--3d {
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.service-card__image--3d model-viewer {
  width: 180px !important;
  height: 180px !important;
  min-width: 180px;
  min-height: 180px;
  --poster-color: transparent;
  --min-hotspot-opacity: 0;
  touch-action: pan-y;
}

.service-card__image--3d model-viewer::part(default-progress-bar) {
  display: none;
}

.service-card:hover .service-card__image--3d model-viewer {
  --auto-rotate-delay: 0;
}

/* 3D SVG Container */
.service-card__image img {
  max-width: 140px;
  max-height: 140px;
  object-fit: contain;
  transform-style: preserve-3d;
  filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.15))
          drop-shadow(0 5px 10px rgba(0, 0, 0, 0.1));
  animation: rotate3d 8s linear infinite;
  transition: filter 0.4s ease, animation-duration 0.4s ease;
}

/* 3D Rotation Animation */
@keyframes rotate3d {
  0% {
    transform: perspective(800px) rotateY(0deg) rotateX(5deg);
  }
  100% {
    transform: perspective(800px) rotateY(360deg) rotateX(5deg);
  }
}

/* 3D Hover Effect - Faster rotation */
.service-card:hover .service-card__image img {
  animation-duration: 2s;
  filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.25))
          drop-shadow(0 15px 20px rgba(0, 0, 0, 0.15))
          drop-shadow(0 5px 8px rgba(var(--color-primary-rgb), 0.3));
}

/* Reflection/Glow Effect */
.service-card__image::after {
  content: '';
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) rotateX(90deg) translateZ(-30px);
  width: 80px;
  height: 80px;
  background: radial-gradient(ellipse, rgba(var(--color-primary-rgb), 0.3) 0%, transparent 70%);
  filter: blur(15px);
  opacity: 0.6;
  transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
  pointer-events: none;
}

.service-card:hover .service-card__image::after {
  width: 100px;
  height: 100px;
  opacity: 0.8;
  filter: blur(20px);
}

/* Staggered Animation Delays - Different start points */
.service-card:nth-child(1) .service-card__image img { animation-delay: 0s; }
.service-card:nth-child(2) .service-card__image img { animation-delay: -1.5s; }
.service-card:nth-child(3) .service-card__image img { animation-delay: -3s; }
.service-card:nth-child(4) .service-card__image img { animation-delay: -4.5s; }
.service-card:nth-child(5) .service-card__image img { animation-delay: -6s; }

/* Alternate rotation direction for variety */
.service-card:nth-child(even) .service-card__image img {
  animation-name: rotate3d-reverse;
}

@keyframes rotate3d-reverse {
  0% {
    transform: perspective(800px) rotateY(360deg) rotateX(-5deg);
  }
  100% {
    transform: perspective(800px) rotateY(0deg) rotateX(-5deg);
  }
}

/* Shimmer effect on hover */
.service-card__image::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.6s ease;
  pointer-events: none;
  z-index: 1;
}

.service-card:hover .service-card__image::before {
  left: 100%;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .service-card__image img {
    animation: none;
    transform: none;
  }

  .service-card:hover .service-card__image img {
    animation: none;
    transform: scale(1.05);
  }

  .service-card__image::before,
  .service-card__image::after {
    display: none;
  }
}

.service-card__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: var(--space-xl);
}

.service-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: var(--space-md);
  background: rgba(var(--color-primary-rgb), 0.1);
  border-radius: var(--radius-xl);
  color: var(--color-primary);
}

.service-card__icon svg {
  width: 28px;
  height: 28px;
}

.service-card__title {
  font-size: var(--text-xl);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-xs);
}

.service-card__subtitle {
  font-size: var(--text-sm);
  color: var(--color-primary);
  font-weight: var(--font-weight-medium);
  margin-bottom: var(--space-md);
}

.service-card__description {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-lg);
}

.service-card__features {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
  padding: 0;
  list-style: none;
}

.service-card__features li {
  position: relative;
  padding-left: var(--space-lg);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.service-card__features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 6px;
  height: 6px;
  background: var(--color-primary);
  border-radius: var(--radius-full);
}

/* ===================
   BREADCRUMB
   =================== */
.breadcrumb {
  margin-bottom: var(--space-lg);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  padding: 0;
  margin: 0;
  list-style: none;
}

.breadcrumb li {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.breadcrumb li:not(:last-child)::after {
  content: '/';
  color: var(--color-text-muted);
}

.breadcrumb a {
  color: var(--color-text-secondary);
  transition: color var(--transition-fast);
}

.breadcrumb a:hover {
  color: var(--color-primary);
}

.breadcrumb span {
  color: var(--color-text-primary);
}

/* ===================
   WHY CHOOSE US
   =================== */
.why-choose-grid {
  display: grid;
  gap: var(--space-lg);
}

@media (min-width: 640px) {
  .why-choose-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

/* ===================
   SERVICE CARD FILTER
   =================== */
.service-card {
  transition: all var(--transition-normal), opacity 0.3s ease, transform 0.3s ease;
}

.service-card--hidden {
  opacity: 0;
  transform: scale(0.8) translateY(20px);
  pointer-events: none;
}
