@media screen and (max-width: 1400px)
{
    #profile{
        height: 83vh;
        margin-bottom: 6rem;
    }
    .about-containers{
        flex-wrap: wrap;
    }
    #projects {
        height: fit-content;
    }
    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    .theme-toggle {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
}
@media screen and (max-width: 600px)
{
    body {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        overflow-x: hidden !important;
    }
    
    body.vsc-domain-127-0-0-1,
    body.vsc-initialized {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
    
    #desktop-nav{
        display: none;
    }
    #hamburger-nav{
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 1rem;
        width: 100%;
        box-sizing: border-box;
    }
}

/* Ensure desktop nav shows for all screens above 600px */
@media screen and (min-width: 601px) {
    #desktop-nav {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    #hamburger-nav {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
}

/* Specific rule for tablet sizes to ensure single nav */
@media screen and (min-width: 601px) and (max-width: 1024px) {
    #hamburger-nav {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
    #desktop-nav {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

@media screen and (min-width: 601px) and (max-width: 1200px)
{
    #desktop-nav{
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 0 2rem;
        height: 10vh;
    }
    #hamburger-nav{
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
    
    /* Ensure desktop nav elements are visible */
    #desktop-nav .logo {
        display: inline-block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    #desktop-nav .theme-toggle {
        display: inline-block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    nav {
        height: 10vh !important;
        min-height: 10vh !important;
        max-height: 10vh !important;
    }
    
    section {
        padding-top: 12vh;
    }
    
    #profile {
        padding-top: 12vh;
    }
    #experience,
    .experience-details-container{
        margin-top: 2rem;
    }
    #profile,
    .section-container{
        display: block;
    }
    .arrow{
        display: none;
    }
    section,
    .section-container{
        height: fit-content;
    }
    section{
        margin: 0 5%;
    }
    .section__pic-container {
        width: 275px;
        height: 275px;
        margin: 0 auto 2rem;
    }
    .about-containers{
        margin-top: 0;
        flex-direction: column;
        gap: 1.5rem;
        display: flex !important;
    }
    
    .about-containers .details-container {
        opacity: 1 !important;
        visibility: visible !important;
        display: flex !important;
    }
    .text-container {
        padding: 0 1rem;
        margin-top: 1rem;
    }
    .text-container p {
        font-size: 1rem;
        line-height: 1.6;
    }
    #experience {
        padding: 2rem 1rem;
        min-height: auto;
    }
    #about {
        padding: 2rem 1rem;
        min-height: auto;
    }
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .theme-toggle {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    .floating-shape {
        display: none !important;
    }
    #experience {
        padding: 2rem 1rem;
        min-height: auto;
    }
    #projects {
        padding: 2rem 1rem;
        min-height: auto;
    }
    #contact {
        padding: 2rem 1rem;
        min-height: auto;
    }
    #certifications {
        padding: 2rem 1rem;
        min-height: auto;
    }
    .certifications-grid {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1.5rem;
        margin-bottom: 3rem;
    }
    .certification-card {
        padding: 2rem 1.5rem;
        min-height: 350px;
        width: 280px;
    }
    .cert-icon {
        width: 80px;
        height: 80px;
        margin-bottom: 1rem;
    }
    .cert-icon img {
        width: 50px;
        height: 50px;
    }
    .certification-card h3 {
        font-size: 1.4rem;
        margin-bottom: 0.5rem;
    }
    .cert-description {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    .achievements-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    .achievements-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1.5rem;
    }
    .skills-categories {
        gap: 2.5rem;
    }
    .category-title {
        font-size: 1.8rem;
    }
    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1.2rem;
    }
    .skill-card {
        padding: 1.3rem 0.8rem;
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    .skill-icon {
        width: 55px;
        height: 55px;
        margin-bottom: 1rem;
    }
    .skill-icon img,
    .skill-icon svg {
        width: 38px;
        height: 38px;
    }
    .header-name-btn {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
        border-radius: 20px;
        position: relative;
        margin-left: 1rem;
    }
    .hero-description {
        font-size: 1rem;
        padding: 0 1rem;
    }
    
    #hamburger-nav {
        justify-content: space-between;
        align-items: center;
        padding: 0 1.5rem;
    }
    
    .hamburger-menu {
        display: flex;
        align-items: center;
        gap: 1rem;
    }
}

