@media screen and (min-width: 768px) and (max-width: 1010px) {
    /* Home section */
    .home {
        flex-direction: column;
        text-align: center;
        margin: 0 2rem;
        gap: 2rem;
        padding-top: 5rem;
    }

    .title {
        order: 1;
    }

    .title-img {
        order: 2;
    }

    .title h1 {
        font-size: clamp(3.5rem, 8vw, 4.5rem);
    }

    .title-img img {
        width: 100%;
        max-width: 25rem;
    }

    /* Features section */
    .features {
        flex-direction: column;
        padding: 2rem 1rem;
        gap: 1rem;
    }

    .features-img {
        width: 100%;
        max-width: 15rem;
    }

    .features-list {
        margin-top: 1rem;
    }
    /* Rider section */
    .rider {
        padding: 2rem;
    }

    .rider-content h2 {
        font-size: clamp(1.8rem, 3vw, 2.5rem);
        letter-spacing: 8px;
    }

    .rider-content p {
        font-size: clamp(1rem, 1.5vw, 1.2rem);
    }

    .card img {
        width: 100%;
        max-width: 12rem;
    }

    /* Carousel controls */
    .carousel-control-prev,
    .carousel-control-next {
        width: 5vh;
        height: 5vh;
    }

    /* Leaderboard section */
    .leaderboard {
        flex-direction: column;
        gap: 3rem;
        text-align: center;
    }

    /* Community section */
    .community-content-video .col-md-4 {
        margin-bottom: 1.5rem;
    }

    /* Make carousel captions visible on tablets */
    .carousel-caption {
        display: block !important;
        background-color: rgba(0, 0, 0, 0.5);
        border-radius: 10px;
        padding: 10px;
    }
}


@media screen and (min-width: 320px) and (max-width: 768px) {
    /* Home section */
    .home {
        min-height: 100vh;
        justify-content: center;
        display: flex;
        flex-direction: column;
        margin: 0 1rem;
        text-align: center;
        padding-top: 4rem;
        gap: 2rem;
    }

    .title {
        order: 1;
    }

    .title-img {
        order: 2;
    }

    .title h1 {
        font-size: clamp(2.5rem, 10vw, 3rem);
    }

    .title p {
        font-size: clamp(0.9rem, 4vw, 1rem);
    }

    .title-img img {
        width: 100%;
        max-width: 20rem;
    }

    /* Features section */
    .features {
        flex-direction: column;
        padding: 2rem 1rem;
        gap: 1rem;
    }

    .features h2 {
        font-size: clamp(1.8rem, 6vw, 2.3rem);
    }

    .features-img {
        width: 100%;
        max-width: 15rem;
    }

    .features-list {
        margin-top: 1rem;
        list-style: none;
        font-size: clamp(0.9rem, 4vw, 1rem);
    }
    /* Rider section */
    .rider {
        min-height: auto;
        padding: 3rem 0;
    }

    .rider-content h2 {
        text-wrap: nowrap;
        color: var(--text-color);
        letter-spacing: 5px;
        font-size: clamp(1.2rem, 6vw, 2rem);
        margin-bottom: 10px;
        white-space: normal;
    }

    .rider-content p {
        color: var(--sec-text-color);
        letter-spacing: 1px;
        font-size: clamp(0.9rem, 3vw, 1rem);
        margin-bottom: 0;
        padding: 0 1rem;
    }

    /* Card carousel */
    .card-carousel {
        padding: 0 0.5rem;
    }

    .card {
        margin-bottom: 1rem;
    }

    .card img {
        width: 100%;
        max-width: 10rem;
    }

    .carousel-inner {
        padding: 0.5em;
    }

    .carousel-control-prev,
    .carousel-control-next {
        width: 4vh;
        height: 4vh;
        background-color: rgba(225, 225, 225, 0.8);
    }

    /* Leaderboard section */
    .leaderboard {
        justify-content: center;
        display: flex;
        flex-direction: column;
        text-align: center;
        gap: 2rem;
        padding: 2rem 0;
    }

    .leaderboard h2 {
        font-size: clamp(1.8rem, 6vw, 2.3rem);
    }

    .leaderboard-container {
        width: 90%;
        box-shadow: 0 8px 32px 0 rgba(255, 255, 255, 0.6), 0 0 0 4px rgba(232, 232, 232, 0.15);
        margin: 0 auto;
        padding: 1rem;
    }

    .leaderboard-item h3,.leaderboard-item h4, .leaderboard-item h5 {
        font-size: clamp(1rem, 5vw, 1.5rem);
    }

    /* Community section */
    .community {
        padding: 2rem 0;
    }

    .community-content h2 {
        font-size: clamp(1.8rem, 6vw, 2.3rem);
    }

    .community-content p {
        font-size: clamp(0.9rem, 4vw, 1rem);
        padding: 0 1rem;
    }

    .community-content-carousel img {
        border-radius: 20px;
    }

    /* Make carousel captions visible on mobile */
    .carousel-caption {
        display: block !important;
        background-color: rgba(0, 0, 0, 0.7);
        border-radius: 10px;
        padding: 8px;
        bottom: 10px;
    }

    .carousel-caption h5 {
        font-size: 0.9rem;
        margin-bottom: 0.2rem;
    }

    .carousel-caption p {
        font-size: 0.8rem;
        margin-bottom: 0;
    }

    /* Video section */
    .community-content-video .col-md-4 {
        margin-bottom: 1.5rem;
    }

    /* About us section */
    .about-us {
        padding: 2rem 1rem;
    }

    .about-us-content h2 {
        font-size: clamp(1.8rem, 6vw, 2.3rem);
    }

    .about-us-content p {
        font-size: clamp(0.9rem, 4vw, 1rem);
        text-align: left !important;
    }

    /* Footer */
    .footer-content {
        text-align: center;
    }

    .footer-content div {
        margin-bottom: 1.5rem;
    }
}

