/* Additional responsive design improvements */

/* Ensure proper spacing on mobile devices */
@media (max-width: 576px) {
  .hero-section {
    padding: 60px 0;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .section-title {
    font-size: 1.8rem;
  }
  
  .py-5 {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
  }
  
  .card {
    margin-bottom: 1.5rem;
  }
}

/* Tablet improvements */
@media (min-width: 577px) and (max-width: 991px) {
  .hero-section {
    padding: 80px 0;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
}

/* Improve navigation on small screens */
@media (max-width: 991px) {
  .navbar-collapse {
    max-height: 58vh;
    overflow-y: auto;
  }
  
  .dropdown-menu {
    border: none;
    padding-left: 1.5rem;
    background-color: transparent;
  }
}

/* Improve form elements on mobile */
@media (max-width: 767px) {
  .form-control, .form-select, .btn {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 0.5rem 0.75rem;
  }
  
  textarea.form-control {
    min-height: 100px;
  }
}

/* Improve touch targets for mobile */
@media (max-width: 767px) {
  .nav-link, .dropdown-item, .btn, .social-icon {
    padding: 0.75rem 1rem;
  }
  
  .social-icon {
    margin: 0 0.5rem;
  }
}

/* Ensure images are responsive */
.img-fluid {
  max-width: 100%;
  height: auto;
}

/* Improve card layouts on different screen sizes */
.card {
  height: 100%;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
}

/* Improve accessibility */
:focus {
  outline: 3px solid rgba(0, 123, 255, 0.5);
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .hero-section, .navbar, .footer, .cta-section {
    display: none;
  }
  
  .container {
    width: 100%;
    max-width: 100%;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.5;
  }
  
  a[href]:after {
    content: " (" attr(href) ")";
  }
}
/* Extra Large Devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .hero-content {
        margin-top: 100px;
    }

    .hero-title {
        font-size: 3.5rem;
    }

    .hero-subtitle {
        font-size: 1.5rem;
    }
}

/* Large Devices (desktops, 992px to 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .hero-section {
        height: 550px;
    }

    .hero-content {
        margin-top: 80px;
        margin-left: 0;
    }

    .hero-title {
        font-size: 3rem;
    }

    .section-title {
        font-size: 2.2rem;
    }

    .service-card {
        min-height: 420px;
    }
}

/* Medium Devices (tablets, 768px to 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .hero-section {
        height: 500px;
        text-align: center;
    }

    .hero-content {
        margin-top: 60px;
        margin-left: 0;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .service-card {
        min-height: 400px;
        margin-bottom: 15px;
    }

    .section-title {
        font-size: 2rem;
    }

    .testimonial-card {
        margin-bottom: 20px;
    }

    .client-card {
        margin-bottom: 20px;
    }

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

/* Small Devices (landscape phones, 576px to 767px) */
@media (min-width: 576px) and (max-width: 767px) {
    .hero-section {
        height: 450px;
        text-align: center;
    }

    .hero-content {
        margin-top: 50px;
        margin-left: 0;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .btn {
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

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

    .service-card {
        margin-bottom: 15px;
    }

    .testimonial-card {
        margin-bottom: 20px;
    }

    .client-card {
        margin-bottom: 20px;
    }

    .container.py-4 {
        margin-top: -30px !important;
    }
}

/* Extra Small Devices (portrait phones, less than 576px) */
@media (max-width: 575px) {
    .hero-section {
        height: 400px;
        text-align: center;
        background-position: center;
    }

    .hero-content {
        margin-top: 40px;
        margin-left: 0;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .lead {
        font-size: 1rem;
    }

    .btn {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }

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

    .testimonial-card,
    .service-card,
    .client-card {
        margin-bottom: 15px;
    }

    .container.py-4 {
        margin-top: -20px !important;
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }

    .d-flex.flex-wrap.gap-3 {
        justify-content: center;
    }

    /* Adjust service cards spacing */
    .service-card .card-body {
        padding: 1rem;
        margin-bottom: 0rem !important;
    }

    /* Make images responsive */
    .img-fluid {
        max-width: 100%;
        height: auto;
    }

    /* Fix negative margins for mobile */
    section[style*="margin-top: -110px"] {
        margin-top: -50px !important;
    }

    section[style*="margin-top: -60px"] .container {
        margin-top: -30px !important;
    }

    /* Testimonials section adjustments */
    .testimonial-text {
        font-size: 0.9rem;
    }

    .project-badge {
        margin-left: 15px !important;
    }

    /* Client section adjustments */
    .client-img {
        max-width: 80%;
        margin: 0 auto;
        display: block;
    }

    .client-name {
        font-size: 1.2rem;
        text-align: center;
    }
}

/* Fix for specific elements and adjustments */
@media (max-width: 767px) {
    /* Fix the about section image on mobile */
    .about-section .img-fluid {
        margin-bottom: 20px;
    }

    /* Make icons responsive */
    .icon-box .fas {
        font-size: 1.5rem;
    }

    /* Card adjustments */
    .card {
        margin-bottom: 20px;
    }

    /* Fix the "Why Choose Us" section on mobile */
    .why-choose-us-section .img-fluid {
        margin-top: 20px;
    }

    /* Fix the navigation and spacing on mobile */
    .col-lg-6,
    .col-lg-4,
    .col-md-6 {
        margin-bottom: 15px;
    }
}

/* Fix for specific issues with spacing and alignment */
@media (max-width: 991px) {
    /* Fix the margins in service section */
    .container[style*="margin-top: -60px"] {
        margin-top: -30px !important;
    }

    /* Fix the call to action section */
    .container[style*="margin-top: -110px"] {
        margin-top: -50px !important;
    }

    /* Fix the client section */
    .clients-section {
        margin-top: 20px;
    }

    .client-title {
        margin-top: 0;
    }
}
/* Large Devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .navbar-brand img {
        height: 60px;
    }

    .navbar-brand span {
        font-size: 1.4rem;
        margin-left: 10px;
    }

    .navbar .nav-link {
        padding: 0.5rem 1rem;
    }

    .btn-quote {
        padding: 0.5rem 1.25rem;
    }

    .topnav a {
        font-size: 0.9rem;
    }
}

/* Medium Devices (tablets, 768px to 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    header {
        position: relative; /* Change to relative on tablets for better layout */
    }

    .navbar-brand img {
        height: 50px;
    }

    .navbar-brand span {
        font-size: 1.2rem;
        margin-left: 8px;
    }

    .topnav {
        display: flex;
        justify-content: center;
    }

        .topnav a.active {
            margin-left: 0 !important;
        }

        .topnav a.ma_0 i {
            margin-left: 20% !important;
        }

    .navbar-nav {
        margin-top: 10px;
    }

    .btn-quote {
        margin-top: 10px;
        margin-left: 0 !important;
        display: inline-block;
    }

    .navbar .container {
        padding: 0.5rem;
    }
}

/* Small Devices (landscape phones, 576px to 767px) */
@media (min-width: 576px) and (max-width: 767px) {
    header {
        position: relative;
    }

    .topnav {
        display: flex;
        flex-direction: column;
        text-align: center;
        padding: 5px 0;
    }

        .topnav a {
            display: block;
            margin: 5px auto;
        }

            .topnav a.active {
                margin-left: 0 !important;
            }

            .topnav a.ma_0 i {
                margin-left: 0 !important;
            }

    .navbar-brand {
        margin-right: auto;
    }

        .navbar-brand img {
            height: 40px;
        }

        .navbar-brand span {
            font-size: 1rem;
            margin-left: 5px;
        }

    .navbar-toggler {
        margin-right: 10px;
    }

    .navbar-collapse {
        margin-right: 0 !important;
    }

    .navbar-nav {
        text-align: center;
    }

    .dropdown-menu {
        margin: 0 auto;
        text-align: center;
    }

    .btn-quote {
        display: block;
        margin: 10px auto !important;
        text-align: center;
        width: 80%;
    }
}

/* Extra Small Devices (portrait phones, less than 576px) */
@media (max-width: 575px) {
    header {
        position: relative;
    }

    .topnav {
        display: flex;
        flex-direction: column;
        text-align: center;
        padding: 5px 0;
    }

        .topnav a {
            display: block;
            margin: 5px auto;
            font-size: 0.8rem;
        }

            .topnav a.active {
                margin-left: 0 !important;
            }

            .topnav a.ma_0 {
                margin-left: 0 !important;
            }

                .topnav a.ma_0 i {
                    margin-left: 0 !important;
                }

    .navbar {
        padding: 0.5rem 0;
    }

        .navbar .container {
            padding: 0 10px;
        }

    .navbar-brand {
        display: flex;
        align-items: center;
        width: 75%;
    }

        .navbar-brand img {
            height: 35px;
        }

        .navbar-brand span {
            font-size: 0.9rem;
            margin-left: 5px;
            white-space: normal;
        }

    .navbar-toggler {
        padding: 0.25rem 0.5rem;
        font-size: 0.9rem;
        background: white;
    }

    .navbar-nav {
        text-align: center;
        margin-top: 10px;
        background-color: #3d2a55
    }

    .nav-item {
        padding: 5px 0;
        color: #382461;
    }

    .dropdown-menu {
        border: none;
        background-color: rgb(61 42 85);
        text-align: center;
    }

    .dropdown-item {
        padding: 0.5rem;
    }

    .navbar-collapse {
        margin-right: 0 !important;
    }

    .btn-quote {
        display: block;
        margin: 10px auto !important;
        width: 100%;
        font-size: 0.9rem;
        padding: 0.4rem 0.75rem;
    }
}

/* Fix for dropdown menus on mobile */
@media (max-width: 991px) {
    .dropdown-menu {
        position: static !important;
        float: none;
        width: auto;
        margin-top: 0;
        background-color: transparent;
        border: 0;
        box-shadow: none;
    }

    .dropdown-item {
        text-align: center;
        padding: 0.5rem 1rem;
    }

        .dropdown-item:hover {
            background-color: rgba(0,0,0,0.05);
        }
}

/* Specific fixes for navigation elements */
@media (max-width: 767px) {
    .navbar-nav .nav-link {
        padding: 0.75rem 0;
    }

    .navbar-collapse {
        padding: 1rem 0;
    }
}

/* Fix for sticky header on small screens */
@media (max-width: 767px) {
    header[style*="position:sticky"] {
        position: relative !important;
    }
}
