:root {
  --mi-primary: #0061f2;
  --mi-secondary: #004ab3;
  --mi-accent: #fca311;
  --mi-dark: #0f172a;
  --mi-light: #f1f5f9;
  --mi-white: #ffffff;
  --mi-text-muted: #64748b;
  --mi-radius: 16px;
  --mi-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.1);
  --mi-font: "Inter", sans-serif;
}

/* Base Overrides for Modern Index Only */
body {
  font-family: var(--mi-font);
  background-color: var(--mi-light);
  color: var(--mi-dark);
}

.mi-wrapper {
  overflow-x: hidden;
}

/* Modern Typography Utilities */
.mi-title {
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--mi-dark);
}

.mi-text-gradient {
  background: linear-gradient(135deg, var(--mi-primary), var(--mi-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Modern Button */
.mi-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  font-weight: 600;
  border-radius: 50px;
  background: var(--mi-primary);
  color: white !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  box-shadow: 0 4px 6px -1px rgba(0, 97, 242, 0.2);
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  text-decoration: none;
}

.mi-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 97, 242, 0.3);
  background: var(--mi-secondary);
}

/* Modern Navbar Overrides */
.mi-navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: none !important;
}

.mi-navbar .navbar-brand img {
  height: 55px;
}

.mi-navbar .nav-link {
  font-weight: 500;
  color: var(--mi-dark) !important;
  padding: 0.5rem 1rem !important;
  border-radius: 8px;
  transition: all 0.2s;
}

.mi-navbar .nav-link:hover,
.mi-navbar .nav-link.active {
  background-color: rgba(0, 97, 242, 0.08);
  color: var(--mi-primary) !important;
}

.mi-topbar {
  background-color: var(--mi-dark);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
}

.mi-topbar a {
  color: rgba(255, 255, 255, 0.9);
}

/* Hero Section */
.mi-hero-item {
  height: 85vh;
  min-height: 600px;
  position: relative;
  background-size: cover;
  background-position: center;
}

.mi-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(15, 23, 42, 0.9) 0%,
    rgba(15, 23, 42, 0.4) 100%
  );
  display: flex;
  align-items: center;
}

.mi-hero-content {
  max-width: 500px;
  padding: 1.5rem;
  color: white;
}

.mi-hero-title {
  color: white;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.mi-hero-text {
  font-size: 1rem;
  opacity: 0.9;
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* About Modern */
.mi-about-section {
  padding: 100px 0;
  background: white;
}

.mi-about-img-wrapper {
  position: relative;
  border-radius: var(--mi-radius);
  overflow: hidden;
  box-shadow: var(--mi-shadow);
}

.mi-about-img-main {
  width: 100%;
  height: 500px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.mi-about-img-wrapper:hover .mi-about-img-main {
  transform: scale(1.03);
}

.mi-exp-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  background: var(--mi-primary);
  padding: 2rem;
  border-top-right-radius: var(--mi-radius);
  color: white;
}

.mi-exp-badge h4 {
  font-size: 3rem;
  font-weight: 800;
  margin: 0;
  line-height: 1;
}

/* Services (What We Do) */
.mi-service-card {
  background: white;
  border-radius: var(--mi-radius);
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  height: 100%;
  border: 1px solid rgba(0, 0, 0, 0.03);
  position: relative;
}

.mi-service-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.mi-service-img {
  height: 250px;
  width: 100%;
  object-fit: cover;
}

.mi-service-body {
  padding: 2rem;
}

.mi-service-icon {
  position: absolute;
  top: 220px;
  right: 20px;
  width: 60px;
  height: 60px;
  background: var(--mi-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 10px rgba(0, 97, 242, 0.4);
}

/* Features (Stats/Icons) */
.mi-features-section {
  background: var(--mi-dark);
  color: white;
  padding: 100px 0;
  position: relative;
  overflow: hidden;
}

.mi-features-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(
    circle at 10% 20%,
    rgba(0, 97, 242, 0.2) 0%,
    transparent 40%
  );
  pointer-events: none;
}

.mi-feature-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2.5rem;
  border-radius: var(--mi-radius);
  backdrop-filter: blur(10px);
  height: 100%;
  transition: background 0.3s;
}

.mi-feature-box:hover {
  background: rgba(255, 255, 255, 0.1);
}

.mi-feature-icon {
  font-size: 2.5rem;
  color: var(--mi-primary);
  margin-bottom: 1.5rem;
}

/* Solutions (Help) */
.mi-solution-item {
  position: relative;
  border-radius: var(--mi-radius);
  overflow: hidden;
  height: 400px;
  group: hover;
}

.mi-solution-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.mi-solution-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.9) 0%,
    rgba(0, 0, 0, 0.2) 60%,
    transparent 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem;
  color: white;
  transition: all 0.3s;
}