/* Additional media query for very small screens */
@media screen and (max-width: 480px) {
    .navbar-brand {
        margin-right: 0;
    }

    #logo {
        width: 2rem;
    }

    .title h1 {
        font-size: clamp(2rem, 8vw, 1rem);
    }
    .title p{
        font-size: clamp(0.5rem, 5vw, 1rem);
    }

    .leaderboard h2, .community-content h2, .about-us-content h2 {
        font-size: clamp(1rem, 5vw, 2.5rem);
        letter-spacing: 5px;
    }
}

/* Media query for large screens (1280px to 2400px) */
@media screen and (min-width: 1400px) and (max-width: 2400px) {
    /* Container max-width to prevent excessive stretching */
    .container, .container-fluid {
        max-width: 1800px;
        margin: 0 auto;
    }

    /* Home section */
    .home {
        max-width: 1800px;
        margin: 0 auto;
        padding: 0 5rem;
        gap: 3rem;
    }

    .title h1 {
        font-size: clamp(5rem, 5vw, 7rem);
    }

    .title p {
        font-size: clamp(1rem, 1.5vw, 1.5rem);
        margin-bottom: 3rem;
    }

    .title-img img {
        width: clamp(30rem, 40vw, 50rem);
    }

    /* Features section */
    .features {
        max-width: 1800px;
        margin: 0 auto;
        padding: 0 5rem;
        gap: 5rem;
    }

    .features h2 {
        font-size: clamp(2.3rem, 3vw, 4rem);
    }

    .features-img {
        width: clamp(20rem, 25vw, 35rem);
    }

    .features-list {
        font-size: clamp(1rem, 1.2vw, 1.5rem);
    }
    /* Rider/Track section */
    .rider {
        padding: 5rem 3rem;
        max-width: 1800px;
        margin: 0 auto;
    }

    .rider-content h2 {
        font-size: clamp(2.5rem, 3vw, 4rem);
        letter-spacing: 15px;
        margin-bottom: 1.5rem;
    }

    .rider-content p {
        font-size: clamp(1.2rem, 1.5vw, 2rem);
        margin-bottom: 2rem;
    }

    /* Card carousel */
    .card-carousel {
        padding: 0 2rem;
    }

    .card img {
        width: 100%;
        max-width: 25rem;
        transition: transform 0.3s ease;
    }

    .card img:hover {
        transform: scale(1.05);
    }

    .carousel-inner {
        padding: 2em;
    }

    /* Carousel controls */
    .carousel-control-prev,
    .carousel-control-next {
        width: 8vh;
        height: 8vh;
    }
    /* Leaderboard section */
    .leaderboard {
        max-width: 1800px;
        margin: 0 auto;
        padding: 0 5rem;
        gap: 8rem;
    }

    .leaderboard h2 {
        font-size: clamp(2.3rem, 3vw, 4rem);
    }

    .leaderboard-container {
        padding: 3rem;
    }

    .leaderboard-item h3 {
        font-size: clamp(1.5rem, 2vw, 2.5rem);
    }

    .leaderboard-item h4 {
        font-size: clamp(1.2rem, 1.5vw, 2rem);
    }

    .leaderboard-item h5 {
        font-size: clamp(1rem, 1.2vw, 1.5rem);
    }

    /* Community section */
    .community {
        max-width: 1800px;
        margin: 0 auto;
    }

    .community-content h2 {
        font-size: clamp(2.3rem, 3vw, 4rem);
    }

    .community-content p {
        font-size: clamp(1rem, 1.2vw, 1.5rem);
        max-width: 70%;
        margin: 0 auto 2rem;
    }

    /* About us section */
    .about-us {
        max-width: 1800px;
        margin: 0 auto;
    }

    .about-us-content h2 {
        font-size: clamp(2.3rem, 3vw, 4rem);
    }

    .about-us-content p {
        font-size: clamp(1rem, 1.2vw, 1.5rem);
        max-width: 70%;
        margin: 1.5rem auto;
    }

    /* Footer */
    .footer-content {
        max-width: 1800px;
        margin: 0 auto;
        padding: 3rem 0;
    }

    .footer-content h5 {
        font-size: clamp(1.2rem, 1.5vw, 2rem);
    }

    .footer-content p, .footer-content a {
        font-size: clamp(1rem, 1.2vw, 1.3rem);
    }
}
