.navbar {
  background-color: #fff !important;
  padding: 0.8rem 2rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  z-index: 1030;
  transition: all 0.3s ease;
}

.navbar-brand {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1d1e22 !important;
  letter-spacing: 0.5px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.navbar-brand:hover {
  color: #ff0000 !important;
  transform: translateY(-1px);
}

.nav-link {
  color: #1d1e22 !important;
  font-weight: 500;
  padding: 0.5rem 1.25rem !important;
  margin: 0 0.15rem;
  position: relative;
  transition: all 0.3s ease;
  font-size: 1.05rem;
}

.nav-link:hover {
  color: #ff0000 !important;
}

.nav-link::before {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  background-color: #ff0000;
  transition: width 0.3s ease;
}

.nav-link:hover::before {
  width: 60%;
}

.nav-link.dropdown-toggle::after {
  display: inline-block;
  margin-left: 0.4em;
  vertical-align: 0.15em;
  content: "";
  border-top: 0.35em solid;
  border-right: 0.35em solid transparent;
  border-left: 0.35em solid transparent;
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  border-top-color: #1d1e22 !important;
}

.dropdown-hover:hover .dropdown-menu {
  display: block;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown-hover:hover .nav-link.dropdown-toggle::after {
  transform: rotate(180deg);
}

.dropdown-menu {
  display: block;
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  margin-top: 0;
  border: none;
  border-radius: 0;
  padding: 0;
  pointer-events: none;
  background-color: #fff !important;
}

.mega-menu {
  width: 100vw;
  left: 0;
  right: 0;
  background-color: #fff;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
  padding: 2rem !important;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.mega-menu h5,
.mega-menu h6 {
  color: #16213e;
  font-weight: 700;
  margin-bottom: 1rem;
  position: relative;
}

.mega-menu h6::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 40px;
  height: 3px;
  background-color: #ff0000;
}

.mega-menu .text-primary {
  color: #ff0000 !important;
}

.mega-menu .dropdown-item {
  color: #4a4a4a !important;
  padding: 0.5rem 0;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  background: none;
  position: relative;
  padding-left: 0;
}

.mega-menu .dropdown-item::before {
  content: "→";
  position: absolute;
  left: -15px;
  opacity: 0;
  transition: all 0.3s ease;
  color: #ff0000;
}

.mega-menu .dropdown-item:hover {
  color: #ff0000 !important;
  background-color: transparent !important;
  padding-left: 15px;
}

.mega-menu .dropdown-item:hover::before {
  opacity: 1;
  left: 0;
}

.mega-menu .card {
  border: none;
  border-radius: 8px;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  background: #f8f9fa;
  height: 100%;
  border-left: 4px solid #ff0000;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.mega-menu .card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.mega-menu .card h6 {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.mega-menu .card p {
  font-size: 0.8rem;
  color: #6c757d;
  margin-bottom: 0.5rem;
}

.lets-talk-btn {
  background-color: #000 !important;
  color: #fff !important;
  border: none !important;
  transition: background-color 0.3s ease, color 0.3s ease;
  border-radius: 6px;
  padding: 0.6rem 1.75rem !important;
  font-weight: 500;
}

.lets-talk-btn:hover {
  background-color: #ff0000 !important;
  color: #fff !important;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 0, 0, 0.2);
}

.navbar-toggler {
  border: none;
  padding: 0.5rem;
}

.navbar-toggler:focus {
  box-shadow: none;
}

.modal-content {
  border-radius: 12px;
  border: none;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-header {
  border-bottom: none;
  padding: 1.5rem 1.5rem 0;
  background: #f8f9fa;
}

.modal-title {
  font-weight: 700;
  color: #16213e;
  font-size: 1.5rem;
}

.form-control {
  padding: 0.85rem 1.25rem;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  transition: all 0.3s ease;
  margin-bottom: 1.25rem;
}

.form-control:focus {
  border-color: #ff0000;
  box-shadow: 0 0 0 0.25rem rgba(255, 0, 0, 0.25);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mega-menu .dropdown-item {
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}

.mega-menu .col-md-3:nth-child(1) .dropdown-item {
  animation-delay: 0.1s;
}
.mega-menu .col-md-3:nth-child(2) .dropdown-item {
  animation-delay: 0.2s;
}
.mega-menu .col-md-3:nth-child(3) .dropdown-item {
  animation-delay: 0.3s;
}
.mega-menu .col-md-3:nth-child(4) .dropdown-item {
  animation-delay: 0.4s;
}

@media (max-width: 992px) {
  .navbar {
    padding: 0.8rem 1.5rem;
  }

  .mega-menu {
    width: 100%;
    position: static !important;
    padding: 1.5rem !important;
    box-shadow: none;
  }

  .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: none;
    position: static;
    width: 100%;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.95) !important;
    pointer-events: auto;
  }

  .navbar-nav {
    padding-top: 1rem;
  }

  .nav-item {
    margin-bottom: 0.75rem;
  }

  .lets-talk-btn {
    margin-left: 0;
    margin-top: 0.5rem;
    width: 100%;
    text-align: center;
  }

  .mega-menu .row {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
  }

  .mega-menu [class^="col-"] {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    margin-bottom: 1rem;
  }

  .mega-menu .row > [class^="col-"] {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .mega-menu .card {
    padding: 1rem;
  }

  .mega-menu .card h6 {
    font-size: 0.9rem;
  }

  .mega-menu .card p {
    font-size: 0.75rem;
  }

  .modal-dialog {
    margin: 1rem auto;
  }

  .modal-content {
    margin: 0 0.5rem;
  }
}

@media (max-width: 576px) {
  .navbar-brand {
    font-size: 1.5rem;
  }

  .nav-link {
    padding: 0.5rem 0.75rem !important;
    font-size: 1rem;
  }

  .mega-menu {
    padding: 1rem !important;
  }

  .mega-menu .card-container,
  .mega-menu .content-card-container {
    grid-template-columns: 1fr;
  }

  .mega-menu .card,
  .mega-menu .content-card {
    max-height: none;
  }

  .modal-dialog {
    width: calc(100% - 1rem);
  }

  .form-control {
    padding: 0.75rem 1rem;
  }
}

@media (max-width: 400px) {
  .navbar {
    padding: 0.8rem 1rem;
  }

  .navbar-brand {
    font-size: 1.3rem;
  }

  .lets-talk-btn {
    padding: 0.5rem 1rem !important;
    font-size: 0.9rem;
  }

  .modal-title {
    font-size: 1.3rem;
  }

  .form-label {
    font-size: 0.9rem;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .modal-dialog {
    max-height: 90vh;
    overflow-y: auto;
  }

  .modal-content {
    max-height: 90vh;
  }

  .modal-body {
    overflow-y: auto;
    max-height: 60vh;
  }
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .nav-link::before,
  .mega-menu h6::after {
    height: 2px;
  }

  .dropdown-menu {
    border: 0.5px solid rgba(0, 0, 0, 0.1); /* thiner boder */
  }
}

/* COMPANY SECTION SPECIFIC STYLES */
/* mega dropdown card ko chota our smoth */
#companyDropdown + .dropdown-menu .card {
  max-height: 150px; /* card ki height*/
  overflow: hidden;
  transition: all 0.3s ease;
  transform: scale(0.95);
  opacity: 0.9;
}

#companyDropdown + .dropdown-menu .card:hover {
  transform: scale(1);
  opacity: 1;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

#companyDropdown + .dropdown-menu .card h6 {
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

#companyDropdown + .dropdown-menu .card p {
  font-size: 0.75rem;
  -webkit-line-clamp: 2; /* text 2 line tak simit kre */
}

/* company section card ke liye  */
@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#companyDropdown + .dropdown-menu .card {
  animation: cardFadeIn 0.4s ease forwards;
  animation-delay: calc(var(--order) * 0.1s);
  opacity: 0;
}

/* mobile viwe ke liye */
@media (max-width: 992px) {
  .navbar-toggler {
    display: block !important; /* hebarger icon*/
    border: none;
    padding: 0.25rem 0.5rem;
  }

  .navbar-toggler-icon {
    width: 1.5em;
    height: 1.5em;
  }

  /* company section ko mobile friendly */
  #companyDropdown + .dropdown-menu .row {
    flex-direction: column;
  }

  #companyDropdown + .dropdown-menu [class^="col-"] {
    width: 100%;
    max-width: 100%;
    padding: 0.5rem;
  }

  #companyDropdown + .dropdown-menu .card {
    max-height: none;
    margin-bottom: 1rem;
  }
}