.mi-solution-item:hover .mi-solution-img {
  transform: scale(1.1);
}

.mi-solution-text {
  height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.4s ease;
}

.mi-solution-item:hover .mi-solution-text {
  height: auto;
  opacity: 1;
  margin-top: 10px;
}

/* Footer Modern */
.mi-footer {
  background: #020617;
  color: #94a3b8;
  padding-top: 80px;
  font-size: 0.95rem;
}

.mi-footer h4,
.mi-footer h3 {
  color: white;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.mi-footer a {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s;
  display: block;
  margin-bottom: 0.8rem;
}

.mi-footer a:hover {
  color: var(--mi-primary);
  padding-left: 5px;
}

.mi-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 20px 0;
  margin-top: 60px;
  font-size: 0.85rem;
}

/* Fix Translator Dropdown in Modern Navbar */
.mi-topbar {
  position: relative;
  z-index: 1031; /* Above sticky navbar */
}

/* Fix Dropdown Text Color (White on White fix) */
.mi-topbar .dropdown-menu a {
  color: var(--mi-dark) !important;
}

.mi-topbar .dropdown-menu a:hover {
  color: var(--mi-primary) !important;
  background-color: transparent;
}

/* Responsive adjustments */
@media (max-width: 991px) {
  .mi-hero-item {
    height: 600px;
  }
  .mi-hero-title {
    font-size: 1.8rem;
  }
  .mi-about-img-main {
    height: 350px;
  }

  .dropdown {
    width: 100%;
  }
  /* Mobile Navbar & Dropdown Fixes */
  .mi-navbar {
    padding: 1rem;
    background: #fff;
  }

  /* Reset branding position */
  .mi-navbar .navbar-brand {
    display: flex !important;
  }
  .mi-navbar .navbar-brand::before,
  .mi-navbar .navbar-brand::after {
    content: none !important;
  }

  /* Collapse container styling */
  .mi-navbar .navbar-collapse {
    background: #fff;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    margin-top: 1rem !important;
    border: 1px solid #f1f5f9;
    max-height: 80vh;
    overflow-y: auto;
  }

  /* Nav Items spacing */
  .mi-navbar .nav-item {
    border-bottom: 1px solid #f1f5f9;
    padding: 0; /* Remove padding here, apply to link */
  }
  .mi-navbar .nav-item:last-child {
    border-bottom: none;
  }

  /* Link styling */
  .mi-navbar .nav-link {
    font-size: 1rem;
    font-weight: 600;
    padding: 1rem !important; /* Larger touch target */
    color: var(--mi-dark) !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }

  /* Dropdown Handling - Fix "Shifted" look */
  .mi-navbar .dropdown-menu {
    position: static !important; /* Force static to align with flow */
    float: none !important;
    width: 100% !important; /* Fill container minus margins */
    max-width: 100% !important;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    box-shadow: none !important;
    transform: none !important; /* Disable Popper.js transforms */
    border-radius: 8px;
    padding: 0.5rem;
  }

  /* Ensure the dropdown toggle arrow aligns nicely */
  .mi-navbar .dropdown-toggle::after {
    margin-left: auto; /* Push arrow to far right */
  }

  .mi-navbar .dropdown-item {
    padding: 0.75rem 1rem;
    color: #64748b;
    font-weight: 500;
    border-radius: 6px;
    font-size: 0.95rem;
  }

  .mi-navbar .dropdown-item:hover,
  .mi-navbar .dropdown-item:focus {
    background-color: white;
    color: var(--mi-primary);
    padding-left: 1.25rem; /* Slight slide effect */
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  }

  /* Button styling in mobile menu */
  .mi-navbar .mi-btn {
    width: 100%;
    margin-top: 1rem;
    margin-left: 0 !important;
    display: flex;
  }

  .navbar .navbar-nav .nav-item {
    padding: 0px;
  }
}
