/* ========================================
   COMPLETE MOBILE RESPONSIVE CSS
   Single file for all mobile optimizations
   ======================================== */

/* ========================================
   FORCE HIDE OLD LEFT-SIDE MENU ELEMENTS
   ======================================== */
/* Hide old template hamburger menus */
.mobile-nav-toggle,
.navbar-toggler,
.nav-toggle,
#mobile-nav-toggle,
.hamburger-menu {
  display: none !important;
  visibility: hidden !important;
}

/* Hide old mobile navigation sidebar */
.mobile-nav:not(.main-nav) {
  display: none !important;
}

/* Hide any hamburger that's NOT inside header-actions */
.header-content > button:not(.header-actions *),
.header-content > .menu-toggle:not(.header-actions .menu-toggle) {
  display: none !important;
}

/* ========================================
   HEADER IMPROVEMENTS - ALL DEVICES
   ======================================== */

/* Cleaner header styling */
.main-header {
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
}

.main-header.header-scrolled {
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

/* Better spacing for header content */
.header-content {
  padding: 0 20px;
  max-width: 1400px;
  margin: 0 auto;
}

/* Logo hover effect */
.logo {
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.02);
}

/* Cleaner navigation */
.main-nav ul {
  margin: 0;
  padding: 0;
}

.main-nav a {
  padding: 8px 0;
  transition: all 0.2s ease;
}

/* Smoother button */
.btn-account {
  box-shadow: 0 2px 8px rgba(23, 146, 103, 0.2);
  border: none;
}

.btn-account:hover {
  box-shadow: 0 4px 15px rgba(23, 146, 103, 0.3);
}

/* User icon improvement */
.user-icon {
  transition: all 0.3s ease;
  cursor: pointer;
}

.user-icon:hover {
  background: #f0f9f6;
  transform: scale(1.1);
}

/* ========================================
   HAMBURGER MENU BUTTON
   ======================================== */
.menu-toggle {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  z-index: 1001;
  position: relative;
  width: 40px;
  height: 40px;
  display: none; /* Hidden on desktop */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

/* Show on mobile */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex !important;
  }
}

.menu-toggle span {
  display: block;
  width: 28px;
  height: 3px;
  background: #179267;
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

/* Hamburger animation when active */
.menu-toggle.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* ========================================
   BACKDROP OVERLAY
   ======================================== */
.menu-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
  cursor: pointer;
}

.menu-backdrop.active {
  opacity: 1;
}

/* ========================================
   PREVENT BODY SCROLL WHEN MENU OPEN
   ======================================== */
body.menu-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* ========================================
   SMOOTH SCROLLING
   ======================================== */
html {
  scroll-behavior: smooth;
}

/* ========================================
   BASE MOBILE ADJUSTMENTS
   ======================================== */