/* small mobile ke liye */
@media (max-width: 576px) {
  #companyDropdown + .dropdown-menu .card {
    padding: 1rem;
  }

  #companyDropdown + .dropdown-menu .card h6 {
    font-size: 0.9rem;
  }

  #companyDropdown + .dropdown-menu .card p {
    font-size: 0.8rem;
  }
}

/* Smoth transtion ke liye */
#companyDropdown + .dropdown-menu {
  transition: all 0.3s ease-out;
}

/* set card oder */
#companyDropdown + .dropdown-menu .col-md-4:nth-child(1) .card {
  --order: 1;
}
#companyDropdown + .dropdown-menu .col-md-4:nth-child(2) .card {
  --order: 2;
}
#companyDropdown + .dropdown-menu .col-md-4:nth-child(3) .card {
  --order: 3;
}

/* testing  */
/* Hamburger Icon Styles for Mobile */
.navbar-toggler {
  border: none;
  padding: 0.25rem 0.5rem;
  display: none; /* Hidden by default */
}

.navbar-toggler-icon {
  width: 1.25em;
  height: 1.25em;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(0, 0, 0, 0.8)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  transition: all 0.3s ease;
}

.navbar-toggler:focus {
  outline: none;
  box-shadow: none;
}

/* Show hamburger only on mobile */
@media (max-width: 992px) {
  .navbar-toggler {
    display: block !important; /* Force show on mobile */
  }

  /* Adjust navbar padding for mobile */
  .navbar {
    padding: 0.5rem 1rem;
  }

  /* Make sure navbar collapses properly */
  .navbar-collapse {
    background-color: #fff;
    padding: 0 1rem;
    margin-top: 0.5rem;
    border-radius: 0.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }

  /* Adjust nav items for mobile */
  .nav-item {
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }

  .nav-item:last-child {
    border-bottom: none;
  }

  .nav-link {
    padding: 0.75rem 0 !important;
  }

  /* Adjust dropdowns for mobile */
  .dropdown-menu {
    position: static !important;
    float: none;
    width: 100%;
    margin-top: 0;
    border: none;
    box-shadow: none;
    padding-left: 1rem;
  }

  /* Mega menu adjustments for mobile */
  .mega-menu {
    padding: 1rem !important;
    width: 100% !important;
    position: static !important;
  }

  .mega-menu .row {
    margin-left: 0;
    margin-right: 0;
  }

  .mega-menu [class^="col-"] {
    padding-left: 0;
    padding-right: 0;
    margin-bottom: 1.5rem;
  }

  /* Let's Talk button adjustments */
  .lets-talk-btn {
    margin: 0.5rem 0;
    width: 100%;
  }
}

