/* Services Section Styles - MazenWare
   Dedicated CSS file for better organization
   Branding: Blue #004AAD, Orange #FF914D, White #FFF, Light Grey #F0F0F0
   Font: Glacial Indifference
*/

/* Services Section Container */
.services {
  padding: 80px 0 60px 0;
  background: var(--white);
  position: relative;
  overflow: hidden;
  background-image: url('../logo/our services.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  z-index: 1;
}

/* Dark overlay for better text readability */
.services::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2;
  pointer-events: none;
}

.services__container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 3;
}

/* Ensure text elements are above the overlay */
.services__header,
.services__title,
.services__subtitle,
.services__grid {
  position: relative;
  z-index: 4;
}

.services__header {
  text-align: center;
  margin-bottom: 1.25rem;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s ease-out forwards;
}

.services__title {
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 1.5rem;
  line-height: 1.2;
  text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.8);
  position: relative;
}

.services__subtitle {
  font-size: 1.4rem;
  color: #fbf7f7;
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.6;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
  position: relative;
}

/* Services Grid Layout */
.services__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s ease-out 0.2s forwards;
  align-items: start;
}

/* Service Card Styles - Larger and More Spacious */
.service-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.3),
    0 0 20px rgba(0, 74, 173, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: visible;
  cursor: pointer;
  transform-style: preserve-3d;
  perspective: 1000px;
  opacity: 0;
  transform: translateY(30px);
  min-height: 400px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Futuristic glow effect on cards */
.service-card::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, 
    rgba(0, 74, 173, 0.5),
    rgba(255, 145, 77, 0.5),
    rgba(0, 74, 173, 0.5)
  );
  border-radius: 24px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
  filter: blur(8px);
}

.service-card:hover::before {
  opacity: 1;
  animation: cardGlow 2s ease-in-out infinite;
}

@keyframes cardGlow {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

.service-card:nth-child(1) { animation: fadeInUp 0.8s ease-out 0.3s forwards; }
.service-card:nth-child(2) { animation: fadeInUp 0.8s ease-out 0.4s forwards; }
.service-card:nth-child(3) { animation: fadeInUp 0.8s ease-out 0.5s forwards; }
.service-card:nth-child(4) { animation: fadeInUp 0.8s ease-out 0.6s forwards; }
.service-card:nth-child(5) { animation: fadeInUp 0.8s ease-out 0.7s forwards; }
.service-card:nth-child(6) { animation: fadeInUp 0.8s ease-out 0.8s forwards; }

.service-card:hover {
  transform: translateY(-12px) scale(1.03);
  box-shadow: 
    0 25px 80px rgba(0, 74, 173, 0.4),
    0 0 40px rgba(255, 145, 77, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  border: 2px solid rgba(255, 145, 77, 0.8);
  z-index: 10;
  background: rgba(255, 255, 255, 0.98);
}

/* Card Front and Back Sides */
.service-card__front,
.service-card__back {
  transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  backface-visibility: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.service-card__back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 100%;
  background: linear-gradient(135deg, 
    rgba(0, 74, 173, 0.95) 0%, 
    rgba(0, 86, 204, 0.95) 50%,
    rgba(255, 145, 77, 0.2) 100%
  );
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--white);
  padding: 2rem;
  border-radius: 24px;
  justify-content: flex-start;
  transform: rotateY(180deg);
  opacity: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 
    0 0 30px rgba(0, 74, 173, 0.6),
    inset 0 0 20px rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.service-card:hover .service-card__front {
  transform: rotateY(180deg);
  opacity: 0;
}

.service-card:hover .service-card__back {
  transform: rotateY(0deg);
  opacity: 1;
}

/* Service Card Icon */
.service-card__icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--blue) 0%, #0056cc 100%);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.service-card:hover .service-card__icon {
  background: linear-gradient(135deg, var(--orange) 0%, #ff7a1a 100%);
  transform: scale(1.1);
}

.service-card__icon svg {
  width: 28px;
  height: 28px;
  color: var(--white);
}

/* Service Card Title */
.service-card__title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 1.5rem;
  line-height: 1.3;
  transition: color 0.3s ease;
}

