/* Compact Mobile Responsive Styles */
@media (max-width: 768px) {
  /* Reduce particles intensity */
  .particles {
    background-size: 80px 40px;
    opacity: 0.4;
  }

  /* Compact Typography - Smaller */
  h1 {
    font-size: 2rem !important;
    line-height: 1.1 !important;
    margin-bottom: 1rem !important;
  }

  h2 {
    font-size: 1.8rem !important;
    line-height: 1.2 !important;
    margin-bottom: 1rem !important;
  }

  h3 {
    font-size: 1.2rem !important;
    line-height: 1.3 !important;
  }

  p {
    font-size: 0.9rem !important;
    line-height: 1.4 !important;
  }

  /* Compact Section Spacing */
  section {
    padding: 2rem 0.75rem !important;
  }

  .py-24,
  .py-16,
  .py-12 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }

  /* Hero Section - Compact */
  #home {
    min-height: 70vh !important;
    padding: 1rem !important;
  }

  #home h1 {
    font-size: 2.2rem !important;
    margin-bottom: 1rem !important;
  }

  #home p {
    font-size: 1rem !important;
    margin-bottom: 1.5rem !important;
  }

  #home a {
    padding: 0.75rem 2rem !important;
    font-size: 1rem !important;
    max-width: 200px !important;
  }

  /* Stats Section - 2x2 Grid */
  .grid-cols-1.sm\:grid-cols-2.lg\:grid-cols-4 {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.75rem !important;
  }

  .stat-number {
    font-size: 2rem !important;
  }

  .bg-card-bg.p-6.sm\:p-8,
  .bg-card-bg.p-8 {
    padding: 1rem !important;
  }

  /* About Section - 2x2 then 1x1 Grid */
  .grid.grid-cols-1.md\:grid-cols-3 {
    grid-template-columns: 1fr 1fr !important;
    gap: 1rem !important;
  }

  .grid.grid-cols-1.md\:grid-cols-3 > div:last-child {
    grid-column: 1 / -1 !important;
  }

  .grid.grid-cols-1.md\:grid-cols-3 img {
    height: 120px !important;
  }

  .grid.grid-cols-1.md\:grid-cols-3 .p-6 {
    padding: 0.75rem !important;
  }

  /* Services Section - Compact */
  .relative.w-full.max-w-7xl.mx-auto.min-h-\[400px\].md\:h-\[700px\] {
    height: 500px !important;
    min-height: 500px !important;
    margin: 1rem !important;
    padding: 1rem !important;
  }

  /* Service Modules - Smaller */
  .service-module {
    min-width: 160px !important;
    max-width: 160px !important;
    padding: 0.5rem !important;
    font-size: 0.75rem !important;
  }

  .service-module h6 {
    font-size: 0.7rem !important;
    line-height: 1.1 !important;
    margin-bottom: 0.25rem !important;
  }

  .service-module .text-xs {
    font-size: 0.6rem !important;
  }

  /* Central Processor - Smaller */
  .min-w-\[360px\] {
    min-width: 280px !important;
    max-width: 280px !important;
    padding: 1rem !important;
  }

  .min-w-\[360px\] h6 {
    font-size: 1rem !important;
  }

  .min-w-\[360px\] .text-3xl {
    font-size: 1.5rem !important;
  }

  /* Reposition service modules for mobile */
  .service-module.absolute.top-\[10\%\].left-\[5\%\] {
    top: 8% !important;
    left: 8% !important;
  }

  .service-module.absolute.top-\[30\%\].left-\[5\%\] {
    top: 25% !important;
    left: 8% !important;
  }

  .service-module.absolute.top-\[50\%\].left-\[5\%\] {
    top: 42% !important;
    left: 8% !important;
  }

  .service-module.absolute.top-\[70\%\].left-\[5\%\] {
    top: 60% !important;
    left: 8% !important;
  }

  .service-module.absolute.top-\[10\%\].right-\[5\%\] {
    top: 8% !important;
    right: 8% !important;
  }

  .service-module.absolute.top-\[30\%\].right-\[5\%\] {
    top: 25% !important;
    right: 8% !important;
  }

  .service-module.absolute.top-\[50\%\].right-\[5\%\] {
    top: 42% !important;
    right: 8% !important;
  }

  .service-module.absolute.top-\[70\%\].right-\[5\%\] {
    top: 60% !important;
    right: 8% !important;
  }

  /* Central processor positioning */
  .absolute.top-\[5\%\].left-1\/2 {
    top: 78% !important;
    transform: translate(-50%, 0) !important;
  }

  /* Service Module Popups - Compact */
  .module-popup {
    min-width: 220px !important;
    max-width: 220px !important;
    padding: 0.75rem !important;
    font-size: 0.7rem !important;
  }

  .module-popup h4 {
    font-size: 0.8rem !important;
    margin-bottom: 0.5rem !important;
  }

  .module-popup li {
    font-size: 0.65rem !important;
    line-height: 1.2 !important;
    margin-bottom: 0.25rem !important;
  }

  /* Clients Section - Horizontal scroll with smaller cards */
  .h-48.w-48 {
    height: 120px !important;
    width: 120px !important;
  }

  .scroll-left {
    gap: 1rem !important;
  }

  /* Team Section - Horizontal scroll with smaller cards */
  .w-72 {
    width: 200px !important;
    max-width: 200px !important;
  }

  .w-72 .h-48 {
    height: 120px !important;
  }

  .w-72 .p-6 {
    padding: 0.75rem !important;
  }

  .scroll-right {
    gap: 1rem !important;
  }

  /* Blog Section - 2x1 then 1x1 Grid */
  .grid.grid-cols-1.md\:grid-cols-3 {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .grid.grid-cols-1.md\:grid-cols-3 > div:nth-child(1),
  .grid.grid-cols-1.md\:grid-cols-3 > div:nth-child(2) {
    grid-column: span 1 !important;
  }

  .grid.grid-cols-1.md\:grid-cols-3 .h-48 {
    height: 120px !important;
  }

  .grid.grid-cols-1.md\:grid-cols-3 .p-6 {
    padding: 1rem !important;
  }

  /* Contact Section - Horizontal scroll */
  .grid.grid-cols-1.md\:grid-cols-3 {
    display: flex !important;
    overflow-x: auto !important;
    gap: 1rem !important;
    padding-bottom: 1rem !important;
  }

  .grid.grid-cols-1.md\:grid-cols-3 > div {
    flex: 0 0 250px !important;
    max-width: 250px !important;
  }

  .p-6.md\:p-10,
  .p-10 {
    padding: 1rem !important;
  }

  .w-16.h-16.md\:w-20.md\:h-20 {
    width: 3rem !important;
    height: 3rem !important;
  }

  /* Footer - Compact */
  .grid.grid-cols-1.md\:grid-cols-5 {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  .md\:col-span-3,
  .md\:col-span-2 {
    grid-column: 1 !important;
  }

  footer .p-6,
  footer .p-8 {
    padding: 1rem !important;
  }

  /* Button Improvements */
  .py-4.px-10,
  .py-3.px-6,
  .py-2.px-4 {
    padding: 0.5rem 1rem !important;
    font-size: 0.9rem !important;
  }

  /* Container Improvements */
  .max-w-4xl,
  .max-w-6xl,
  .max-w-7xl {
    max-width: 100% !important;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  /* Hide connection lines on mobile */
  .connection-line {
    display: none !important;
  }

  /* Mobile Logo */
  .h-8.w-auto.md\:h-12,
  .h-12.w-auto.md\:h-15 {
    height: 2rem !important;
  }

  /* Mobile specific hover effects */
  @media (hover: none) {
    .hover\:scale-105:hover,
    .hover\:-translate-y-2:hover,
    .hover\:-translate-y-4:hover,
    .hover\:scale-105:hover {
      transform: scale(1.02) !important;
    }
  }

  /* Touch targets - ensure minimum 44px */
  .service-module,
  button,
  a {
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .service-module {
    display: block !important;
    min-height: auto !important;
    padding: 0.5rem !important;
  }

  /* Prevent overflow */
  body {
    overflow-x: hidden !important;
  }

  /* Scrollable sections styling */
  .scroll-left,
  .scroll-right {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }

  .scroll-left::-webkit-scrollbar,
  .scroll-right::-webkit-scrollbar {
    display: none !important;
  }

  /* Contact section scroll indicators */
  .grid.grid-cols-1.md\:grid-cols-3::-webkit-scrollbar {
    height: 4px !important;
  }

  .grid.grid-cols-1.md\:grid-cols-3::-webkit-scrollbar-track {
    background: rgba(0, 212, 170, 0.1) !important;
  }

  .grid.grid-cols-1.md\:grid-cols-3::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 170, 0.5) !important;
    border-radius: 2px !important;
  }
}

/* Very Small Mobile Devices (320px - 480px) */
@media (max-width: 480px) {
  h1 {
    font-size: 1.8rem !important;
  }

  h2 {
    font-size: 1.6rem !important;
  }

  .stat-number {
    font-size: 1.8rem !important;
  }

  .service-module {
    min-width: 140px !important;
    max-width: 140px !important;
  }

  .min-w-\[360px\] {
    min-width: 250px !important;
    max-width: 250px !important;
  }

  .h-48.w-48 {
    height: 100px !important;
    width: 100px !important;
  }

  .w-72 {
    width: 180px !important;
  }

  section {
    padding: 1.5rem 0.5rem !important;
  }

  .py-24 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }
}

@media (max-width: 640px) {
  #home a[href="#about"] {
    display: block !important;
    margin: 0 auto !important;
    text-align: center !important;
  }

  /* Alternative approach - using flex on parent */
  #home .max-w-4xl {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  #home .max-w-4xl > a {
    align-self: center;
  }
}

@media (max-width: 768px) {
  /* Hide the central processor card on mobile */
  .absolute.top-\[5\%\].left-1\/2,
  .min-w-\[360px\] {
    display: none !important;
  }

  /* Service modules as 2x4 grid */
  .service-modules {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: repeat(4, 1fr) !important;
    gap: 0.75rem !important;
    position: static !important;
    width: 100% !important;
    height: auto !important;
    justify-items: stretch !important;
    align-items: stretch !important;
  }

  .service-module {
    position: static !important;
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    margin-bottom: 0 !important;
    height: auto !important;
    box-sizing: border-box !important;
  }

  /* Make service popups smaller and fit screen */
  .module-popup {
    min-width: 0 !important;
    max-width: 90vw !important;
    left: 50% !important;
    transform: translateX(-50%) translateY(5px) !important;
    box-sizing: border-box !important;
    padding: 0.5rem 0.75rem !important;
    font-size: 0.8rem !important;
  }
}
