/* Tablet and smaller desktop adjustments */
@media screen and (max-width: 1000px) {
    p {
        font-size: .9rem;
        line-height: 1.8rem;
    }

    .grid-3 {
        gap: 1.5rem;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }

    .skills-right ul li {
        font-size: .9rem;
    }

    .main-container {
        max-width: 90%;
    }

    .hero-name {
        font-size: 3rem;
    }

    .section-title {
        font-size: 2.2rem;
    }

    /* Burger Menu */
    .burger {
        display: block;
        cursor: pointer;
        position: absolute;
        top: 2rem;
        right: 2rem;
        z-index: 1000;
    }

    .burger .line-1, .burger .line-2, .burger .line-3 {
        width: 25px;
        height: 3px;
        background-color: white;
        margin: 5px 0;
        transition: all 0.3s ease;
    }

    .toggle-burger .line-1 {
        transform: rotate(-45deg) translate(-5px, 7px);
    }

    .toggle-burger .line-2 {
        opacity: 0;
    }

    .toggle-burger .line-3 {
        transform: rotate(45deg) translate(-5px, -7px);
    }

    .nav {
        justify-content: space-between;
    }

    /* Navigation Sidebar */
    nav {
        position: fixed;
        width: 70%;
        right: 0;
        top: 0;
        height: 100vh;
        flex-direction: column;
        background: var(--thirdBackgroundColor);
        border-left: 1px solid var(--borderColor);
        z-index: 999;
        transform: translateX(100%);
        transition: .3s ease-in-out;
        padding: 6rem 2rem;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
    }



    nav ul {
        height: auto;
        align-items: flex-start;
        flex-direction: column;
        justify-content: flex-start;
        gap: 2rem;
        width: 100%;
    }

    nav ul li {
        width: 100%;
    }

    nav ul li a {
        width: 100%;
        padding: 1rem;
        border-radius: 8px;
        transition: all 0.3s ease;
    }

    nav ul li a:hover {
        background: var(--primaryIconColor);
        color: white;
    }

    .nav-active {
        transform: translateX(0);
    }
}

