/* ==========================================================================
   Nile Business Solutions — Main Stylesheet
   ========================================================================== */

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #1F1B5C;
  background: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* RTL Support */
body[dir="rtl"] {
  font-family: 'Tajawal', -apple-system, sans-serif;
  text-align: right;
}

/* Brand Variables */
:root {
  --primary: #2E2A78;
  --primary-dark: #1F1B5C;
  --secondary: #C73E9C;
  --secondary-dark: #9B2D7A;
  --accent: #5E2D8E;
  --gradient: linear-gradient(90deg, #2E2A78, #C73E9C);
  --gradient-soft: linear-gradient(135deg, #FAFAFA 0%, #F5EFFA 100%);
  --gradient-bold: linear-gradient(135deg, #2E2A78 0%, #C73E9C 100%);
  --text-dark: #1F1B5C;
  --text-medium: #5F5E5A;
  --text-light: #888780;
  --bg-light: #FAFAFA;
  --border-light: #EEEDFE;
  --shadow-sm: 0 2px 8px rgba(46, 42, 120, 0.06);
  --shadow-md: 0 8px 24px rgba(46, 42, 120, 0.1);
  --shadow-lg: 0 12px 40px rgba(46, 42, 120, 0.15);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: var(--transition); }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul { list-style: none; }

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.nav {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-light);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: var(--transition);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo svg { width: 44px; height: 32px; }

.nav-logo-text {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.3px;
}

.nav-logo-text .bs {
  color: var(--secondary);
  font-weight: 300;
}

.nav-menu {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-link {
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
  position: relative;
  padding: 6px 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient);
  transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link.active {
  color: var(--secondary);
}

.lang-switch {
  padding: 8px 14px;
  border: 1.5px solid var(--primary);
  border-radius: 6px;
  font-size: 12px;
  color: var(--primary);
  background: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.lang-switch:hover {
  background: var(--primary);
  color: #fff;
}

.nav-cta {
  background: var(--gradient);
  color: #fff !important;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
}

.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

.mobile-menu-btn span {
  width: 24px;
  height: 2px;
  background: var(--primary);
  transition: var(--transition);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  background: var(--gradient-soft);
  padding: 100px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before,
.hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.hero::before {
  top: -150px;
  right: -150px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(199, 62, 156, 0.1) 0%, transparent 70%);
}

.hero::after {
  bottom: -200px;
  left: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(46, 42, 120, 0.08) 0%, transparent 70%);
}

.hero-tag {
  display: inline-block;
  padding: 8px 20px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 100px;
  font-size: 12px;
  color: var(--secondary);
  font-weight: 600;
  letter-spacing: 1.5px;
  margin-bottom: 28px;
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.6s ease forwards;
}

.hero h1 {
  font-size: 56px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 24px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.8s ease forwards;
  animation-delay: 0.1s;
  opacity: 0;
}

.hero h1 .accent {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 19px;
  color: var(--text-medium);
  max-width: 640px;
  margin: 0 auto 40px;
  position: relative;
  z-index: 1;
  animation: fadeInUp 1s ease forwards;
  animation-delay: 0.2s;
  opacity: 0;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
  animation: fadeInUp 1.2s ease forwards;
  animation-delay: 0.3s;
  opacity: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 30px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  border: 1.5px solid transparent;
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: #fff;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-secondary:hover {
  background: var(--primary);
  color: #fff;
}

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

/* ==========================================================================
   Sections
   ========================================================================== */
.section {
  padding: 90px 0;
}

.section-alt {
  background: var(--bg-light);
}

.section-title {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 60px;
}

.section-tag {
  display: inline-block;
  font-size: 12px;
  color: var(--secondary);
  font-weight: 700;
  letter-spacing: 2.5px;
  margin-bottom: 14px;
  text-transform: uppercase;
}

.section-title h2 {
  font-size: 42px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 16px;
  line-height: 1.2;
}

.section-title p {
  font-size: 17px;
  color: var(--text-medium);
}

/* ==========================================================================
   Stats
   ========================================================================== */
.stats {
  padding: 70px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  max-width: 1000px;
  margin: 0 auto;
  text-align: center;
}

.stat-item {
  padding: 20px;
}

.stat-num {
  font-size: 48px;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
  line-height: 1;
}

.stat-label {
  font-size: 13px;
  color: var(--text-medium);
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* ==========================================================================
   Services Grid
   ========================================================================== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.service-card {
  background: #fff;
  padding: 32px 28px;
  border-radius: 16px;
  border: 1px solid var(--border-light);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: var(--transition);
}

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

.service-card:hover::before {
  transform: scaleX(1);
}

.service-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  color: #fff;
}

.service-icon svg {
  width: 28px;
  height: 28px;
  stroke: #fff;
}

.service-card h3 {
  font-size: 19px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 12px;
}

.service-card p {
  font-size: 14.5px;
  color: var(--text-medium);
  line-height: 1.65;
}

/* ==========================================================================
   Customer Logos Carousel
   ========================================================================== */
.customers {
  padding: 80px 0;
  background: #fff;
  overflow: hidden;
}

.customers-title {
  text-align: center;
  font-size: 13px;
  color: var(--text-medium);
  font-weight: 700;
  letter-spacing: 2.5px;
  margin-bottom: 50px;
  text-transform: uppercase;
}

.logos-track-wrapper {
  overflow: hidden;
  width: 100%;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent);
}

.logos-track {
  display: flex;
  gap: 60px;
  animation: scroll 35s linear infinite;
  width: max-content;
}

.logos-track:hover {
  animation-play-state: paused;
}

.logo-item {
  flex-shrink: 0;
  width: 160px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  color: var(--text-light);
  font-size: 13px;
  font-weight: 600;
  filter: grayscale(100%) opacity(0.65);
  transition: var(--transition);
  padding: 12px;
}

.logo-item:hover {
  filter: grayscale(0%) opacity(1);
  transform: scale(1.05);
  border-color: var(--secondary);
}

.logo-item img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

@keyframes scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

[dir="rtl"] .logos-track {
  animation: scroll-rtl 35s linear infinite;
}

@keyframes scroll-rtl {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}

/* ==========================================================================
   CTA Section
   ========================================================================== */
.cta-section {
  background: var(--gradient-bold);
  padding: 80px 60px;
  text-align: center;
  color: #fff;
  border-radius: 24px;
  margin: 60px auto;
  max-width: 1140px;
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  border-radius: 50%;
}

.cta-section h2 {
  font-size: 38px;
  font-weight: 700;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.cta-section p {
  font-size: 17px;
  opacity: 0.95;
  max-width: 540px;
  margin: 0 auto 32px;
  position: relative;
  z-index: 1;
}

.btn-white {
  background: #fff;
  color: var(--primary);
  position: relative;
  z-index: 1;
}

.btn-white:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  background: var(--primary-dark);
  color: #fff;
  padding: 70px 0 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 50px;
  max-width: 1200px;
  margin: 0 auto 50px;
  padding: 0 32px;
}

.footer-about {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.7;
  margin-top: 20px;
  margin-bottom: 24px;
}

.footer-social {
  display: flex;
  gap: 12px;
}

.footer-social a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.footer-social a:hover {
  background: var(--secondary);
  transform: translateY(-3px);
}

.footer-social svg {
  width: 18px;
  height: 18px;
  fill: #fff;
}

.footer h4 {
  font-size: 15px;
  margin-bottom: 20px;
  color: #fff;
  font-weight: 600;
}

.footer ul li {
  margin-bottom: 10px;
}

.footer a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

.footer a:hover {
  color: var(--secondary);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 24px;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 32px;
  padding-right: 32px;
}

/* ==========================================================================
   Page Hero (for inner pages)
   ========================================================================== */
.page-hero {
  background: var(--gradient-soft);
  padding: 80px 0 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-hero h1 {
  font-size: 48px;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 16px;
}

.page-hero p {
  font-size: 18px;
  color: var(--text-medium);
  max-width: 600px;
  margin: 0 auto;
}

.breadcrumb {
  font-size: 13px;
  color: var(--text-medium);
  margin-bottom: 16px;
}

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

/* ==========================================================================
   Service Detail Cards (Services page)
   ========================================================================== */
.service-detail {
  background: #fff;
  border-radius: 20px;
  padding: 40px;
  margin-bottom: 24px;
  border: 1px solid var(--border-light);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  align-items: start;
  transition: var(--transition);
}

.service-detail:hover {
  box-shadow: var(--shadow-md);
}

.service-detail-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.service-detail-icon svg {
  width: 40px;
  height: 40px;
  stroke: #fff;
}

.service-detail h3 {
  font-size: 24px;
  color: var(--primary-dark);
  margin-bottom: 12px;
  font-weight: 700;
}

.service-detail p {
  font-size: 15.5px;
  color: var(--text-medium);
  margin-bottom: 16px;
  line-height: 1.7;
}

.service-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.service-feature {
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 100px;
}

/* ==========================================================================
   About Page
   ========================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
}

.about-image {
  background: var(--gradient-soft);
  border-radius: 20px;
  padding: 60px;
  text-align: center;
}

.about-image svg {
  width: 100%;
  max-width: 300px;
}

.about-text h2 {
  font-size: 36px;
  color: var(--primary-dark);
  margin-bottom: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.about-text p {
  font-size: 16px;
  color: var(--text-medium);
  margin-bottom: 16px;
  line-height: 1.7;
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.value-card {
  text-align: center;
  padding: 32px 24px;
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--border-light);
  transition: var(--transition);
}

.value-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: var(--secondary);
}

.value-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.value-icon svg {
  width: 32px;
  height: 32px;
  stroke: #fff;
}

.value-card h3 {
  font-size: 18px;
  color: var(--primary-dark);
  margin-bottom: 10px;
  font-weight: 700;
}

.value-card p {
  font-size: 14px;
  color: var(--text-medium);
  line-height: 1.6;
}

/* ==========================================================================
   Contact Page
   ========================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 60px;
  max-width: 1100px;
  margin: 0 auto;
}

.contact-info h3 {
  font-size: 24px;
  color: var(--primary-dark);
  margin-bottom: 16px;
  font-weight: 700;
}

.contact-info > p {
  font-size: 15px;
  color: var(--text-medium);
  margin-bottom: 32px;
  line-height: 1.7;
}

.contact-item {
  display: flex;
  gap: 16px;
  align-items: start;
  margin-bottom: 24px;
}

.contact-item-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-item-icon svg {
  width: 20px;
  height: 20px;
  stroke: #fff;
}

.contact-item-content strong {
  display: block;
  font-size: 14px;
  color: var(--primary-dark);
  margin-bottom: 4px;
  font-weight: 600;
}

.contact-item-content span,
.contact-item-content a {
  font-size: 14px;
  color: var(--text-medium);
}

.contact-form {
  background: #fff;
  padding: 40px;
  border-radius: 20px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border-light);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--primary-dark);
  background: #fff;
  transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(199, 62, 156, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-submit {
  width: 100%;
  background: var(--gradient);
  color: #fff;
  padding: 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
}

.form-submit:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 968px) {
  .nav-menu { gap: 20px; }
  .hero h1 { font-size: 42px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 32px; }
  .service-detail { grid-template-columns: 1fr; text-align: center; }
  .service-detail-icon { margin: 0 auto; }
  .section-title h2 { font-size: 32px; }
  .cta-section h2 { font-size: 30px; }
}

@media (max-width: 720px) {
  .container, .nav-container { padding: 0 20px; }
  .nav-menu { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff; flex-direction: column; padding: 20px; gap: 14px; box-shadow: var(--shadow-md); border-top: 1px solid var(--border-light); }
  .nav-menu.active { display: flex; }
  .mobile-menu-btn { display: flex; }
  .hero { padding: 70px 0 60px; }
  .hero h1 { font-size: 34px; }
  .hero p { font-size: 16px; }
  .section { padding: 60px 0; }
  .section-title h2 { font-size: 28px; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-num { font-size: 36px; }
  .footer-grid { grid-template-columns: 1fr; }
  .cta-section { padding: 50px 30px; margin: 40px 20px; }
  .cta-section h2 { font-size: 26px; }
  .contact-form { padding: 28px; }
}

/* ==========================================================================
   Utilities
   ========================================================================== */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

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