/**
 * AR Edilizia - Service List Page V3
 * Ultra-modern list page with enhanced filters and animations
 * Version: 3.0 - Complete Enhancement
 */

/* ============================================
   LIST PAGE HERO - Enhanced
   ============================================ */

.services-list-hero {
  position: relative;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  padding: 100px 0 80px;
  overflow: hidden;
}

/* Animated geometric background */
.services-list-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background-image:
    radial-gradient(circle at 30% 40%, rgba(14, 165, 233, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 70% 60%, rgba(99, 102, 241, 0.1) 0%, transparent 40%);
  animation: rotate-gradient 30s linear infinite;
}

@keyframes rotate-gradient {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Grid pattern */
.services-list-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 50px 50px;
  opacity: 0.5;
}

.services-list-hero__container {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.services-list-hero__content {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  animation: fade-in-up 0.8s ease forwards;
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.services-list-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 24px;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.3);
  backdrop-filter: blur(12px);
  color: #60a5fa;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
  animation: float-badge 4s ease-in-out infinite;
}

@keyframes float-badge {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.services-list-hero__badge svg {
  width: 16px;
  height: 16px;
}

.services-list-hero__title {
  font-size: 56px;
  font-weight: 900;
  color: white;
  margin: 0 0 20px 0;
  line-height: 1.1;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 0%, #60a5fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 8s ease infinite;
}

@keyframes gradient-shift {
  0%, 100% {
    filter: hue-rotate(0deg);
  }
  50% {
    filter: hue-rotate(20deg);
  }
}

.services-list-hero__subtitle {
  font-size: 20px;
  line-height: 1.6;
  color: #cbd5e1;
  margin: 0;
}

/* ============================================
   ENHANCED FILTER BAR - V3
   ============================================ */

.services-filter-bar {
  position: sticky;
  top: 80px;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  animation: slide-down 0.6s ease 0.3s backwards;
}

@keyframes slide-down {
  from {
    opacity: 0;
    transform: translateY(-100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

[data-theme="dark"] .services-filter-bar {
  background: rgba(15, 23, 42, 0.95);
  border-color: #334155;
}

.services-filter-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 24px;
}

.services-filter-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.services-filter-label {
  font-size: 14px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  min-width: fit-content;
}

[data-theme="dark"] .services-filter-label {
  color: #94a3b8;
}

.services-filter-pills {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  flex: 1;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #f8fafc;
  border: 2px solid transparent;
  border-radius: 28px;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .filter-pill {
  background: #1e293b;
  color: #cbd5e1;
}

.filter-pill::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #0ea5e9, #3b82f6);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.filter-pill svg,
.filter-pill span {
  position: relative;
  z-index: 1;
  transition: all 0.3s ease;
}

.filter-pill svg {
  width: 18px;
  height: 18px;
}

.filter-pill:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.filter-pill:hover::before {
  opacity: 0.1;
}

.filter-pill.active {
  background: linear-gradient(135deg, #0ea5e9, #3b82f6);
  color: white;
  border-color: transparent;
  box-shadow:
    0 8px 20px rgba(59, 130, 246, 0.4),
    0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-pill.active::before {
  opacity: 0;
}

.filter-pill-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  background: rgba(59, 130, 246, 0.2);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}

.filter-pill.active .filter-pill-count {
  background: rgba(255, 255, 255, 0.3);
}

/* Search Input */
.services-search-input {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 28px;
  min-width: 300px;
  transition: all 0.3s ease;
}

[data-theme="dark"] .services-search-input {
  background: #1e293b;
  border-color: #334155;
}

.services-search-input:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.services-search-input svg {
  width: 20px;
  height: 20px;
  color: #94a3b8;
}

.services-search-input input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  color: #0f172a;
  outline: none;
}

[data-theme="dark"] .services-search-input input {
  color: #f8fafc;
}

.services-search-input input::placeholder {
  color: #94a3b8;
}

/* ============================================
   CATEGORY SECTIONS - Enhanced
   ============================================ */

.services-list-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 60px 24px;
}

.services-category-section {
  margin-bottom: 80px;
  opacity: 0;
  animation: fade-in-section 0.8s ease forwards;
}

@keyframes fade-in-section {
  to {
    opacity: 1;
  }
}

.services-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 2px solid transparent;
  background: linear-gradient(90deg, #e2e8f0 0%, transparent 100%) bottom / 100% 2px no-repeat;
  position: relative;
}

[data-theme="dark"] .services-category-header {
  background: linear-gradient(90deg, #334155 0%, transparent 100%) bottom / 100% 2px no-repeat;
}

/* Animated underline */
.services-category-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, #0ea5e9, #3b82f6, #6366f1);
  animation: expand-line 1.5s ease-out forwards;
}

@keyframes expand-line {
  to {
    width: 250px;
  }
}

.services-category-title-group {
  display: flex;
  align-items: center;
  gap: 20px;
}

.services-category-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #0ea5e9, #3b82f6);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 36px;
  box-shadow:
    0 8px 20px rgba(59, 130, 246, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: icon-float 4s ease-in-out infinite;
}

@keyframes icon-float {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(5deg);
  }
}

.services-category-icon:hover {
  transform: scale(1.1) rotate(15deg);
  box-shadow:
    0 12px 30px rgba(59, 130, 246, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.services-category-title {
  font-size: 36px;
  font-weight: 900;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, #0f172a 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="dark"] .services-category-title {
  background: linear-gradient(135deg, #f8fafc 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.services-category-count {
  font-size: 14px;
  color: #64748b;
  font-weight: 600;
}

[data-theme="dark"] .services-category-count {
  color: #94a3b8;
}

.services-view-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #0ea5e9, #3b82f6);
  color: white;
  text-decoration: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.services-view-all:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.services-view-all svg {
  width: 16px;
  height: 16px;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.services-view-all:hover svg {
  transform: translateX(4px);
}

/* ============================================
   PAGINATION - Enhanced
   ============================================ */

.services-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 80px;
  padding: 40px 0;
}

.pagination-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 48px;
  padding: 0 16px;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="dark"] .pagination-button {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

.pagination-button:hover:not(.active):not(:disabled) {
  transform: translateY(-2px) scale(1.05);
  border-color: #3b82f6;
  color: #3b82f6;
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.2);
}

.pagination-button.active {
  background: linear-gradient(135deg, #0ea5e9, #3b82f6);
  border-color: transparent;
  color: white;
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.pagination-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-button svg {
  width: 20px;
  height: 20px;
}

.pagination-ellipsis {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 48px;
  color: #94a3b8;
  font-weight: 700;
}

/* ============================================
   EMPTY STATE
   ============================================ */

.services-empty-state {
  text-align: center;
  padding: 100px 24px;
}

.services-empty-icon {
  width: 120px;
  height: 120px;
  margin: 0 auto 32px;
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: scale-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes scale-in {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

[data-theme="dark"] .services-empty-icon {
  background: linear-gradient(135deg, #1e293b, #334155);
}

.services-empty-icon svg {
  width: 60px;
  height: 60px;
  color: #94a3b8;
}

.services-empty-title {
  font-size: 28px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 12px 0;
}

[data-theme="dark"] .services-empty-title {
  color: #f8fafc;
}

.services-empty-description {
  font-size: 16px;
  color: #64748b;
  margin: 0 0 32px 0;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

[data-theme="dark"] .services-empty-description {
  color: #94a3b8;
}

.services-empty-action {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  background: linear-gradient(135deg, #0ea5e9, #3b82f6);
  color: white;
  text-decoration: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.services-empty-action:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 12px 30px rgba(59, 130, 246, 0.4);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1024px) {
  .services-list-hero__title {
    font-size: 48px;
  }

  .services-category-icon {
    width: 64px;
    height: 64px;
    font-size: 32px;
  }

  .services-category-title {
    font-size: 32px;
  }
}

@media (max-width: 768px) {
  .services-list-hero {
    padding: 80px 0 60px;
  }

  .services-list-hero__title {
    font-size: 36px;
  }

  .services-list-hero__subtitle {
    font-size: 16px;
  }

  .services-filter-bar {
    position: relative;
    top: 0;
  }

  .services-filter-wrapper {
    flex-direction: column;
    align-items: stretch;
  }

  .services-filter-pills {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 8px;
  }

  .services-search-input {
    min-width: 100%;
  }

  .services-category-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .services-category-title-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .services-category-icon {
    width: 56px;
    height: 56px;
    font-size: 28px;
  }

  .services-category-title {
    font-size: 28px;
  }

  .services-pagination {
    gap: 8px;
  }

  .pagination-button {
    min-width: 44px;
    height: 44px;
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* GPU acceleration */
.filter-pill,
.pagination-button,
.services-category-icon {
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}
