/* Extra small devices (phones, less than 576px) */
@media (max-width: 575.98px) {
    .hero-section {
        padding: 100px 0 40px;
        text-align: center;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .hero-section .lead {
        font-size: 1.1rem;
    }

    .service-card {
        margin-bottom: 1.5rem;
    }

    .stat-card {
        margin-bottom: 1rem;
    }

    .stat-card h3 {
        font-size: 2rem;
    }

    .footer {
        text-align: center;
    }

    .social-links {
        margin-top: 1rem;
    }
}

/* Small devices (tablets, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .hero-section {
        padding: 110px 0 50px;
    }

    .hero-section h1 {
        font-size: 2.25rem;
    }

    .service-card {
        margin-bottom: 1.5rem;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .hero-section {
        padding: 120px 0 60px;
    }

    .hero-section h1 {
        font-size: 2.5rem;
    }

    .service-card {
        margin-bottom: 2rem;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .hero-section {
        min-height: 100vh;
        display: flex;
        align-items: center;
    }

    .navbar-expand-lg .navbar-nav .nav-link {
        padding-right: 1.5rem !important;
        padding-left: 1.5rem !important;
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }

    .hero-section h1 {
        font-size: 3.5rem;
    }
}

/* Custom media queries for specific components */

/* Navigation responsiveness */
@media (max-width: 991.98px) {
    .navbar {
        padding: 0.5rem 0;
    }

    .navbar-collapse {
        background: var(--white);
        padding: 1rem;
        border-radius: 8px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        margin-top: 1rem;
    }

    .nav-link {
        padding: 0.75rem 1rem !important;
    }
}

/* Service cards grid responsiveness */
@media (max-width: 767.98px) {
    .services-section .row {
        margin-right: -10px;
        margin-left: -10px;
    }

    .services-section [class*="col-"] {
        padding-right: 10px;
        padding-left: 10px;
    }
}

/* Statistics section responsiveness */
@media (max-width: 767.98px) {
    .stats-section .row > div {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* Footer responsiveness */
@media (max-width: 767.98px) {
    .footer .col-md-4 {
        margin-bottom: 2rem;
    }

    .footer .social-links {
        justify-content: center;
        margin-top: 1rem;
    }
}

/* Form responsiveness */
@media (max-width: 575.98px) {
    .form-control {
        font-size: 0.9rem;
    }

    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* Responsive fixes for navbar */
@media (max-width: 576px) {
  .navbar-brand img {
    height: 32px !important;
  }
  .navbar .brand-text {
    font-size: 0.9rem !important;
  }
  .navbar .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .navbar-collapse {
    width: 100%;
    background: #fff;
    z-index: 999;
  }
  .brand-title {
    font-size: 0.95rem;
  }
  .brand-subtitle {
    font-size: 0.75rem;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .navbar .brand-text {
    font-size: 1.05rem;
  }
}

@media (max-width: 375px) {
  .navbar .brand-text {
    font-size: 0.85rem !important;
  }
  .navbar .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

.navbar-toggler {
  z-index: 1001 !important;
}

@media (min-width: 576px) and (max-width: 1024px) {
  .navbar-collapse {
    max-width: 400px;
    margin: 0 auto;
  }
  .navbar-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
  }
  .navbar-nav .nav-link {
    text-align: center;
    width: 100%;
  }
}

/* About page tablet responsiveness (768px to 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    /* Who We Are section */
    .about-container {
        flex-direction: column;
        gap: 2rem;
    }

    .about-text {
        text-align: center;
        padding: 0 1rem;
    }

    .about-text h2 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }

    .about-text p {
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: 1.5rem;
    }

    .about-image {
        margin-top: 1rem;
    }

    .about-image img {
        max-width: 100%;
        height: auto;
    }

    /* Core Values section */
    .core-values .row {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .core-values .col-md-3 {
        width: 100%;
        padding: 0;
    }

    .value-card {
        height: 100%;
        padding: 2rem !important;
    }

    .value-card h3 {
        font-size: 1.25rem;
        margin: 1rem 0;
    }

    .value-card p {
        font-size: 0.95rem;
        line-height: 1.5;
    }

    .value-card i {
        font-size: 2.5rem !important;
    }

    /* Team Preview section */
    .team-preview > .container > .row.align-items-center {
        flex-direction: column;
        gap: 2rem;
    }

    .team-preview .col-lg-6:first-child {
        text-align: center;
        padding: 0 1rem;
    }

    .team-preview h2 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }

    .team-preview .lead {
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: 2rem;
    }

    .team-preview .btn-primary {
        padding: 0.75rem 2rem;
    }

    .team-preview .col-lg-6:last-child {
        padding: 0 1rem;
    }

    .team-preview .col-lg-6 .row.g-4 {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1rem;
        justify-content: center;
        margin: 0;
    }

    .team-preview .col-6 {
        padding: 0.5rem;
        flex: 0 0 calc(50% - 1rem);
        max-width: calc(50% - 1rem);
    }

    .team-preview img {
        width: 100%;
        height: auto;
        object-fit: cover;
    }
}

/* Team page specific responsive styles */
@media (max-width: 767.98px) {
    .team-members .container {
        padding-left: 10px;
        padding-right: 10px;
    }

    .team-members .row {
        flex-direction: column;
        align-items: center;
    }

    .team-members .col-md-5 {
        width: 100%;
        max-width: 90%;
        margin-bottom: 2rem;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .team-members .row {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 2rem;
    }

    .team-members .col-md-5 {
        flex: 0 0 45%;
        max-width: 45%;
        text-align: center;
    }
}

/* Scoped fix for padding in team.html */
@media (max-width: 1024px) {
    .team-members .container {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .team-members .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .team-members .col-md-5 {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .team-members img {
        display: block;
        margin: 0 auto;
        max-width: 100%;
        height: auto;
    }
}

/* Contact form section responsive styles */
@media (max-width: 1024px) {
    .contact-form-section .contact-form {
        margin-bottom: 2rem;
    }

    .contact-form-section .map-container {
        height: 400px;
        border-radius: 10px;
        overflow: hidden;
    }

    .contact-form-section .map-container iframe {
        min-height: 400px;
        border-radius: 10px;
    }
}

@media (max-width: 768px) {
    .contact-form-section .contact-form {
        margin-bottom: 1.5rem;
        padding: 1.5rem !important;
    }

    .contact-form-section .map-container {
        height: 300px;
    }

    .contact-form-section .map-container iframe {
        min-height: 300px;
    }

    .contact-form-section h2 {
        font-size: 1.75rem;
        margin-bottom: 1.5rem;
    }
}