.service-card:hover .service-card__title {
  color: var(--orange);
}

.service-card__back .service-card__title {
  color: var(--white);
  font-size: 1.5rem;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

/* Service Card Descriptions */
.service-card__description {
  color: #666;
  line-height: 1.7;
  margin-bottom: 0;
  font-size: 1.1rem;
  flex-grow: 1;
}

.service-card__full-description {
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.6;
  margin-bottom: 1rem;
  font-size: 1rem;
  flex-grow: 1;
  word-wrap: break-word;
  overflow-wrap: break-word;
  overflow: visible;
  padding-right: 8px;
}

/* Learn More Button */
.service-card__btn {
  background: var(--orange);
  color: var(--white);
  border: none;
  padding: 0.875rem 1.75rem;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  align-self: flex-start;
  margin-top: 0.5rem;
  text-decoration: none;
  display: inline-block;
  flex-shrink: 0;
}

.service-card__btn:hover {
  background: #ff7a1a;
  transform: translateY(-3px);
  box-shadow: 0 12px 25px rgba(255, 145, 77, 0.4);
}

/* Animation Keyframes */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInFromBottom {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Design */
@media (max-width: 1200px) {
  .services__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    align-items: start;
  }
  
  .services__title {
    font-size: 3rem;
  }
  
  .service-card {
    min-height: 380px;
    padding: 2rem;
  }
}

@media (max-width: 768px) {
  .services {
    padding: 60px 0 40px 0;
    background-attachment: scroll; /* Better performance on mobile */
  }
  
  .services__container {
    padding: 0 1rem;
  }
  
  .services__grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: start;
  }
  
  .services__title {
    font-size: 2.5rem;
  }
  
  .services__subtitle {
    font-size: 1.2rem;
  }
  
  .service-card {
    padding: 2rem;
    min-height: 360px;
  }
  
  .service-card__icon {
    width: 70px;
    height: 70px;
  }
  
  .service-card__icon svg {
    width: 32px;
    height: 32px;
  }
  
  .service-card__title {
    font-size: 1.6rem;
  }
  
  .service-card__description {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .services {
    padding: 50px 0 30px 0;
  }
  
  .services__header {
    margin-bottom: 1.25rem;
  }
  
  .services__title {
    font-size: 2rem;
  }
  
  .service-card {
    padding: 1.5rem;
    min-height: 340px;
  }
  
  .service-card__back {
    padding: 1.5rem;
  }
  
  .service-card__icon {
    width: 60px;
    height: 60px;
  }
  
  .service-card__icon svg {
    width: 28px;
    height: 28px;
  }
}

/* Scroll Reveal Animation Classes */
.service-card.reveal {
  opacity: 1;
  transform: translateY(0);
}

.service-card.reveal:nth-child(1) { animation-delay: 0.1s; }
.service-card.reveal:nth-child(2) { animation-delay: 0.2s; }
.service-card.reveal:nth-child(3) { animation-delay: 0.3s; }
.service-card.reveal:nth-child(4) { animation-delay: 0.4s; }
.service-card.reveal:nth-child(5) { animation-delay: 0.5s; }
.service-card.reveal:nth-child(6) { animation-delay: 0.6s; }

/* Flipped card state for mobile */
.service-card.flipped .service-card__front {
  transform: rotateY(180deg);
  opacity: 0;
}

.service-card.flipped .service-card__back {
  transform: rotateY(0deg);
  opacity: 1;
}

/* Mobile touch improvements */
@media (max-width: 768px) {
  .service-card {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  
  .service-card:active {
    transform: scale(0.98);
  }
  
  .service-card__btn {
    -webkit-tap-highlight-color: transparent;
  }
  
  /* Disable hover effects on mobile */
  .service-card:hover {
    transform: none;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
    border: none;
  }
  
  .service-card:hover .service-card__front {
    transform: none;
    opacity: 1;
  }
  
  .service-card:hover .service-card__back {
    transform: rotateY(180deg);
    opacity: 0;
  }
  
  .service-card:hover .service-card__icon {
    background: linear-gradient(135deg, var(--blue) 0%, #0056cc 100%);
    transform: none;
  }
  
  .service-card:hover .service-card__title {
    color: var(--blue);
  }
}

/* Focus styles for accessibility */
.service-card:focus {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}

.service-card__btn:focus {
  outline: 2px solid var(--white);
  outline-offset: 2px;
}

/* Enhanced hover effect for better visibility */
.service-card:hover .service-card__back {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding-bottom: 2rem;
}

/* Ensure expanded cards don't overlap */
.service-card:hover {
  margin-bottom: 1.25rem;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .service-card,
  .service-card__front,
  .service-card__back,
  .service-card__icon,
  .service-card__btn {
    transition: none;
  }
  
  .service-card:hover {
    transform: none;
  }
  
  .service-card:hover .service-card__front,
  .service-card:hover .service-card__back {
    transform: none;
  }
  
  .service-card.flipped .service-card__front {
    transform: rotateY(180deg);
  }
  
  .service-card.flipped .service-card__back {
    transform: rotateY(0deg);
  }
}

/* Service Modal Styles */
.service-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: modalFadeIn 0.3s ease-out;
}

.service-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  animation: overlayFadeIn 0.3s ease-out;
}

.service-modal__content {
  position: relative;
  background: var(--white);
  border-radius: 24px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 1001;
}

.service-modal__header {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 2rem 2rem 1rem 2rem;
  border-bottom: 1px solid #e5e5e5;
  position: sticky;
  top: 0;
  background: var(--white);
  border-radius: 24px 24px 0 0;
  z-index: 10;
}

.service-modal__icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--blue) 0%, #0056cc 100%);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.service-modal__icon svg {
  width: 28px;
  height: 28px;
  color: var(--white);
}