/* Extra small devices (phones, 576px and down) */
@media (max-width: 576px) {
  .navbar-brand {
    font-size: 1.3rem;
  }

  .navbar-toggler-icon {
    width: 1em;
    height: 1em;
  }

  .mega-menu {
    padding: 0.5rem !important;
  }

  .mega-menu .card {
    padding: 0.75rem;
  }
}

/* Animation for smoother mobile menu transitions */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.navbar-collapse.collapsing,
.navbar-collapse.show {
  animation: slideDown 0.3s ease forwards;
}

/* Desktop hover effects (≥992px) */
@media (min-width: 992px) {
  /* Smooth dropdown transitions */
  .dropdown-menu.mega-menu {
    transition: all 0.3s ease-in-out !important;
    opacity: 0 !important;
    visibility: hidden !important;
    display: block !important;
    transform: translateY(10px) !important;
  }

  /* Show dropdown on hover */
  .dropdown-hover:hover .dropdown-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
  }

  /* Prevent flickering when moving between dropdown and menu */
  .navbar-nav {
    position: static !important;
  }

  .dropdown-hover {
    position: static !important;
  }

  .dropdown-menu.mega-menu {
    left: 0 !important;
    right: 0 !important;
  }
}

/* Mobile/tablet behavior (<992px) */
@media (max-width: 991.98px) {
  /* Disable hover effects on mobile */
  .dropdown-hover:hover .dropdown-menu {
    display: none !important;
  }

  /* Show dropdown only when parent has .show class */
  .dropdown-hover .dropdown-menu {
    display: none !important;
  }

  .dropdown-hover.show .dropdown-menu {
    display: block !important;
  }

  /* Adjust mobile menu spacing */
  .navbar-collapse {
    padding-bottom: 20px !important;
  }

  .dropdown-menu.mega-menu {
    box-shadow: none !important;
    padding: 0 !important;
  }

  /* Mobile dropdown indicators */
  .dropdown-toggle::after {
    display: inline-block !important;
    margin-left: 0.255em !important;
    vertical-align: 0.255em !important;
    content: "" !important;
    border-top: 0.3em solid !important;
    border-right: 0.3em solid transparent !important;
    border-bottom: 0 !important;
    border-left: 0.3em solid transparent !important;
    transition: transform 0.2s ease-in-out !important;
  }

  .dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(-180deg) !important;
  }
}

/* Performance optimizations */
.navbar {
  will-change: transform !important;
}

.dropdown-menu {
  will-change: transform, opacity !important;
}

/* Smooth scrolling for anchor links */
html {
  scroll-behavior: smooth !important;
}
