/* ============================================
   RESPONSIVE FIXES FOR SYGMA WEBSITE
   ============================================ */

/* Prevent horizontal scrolling */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* Fix container widths on mobile */
.container, .container-fluid {
  padding-left: 15px !important;
  padding-right: 15px !important;
  overflow-x: hidden;
}

/* ============================================
   MOBILE NAVIGATION FIXES
   ============================================ */
@media (max-width: 991px) {
  /* Fix navbar padding */
  .navbar {
    padding: 0.5rem 0 !important;
  }

  .navbar-toggler {
    padding: 0.25rem 0.5rem;
    font-size: 1rem;
    border: 1px solid rgba(0,0,0,0.1);
  }

  /* Fix dropdown menus on mobile */
  .navbar-collapse {
    margin-top: 1rem;
    padding: 1rem 0;
    border-top: 1px solid rgba(0,0,0,0.1);
  }

  .navbar-nav {
    width: 100%;
  }

  .navbar-nav .nav-link {
    padding: 0.75rem 1rem !important;
    font-size: 0.95rem !important;
  }

  .navbar-nav .dropdown-menu {
    position: static !important;
    transform: none !important;
    border: none;
    box-shadow: none;
    background-color: rgba(248,249,250,0.9);
    padding: 0 1rem;
  }

  .navbar-nav .dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  /* Language switcher on mobile */
  .language-switcher {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0,0,0,0.1);
  }

  .language-switcher .dropdown-menu {
    position: absolute !important;
    left: auto !important;
    right: 0 !important;
  }
}

/* ============================================
   HERO SECTION RESPONSIVE
   ============================================ */
@media (max-width: 767px) {
  /* Hero content */
  .hero-section h1,
  .hero-slide-title {
    font-size: 1.75rem !important;
    line-height: 1.3;
    word-wrap: break-word;
  }

  .hero-section .hero-subtitle,
  .hero-slide-subtitle {
    font-size: 1rem !important;
    line-height: 1.4;
  }

  .hero-section .btn-lg {
    font-size: 0.95rem !important;
    padding: 0.75rem 1.5rem !important;
  }

  /* Hero slider */
  .hero-slider-section .carousel-item {
    height: 50vh !important;
    min-height: 350px !important;
  }

  .hero-content {
    padding: 1.5rem !important;
  }
}

/* ============================================
   SECTORS SECTION RESPONSIVE
   ============================================ */
@media (max-width: 991px) {
  /* Sector cards */
  .sector-item {
    margin-bottom: 3rem;
  }

  .sector-header {
    padding: 1.5rem !important;
  }

  .sector-header h3 {
    font-size: 1.5rem !important;
  }

  .sector-features {
    padding: 1rem !important;
  }

  /* Sub-items grid */
  .sector-features .row {
    gap: 1rem;
  }

  .sector-features .col-sm-6 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .feature-card {
    padding: 1rem !important;
    margin-bottom: 0.75rem;
  }

  .feature-card h5 {
    font-size: 1rem !important;
  }

  .feature-card p {
    font-size: 0.85rem !important;
  }

  /* Sector CTA button */
  .sector-item .btn-primary {
    font-size: 0.9rem !important;
    padding: 0.6rem 1.5rem !important;
  }
}

@media (max-width: 575px) {
  .sector-header {
    padding: 1.25rem !important;
  }

  .sector-header h3 {
    font-size: 1.25rem !important;
  }

  .sector-header .badge {
    font-size: 0.7rem !important;
    padding: 0.25rem 0.5rem !important;
  }

  .feature-icon {
    width: 40px !important;
    height: 40px !important;
    font-size: 1.25rem !important;
  }
}

/* ============================================
   SERVICES CARDS RESPONSIVE
   ============================================ */
@media (max-width: 767px) {
  .service-card {
    margin-bottom: 1.5rem;
  }

  .service-card .card-body {
    padding: 1.25rem !important;
  }

  .service-card h5 {
    font-size: 1.1rem !important;
  }

  .service-card p {
    font-size: 0.9rem !important;
  }

  .service-card .btn {
    font-size: 0.85rem !important;
    padding: 0.5rem 1rem !important;
  }
}