.service-modal__title-section {
  flex: 1;
  min-width: 0;
}

.service-modal__title {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--blue);
  margin: 0 0 0.5rem 0;
  line-height: 1.2;
}

.service-modal__subtitle {
  font-size: 1.1rem;
  color: #666;
  margin: 0;
  line-height: 1.4;
}

.service-modal__close {
  background: none;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #666;
  flex-shrink: 0;
}

.service-modal__close:hover {
  background: #f5f5f5;
  color: var(--blue);
  transform: scale(1.1);
}

.service-modal__close svg {
  width: 20px;
  height: 20px;
}

.service-modal__body {
  padding: 2rem;
}

.service-modal__body h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--blue);
  margin: 0 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--orange);
  display: inline-block;
}

.service-modal__description {
  margin-bottom: 2rem;
}

.service-modal__description p {
  font-size: 1.1rem;
  line-height: 1.7;
  color: #333;
  margin: 0;
}

.service-modal__features {
  margin-bottom: 2rem;
}

.service-modal__features ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0.75rem;
}

.service-modal__features li {
  padding: 0.75rem 1rem;
  background: #f8f9fa;
  border-radius: 12px;
  border-left: 4px solid var(--orange);
  font-size: 1rem;
  line-height: 1.5;
  color: #333;
  position: relative;
  padding-left: 2.5rem;
}

.service-modal__features li::before {
  content: "✓";
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--orange);
  font-weight: bold;
  font-size: 1.1rem;
}

.service-modal__technologies {
  margin-bottom: 2rem;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.tech-tag {
  background: linear-gradient(135deg, var(--blue) 0%, #0056cc 100%);
  color: var(--white);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.tech-tag:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 74, 173, 0.3);
}

.service-modal__process {
  margin-bottom: 2rem;
}

.process-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.process-step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 16px;
  border: 1px solid #e5e5e5;
  transition: all 0.3s ease;
}