@media (max-width: 768px) {
  
  /* Prevent horizontal scroll */
  body {
    overflow-x: hidden;
    width: 100%;
  }
  
  html {
    overflow-x: hidden;
    width: 100%;
  }
  
  .container {
    padding: 0 15px;
    width: 100%;
    max-width: 100%;
  }
  
  /* Prevent images from breaking layout */
  img {
    max-width: 100%;
    height: auto;
  }
  
  /* ========================================
     HEADER & NAVIGATION - MOBILE
     ======================================== */
  .main-header {
    padding: 8px 0;
  }
  
  .header-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
  }
  
  .logo {
    order: 0;
  }
  
  .logo img {
    height: 45px;
  }
  
  /* Show hamburger button - positioned on the right */
  .menu-toggle {
    display: flex !important;
    order: 999;
    margin-left: auto;
  }
  
  /* Hide desktop nav by default */
  .main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: right 0.4s ease;
    overflow-y: auto;
    padding: 80px 20px 30px;
  }
  
  /* Show nav when active */
  .main-nav.active {
    right: 0;
  }
  
  /* Stack menu items vertically */
  .main-nav ul {
    flex-direction: column;
    gap: 0;
    align-items: stretch;
  }
  
  .main-nav li {
    width: 100%;
    border-bottom: 1px solid #f0f0f0;
  }
  
  .main-nav a {
    display: block;
    padding: 16px 20px;
    color: #333;
    font-size: 16px;
    text-align: left;
    border-radius: 8px;
    transition: all 0.3s ease;
  }
  
  .main-nav a:hover,
  .main-nav a.active {
    background: #f0f9f6;
    color: #179267;
    transform: translateX(5px);
  }
  
  /* Remove underline effect on mobile */
  .main-nav a::after {
    display: none;
  }
  
  /* Keep header actions visible but compact */
  .header-actions {
    display: flex;
    gap: 10px;
    order: 1;
    align-items: center;
  }
  
  .btn-account {
    padding: 8px 18px;
    font-size: 13px;
    white-space: nowrap;
  }
  
  .user-icon {
    width: 35px;
    height: 35px;
    display: none;
  }
  
 /* ========================================
     HERO SECTION - MOBILE
     ======================================== */
  .hero-section {
    min-height: 100vh; /* Full screen height */
    position: relative;
    width: 100%;
  }
  
  /* Hero background takes FULL screen */
  .hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh; /* Full viewport height */
    z-index: 1;
  }
  
  .hero-content {
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 2;
  }
  
  .hero-left {
    margin-left: 0;
    max-width: 100%;
    text-align: left;
  }
  
  .hero-left h1 {
    font-size: 32px;
    line-height: 1.2;
  }
  
  .hero-left p {
    font-size: 16px;
  }
  
  /* Hero carousel - WIDER view to show people on RIGHT */
  .hero-carousel {
    width: 120%; /* Wider than screen */
    margin-left: -10%; /* Shift left to show more right side */
    height: 100%;
  }
  
  /* Hero carousel images - FULL SCREEN, show RIGHT side (people) */
  .hero-background img,
  .carousel-image {
    object-fit: cover;
    object-position: 65% center; /* Show more of RIGHT side (where people are) */
    width: 100%;
    height: 100vh;
    min-height: 100vh;
  }
  
  /* Hide carousel buttons on mobile */
  .carousel-btn {
    display: none;
  }
  
  /* ========================================
     BOTTOM ICONS BAR - MOBILE
     Shows ONLY when scrolling down
     ======================================== */
  .hero-bottom-bar {
    padding: 20px 0;
    position: relative;
    margin-top: 0;
    /* Initially hidden, shows after scrolling */
  }
  
  .icon-grid {
    flex-wrap: wrap;
    gap: 30px;
    padding: 0 10px;
  }
  
  .icon-item {
    flex: 0 0 calc(33.333% - 20px);
    min-width: 80px;
  }
  
  .icon-circle {
    width: 60px;
    height: 60px;
  }
  
  .icon-circle img {
    width: 50px;
    height: 50px;
  }
  
  .icon-item p {
    font-size: 12px;
  }
  
  
  /* ========================================
     BOTTOM ICONS BAR - MOBILE
     ======================================== */
  .hero-bottom-bar {
    padding: 20px 0;
  }
  
  .icon-grid {
    flex-wrap: wrap;
    gap: 30px;
    padding: 0 10px;
  }
  
  .icon-item {
    flex: 0 0 calc(33.333% - 20px);
    min-width: 80px;
  }
  
  .icon-circle {
    width: 60px;
    height: 60px;
  }
  
  .icon-circle img {
    width: 50px;
    height: 50px;
  }
  
  .icon-item p {
    font-size: 12px;
  }
  
  /* ========================================
     PRODUCTIVE SECTION - MOBILE
     ======================================== */
  .productive-section {
    padding: 60px 0;
  }
  
  .productive-section .container {
    flex-direction: column;
    gap: 30px;
  }
  
  .productive-content {
    flex: 1;
    text-align: center;
    padding-bottom: 0;
  }
  
  .productive-content h2 {
    font-size: 28px;
    text-align: center;
  }
  
  .subtitle {
    text-align: center;
  }
  
  .card-grid {
    grid-template-columns: fr;
    gap: 5px;
  }
  
  .feature-card {
    height: 250px;
    max-width: 100%;
  }
  
  /* Ensure images don't break */
  .feature-card img {
    object-fit: cover;
    width: 100%;
    height: 100%;
  }
  
  /* ========================================
     CONNECTION SECTION - MOBILE
     ======================================== */
  .connection-section {
    min-height: auto;
  }
  
  .connection-content {
    flex-direction: column;
    min-height: auto;
      max-width: 100%;
  }
  
  .connection-left {
    padding: 20px 20px;
    max-width: 100%;
    text-align: center;
  }
  
  .connection-left h2 {
    font-size: 32px;
  }
  
  .connection-left p {
    font-size: 14px;
    color: #000000;
  }
  
  .connection-right {
    position: relative;
    width: 40vh;
  }
  
  /* Ensure connection images don't break */
  .connection-carousel-image {
    object-fit: cover;
    object-position: center;
  }
  
  .banner-arrow {
    display: none;
  }
  
  /* ========================================
     FEATURE BOXES - MOBILE
     ======================================== */
  .feature-boxes {
    padding: 30px 0 60px;
  }
  
  .boxes-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .info-box {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
  
  .box-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
  }
  
  .box-icon img {
    width: 35px;
    height: 35px;
  }
  
  .info-box-content {
    text-align: center;
  }
  
  /* ========================================
     JOIN SECTION - MOBILE
     ======================================== */
  .join-section {
    min-height: auto;
  }
  
  .join-content {
    min-height: auto;
  }
  
  .join-left {
    padding: 40px 20px;
    margin-left: 0;
    max-width: 100%;
    text-align: center;
  }
  
  .join-left h2 {
    font-size: 32px;
  }
  
  .join-left p {
    font-size: 16px;
  }
  
  .join-right {
    height: 250px;
  }
  
  /* Ensure join image doesn't break */
  .join-right img {
    object-fit: cover;
    object-position: center;
  }
  
  /* ========================================
     ADVANTAGE SECTION - MOBILE
     ======================================== */
  .advantage-section {
    padding: 60px 0;
  }
  
  .advantage-section .container {
    max-width: 100%; /* Full width container */
    padding: 0 10px; /* Less side padding */
  }
  
  .advantage-content {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  .advantage-left {
    padding-right: 0;
    text-align: center;
  }
  
  .advantage-left h2 {
    font-size: 32px;
  }
  
  .advantage-left h3 {
    font-size: 22px;
  }
  
  /* Make gray background WIDER (fatter) */
  .advantage-inner {
    padding: 30px 25px; /* More horizontal padding */
    border-radius: 30px;
    margin: 0 -15px; /* Extend beyond container edges */
  }
  
  /* Make grid use MORE width for bigger pictures */
  .advantage-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 12px;
    margin: 0 auto;
    max-width: 100%; /* Full width */
    padding: 0;
  }
  
  /* First card (CCTV) - top left - SHORTER */
  .advantage-card:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
    transform: none !important;
    margin: 0 !important;
    height: 110px; /* Shorter - decreased from 160px */
    width: 100%;
    left: -15px;
    right: -15px;
  }
  
  /* Second card (Running man) - bottom left - SHORTER */
  .advantage-card:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
    transform: none !important;
    margin: 0 !important;
    height: 110px; /* Shorter - decreased from 160px */
    width: 100%;
    left: -15px;
  }
  
  /* Third card (Construction man) - spans both rows on the right */
  .advantage-card:nth-child(3) {
    grid-column: 2;
    grid-row: 1 / 3;
    transform: none !important;
    margin: 0 !important;
    height: 100%;
    width: 200%;
    left: -65px;
  }
  
  /* Remove white border, show complete pictures */
  .advantage-card {
    overflow: hidden;
    background: transparent;
    border-radius: 15px;
  }
  
  .advantage-card img {
    object-fit: cover;
    object-position: center;
    transform: none !important;
    width: 100%;
    height: 100%;
  }
  
  .advantage-card-overlay {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    text-align: center;
    padding: 8px;
    border-radius: 8px;
  }
  
  .advantage-card-overlay p {
    font-size: 10px;
    line-height: 1.3;
    font-weight: 600;
    color: white;
  }
  
  /* ========================================
     TESTIMONIAL SECTION - MOBILE
     ======================================== */
  .testimonial-section {
    padding: 60px 0;
  }
  
  .testimonial-header {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  .testimonial-left {
    text-align: center;
  }
  
  .testimonial-left h2 {
    font-size: 32px;
  }
  
  .testimonial-controls {
    justify-content: center;
  }
  
  .testimonial-card {
    padding: 30px 20px;
  }
  
  .company-logo img {
    height: 100px;
  }
  
  /* ========================================
     HELP SECTION - MOBILE
     ======================================== */
  .help-section {
    padding: 60px 0;
  }
  
  .help-section h2 {
    font-size: 32px;
  }
  
  .help-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .help-card {
    padding: 40px 30px;
  }
  
  /* ========================================
     FOOTER - MOBILE
     ======================================== */
  .footer-content {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  .footer-brand {
    text-align: center;
    padding-right: 0;
  }
  
  .footer-logo {
    margin: 0 auto 15px;
  }
  
  .social-icons {
    justify-content: center;
  }
  
  .footer-links {
    flex-direction: column;
    text-align: center;
  }
  
  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }
  
  /* ========================================
     DROPDOWN MENU SUPPORT
     ======================================== */
  .main-nav .drop-down ul {
    position: static;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    padding: 0;
    background: #f9f9f9;
    margin-left: 20px;
    margin-top: 8px;
    border-radius: 8px;
    display: none;
  }
  
  .main-nav .drop-down.active ul {
    display: block;
  }
  
  .main-nav .drop-down li {
    border-bottom: none;
  }
  
  .main-nav .drop-down ul a {
    padding: 12px 15px;
    font-size: 14px;
  }
}

