/* CSS Reset for consistent rendering */
* {
  box-sizing: border-box;
}

/* Main container styles */
html, body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  position: relative;
  margin: 0;
  padding: 0;
}

.wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  margin: 0;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.home-container {
  max-width: 1200px;
  width: 100%;
  margin: 0;
  padding: 2rem 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  box-sizing: border-box;
  position: relative;
  left: 0;
  right: 0;
}

.logo-container {
  text-align: center;
  margin-bottom: 2rem;
}

.logo {
  max-width: 240px;
  height: auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.wrapper .logo {
  filter: brightness(0) invert(1); /* تحويل الشعار للون الأبيض عندما تكون الخلفية ملونة */
}

.service-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  padding: 3rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  text-align: center;
  max-width: 600px;
  width: calc(100% - 2rem); /* Ensure there's always margin on mobile */
  margin-left: auto;
  margin-right: auto;
  position: relative;
  left: 0;
  right: 0;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-sizing: border-box;
}

.service-card .logo {
  max-width: 180px;
  margin-bottom: 2rem;

  filter: brightness(01) invert(0); /* تحويل الشعار للون الأبيض عندما تكون الخلفية ملونة */

}

.service-title {
  color: var(--primary-color);
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
}

.service-description {
  color: var(--text-dark);
  font-size: 1.2rem;
  margin-bottom: 2.5rem;
  line-height: 1.6;
}

.language-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 300px;
  margin: 0 auto;
}

.home-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--gradient);
  color: var(--text-light);
  text-decoration: none;
  border-radius: 12px;
  font-weight: 500;
  transition: all 0.3s ease;
  border: none;
}

.home-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(109, 57, 145, 0.2);
}

.home-button.button-outline {
  background: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.home-button.button-outline:hover {
  background: var(--gradient);
  color: var(--text-light);
  border-color: transparent;
}

.button-text {
  font-size: 1.1rem;
}

.button-icon {
  font-size: 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* RTL specific styles */
[dir="rtl"] .button-icon {
  transform: scaleX(-1);
}

/* Improved responsive breakpoints */
@media (max-width: 768px) {
  .home-container {
    padding: 1.5rem 0;
    gap: 2.5rem;
    justify-content: center; /* Keep centered on mobile */
    width: 100%;
    left: 0;
    right: 0;
    margin: 0;
  }

  .service-card {
    padding: 2rem;
    max-width: 90%;
    width: 90%; /* Keep margins on both sides */
    left: 0;
    right: 0;
    margin-left: auto;
    margin-right: auto;
  }

  .service-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
  }

  .service-description {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.5;
  }

  .logo {
    max-width: 160px;
    margin-bottom: 1.5rem;
  }
  
  .language-buttons {
    width: 100%;
    max-width: 90%;
  }
  
  .home-button {
    padding: 1rem 1.5rem;
    margin-bottom: 0.5rem;
  }
  
  .button-text {
    font-size: 1.1rem;
  }
}

/* Footer styles */
.home-footer {
  width: 100%;
  text-align: center;
  padding: 1rem 0;
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  font-size: 0.9rem;
  margin-top: 2rem;
  backdrop-filter: blur(5px);
}

.home-footer p {
  margin: 0;
}

/* Extra small devices */
@media (max-width: 480px) {
  .home-container {
    padding: 1.5rem 0;
    gap: 2rem;
    width: 100%;
    left: 0;
    right: 0;
    margin: 0;
  }
  
  .service-card {
    padding: 2rem 1.5rem;
    border-radius: 14px;
    width: 92%;
    max-width: 92%;
  }
  
  .service-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
  }
  
  .service-description {
    font-size: 1rem;
    margin-bottom: 2rem;
    line-height: 1.5;
  }
  
  .logo {
    max-width: 140px;
    margin-bottom: 1.5rem;
  }
  
  .language-buttons {
    max-width: 100%;
  }
  
  .home-button {
    padding: 1rem 1.2rem;
    margin-bottom: 0.8rem;
  }
  
  .home-footer {
    padding: 1rem 0;
    font-size: 0.9rem;
    margin-top: 1.5rem;
  }
}