.process-step:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.process-step__number {
  width: 40px;
  height: 40px;
  background: var(--orange);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.process-step__content h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--blue);
  margin: 0 0 0.5rem 0;
  line-height: 1.3;
}

.process-step__content p {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #666;
  margin: 0;
}

.service-modal__benefits {
  margin-bottom: 2rem;
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.benefit-item {
  text-align: center;
  padding: 1.5rem;
  background: var(--white);
  border-radius: 16px;
  border: 2px solid #f0f0f0;
  transition: all 0.3s ease;
}

.benefit-item:hover {
  border-color: var(--orange);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(255, 145, 77, 0.2);
}

.benefit-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
}

.benefit-item h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--blue);
  margin: 0 0 0.75rem 0;
  line-height: 1.3;
}

.benefit-item p {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #666;
  margin: 0;
}

.service-modal__footer {
  padding: 2rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 0 0 24px 24px;
  border-top: 1px solid #e5e5e5;
}

.service-modal__cta {
  text-align: center;
}

.service-modal__cta h3 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--blue);
  margin: 0 0 0.75rem 0;
  border: none;
  padding: 0;
}

.service-modal__cta p {
  font-size: 1.1rem;
  color: #666;
  margin: 0 0 2rem 0;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  padding: 1rem 2rem;
  border-radius: 30px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  border: none;
  min-width: 160px;
}

.btn-primary {
  background: var(--orange);
  color: var(--white);
}

.btn-primary:hover {
  background: #ff7a1a;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 145, 77, 0.4);
}

.btn-secondary {
  background: var(--white);
  color: var(--blue);
  border: 2px solid var(--blue);
}

.btn-secondary:hover {
  background: var(--blue);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 74, 173, 0.3);
}

/* Modal Animations */
@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes overlayFadeIn {
  from {
    opacity: 0;
    backdrop-filter: blur(0px);
  }
  to {
    opacity: 1;
    backdrop-filter: blur(5px);
  }
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Responsive Modal Design */
@media (max-width: 768px) {
  .service-modal {
    padding: 0.5rem;
  }
  
  .service-modal__content {
    max-height: 95vh;
    border-radius: 16px;
  }
  
  .service-modal__header {
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    gap: 1rem;
  }
  
  .service-modal__icon {
    width: 50px;
    height: 50px;
  }
  
  .service-modal__icon svg {
    width: 24px;
    height: 24px;
  }
  
  .service-modal__title {
    font-size: 1.8rem;
  }
  
  .service-modal__subtitle {
    font-size: 1rem;
  }
  
  .service-modal__body {
    padding: 1.5rem;
  }
  
  .service-modal__body h3 {
    font-size: 1.3rem;
  }
  
  .service-modal__features ul {
    grid-template-columns: 1fr;
  }
  
  .process-steps {
    grid-template-columns: 1fr;
  }
  
  .benefits-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
  
  .service-modal__footer {
    padding: 1.5rem;
  }
  
  .service-modal__cta h3 {
    font-size: 1.5rem;
  }
  
  .modal-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .btn {
    width: 100%;
    max-width: 300px;
  }
}

@media (max-width: 480px) {
  .service-modal__header {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
  
  .service-modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
  }
  
  .service-modal__title {
    font-size: 1.6rem;
  }
  
  .service-modal__body h3 {
    font-size: 1.2rem;
  }
  
  .benefits-grid {
    grid-template-columns: 1fr;
  }
}

/* Focus management for accessibility */
.service-modal:focus-within .service-modal__content {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}

.btn:focus {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* Reduced motion support for modal */
@media (prefers-reduced-motion: reduce) {
  .service-modal,
  .service-modal__overlay,
  .service-modal__content,
  .process-step,
  .benefit-item,
  .btn {
    animation: none;
    transition: none;
  }
  
  .service-modal__content {
    animation: none;
  }
} 
