/* Fixed Services Section Styling */

/* Services Section General */
.services {
  position: relative;
  overflow: hidden;
  background-color: var(--bg-dark);
  padding: 100px 0 120px;
  margin: 0; /* Reset margin to prevent layout issues */
}

/* Services Section Background and Overlay */
.services-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(18, 18, 18, 0.9),
    rgba(10, 10, 10, 0.95)
  );
  z-index: 0;
}

/* Services Section Decorative Elements */
.services::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 300px;
  height: 300px;
  background: radial-gradient(
    circle,
    rgba(52, 152, 219, 0.1) 0%,
    rgba(52, 152, 219, 0) 70%
  );
  border-radius: 50%;
  z-index: 1;
}

.services::after {
  content: '';
  position: absolute;
  bottom: 50px;
  left: 50px;
  width: 200px;
  height: 200px;
  background: radial-gradient(
    circle,
    rgba(231, 76, 60, 0.05) 0%,
    rgba(231, 76, 60, 0) 70%
  );
  border-radius: 50%;
  z-index: 1;
}

/* Services Introduction */
.services-intro {
  max-width: 800px;
  margin: 0 auto 60px;
  text-align: center;
  position: relative;
  z-index: 2;
}

.services-intro p {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-color);
  opacity: 0.9;
}

.section-tagline {
  font-size: 1.1rem;
  color: var(--accent-color);
  margin-top: 5px;
  opacity: 0.9;
}

/* Services Container - Fixed Layout */
.services-container {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  padding: 0;
}

/* Combined Service Card */
.combined-service-card {
  background-color: rgba(37, 37, 37, 0.8);
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
  transition: all 0.4s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
  z-index: 2;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.combined-service-card:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  border-color: rgba(var(--primary-color-rgb), 0.5);
  transform: translateY(-5px);
}

.service-card-header {
  text-align: center;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.service-card-header h3 {
  color: var(--primary-color);
  font-size: 2rem;
  margin-bottom: 10px;
  font-weight: 600;
}

.service-card-subtitle {
  color: var(--accent-color);
  font-size: 1.1rem;
  opacity: 0.9;
}

/* Service Items Container */
.service-items-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* Service Item */
.service-item {
  display: flex;
  align-items: flex-start;
  padding: 20px;
  background-color: rgba(25, 25, 35, 0.5);
  border-radius: 10px;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateX(-20px);
}

.service-item.animated {
  opacity: 1;
  transform: translateX(0);
}

.service-item:hover {
  background-color: rgba(30, 30, 40, 0.8);
  border-left-color: var(--primary-color);
  transform: translateX(5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Active and dimmed states */
.service-item.active {
  background-color: rgba(30, 30, 40, 0.9);
  border-left-color: var(--primary-color);
  transform: translateX(5px);
}

.service-item.dimmed {
  opacity: 0.6;
}

/* Service item hover effect */
.service-item::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(var(--primary-color-rgb), 0.05),
    transparent
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.service-item:hover::after {
  opacity: 1;
}

/* Service Icon */
.service-icon {
  min-width: 60px;
  height: 60px;
  background: radial-gradient(
    circle,
    rgba(var(--primary-color-rgb), 0.2),
    rgba(var(--primary-color-rgb), 0.05)
  );
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--primary-color);
  transition: all 0.3s ease;
  margin-right: 20px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.service-item:hover .service-icon {
  background: var(--primary-color);
  color: #fff;
  transform: scale(1.1);
}

/* Service Item Content */
.service-item-content {
  flex: 1;
}

.service-item-content h4 {
  color: var(--light-text);
  font-size: 1.3rem;
  margin-bottom: 10px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.service-item:hover .service-item-content h4 {
  color: var(--accent-color);
}

.service-item-content p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(52, 152, 219, 0.1) 0%,
    rgba(26, 188, 156, 0.05) 100%
  );
  opacity: 0;
  z-index: 0;
  transition: opacity 0.4s ease;
}

.service-card:hover {
  transform: translateY(-10px);
  border-color: rgba(var(--primary-color-rgb), 0.5);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.service-card:hover::before {
  opacity: 1;
}

/* Service Icon */
.service-icon {
  position: relative;
  font-size: 36px;
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: radial-gradient(
    circle,
    rgba(var(--primary-color-rgb), 0.2),
    rgba(var(--primary-color-rgb), 0.05)
  );
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  transition: all 0.4s ease;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 1;
}

.service-card:hover .service-icon {
  transform: scale(1.1);
  color: #fff;
  background: var(--primary-color);
  box-shadow: 0 10px 25px rgba(var(--primary-color-rgb), 0.4);
}

/* Service Content */
.service-card h3 {
  color: var(--light-text);
  font-size: 1.4rem;
  margin-bottom: 15px;
  letter-spacing: 0.5px;
  font-weight: 600;
  position: relative;
  z-index: 1;
  transition: all 0.3s ease;
}

.service-card:hover h3 {
  color: var(--accent-color);
}

.service-card p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.8);
  position: relative;
  z-index: 1;
  margin-bottom: 0;
}

/* Animation for service cards */
.section-animated-item {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.section-animated-item.animated {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animations for cards */
.services-grid .service-card:nth-child(1) {
  transition-delay: 0.1s;
}

.services-grid .service-card:nth-child(2) {
  transition-delay: 0.2s;
}

.services-grid .service-card:nth-child(3) {
  transition-delay: 0.3s;
}

.services-grid .service-card:nth-child(4) {
  transition-delay: 0.4s;
}

.services-grid .service-card:nth-child(5) {
  transition-delay: 0.5s;
}

/* Add an elegant hover effect with shadow and glare */
.service-card:before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to bottom right,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.05) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(30deg);
  transition: transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
  opacity: 0;
  z-index: 0;
}

.service-card:hover:before {
  transform: rotate(0deg) translateY(-10%);
  opacity: 1;
}

/* Improve spacing between services section and adjacent sections */
.services:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50px;
  background: linear-gradient(to bottom, rgba(18, 18, 18, 0), var(--bg-dark));
  z-index: 2;
}

