/* Desktop Layout Optimizations - Fit sections on one screen */

/* Apply comprehensive desktop optimizations */
@media (min-width: 1024px) {
    
    /* Section spacing optimization - reduce vertical padding */
    .py-5 {
        padding: 3rem 0 !important;
    }
    
    .py-4 {
        padding: 2.5rem 0 !important;
    }
    
    /* Typography optimizations for space efficiency */
    h2.display-5 {
        font-size: 1.8rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    h2:not(.display-5) {
        font-size: 1.6rem !important;
        margin-bottom: 1.2rem !important;
    }
    
    h3 {
        font-size: 1.3rem !important;
        margin-bottom: 1rem !important;
    }
    
    h4 {
        font-size: 1.1rem !important;
        margin-bottom: 0.8rem !important;
    }
    
    /* Lead text optimization */
    .lead {
        font-size: 1rem !important;
        margin-bottom: 1.5rem !important;
        line-height: 1.5 !important;
    }
    
    /* General paragraph spacing */
    p {
        font-size: 0.9rem !important;
        line-height: 1.4 !important;
        margin-bottom: 1rem !important;
    }
    
    /* Card content optimization */
    .card-body {
        padding: 1.5rem !important;
    }
    
    .feature-card {
        padding: 1.5rem !important;
    }
    
    /* Service cards in grid layout - more compact */
    .service-card {
        padding: 1.5rem !important;
        min-height: 250px !important;
        max-height: 250px !important;
    }
    
    .service-card h3 {
        font-size: 1.1rem !important;
        margin-bottom: 0.8rem !important;
    }
    
    .service-card p {
        font-size: 0.85rem !important;
        line-height: 1.3 !important;
    }
    
    /* Process/Approach section optimization */
    .agile-cycle {
        width: 350px !important;
        height: 350px !important;
        margin: 0 auto !important;
    }
    
    .cycle-step {
        padding: 8px !important;
        font-size: 0.75rem !important;
        width: 65px !important;
        height: 65px !important;
    }
    
    .cycle-step h5 {
        font-size: 0.8rem !important;
        margin-bottom: 0.2rem !important;
    }
    
    .cycle-step p {
        font-size: 0.7rem !important;
        line-height: 1.2 !important;
        margin: 0 !important;
    }
    
    /* Industry focus section - 4x2 grid optimization */
    .industry-focus-section .row {
        row-gap: 1.5rem !important;
    }
    
    .industry-card {
        padding: 1.2rem !important;
        min-height: 150px !important;
        max-height: 150px !important;
    }
    
    .industry-card h4 {
        font-size: 1rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .industry-card p {
        font-size: 0.8rem !important;
        line-height: 1.3 !important;
    }
    
    /* About us philosophy section - compact */
    .philosophy-card {
        padding: 1.2rem !important;
        margin-bottom: 1rem !important;
    }
    
    .philosophy-card h6 {
        font-size: 1.4rem !important;
    }
    
    .philosophy-card p {
        font-size: 1.1rem !important;
        line-height: 1.5 !important;
    }
    
    /* Team photo optimization */
    .team-photo {
        max-height: 300px !important;
        object-fit: cover !important;
    }
    
    /* SME Trust section - horizontal layout */
    .sme-trust-section .row.g-4 {
        row-gap: 2rem !important;
    }
    
    .sme-trust-section .feature-card {
        min-height: 200px !important;
        max-height: 200px !important;
    }
    
    /* Contact page optimization */
    .contact-card {
        padding: 1.5rem !important;
        min-height: 180px !important;
    }
    
    .contact-card h4 {
        font-size: 1.1rem !important;
        margin-bottom: 0.8rem !important;
    }
    
    /* Button optimization */
    .btn-lg {
        padding: 0.6rem 1.8rem !important;
        font-size: 0.95rem !important;
    }
    
    .btn {
        font-size: 0.9rem !important;
        padding: 0.5rem 1.5rem !important;
    }
    
    /* Margin optimizations */
    .mb-5 {
        margin-bottom: 2.5rem !important;
    }
    
    .mb-4 {
        margin-bottom: 2rem !important;
    }
    
    .mb-3 {
        margin-bottom: 1.5rem !important;
    }
    
    /* Container max width for better content distribution */
    .container {
        max-width: 1200px !important;
    }
    
    /* Two-column layout optimization for text+image sections */
    .two-column-section .row {
        align-items: center !important;
        min-height: 400px !important;
    }
    
    .two-column-section .col-lg-6 {
        padding: 2rem !important;
    }
    
    /* Value highlights horizontal layout */
    .value-highlight {
        padding: 1rem !important;
        margin-bottom: 1rem !important;
    }
    
    .value-highlight span {
        font-size: 0.85rem !important;
    }
    
    /* Additional values section - horizontal cards */
    .additional-values .row {
        justify-content: center !important;
        max-width: 800px !important;
        margin: 0 auto !important;
    }
    
    /* Testimonial section - compact horizontal layout */
    .testimonial-section {
        padding: 2.5rem 0 !important;
    }
    
    .testimonial-section .swiper-slide {
        padding: 1.2rem !important;
        max-height: 180px !important;
    }
    
    /* CTA section - compact */
    .cta-section {
        padding: 2.5rem 0 !important;
    }
    
    .cta-section h2 {
        font-size: 1.8rem !important;
        margin-bottom: 1rem !important;
    }
    
    .cta-section p {
        font-size: 1rem !important;
        margin-bottom: 1.5rem !important;
    }
}

/* Extra large screens - even more compact */
@media (min-width: 1400px) {
    .py-5 {
        padding: 2.5rem 0 !important;
    }
    
    .py-4 {
        padding: 2rem 0 !important;
    }
    
    /* Further reduce spacing for large screens */
    .mb-5 {
        margin-bottom: 2rem !important;
    }
    
    .mb-4 {
        margin-bottom: 1.5rem !important;
    }
    
    /* More compact cards on large screens */
    .service-card {
        min-height: 220px !important;
        max-height: 220px !important;
    }
    
    .feature-card {
        min-height: 180px !important;
        max-height: 180px !important;
    }
}

/* Services page specific optimizations */
@media (min-width: 1024px) {
    /* Core services section - 2x2 grid optimization */
    #core-services {
        padding: 2.5rem 0 !important;
    }
    
    #core-services .service-card {
        min-height: 280px !important;
        max-height: 280px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
    }
    
    /* Industries section - better desktop layout */
    .industry-focus-section {
        padding: 2.5rem 0 !important;
    }
    
    .industry-focus-section .container {
        max-width: 1400px !important;
    }
    
    /* Create a compact 8-column grid for industries */
    .industry-focus-section .row {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 1.2rem !important;
        justify-content: center !important;
    }
    
    .industry-card {
        min-height: 140px !important;
        max-height: 140px !important;
        padding: 1.2rem !important;
        background: white !important;
        border-radius: 12px !important;
        box-shadow: 0 3px 12px rgba(0,0,0,0.08) !important;
        border: 1px solid #e9ecef !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        transition: all 0.3s ease !important;
        position: relative !important;
        overflow: hidden !important;
    }
    
    .industry-card:hover {
        transform: translateY(-3px) !important;
        box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
        border-color: #1fa1dc !important;
    }
    
    .industry-card-icon {
        width: 50px !important;
        height: 50px !important;
        background: linear-gradient(135deg, #1fa1dc, #1790c4) !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin-bottom: 0.8rem !important;
        box-shadow: 0 4px 12px rgba(31, 161, 220, 0.3) !important;
    }
    
    .industry-card-icon i {
        font-size: 1.4rem !important;
        color: white !important;
    }
    
    .industry-card h5 {
        font-size: 0.95rem !important;
        font-weight: 600 !important;
        margin-bottom: 0.5rem !important;
        color: #353535 !important;
        line-height: 1.2 !important;
    }
    
    .industry-card p {
        font-size: 0.75rem !important;
        line-height: 1.3 !important;
        color: #6c757d !important;
        margin-bottom: 0 !important;
        text-align: center !important;
    }
    
    /* Add subtle accent for visual interest */
    .industry-card::before {
        content: '' !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 3px !important;
        background: linear-gradient(90deg, #1fa1dc, #e32949) !important;
        opacity: 0 !important;
        transition: opacity 0.3s ease !important;
    }
    
    .industry-card:hover::before {
        opacity: 1 !important;
    }
}

/* Alternative approach - larger cards for extra-large screens */
@media (min-width: 1400px) {
    .industry-focus-section .row {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        grid-template-rows: repeat(4, 1fr) !important;
        gap: 1.5rem !important;
        max-width: 800px !important;
        margin: 0 auto !important;
    }
    
    .industry-card {
        min-height: 100px !important;
        max-height: 100px !important;
        padding: 1rem 1.5rem !important;
        flex-direction: row !important;
        text-align: left !important;
        align-items: center !important;
        justify-content: flex-start !important;
    }
    
    .industry-card-icon {
        margin-bottom: 0 !important;
        margin-right: 1rem !important;
        width: 45px !important;
        height: 45px !important;
        flex-shrink: 0 !important;
    }
    
    .industry-card-content {
        flex: 1 !important;
    }
    
    .industry-card h5 {
        font-size: 1rem !important;
        margin-bottom: 0.3rem !important;
    }
    
    .industry-card p {
        font-size: 0.8rem !important;
        line-height: 1.3 !important;
    }
    
    /* Timeline/Process section optimization - wide desktop layout */
    .timeline {
        position: relative !important;
        max-width: 1200px !important;
        margin: 0 auto !important;
        padding: 0 !important;
    }
    
    .timeline::before {
        content: '' !important;
        position: absolute !important;
        left: 50% !important;
        top: 0 !important;
        bottom: 0 !important;
        width: 4px !important;
        background: linear-gradient(180deg, #1fa1dc, #e32949) !important;
        transform: translateX(-50%) !important;
    }
    
    .timeline-item {
        position: relative !important;
        margin-bottom: 2.5rem !important;
        width: 42% !important;
        background: white !important;
        border-radius: 15px !important;
        padding: 2rem !important;
        box-shadow: 0 6px 20px rgba(0,0,0,0.1) !important;
        min-height: 160px !important;
        max-height: 160px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        transition: all 0.3s ease !important;
    }
    
    .timeline-item:hover {
        transform: translateY(-3px) !important;
        box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
    }
    
    .timeline-item:nth-child(odd) {
        left: 0 !important;
        text-align: right !important;
        margin-right: 8% !important;
    }
    
    .timeline-item:nth-child(even) {
        left: 58% !important;
        text-align: left !important;
        margin-left: 8% !important;
    }
    
    .timeline-content h3 {
        font-size: 1.2rem !important;
        margin-bottom: 0.8rem !important;
        color: #353535 !important;
        font-weight: 600 !important;
    }
    
    .timeline-content p {
        font-size: 0.9rem !important;
        line-height: 1.4 !important;
        margin-bottom: 0 !important;
        color: #6c757d !important;
    }
    
    .timeline-icon {
        position: absolute !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 55px !important;
        height: 55px !important;
        background: white !important;
        border: 4px solid #1fa1dc !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 1.3rem !important;
        color: #1fa1dc !important;
        z-index: 10 !important;
        box-shadow: 0 6px 18px rgba(0,0,0,0.15) !important;
    }
    
    .timeline-item:nth-child(odd) .timeline-icon {
        right: -85px !important;
        left: auto !important;
    }
    
    .timeline-item:nth-child(even) .timeline-icon {
        left: -85px !important;
    }
    
    /* Optimized timeline section padding for desktop */
    .py-5.bg-light {
        padding: 3rem 0 !important;
    }
    
    .timeline-item:last-child {
        margin-bottom: 0 !important;
    }
    
    /* Ensure timeline utilizes full desktop width */
    .timeline {
        max-height: none !important;
        overflow: visible !important;
    }
    
    /* Better spacing for the timeline section */
    .section-our-process {
        padding: 3rem 0 !important;
    }
    
    /* Contact page desktop optimizations */
    .contact-details .row.g-3 {
        gap: 0.8rem !important;
    }
    
    .contact-card {
        transition: all 0.3s ease !important;
    }
    
    .contact-card:hover {
        transform: translateY(-2px) !important;
        box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
    }
    
    .map-wrapper iframe {
        max-height: 350px !important;
    }
    
    /* Contact section compact spacing */
    .contact-details h2 {
        margin-bottom: 0.8rem !important;
    }
    
    .contact-details .mb-3 {
        margin-bottom: 1rem !important;
    }
    
    /* Our approach section - make agile cycle more compact */
    .approach-section {
        padding: 2.5rem 0 !important;
    }
    
    .approach-section .container {
        max-width: 1000px !important;
    }
    
    .approach-section .row {
        align-items: center !important;
        min-height: 500px !important;
    }
    
    .approach-section .col-lg-7 {
        padding-right: 3rem !important;
    }
    
    .approach-section .col-lg-5 {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }
}

/* About Us page optimizations */
@media (min-width: 1024px) {
    /* Philosophy section - 3 cards on left, photo on right */
    .philosophy-section {
        padding: 2.5rem 0 !important;
    }
    
    .philosophy-cards {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
    }
    
    .philosophy-card {
        padding: 1rem !important;
        margin-bottom: 0 !important;
    }
    
    .philosophy-card h6 {
        font-size: 0.9rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .philosophy-card p {
        font-size: 0.75rem !important;
        line-height: 1.3 !important;
        margin-bottom: 0 !important;
    }
    
    /* Team photo optimization */
    .team-photo-section {
        display: flex !important;
        align-items: center !important;
        padding: 1rem !important;
    }
    
    .team-photo img {
        max-height: 300px !important;
        object-fit: cover !important;
        border-radius: 15px !important;
    }
    
    /* Two-column layout for about sections */
    .about-two-column {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 3rem !important;
        align-items: center !important;
    }
}

/* Homepage optimizations */
@media (min-width: 1024px) {
    /* SME Trust section - enhanced visual harmony */
    .sme-trust-section {
        padding: 2.5rem 0 !important;
    }
    
    .sme-trust-section .row.g-4 {
        gap: 1.5rem !important;
    }
    
    .sme-trust-section .feature-card {
        min-height: 180px !important;
        max-height: 180px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
    }
    
    /* Bottom value cards - better positioning and consistency */
    .additional-values {
        margin-top: 2rem !important;
    }
    
    .additional-values .row {
        justify-content: center !important;
        max-width: 600px !important;
        margin: 0 auto !important;
    }
    
    .value-highlight {
        min-height: 80px !important;
        max-height: 80px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        padding: 1.2rem !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
        border: 1px solid #e9ecef !important;
        background: white !important;
        border-left: 4px solid #1fa1dc !important;
    }
    
    .value-highlight i {
        font-size: 1.2rem !important;
        margin-right: 0.8rem !important;
        color: #1fa1dc !important;
        flex-shrink: 0 !important;
    }
    
    .value-highlight span {
        font-size: 0.85rem !important;
        font-weight: 500 !important;
        line-height: 1.3 !important;
        color: #353535 !important;
    }
    
    /* Better spacing for the Learn More button */
    .additional-values + .mt-4 {
        margin-top: 2rem !important;
    }
    
    /* Consistent typography hierarchy for SME Trust section */
    .sme-trust-section h4 {
        font-size: 1.1rem !important;
        font-weight: 600 !important;
        margin-bottom: 0.8rem !important;
        color: #353535 !important;
    }
    
    .sme-trust-section p {
        font-size: 0.85rem !important;
        line-height: 1.4 !important;
        color: #6c757d !important;
        margin-bottom: 0 !important;
    }
    
    .sme-trust-section .fa-3x {
        font-size: 2.2rem !important;
        margin-bottom: 1rem !important;
    }
    
    /* Ensure all feature cards have the same visual weight */
    .feature-card {
        transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    }
    
    .feature-card:hover {
        transform: translateY(-2px) !important;
        box-shadow: 0 8px 25px rgba(0,0,0,0.12) !important;
    }
    
    /* Better grid layout for main 3 cards */
    .sme-trust-section .row:first-child {
        justify-content: center !important;
        max-width: 1000px !important;
        margin: 0 auto !important;
    }
    
    .sme-trust-section .col-lg-4 {
        max-width: 320px !important;
        flex: 0 0 auto !important;
    }
    
    /* Ensure proper spacing between all elements */
    .sme-trust-section .container {
        max-width: 1200px !important;
    }
    
    /* Perfect center alignment for bottom value cards */
    .additional-values .col-md-5 {
        max-width: 280px !important;
        flex: 0 0 auto !important;
    }
    
    /* Services section on homepage - 2x2 grid */
    .services-section {
        padding: 2.5rem 0 !important;
    }
    
    .services-section .service-card {
        min-height: 200px !important;
        max-height: 200px !important;
    }
    
    /* Technology stack section - more compact grid */
    .tech-stack-section {
        padding: 2rem 0 !important;
    }
    
    .tech-stack-section .tech-item {
        padding: 1rem !important;
        min-height: 120px !important;
        max-height: 120px !important;
    }
}

/* Contact page optimizations */
@media (min-width: 1024px) {
    /* Contact cards side by side with map */
    .contact-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 2rem !important;
        align-items: start !important;
    }
    
    .contact-cards {
        display: flex !important;
        flex-direction: column !important;
        gap: 1.5rem !important;
    }
    
    .contact-card {
        padding: 1.2rem !important;
        min-height: 150px !important;
        max-height: 150px !important;
    }
    
    .contact-map {
        height: 350px !important;
        border-radius: 15px !important;
    }
}

/* General section spacing optimization for all pages */
@media (min-width: 1024px) {
    /* Make sections fit better on one screen */
    .section-spacing-optimized {
        padding: 2rem 0 !important;
    }
    
    /* Compact footer */
    footer {
        padding: 2rem 0 !important;
    }
    
    footer .row {
        margin-bottom: 1rem !important;
    }
    
    footer h6 {
        font-size: 0.95rem !important;
        margin-bottom: 0.8rem !important;
    }
    
    footer p, footer a {
        font-size: 0.8rem !important;
        line-height: 1.4 !important;
    }
    
    /* Navbar height optimization */
    .navbar {
        min-height: 70px !important;
        padding: 0.5rem 0 !important;
    }
    
    .navbar-brand img {
        max-height: 50px !important;
    }
}