@media screen and (max-width: 600px)
{
    #contact{
        height: auto;
        min-height: 40vh;
        padding: 5rem 1rem;
    }
    footer{
        height: auto;
        min-height: 10vh;
        padding: 2rem 1rem;
    }
    #profile{
        height: auto;
        min-height: 85vh;
        margin-bottom: 0;
        padding: 15vh 1rem 3rem;
    }
    article{
        font-size: 1rem;
    }
    footer nav{
        height: fit-content;
        margin-bottom: 1rem;
    }
    .about-containers, 
    .contact-info-upper-container{
        flex-direction: column;
        padding: 1.5rem 1rem;
        margin: 1rem;
        gap: 1rem;
    }
    .contact-info-container {
        margin: 0.5rem;
        justify-content: center;
        padding: 1.5rem 1rem;
        display: flex;
        align-items: center;
        gap: 1rem;
    }
    .btn-container{
        flex-wrap: wrap;
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
        margin: 1.5rem 0;
        width: 70%;
    }
    .contact-info-container p,
    .nav-links li a{
        font-size: 1.1rem;
    }
    .contact-info-container {
        min-height: 80px;
        border-radius: 15px;
        background: rgba(255, 255, 255, 0.8);
        backdrop-filter: blur(10px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    [data-theme="dark"] .contact-info-container {
        background: rgba(15, 23, 42, 0.8);
    }
    .experience-sub-title{
        font-size: 1.25rem;
    }
    .logo{
        font-size: 1.5rem;
    }
    .nav-links{
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    .section__pic-container{
        width: auto;
        height: 46vw;
        justify-content: center;
    }
    .section__text__p2{
        font-size: 1.25rem;
    }
    .title{
        font-size: 2rem !important;
    }
    .text-container{
        text-align: center;
        padding: 0 1.5rem;
        margin-top: 1.5rem;
    }
    .text-container p {
        font-size: 0.9rem;
        line-height: 1.6;
    }
    .about-containers {
        flex-direction: column;
        gap: 1rem;
        display: flex !important;
    }
    
    .about-containers .details-container {
        opacity: 1 !important;
        visibility: visible !important;
        display: flex !important;
        flex-direction: column;
        align-items: center;
    }
    #experience {
        padding: 2rem 1rem;
        min-height: auto;
    }
    
    .skills-container {
        padding: 1rem 0.5rem;
    }
    #about {
        padding: 1rem;
        min-height: auto;
    }
    #projects {
        padding: 1rem;
        min-height: auto;
    }
    #contact {
        padding: 5rem 1rem;
        min-height: max-content;
    }
    #certifications {
        padding: 1rem;
        min-height: auto;
    }
    .certifications-grid {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1.5rem;
        margin-bottom: 2rem;
    }
    .certification-card {
        padding: 1.8rem 1.2rem;
        min-height: 320px;
        width: 250px;
    }
    .cert-icon {
        width: 70px;
        height: 70px;
        margin-bottom: 1rem;
    }
    .cert-icon img {
        width: 45px;
        height: 45px;
    }
    .certification-card h3 {
        font-size: 1.3rem;
        margin-bottom: 0.5rem;
    }
    .cert-description {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    .achievements-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .cert-icon {
        width: 70px;
        height: 70px;
        margin-bottom: 1rem;
    }
    .cert-icon img {
        width: 45px;
        height: 45px;
    }
    .certification-card h3 {
        font-size: 1.3rem;
    }
    .achievements-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .achievement-item {
        padding: 1.5rem 1rem;
    }
    .achievement-icon {
        font-size: 2.5rem;
    }
    .skills-categories {
        gap: 2rem;
    }
    .category-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
    .skills-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem;
        padding: 0 0.5rem;
    }
    .skill-card {
        padding: 1rem 0.5rem;
        min-height: 140px;
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    .skill-card h3 {
        font-size: 0.9rem;
        text-align: center;
        margin-bottom: 0.3rem;
    }
    .skill-card p {
        font-size: 0.7rem;
        text-align: center;
    }
    .skill-icon {
        width: 45px;
        height: 45px;
        margin-bottom: 0.5rem;
        flex-shrink: 0;
    }
    .skill-icon img,
    .skill-icon svg {
        width: 30px;
        height: 30px;
    }
    .header-name-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.7rem;
        border-radius: 15px;
        margin-left: 0.5rem;
    }
    
    #hamburger-nav {
        padding: 0 1rem;
    }
    .experience-details-container {
        padding: 1rem 0;
    }
    .theme-toggle {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.8rem;
        width: 80%;
        margin-bottom: 0.5rem;
    }
    .btn-container {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
        margin: 1.5rem 0;
    }
    
    #socials-container {
        max-width: 250px;
        padding: 1rem;
    }
    
    #socials-container .icon {
        height: 3rem;
        width: 3rem;
    }
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1rem;
    }
    .hero-description {
        font-size: 0.9rem;
        padding: 1rem 1.5rem;
        line-height: 1.6;
    }
    .particle {
        display: none !important;
    }
    
    .particles {
        display: none !important;
    }
    section {
        padding-top: 2vh;
        margin: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .section-container {
        margin: 0 !important;
        padding: 0 1rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    footer nav {
        display: none;
    }
    
    /* Override any unwanted styles */
    * {
        box-sizing: border-box !important;
    }
    
    html {
        width: 100% !important;
        overflow-x: hidden !important;
    }
}

/* TABLET AND DESKTOP SPECIFIC */
@media screen and (min-width: 601px) and (max-width: 1199px) {
    #desktop-nav {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 0 2rem;
    }
    
    #desktop-nav .logo {
        order: 2;
        flex: 1;
        text-align: center;
    }
    
    #desktop-nav .logo {
        order: 1;
        display: inline-block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    #desktop-nav > div:first-of-type {
        order: 3;
        display: flex;
        align-items: center;
        gap: 1rem;
    }
    
    #desktop-nav .theme-toggle {
        order: 4;
        width: 40px;
        height: 40px;
        font-size: 1rem;
        display: inline-block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .nav-links {
        gap: 1rem;
        font-size: 1rem;
    }
    
    .header-name-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.8rem;
        display: inline-block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .theme-toggle {
        display: inline-block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: static !important;
    }
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    .btn-container {
        justify-content: center;
        gap: 1rem;
    }
    .hero-description {
        max-width: 80%;
        font-size: 1rem;
    }
    .text-container {
        padding: 0 2rem;
        margin-top: 1.5rem;
    }
    .text-container p {
        font-size: 1rem;
        line-height: 1.7;
    }
    #experience {
        padding: 3rem 2rem;
    }
    #about {
        padding: 3rem 2rem;
    }
    #projects {
        padding: 3rem 2rem;
    }
    #contact {
        padding: 3rem 2rem;
    }
    #certifications {
        padding: 3rem 2rem;
    }
    .certifications-grid {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 2rem;
        width: 100%;
    }
    .certification-card {
        min-height: 380px;
        width: 320px;
    }
    .cert-icon {
        width: 85px;
        height: 85px;
    }
    .cert-icon img {
        width: 55px;
        height: 55px;
    }
    .achievements-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 2rem;
    }
    .achievements-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 1.8rem;
    }
    .skills-categories {
        gap: 3.5rem;
    }
    .category-title {
        font-size: 1.9rem;
    }
    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 1.5rem;
    }
    .skill-card {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    .header-name-btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* iPhone 11 Pro Max and similar large phones */
@media screen and (max-width: 600px) and (min-width: 400px) {
    .contact-info-container {
        min-height: 100px;
        padding: 2rem 1.5rem;
        margin: 1rem 0.5rem;
    }
    
    .contact-info-container p {
        font-size: 1.2rem;
    }
    
    .contact-info-container .icon {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    #contact {
        min-height: 50vh;
        padding: 6rem 1rem;
    }
    
    .contact-info-upper-container {
        gap: 2rem;
        padding: 2rem 1rem;
        margin: 2rem auto;
        max-width: 400px;
    }
    
    footer {
        padding: 3rem 1rem;
        font-size: 1rem;
    }
}

/* HIGH DPI DISPLAYS */
@media screen and (min-resolution: 192dpi) {
    .theme-toggle {
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    .btn {
        border-width: 1px;
    }
}

/* DARK MODE MOBILE ADJUSTMENTS */
@media screen and (max-width: 600px) {
    [data-theme="dark"] .hamburger-icon span {
        background-color: white;
    }
    [data-theme="dark"] .menu-links {
        background-color: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(10px);
    }
    
    .menu-links {
        width: 180px;
        right: 10px;
        top: 100%;
        z-index: 1000;
        position: absolute;
        margin-top: 0;
    }
    
    .menu-links.open {
        display: block;
        transform: translateY(0);
    }
    
    .menu-links a {
        font-size: 1rem;
        padding: 12px 15px;
    }
    
    nav {
        height: 8vh;
    }
    
    #desktop-nav {
        display: none !important;
    }
    
    #hamburger-nav {
        display: flex !important;
        height: 8vh;
        padding: 0 1rem;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        z-index: 999;
    }
    
    [data-theme="dark"] #hamburger-nav {
        background: rgba(15, 23, 42, 0.95);
    }
    
    .hamburger-menu {
        display: flex;
        align-items: center;
        gap: 0.8rem;
    }
    
    #hamburger-nav .theme-toggle {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
        margin-left: 0;
        margin-right: 0.5rem;
    }
}