/* ============================================
   STATISTICS SECTION RESPONSIVE
   ============================================ */
@media (max-width: 767px) {
  .stats-section {
    padding: 2.5rem 0 !important;
  }

  .stat-box {
    padding: 1.5rem 1rem !important;
    margin-bottom: 1rem;
  }

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

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

  .stat-label {
    font-size: 0.9rem !important;
  }
}

@media (max-width: 575px) {
  .statistics-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .stat-card {
    padding: 1.25rem !important;
  }
}

/* ============================================
   FOOTER RESPONSIVE
   ============================================ */
@media (max-width: 767px) {
  .footer {
    padding: 2rem 0 1rem !important;
  }

  .footer .row > div {
    margin-bottom: 2rem;
  }

  .footer h5 {
    font-size: 1.1rem !important;
    margin-bottom: 1rem !important;
  }

  .footer-links {
    font-size: 0.9rem !important;
  }

  .footer-links li {
    margin-bottom: 0.5rem;
  }

  .social-links a {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }

  .footer-bottom {
    padding: 1rem 0 !important;
    font-size: 0.85rem !important;
  }

  .footer-bottom .container {
    flex-direction: column;
    text-align: center !important;
  }

  .footer-bottom .text-end {
    text-align: center !important;
    margin-top: 0.5rem;
  }
}

/* ============================================
   FORMS RESPONSIVE
   ============================================ */
@media (max-width: 575px) {
  .form-control,
  .form-select {
    font-size: 0.95rem !important;
    padding: 0.5rem 0.75rem !important;
  }

  .form-label {
    font-size: 0.9rem !important;
  }

  .btn-lg {
    font-size: 0.95rem !important;
    padding: 0.6rem 1.25rem !important;
  }
}

/* ============================================
   CARDS & CONTENT RESPONSIVE
   ============================================ */
@media (max-width: 767px) {
  /* General cards */
  .card {
    margin-bottom: 1.5rem;
  }

  .card-body {
    padding: 1.25rem !important;
  }

  .card-title {
    font-size: 1.1rem !important;
  }

  .card-text {
    font-size: 0.9rem !important;
  }

  /* Badges and pills */
  .badge {
    font-size: 0.75rem !important;
    padding: 0.25rem 0.5rem !important;
  }

  .badge-pill {
    padding: 0.35rem 0.75rem !important;
    font-size: 0.8rem !important;
  }
}

/* ============================================
   TYPOGRAPHY RESPONSIVE
   ============================================ */
@media (max-width: 767px) {
  .display-1 {
    font-size: 2.5rem !important;
  }

  .display-2 {
    font-size: 2.25rem !important;
  }

  .display-3 {
    font-size: 2rem !important;
  }

  .display-4 {
    font-size: 1.75rem !important;
  }

  .display-5 {
    font-size: 1.5rem !important;
  }

  .display-6 {
    font-size: 1.25rem !important;
  }

  h1, .h1 {
    font-size: 1.75rem !important;
  }

  h2, .h2 {
    font-size: 1.5rem !important;
  }

  h3, .h3 {
    font-size: 1.25rem !important;
  }

  h4, .h4 {
    font-size: 1.1rem !important;
  }

  h5, .h5 {
    font-size: 1rem !important;
  }

  h6, .h6 {
    font-size: 0.9rem !important;
  }

  .lead {
    font-size: 1rem !important;
    line-height: 1.5;
  }

  p, .text-body {
    font-size: 0.95rem !important;
    line-height: 1.6;
  }
}

@media (max-width: 575px) {
  h1, .h1, .display-4 {
    font-size: 1.5rem !important;
  }

  h2, .h2, .display-5 {
    font-size: 1.25rem !important;
  }

  h3, .h3 {
    font-size: 1.1rem !important;
  }
}

/* ============================================
   SPACING RESPONSIVE
   ============================================ */
