/* =========================================
   RESPONSIVE STYLES (Tablet & Mobile)
========================================= */

/* Default: Hide menu icon on desktop */
.menu-icon {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    z-index: 10001;
    /* Above the menu */
}

.menu-icon .bar {
    width: 30px;
    height: 3px;
    background-color: #fff;
    transition: 0.4s ease;
    border-radius: 2px;
}

/* Hamburger Animation to 'X' */
.menu-icon.active .bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}

.menu-icon.active .bar:nth-child(2) {
    opacity: 0;
    transform: translateX(10px);
}

.menu-icon.active .bar:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* Default: Hide Bottom Nav on Desktop/Tablet */
.bottom-nav {
    display: none;
}


/* =========================================
   MEDIA QUERY: TABLET (max-width: 990px)
========================================= */
@media (max-width: 990px) {

    /* Show Hamburger Icon */
    .menu-icon {
        display: flex;
    }

    /* Hide the horizontal menu by default and style as sidebar */
    header ul {
        position: fixed;
        top: 0;
        right: -100%;
        /* Hidden off-screen */
        width: 70%;
        /* Occupy 70% of screen */
        height: 100vh;

        /* Glassmorphism / Blur Effect */
        background: rgba(15, 10, 30, 0.6);
        /* Semi-transparent dark background */
        backdrop-filter: blur(15px);
        /* The blur effect */
        -webkit-backdrop-filter: blur(15px);
        /* Safari support */

        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;

        transition: right 0.5s cubic-bezier(0.77, 0.2, 0.05, 1.0);
        /* Smooth easing */
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
        z-index: 10000;
    }

    /* Active State: Slide in */
    header ul.active {
        right: 0;
    }

    header ul li {
        margin: 0;
    }

    header ul li a {
        font-size: 1.5rem;
        display: block;
        padding: 10px 20px;
    }

    /* Adjust Header Padding */
    header {
        padding: 20px 40px;
    }

    /* Resize Title for Tablet */
    #text {
        font-size: 5rem;
        right: -100px;
        /* Adjust position */
    }

    /* Resize Buttons for Tablet */
    #mainBtn {
        font-size: 1.1em;
        padding: 8px 25px;
    }

    /* Resize Project Title for Tablet */
    .project-counter h1 {
        font-size: 7.5vw !important;
    }

    .project-title,
    .count {
        height: 100px !important;
        /* Reduced from 150px */
        width: 100% !important;
        /* Ensure it fits screen */
    }

    .count-container {
        transform: translateY(100px);
        /* Initial offset matches height */
    }

    .count-container h1 {
        height: 100px !important;
        line-height: 100px !important;
        margin: 0 !important;
        display: flex;
        align-items: center;
    }

    /* Responsive About Section (Tablet) */
    #aboult {
        flex-direction: column;
        height: auto !important;
        padding: 100px 0;
        gap: 2rem;
    }

    .perfil-card,
    .resun {
        width: 80% !important;
    }

    /* Refine About Details (Tablet) */
    .perfil-img {
        width: 250px !important;
        height: 250px !important;
    }

    .container-text-resume ul {
        padding: 0 20px !important;
        /* Added padding */
    }

    .container-text-resume ul li {
        font-size: 0.9rem !important;
    }

    .img-tecs {
        width: 50px !important;
        /* Increased size */
        height: 50px !important;
    }
}

/* =========================================
   MEDIA QUERY: MOBILE (< 500px)
========================================= */
@media (max-width: 500px) {

    /* Hide Top Header & Hamburger */
    header {
        display: none;
    }

    .menu-icon {
        display: none;
    }

    /* Resize Title for Mobile */
    #text {
        font-size: 2.5rem;
        /* Standard H1 size for mobile */
        right: 0;
        white-space: normal;
        /* Allow wrapping if needed */
        text-align: center;
        width: 100%;
        padding: 0 10px;
    }

    /* Resize Buttons for Mobile */
    #mainBtn {
        font-size: 1rem;
        padding: 8px 20px;
    }

    /* Resize Project Title for Mobile */
    .project-counter h1 {
        font-size: 7.5vw !important;
    }

    .project-title,
    .count {
        height: 60px !important;
        /* Reduced further for mobile */
        width: 100% !important;
    }

    .count-container {
        transform: translateY(60px);
        /* Initial offset matches height */
    }

    .count-container h1 {
        height: 60px !important;
        line-height: 60px !important;
        margin: 0 !important;
        display: flex;
        align-items: center;
    }

    /* Show Bottom Nav */
    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 10px;
        left: 0;
        right: 0;
        margin: 0 auto;
        width: 90%;
        height: 70px;

        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);

        border-radius: 50px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);

        justify-content: space-around;
        align-items: center;
        z-index: 99999;
        padding: 0 20px;
    }

    /* Resize Project Cards for Mobile */
    .card {
        width: 300px !important;
        height: 400px !important;
        margin-left: -150px !important;
        /* Half of width to center */
    }

    /* Responsive About Section (Mobile) */
    #aboult {
        padding: 50px 0 120px 0;
        /* Extra bottom padding for nav */
    }

    .perfil-card,
    .resun {
        width: 90% !important;
    }

    /* Refine About Details (Mobile) */
    .perfil-img {
        width: 200px !important;
        height: 200px !important;
    }

    .container-text-resume ul {
        padding: 0 15px !important;
        /* Added padding */
    }

    .container-text-resume ul li {
        font-size: 0.85rem !important;
    }

    .img-tecs {
        width: 45px !important;
        /* Increased size */
        height: 45px !important;
    }

    .nav-item {
        color: rgba(255, 255, 255, 0.6);
        font-size: 24px;
        transition: 0.3s ease;
        display: flex;
        justify-content: center;
        align-items: center;
        text-decoration: none;
    }

    .nav-item:hover,
    .nav-item.active {
        color: #fff;
    }

    /* Highlight Active Icon */
    .nav-item.active {
        background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
        width: 60px;
        height: 60px;
        border-radius: 50%;
        transform: translateY(-25px);
        /* Float above */
        box-shadow: 0 8px 15px rgba(37, 117, 252, 0.4);
        color: #fff;
        font-size: 28px;
        border: 4px solid #1e1a1f;
        /* Match bg color to look like cutout */
    }

    .nav-item.active:hover {
        transform: translateY(-30px);
        box-shadow: 0 12px 20px rgba(37, 117, 252, 0.6);
    }

    /* Adjust page padding so content isn't hidden behind nav */
    body {
        padding-bottom: 100px;
    }
}