/* Responsive & SEO Improvements */

/* ========================================
   MOBILE OVERFLOW & PADDING FIXES
   ======================================== */

/* Prevent horizontal scroll on all devices */
html {
  overflow-x: hidden;
  width: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  font-size: 16px;
  line-height: 1.6;
}

/* Prevent any element from causing horizontal overflow */
* {
  max-width: 100%;
  box-sizing: border-box;
}

/* Fix container overflow issues */
.container-fluid {
  overflow-x: hidden;
  max-width: 100vw;
}

.row {
  margin-left: 0;
  margin-right: 0;
  max-width: 100%;
}

/* Mobile padding fixes - Tablet */
@media (max-width: 768px) {
  body {
    padding: 0 !important;
  }
  
  .container-fluid {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }
  
  .container {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }
  
  /* Ensure text doesn't touch edges */
  p, h1, h2, h3, h4, h5, h6, span, div {
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  /* Fix row overflow */
  .row {
    margin-left: -15px;
    margin-right: -15px;
  }
  
  .row > * {
    padding-left: 15px;
    padding-right: 15px;
  }
  
  /* Prevent images from causing overflow */
  img {
    max-width: 100% !important;
    height: auto !important;
  }
  
  /* Fix table overflow */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Mobile padding fixes - Small Mobile */
@media (max-width: 576px) {
  .container-fluid {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
  
  .container {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
  
  /* Tighter padding for very small screens */
  .row > * {
    padding-left: 10px;
    padding-right: 10px;
  }
  
  /* Additional mobile fixes */
  img {
    max-width: 100% !important;
    height: auto !important;
  }
  
  /* Ensure SVG doesn't overflow */
  svg {
    max-width: 100%;
    height: auto;
  }
  
  /* Fix button overflow */
  .btn {
    white-space: normal !important;
    word-wrap: break-word !important;
  }
}

/* ========================================
   END MOBILE OVERFLOW & PADDING FIXES
   ======================================== */

/* Mobile First - Base Styles */
:root {
  --primary-color: #06A3DA;
  --dark-color: #061429;
  --light-color: #f8f9fa;
}

/* Images - Lazy Loading & Responsiveness */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

img[loading="lazy"] {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Touch-friendly buttons */
button, a.btn, input[type="button"], input[type="submit"] {
  min-height: 44px;
  min-width: 44px;
  padding: 12px 16px;
  font-size: 16px;
}

/* Form optimization */
input, textarea, select {
  font-size: 16px;
  padding: 12px;
  border-radius: 4px;
  border: 1px solid #ddd;
  width: 100%;
  box-sizing: border-box;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(6, 163, 218, 0.1);
}

/* Navbar responsiveness */
.navbar {
  padding: 0.5rem 1rem;
}

.navbar-brand img {
  max-height: 50px;
  width: auto;
}

.navbar-toggler {
  border: none;
  padding: 0.25rem 0.75rem;
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 0.25rem rgba(6, 163, 218, 0.25);
}

/* Dropdown menu responsiveness */
.dropdown-menu {
  min-width: 200px;
}

.dropdown-item {
  padding: 0.75rem 1rem;
  font-size: 14px;
}

/* Heading hierarchy */
h1 {
  font-size: clamp(24px, 5vw, 48px);
  line-height: 1.2;
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(20px, 4vw, 36px);
  line-height: 1.3;
  margin-bottom: 0.875rem;
}

h3 {
  font-size: clamp(18px, 3.5vw, 28px);
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

h4 {
  font-size: clamp(16px, 3vw, 24px);
  line-height: 1.4;
  margin-bottom: 0.625rem;
}

h5 {
  font-size: clamp(14px, 2.5vw, 20px);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

/* Enhanced Service Cards Responsiveness */
.service-card, .ai-service-card, .security-service-card, 
.sms-service-card, .whatsapp-service-card, .ads-service-card,
.web-security-card {
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .service-card, .ai-service-card, .security-service-card, 
  .sms-service-card, .whatsapp-service-card, .ads-service-card,
  .web-security-card {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
  }
  
  .service-icon, .security-icon, .sms-icon, .whatsapp-icon, 
  .ads-icon, .web-security-icon {
    width: 70px;
    height: 70px;
  }
  
  .service-icon i, .security-icon i, .sms-icon i, .whatsapp-icon i, 
  .ads-icon i, .web-security-icon i {
    font-size: 1.5rem;
  }
}

/* Hero Section Responsiveness */
.service-hero {
  min-height: 400px;
  padding: 3rem 1rem;
}

@media (max-width: 768px) {
  .service-hero {
    min-height: 300px;
    padding: 2rem 1rem;
  }
  
  .service-hero h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
  }
  
  .service-hero .lead {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .service-hero .btn {
    margin: 0.25rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 576px) {
  .service-hero {
    min-height: 250px;
    padding: 1.5rem 0.5rem;
  }
  
  .service-hero h1 {
    font-size: 1.75rem;
  }
  
  .service-hero .btn {
    display: block;
    width: 100%;
    margin: 0.5rem 0;
  }
}

/* Grid System Enhancements */
@media (max-width: 992px) {
  .col-lg-4, .col-lg-3, .col-lg-6 {
    margin-bottom: 2rem;
  }
}

@media (max-width: 768px) {
  .col-md-6 {
    margin-bottom: 1.5rem;
  }
  
  .row.g-4 > * {
    margin-bottom: 1.5rem;
  }
  
  .row.g-5 > * {
    margin-bottom: 2rem;
  }
}

/* Feature Box Responsiveness */
.feature-box, .threat-feature, .integration-feature, 
.scanner-feature, .platform-feature {
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .feature-box, .threat-feature, .integration-feature, 
  .scanner-feature, .platform-feature {
    padding: 1.5rem;
    margin-bottom: 1rem;
  }
}

/* Technology Grid Responsiveness */
.tech-item, .ai-tech-item {
  margin-bottom: 1rem;
}

@media (max-width: 768px) {
  .tech-item, .ai-tech-item {
    padding: 1rem;
  }
  
  .tech-item i, .ai-tech-item i {
    font-size: 2rem;
  }
}

/* Process Steps Responsiveness */
.process-step {
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .process-step {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
  }
  
  .step-number {
    width: 50px;
    height: 50px;
    font-size: 1.25rem;
  }
}

/* Statistics and Metrics */
.security-stat, .roi-stat, .security-metric {
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .security-stat, .roi-stat, .security-metric {
    padding: 1.5rem;
  }
  
  .stat-number, .metric-number {
    font-size: 2.5rem;
  }
}

/* Pricing Cards */
.pricing-card {
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .pricing-card {
    padding: 2rem;
    margin-bottom: 1.5rem;
  }
}

/* Navigation Improvements */
@media (max-width: 991px) {
  .navbar-nav {
    padding: 1rem 0;
  }
  
  .nav-item {
    margin-bottom: 0.5rem;
  }
  
  .dropdown-menu {
    position: static;
    float: none;
    width: 100%;
    margin-top: 0;
    background-color: rgba(6, 20, 41, 0.95) !important;
    border: none;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.3);
  }
  
  .dropdown-item {
    color: rgba(255,255,255,0.9) !important;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  
  .dropdown-item:last-child {
    border-bottom: none;
  }
  
  .dropdown-item:hover,
  .dropdown-item:focus {
    background-color: rgba(6, 163, 218, 0.3) !important;
    color: #fff !important;
  }
  
  .dropdown-item.active {
    background-color: rgba(6, 163, 218, 0.5) !important;
    color: #fff !important;
  }
}

/* Footer Responsiveness */
@media (max-width: 768px) {
  .footer-column {
    padding: 1rem;
    margin-bottom: 2rem;
    text-align: center;
  }
  
  .footer-social-btn {
    margin: 0 0.25rem;
  }
  
  .footer-bottom {
    text-align: center;
  }
  
  .footer-bottom .row > div {
    margin-bottom: 1rem;
  }
}

/* Container Spacing */
@media (max-width: 768px) {
  .container-fluid.py-5 {
    padding: 3rem 0;
  }
  
  .container.py-5 {
    padding: 2rem 0;
  }
  
  .section-title {
    margin-bottom: 2rem;
  }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .btn-primary {
    border: 2px solid;
  }
  
  .card, .feature-box {
    border: 1px solid;
  }
}

/* Print styles */
@media print {
  .navbar, .footer-enhanced, .btn, .back-to-top {
    display: none !important;
  }
  
  .service-hero {
    background: none !important;
    color: black !important;
  }
  
  * {
    box-shadow: none !important;
  }
}
