/* Responsive Design for ERP Company Website */

/* Base responsive utilities */
.container-fluid {
  width: 100%;
  padding-right: var(--spacing-4);
  padding-left: var(--spacing-4);
  margin-right: auto;
  margin-left: auto;
}

/* Responsive Grid System */
.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -15px;
  margin-left: -15px;
}

.col {
  flex: 1 0 0%;
  padding-right: 15px;
  padding-left: 15px;
}

/* Column Classes */
.col-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
.col-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
.col-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
.col-9 { flex: 0 0 75%; max-width: 75%; }
.col-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
.col-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

/* Extra Small devices (portrait phones, less than 576px) */
@media (max-width: 575.98px) {
  .container {
    max-width: 100%;
    padding-right: var(--spacing-3);
    padding-left: var(--spacing-3);
  }
  
  /* Typography adjustments */
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-xl); }
  h4 { font-size: var(--text-lg); }
  h5 { font-size: var(--text-base); }
  h6 { font-size: var(--text-sm); }
  
  /* Button adjustments */
  .btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
  }
  
  .btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }
  
  /* Card adjustments */
  .card {
    margin-bottom: 1rem;
  }
  
  .card-body {
    padding: 1rem;
  }
  
  /* Section padding adjustments */
  .section-padding {
    padding: var(--spacing-12) 0;
  }
  
  /* Navigation adjustments */
  .navbar-custom {
    padding: 0.5rem 0;
  }
  
  .navbar-nav {
    margin-top: 1rem;
  }
  
  .navbar-nav .nav-link {
    padding: 0.75rem 1rem;
    margin: 0.25rem 0;
    border-radius: var(--radius-md);
  }
  
  /* Hero section adjustments */
  .hero-title {
    font-size: 2rem;
    line-height: 1.2;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .hero-buttons .btn {
    width: 100%;
    max-width: 280px;
  }
  
  /* Service cards */
  .service-card {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
  }
  
  .service-icon {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }
  
  /* Stats grid */
  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .stat-number {
    font-size: 2rem;
  }
  
  /* Form adjustments */
  .form-control {
    padding: 0.75rem;
  }
  
  /* Modal adjustments */
  .modal-content {
    margin: 1rem;
    width: calc(100% - 2rem);
  }
  
  /* Table responsive */
  .table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Hidden on mobile */
  .d-xs-none {
    display: none !important;
  }
  
  /* Show only on mobile */
  .d-xs-block {
    display: block !important;
  }
  
  .d-xs-flex {
    display: flex !important;
  }
  
  /* Text alignment */
  .text-xs-center {
    text-align: center !important;
  }
  
  .text-xs-left {
    text-align: left !important;
  }
  
  .text-xs-right {
    text-align: right !important;
  }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
  .container {
    max-width: 540px;
  }
  
  /* Column classes for small devices */
  .col-sm { flex: 1 0 0%; }
  .col-sm-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
  .col-sm-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
  .col-sm-3 { flex: 0 0 25%; max-width: 25%; }
  .col-sm-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
  .col-sm-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
  .col-sm-6 { flex: 0 0 50%; max-width: 50%; }
  .col-sm-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
  .col-sm-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
  .col-sm-9 { flex: 0 0 75%; max-width: 75%; }
  .col-sm-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
  .col-sm-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
  .col-sm-12 { flex: 0 0 100%; max-width: 100%; }
  
  /* Display utilities */
  .d-sm-none { display: none !important; }
  .d-sm-block { display: block !important; }
  .d-sm-flex { display: flex !important; }
  
  /* Text alignment */
  .text-sm-center { text-align: center !important; }
  .text-sm-left { text-align: left !important; }
  .text-sm-right { text-align: right !important; }
}