@media (max-width: 767px) {
  /* Reduce section padding */
  section {
    padding: 3rem 0 !important;
  }

  .py-5 {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
  }

  .py-4 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }

  .my-5 {
    margin-top: 2.5rem !important;
    margin-bottom: 2.5rem !important;
  }

  .my-4 {
    margin-top: 2rem !important;
    margin-bottom: 2rem !important;
  }

  .mb-5 {
    margin-bottom: 2.5rem !important;
  }

  .mt-5 {
    margin-top: 2.5rem !important;
  }
}

@media (max-width: 575px) {
  section {
    padding: 2.5rem 0 !important;
  }

  .py-5 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }

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

/* ============================================
   IMAGES & MEDIA RESPONSIVE
   ============================================ */
@media (max-width: 767px) {
  /* Ensure all images are responsive */
  img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Icon sizes */
  .fa-3x {
    font-size: 2rem !important;
  }

  .fa-2x {
    font-size: 1.5rem !important;
  }

  .fa-lg {
    font-size: 1.1rem !important;
  }

  /* Feature icons */
  .feature-icon,
  .service-icon {
    width: 50px !important;
    height: 50px !important;
    font-size: 1.5rem !important;
  }
}

/* ============================================
   TABLES RESPONSIVE
   ============================================ */
@media (max-width: 767px) {
  .table-responsive {
    border: 0;
  }

  table {
    font-size: 0.85rem !important;
  }

  th, td {
    padding: 0.5rem !important;
  }
}

/* ============================================
   MODALS RESPONSIVE
   ============================================ */
@media (max-width: 575px) {
  .modal-dialog {
    margin: 0.5rem;
    max-width: calc(100% - 1rem);
  }

  .modal-content {
    border-radius: 0.5rem;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 1rem !important;
  }

  .modal-title {
    font-size: 1.1rem !important;
  }
}

/* ============================================
   RTL SUPPORT FOR MOBILE
   ============================================ */
@media (max-width: 767px) {
  [dir="rtl"] .text-start {
    text-align: right !important;
  }

  [dir="rtl"] .text-end {
    text-align: left !important;
  }

  [dir="rtl"] .ms-auto {
    margin-right: auto !important;
    margin-left: 0 !important;
  }

  [dir="rtl"] .me-auto {
    margin-left: auto !important;
    margin-right: 0 !important;
  }
}

/* ============================================
   UTILITY CLASSES FOR MOBILE
   ============================================ */
@media (max-width: 767px) {
  /* Hide elements on mobile */
  .hide-mobile {
    display: none !important;
  }

  /* Text alignment on mobile */
  .text-center-mobile {
    text-align: center !important;
  }

  /* Flexbox utilities */
  .flex-column-mobile {
    flex-direction: column !important;
  }

  /* Width utilities */
  .w-100-mobile {
    width: 100% !important;
  }

  /* Margin utilities */
  .mx-auto-mobile {
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

/* ============================================
   PREVENT COMMON OVERFLOW ISSUES
   ============================================ */
* {
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Prevent pre and code blocks from overflowing */
pre, code {
  overflow-x: auto;
  max-width: 100%;
  white-space: pre-wrap;
}

/* Prevent tables from overflowing */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Fix long URLs and text */
.text-break {
  word-break: break-all !important;
}

/* ============================================
   TOUCH DEVICE OPTIMIZATIONS
   ============================================ */
@media (hover: none) and (pointer: coarse) {
  /* Increase tap targets */
  a, button, .btn, .nav-link, .dropdown-item {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Remove hover effects on touch devices */
  .card:hover,
  .feature-card:hover,
  .service-card:hover {
    transform: none !important;
    box-shadow: none !important;
  }
}

/* ============================================
   LANDSCAPE MOBILE FIXES
   ============================================ */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-section,
  .hero-slider-section .carousel-item {
    min-height: 60vh !important;
  }

  .navbar {
    padding: 0.25rem 0 !important;
  }

  section {
    padding: 2rem 0 !important;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .navbar,
  .footer,
  .btn,
  .social-links,
  .language-switcher {
    display: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
  }

  h1 { font-size: 18pt; }
  h2 { font-size: 16pt; }
  h3 { font-size: 14pt; }

  a {
    color: #000 !important;
    text-decoration: underline;
  }

  .container {
    max-width: 100% !important;
  }
}