/* Mobile adjustments */
@media screen and (max-width: 825px) {
    /* Center hero-left content on mobile */
    .hero-left {
        text-align: center;
        margin: 0 auto;
    }

    /* Center the "Hello! I'm.." */
    .pre-title-hello {
        text-align: center;
        margin: 1rem auto 1rem auto;
    }

    /* Center the hero-name */
    .hero-name {
        text-align: center;
        margin: 0 auto 1rem auto;
    }

    /* Center the paragraph under hero-name */
    .hero-left p {
        text-align: center;
        margin: 0 auto 2rem auto;
    }

    /* Center the tech stack list under skills-right */
    .skills-right {
        text-align: center;
        margin: 0 auto;
    }

    .skills-right ul {
        display: inline-block;
        padding-left: 0;
    }

    /* Center LinkedIn and Email in contact section */
    #contact .contact-right {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    #contact .contact-item {
        justify-content: center;
    }

    /* Global Section Adjustments */
    :root {
        --sectionPadding: 3rem 0;
    }

    .section-title {
        font-size: 1.8rem;
        margin: .6rem 0 2.5rem;
    }

    .pre-title {
        font-size: .8rem;
        padding-left: 30px;
    }

    .pre-title::before {
        width: 25px;
    }

    /* Hero Section */
    #hero {
        grid-template-columns: 1fr;
        height: auto;
        padding: 3rem 0;
    }

    .hero-right {
        order: -1;
        margin-bottom: 2rem;
    }

    .hero-right img {
        width: 70%;
        max-width: 300px;
    }

    .hero-left {
        text-align: center;
        padding-bottom: 3rem;
    }

    .hero-left .pre-title {
        margin: 0 auto;
    }

    .hero-name {
        font-size: 2.5rem;
        margin-bottom: .5rem;
        line-height: 1.1;
    }

    .hero-left p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .hero-buttons {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .btn-primary, .btn-secondary {
        width: 100%;
        max-width: 250px;
        font-size: 1rem;
        align-items: center;
    }

    /* Services Section */
    .grid-3 {
        grid-template-columns: 1fr;
        gap: 2rem;
        justify-items: center;
    }

    .service {
        padding: 2.5rem 1.5rem;
        text-align: center;
        max-width: 400px;
        width: 100%;
    }

    .service h4 {
        font-size: 1.1rem;
    }

    .service p {
        font-size: 0.9rem;
    }

    /* Portfolio Section */
    .portfolio-filters {
        gap: 0.5rem;
        justify-content: center;
    }

    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        min-width: auto;
    }

    .portfolio-cover {
        height: 200px;
    }

    .portfolio-info {
        padding: 1.5rem 1rem;
    }

    .portfolio h4 {
        font-size: 1.1rem;
    }

    /* Skills Section */
    .skills-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .education {
        flex-direction: column;
        text-align: left;
        gap: 1rem;
    }

    .education .line {
        display: none;
    }

    .education-info {
        text-align: center;
    }

    .skills-list {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .skills-right ul li {
        font-size: 0.9rem;
        margin-bottom: 0.8rem;
        text-align: left;
    }

    /* Contact Section */
    .contact {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .contact-form input, .contact-form textarea {
        padding: 0.8rem 1rem;
        font-size: 1rem;
    }

    .contact-item {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        margin-bottom: 2rem;
    }

    .contact-item-icon {
        align-self: center;
    }

    /* Footer */
    footer {
        padding: 2rem 0;
    }

    .footer-icons {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .footer-icons a {
        width: 45px;
        height: 45px;
    }

    .footer-icons i {
        font-size: 1.3rem;
    }

    footer p {
        font-size: 0.9rem;
        margin-top: 1.5rem;
    }

    /* Scroll to Top */
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }

    .scroll-to-top i {
        font-size: 1.2rem;
    }
}

/* Small mobile devices */
@media screen and (max-width: 640px) {
    .main-container {
        max-width: 95%;
        padding: 0 1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .pre-title {
        font-size: .75rem;
        padding-left: 25px;
    }

    .pre-title::before {
        width: 20px;
    }

    .hero-name {
        font-size: 2.2rem;
    }

    .hero-left p {
        font-size: 0.95rem;
    }

    .hero-right img {
        width: 80%;
        max-width: 280px;
    }

    .service {
        padding: 2rem 1rem;
    }

    .portfolio-filters {
        gap: 0.4rem;
    }

    .filter-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .portfolio-tags div {
        font-size: 0.8rem;
        padding: 0.3rem 0.8rem;
    }

    .contact-form input, .contact-form textarea {
        padding: 0.7rem 0.9rem;
        font-size: 0.95rem;
    }

    .btn-submit {
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
    }

    .nav ul {
        gap: 1.5rem;
    }

    nav {
        width: 80%;
        padding: 5rem 1.5rem;
    }
}

/* Very small mobile devices */
@media screen and (max-width: 480px) {
    :root {
        --sectionPadding: 2rem 0;
    }

    .section-title {
        font-size: 1.3rem;
        margin: 0.5rem 0 2rem;
    }

    .pre-title {
        font-size: .7rem;
        letter-spacing: .3rem;
        padding-left: 20px;
    }

    .pre-title::before {
        width: 15px;
    }

    .hero-name {
        font-size: 2rem;
        letter-spacing: -0.5px;
    }

    .hero-left p {
        font-size: 0.9rem;
        line-height: 1.6rem;
    }

    .hero-right img {
        width: 90%;
        max-width: 250px;
    }

    .hero-buttons {
        gap: 0.8rem;
    }

    .btn-primary, .btn-secondary {
        width: 100%;
        font-size: 0.95rem;
        align-items: center;
    }

    .service {
        padding: 1.5rem 1rem;
    }

    .service h4 {
        font-size: 1rem;
        margin: 1rem 0;
    }

    .service p {
        font-size: 0.85rem;
        line-height: 1.5rem;
    }

    .service-icon {
        width: 60px;
        height: 60px;
    }

    .service-icon i {
        font-size: 1.5rem;
    }

    .portfolio-cover {
        height: 180px;
    }

    .portfolio-info {
        padding: 1.2rem 0.8rem;
    }

    .portfolio h4 {
        font-size: 1rem;
    }

    .portfolio p {
        font-size: 0.85rem;
    }

    .portfolio-tags {
        gap: 0.5rem;
        justify-content: center;
    }

    .portfolio-tags div {
        font-size: 0.75rem;
        padding: 0.25rem 0.6rem;
    }

    .education-info h4 {
        font-size: 1rem;
    }

    .education-info p {
        font-size: 0.9rem;
        margin: 0.4rem 0 1rem;
    }

    .education-years {
        font-size: 0.9rem;
        margin-bottom: 2rem;
    }

    .skills-right ul li {
        font-size: 0.85rem;
        margin-bottom: 0.6rem;
    }

    .skills-right ul li i {
        font-size: 1rem;
        margin-right: 8px;
    }

    .contact-item-detail h4 {
        font-size: 1rem;
        margin-bottom: 0.4rem;
    }

    .contact-item-detail p {
        font-size: 0.9rem;
    }

    .footer-icons a {
        width: 40px;
        height: 40px;
    }

    .footer-icons i {
        font-size: 1.2rem;
    }

    footer p {
        font-size: 0.85rem;
    }

    .scroll-to-top {
        width: 40px;
        height: 40px;
        bottom: 15px;
        right: 15px;
    }

    .scroll-to-top i {
        font-size: 1rem;
    }

    /* Burger menu adjustments for small screens */
    .burger {
        position: absolute;
        top: 25px;
        right: 20px;
    }

    .burger .line-1, .burger .line-2, .burger .line-3 {
        width: 25px;
        height: 3px;
    }

    nav {
        width: 85%;
        padding: 4rem 1rem;
    }

    nav ul li a {
        padding: 0.8rem;
        font-size: 1rem;
    }
}

/* Extra small devices */
@media screen and (max-width: 360px) {
    .main-container {
        max-width: 98%;
        padding: 0 0.5rem;
    }

    .hero-name {
        font-size: 1.8rem;
    }

    .hero-left p {
        font-size: 0.85rem;
    }

    .hero-right img {
        width: 95%;
        max-width: 220px;
    }

    .btn-primary, .btn-secondary {
        width: 100%;
        font-size: 0.9rem;
        align-items: center;
    }

    .service {
        padding: 1.2rem 0.8rem;
    }

    .portfolio-filters {
        flex-direction: column;
        align-items: center;
    }

    .filter-btn {
        width: 80%;
        max-width: 200px;
    }

    .contact-form input, .contact-form textarea {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }

    .btn-submit {
        padding: 0.7rem 0.9rem;
        font-size: 0.9rem;
    }

    .footer-icons {
        gap: 0.8rem;
    }

    .footer-icons a {
        width: 35px;
        height: 35px;
    }

    .footer-icons i {
        font-size: 1rem;
    }
}