@media (max-width: 767.98px) {
  /* Stats adjustments */
  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Services grid */
  .services-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  /* About section */
  .about-content,
  .about-visual {
    padding: 0;
    margin-bottom: 2rem;
  }
  
  .visual-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  /* Pricing cards */
  .pricing-grid {
    grid-template-columns: 1fr;
  }
  
  .pricing-card.popular {
    transform: none;
    margin-bottom: 1rem;
  }
  
  /* Team grid */
  .team-grid {
    grid-template-columns: 1fr;
  }
  
  /* Testimonials */
  .testimonials-grid {
    grid-template-columns: 1fr;
  }
  
  /* Contact section */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  /* Footer */
  .footer-menu {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
  .container {
    max-width: 720px;
  }
  
  /* Column classes for medium devices */
  .col-md { flex: 1 0 0%; }
  .col-md-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
  .col-md-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
  .col-md-3 { flex: 0 0 25%; max-width: 25%; }
  .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
  .col-md-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
  .col-md-6 { flex: 0 0 50%; max-width: 50%; }
  .col-md-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
  .col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
  .col-md-9 { flex: 0 0 75%; max-width: 75%; }
  .col-md-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
  .col-md-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
  .col-md-12 { flex: 0 0 100%; max-width: 100%; }
  
  /* Display utilities */
  .d-md-none { display: none !important; }
  .d-md-block { display: block !important; }
  .d-md-flex { display: flex !important; }
  
  /* Text alignment */
  .text-md-center { text-align: center !important; }
  .text-md-left { text-align: left !important; }
  .text-md-right { text-align: right !important; }
  
  /* Services grid for tablets */
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Team grid for tablets */
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Testimonials for tablets */
  .testimonials-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
  .container {
    max-width: 960px;
  }
  
  /* Column classes for large devices */
  .col-lg { flex: 1 0 0%; }
  .col-lg-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
  .col-lg-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
  .col-lg-3 { flex: 0 0 25%; max-width: 25%; }
  .col-lg-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
  .col-lg-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
  .col-lg-6 { flex: 0 0 50%; max-width: 50%; }
  .col-lg-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
  .col-lg-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
  .col-lg-9 { flex: 0 0 75%; max-width: 75%; }
  .col-lg-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
  .col-lg-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
  .col-lg-12 { flex: 0 0 100%; max-width: 100%; }
  
  /* Display utilities */
  .d-lg-none { display: none !important; }
  .d-lg-block { display: block !important; }
  .d-lg-flex { display: flex !important; }
  
  /* Text alignment */
  .text-lg-center { text-align: center !important; }
  .text-lg-left { text-align: left !important; }
  .text-lg-right { text-align: right !important; }
  
  /* Services grid for desktop */
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  /* Team grid for desktop */
  .team-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  /* Pricing grid for desktop */
  .pricing-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
  .container {
    max-width: 1140px;
  }
  
  /* Column classes for extra large devices */
  .col-xl { flex: 1 0 0%; }
  .col-xl-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
  .col-xl-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
  .col-xl-3 { flex: 0 0 25%; max-width: 25%; }
  .col-xl-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
  .col-xl-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
  .col-xl-6 { flex: 0 0 50%; max-width: 50%; }
  .col-xl-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
  .col-xl-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
  .col-xl-9 { flex: 0 0 75%; max-width: 75%; }
  .col-xl-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
  .col-xl-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
  .col-xl-12 { flex: 0 0 100%; max-width: 100%; }
  
  /* Display utilities */
  .d-xl-none { display: none !important; }
  .d-xl-block { display: block !important; }
  .d-xl-flex { display: flex !important; }
  
  /* Text alignment */
  .text-xl-center { text-align: center !important; }
  .text-xl-left { text-align: left !important; }
  .text-xl-right { text-align: right !important; }
  
  /* Team grid for large desktop */
  .team-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Extra extra large devices (larger desktops, 1400px and up) */
@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }
  
  /* Column classes for extra extra large devices */
  .col-xxl { flex: 1 0 0%; }
  .col-xxl-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
  .col-xxl-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
  .col-xxl-3 { flex: 0 0 25%; max-width: 25%; }
  .col-xxl-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
  .col-xxl-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
  .col-xxl-6 { flex: 0 0 50%; max-width: 50%; }
  .col-xxl-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
  .col-xxl-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
  .col-xxl-9 { flex: 0 0 75%; max-width: 75%; }
  .col-xxl-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
  .col-xxl-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
  .col-xxl-12 { flex: 0 0 100%; max-width: 100%; }
  
  /* Display utilities */
  .d-xxl-none { display: none !important; }
  .d-xxl-block { display: block !important; }
  .d-xxl-flex { display: flex !important; }
  
  /* Text alignment */
  .text-xxl-center { text-align: center !important; }
  .text-xxl-left { text-align: left !important; }
  .text-xxl-right { text-align: right !important; }
}

/* RTL Responsive Adjustments */
[dir="rtl"] .row {
  margin-right: -15px;
  margin-left: -15px;
}

[dir="rtl"] .col,
[dir="rtl"] [class*="col-"] {
  padding-right: 15px;
  padding-left: 15px;
}

/* Print Styles */
@media print {
  .container {
    max-width: none !important;
  }
  
  .row {
    margin-right: 0;
    margin-left: 0;
  }
  
  .col,
  [class*="col-"] {
    padding-right: 0;
    padding-left: 0;
  }
  
  .d-print-none {
    display: none !important;
  }
  
  .d-print-block {
    display: block !important;
  }
  
  .d-print-inline {
    display: inline !important;
  }
  
  .d-print-inline-block {
    display: inline-block !important;
  }
  
  /* Hide navigation and footer in print */
  .navbar,
  .footer-section,
  .back-to-top {
    display: none !important;
  }
  
  /* Adjust spacing for print */
  .section-padding {
    padding: 1rem 0 !important;
  }
  
  /* Ensure text is readable in print */
  body {
    font-size: 12pt !important;
    line-height: 1.4 !important;
    color: #000 !important;
    background: white !important;
  }
  
  h1, h2, h3, h4, h5, h6 {
    color: #000 !important;
  }
  
  /* Page breaks */
  .page-break-before {
    page-break-before: always;
  }
  
  .page-break-after {
    page-break-after: always;
  }
  
  .page-break-inside {
    page-break-inside: avoid;
  }
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 500px) {
  .hero-section {
    min-height: auto;
    padding: 2rem 0;
  }
  
  .navbar-custom {
    padding: 0.25rem 0;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Adjust for retina displays */
  .logo-icon {
    background-size: contain;
  }
  
  .cert-logo {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Accessibility - Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .animate-fadeIn,
  .animate-slideInUp,
  .animate-zoomIn,
  .card-3d,
  .btn-3d {
    animation: none !important;
    transform: none !important;
    transition: none !important;
  }
}

/* Dark mode responsive adjustments */
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
    --white: #1a1a1a;
    --black: #ffffff;
    --gray-50: #1a1a1a;
    --gray-100: #2d2d2d;
    --gray-900: #ffffff;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .btn,
  .card,
  .service-card {
    transition: none;
  }
  
  .btn:hover,
  .card:hover,
  .service-card:hover {
    transform: none;
  }
  
  /* Increase touch targets */
  .nav-link,
  .btn,
  .form-control {
    min-height: 44px;
  }
}