/* Responsive design */
@media screen and (max-width: 1200px) {
  .services-container {
    padding: 0 20px;
  }

  .combined-service-card {
    padding: 30px;
  }
}

@media screen and (max-width: 992px) {
  .services {
    padding: 80px 0 100px;
  }

  .services-intro p {
    padding: 0 20px;
  }

  .combined-service-card {
    padding: 30px 25px;
  }

  .service-card-header h3 {
    font-size: 1.8rem;
  }

  .service-items-container {
    gap: 20px;
  }
}

@media screen and (max-width: 768px) {
  .combined-service-card {
    padding: 25px 20px;
  }

  .service-icon {
    min-width: 50px;
    height: 50px;
    font-size: 20px;
    margin-right: 15px;
  }

  .service-item-content h4 {
    font-size: 1.2rem;
  }

  .service-item-content p {
    font-size: 0.9rem;
  }

  .section-header h2 {
    font-size: 2rem;
  }

  .service-card-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
  }

  .service-card-subtitle {
    font-size: 1rem;
  }

  .service-item {
    padding: 15px;
  }
}

@media screen and (max-width: 576px) {
  .services {
    padding: 70px 0 90px;
  }

  .combined-service-card {
    border-radius: 10px;
    padding: 25px 20px;
  }

  .service-card-header h3 {
    font-size: 1.5rem;
  }

  .service-item {
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-left: none;
    border-top: 3px solid transparent;
  }

  .service-item:hover {
    border-top-color: var(--primary-color);
    border-left-color: transparent;
    transform: translateY(-5px);
    transform: translateX(0);
  }

  .service-icon {
    margin-right: 0;
    margin-bottom: 15px;
  }

  .service-items-container {
    gap: 15px;
  }
}

/* Target very small screens */
@media screen and (max-width: 380px) {
  .services-container {
    max-width: 280px;
    margin: 0 auto;
  }

  .combined-service-card {
    padding: 20px 15px;
  }

  .service-icon {
    min-width: 45px;
    height: 45px;
    font-size: 18px;
  }

  .service-card-header {
    margin-bottom: 20px;
  }

  .service-item {
    padding: 12px;
  }
}
