@media (max-width: 1400px) {
    header {
        padding: 10px 3%;
        transition: .2s;
    }
    section {
        padding: 100px 3% 80px;
        transition: .2s;
    }
}

@media (max-width: 1400px) {
    header {
        padding: 10px 3%;
        transition: .2s;
    }
    section {
        padding: 100px 3% 80px;
        transition: .2s;
    }
    :root {
        --h1-font: 4.5rem;
        --h2-font: 2.5rem;
        --p-font: 1rem;
    }
}

@media (max-width: 1090px) {
    .logo img {
        max-width: 100px; /* Adjust logo size for medium screens */
    }
    .about {
        grid-template-columns: 1fr;
        gap: 4rem;
    }
    .about_img {
        text-align: center;
    }
    .about_img img {
        max-width: 450px;
        width: 100%;
        height: auto;
    }
    .about_text {
        text-align: center;
    }
    .contact {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    .left_contect {
        flex-wrap: wrap;
        justify-content: center;
    }
    .right_contact {
        text-align: center;
    }
}

@media (max-width: 800px) {
    .nav_menu {
        display: none; /* Hide the main navigation on mobile */
        flex-direction: column; /* Changed to column to stack items vertically */
        justify-content: flex-end; /* Justify content to the right */
        align-items: flex-end; /* Align items to the right */
        background-color: rgba(0, 0, 0, 0.7); /* Semi-transparent background */
        backdrop-filter: blur(10px); /* Blurry effect */
        border-radius: 25px; /* More rounded corners */
        position: absolute;
        top: 110%; /* Add more space from the top */
        right: 0;
        padding: 20px 0;
        margin-right: 10px; /* Add some margin from the right edge */
        max-height: 0; /* Initially hidden */
        overflow: hidden;
        transition: max-height 0.5s ease-in-out; /* Smooth transition */
    }
    .nav_menu.active {
        display: flex; /* Show the navigation when active */
        max-height: 500px; /* Show the navigation when active */
    }
    .nav_list {
        flex-grow: 0;
        flex-direction: column; /* Changed to column to stack items vertically */
        align-items: center; /* Center items horizontally */
    }
    .nav_list li {
        margin: 10px 15px; /* Add some horizontal margin for spacing */
    }
    .menu-icon {
        display: block !important;
        font-size: 2rem;
        cursor: pointer;
        color: var(--text-color);
        z-index: 1001;
    }
    .nav_menu.active .theme-toggle {
        margin: 10px auto; /* Center the button horizontally */
    }
    .banner {
        flex-direction: column;
        align-items: center; /* Center items horizontally when flex-direction is column */
        padding-top: 80px;
    }
    .banner_text {
        text-align: left;
        padding: 0 15px;
    }
    .banner_text h1 {
        font-size: 3.5rem;
    }
    header {
        padding: 10px 3%;
    }
    .banner_text h4 {
        font-size: 1.5rem;
    }
    .banner_image {
        margin-top: 70px;
    }
    .banner_image_img {
        max-width: 90%; /* Increased size for mobile */
        height: auto;
        margin: 30px auto; /* Added top and bottom margin */
    }
    .service_item {
        grid-template-columns: repeat(auto-fit, minmax(280px, auto));
    }
    .contact-info-content {
        flex-direction: column;
    }
    .contact-info-svg img {
        margin-top: 30px;
    }
    .skills {
        padding: 0 10px;
    }
}

@media (max-width: 500px) {
    :root {
        --h1-font: 3.5rem;
        --h2-font: 2rem;
    }
    .banner {
        flex-direction: column;
        align-items: center;
        padding-top: 50px;
    }
    .banner_text h3 {
        font-size: 18px;
    }
    .banner_text h4 {
        font-size: 1.2rem;
    }
    .btn {
        padding: 10px 25px;
        font-size: 0.9rem;
    }
    .banner_image_img {
        max-width: 90%;
    }
    .banner_image {
        margin: 10% 0;
    }
    .service_box {
        padding: 30px 20px;
    }
    .in i {
        font-size: 60px;
    }
    .end_section h3 {
        font-size: 22px;
    }
    .end_section p {
        font-size: 0.9rem;
    }
    .tech-cards-container {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
}