/* ========================================
   EXTRA SMALL DEVICES (max-width: 480px)
   ======================================== */
@media (max-width: 480px) {
  
  .hero-left h1 {
    font-size: 28px;
  }
  
  .icon-item {
    flex: 0 0 calc(50% - 15px);
  }
  
  .productive-content h2,
  .connection-left h2,
  .join-left h2,
  .advantage-left h2,
  .testimonial-left h2,
  .help-section h2 {
    font-size: 24px;
  }
  
  .feature-card {
    height: 200px;
  }
  
  /* Mobile menu adjustments */
  .main-nav {
    width: 260px;
  }
  
  .menu-toggle {
    width: 36px;
    height: 36px;
  }
  
  .menu-toggle span {
    width: 24px;
    height: 2.5px;
  }
  
  .header-content {
    padding: 10px 15px;
  }
  
  .logo img {
    height: 42px;
  }
  
  .user-icon {
    display: none;
  }
  
  .btn-account {
    padding: 8px 18px;
    font-size: 12px;
  }
}

/* ========================================
   TABLET SIZE (769px - 1024px)
   ======================================== */
@media (min-width: 769px) and (max-width: 1024px) {
  .main-nav ul {
    gap: 20px;
  }
  
  .main-nav a {
    font-size: 14px;
  }
  
  .header-content {
    padding: 12px 30px;
  }
  
  .logo img {
    height: 55px;
  }
}

/* ========================================
   IMAGE OPTIMIZATION - ALL DEVICES
   Prevents images from breaking layout
   ======================================== */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Specific image containers that need object-fit */
.hero-background img,
.carousel-image,
.connection-carousel-image,
.join-right img,
.feature-card img,
.advantage-card img {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

/* ========================================
   ACCESSIBILITY IMPROVEMENTS
   ======================================== */
.menu-toggle:focus,
.main-nav a:focus,
.btn-account:focus,
.user-icon:focus {
  outline: none;
  outline-offset: 2px;
}

/* Screen reader only text */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Prevent text selection on menu toggle */
.menu-toggle {
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* ========================================
   ANIMATION CLASSES
   ======================================== */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.main-nav.active {
  animation: slideInRight 0.4s ease forwards;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .main-header,
  .main-nav,
  .main-nav a,
  .btn-account,
  .user-icon,
  .menu-toggle,
  .menu-toggle span,
  .menu-backdrop {
    transition: none;
    animation: none;
  }
}