body {
    background-color: #1a1a1a;
    color: white;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    text-align: center;
}

html {
    scroll-behavior: smooth;
}

html, body {
    overflow-x: hidden; /* Prevents horizontal scrolling */
    margin: 0; /* Removes any default margin */
    box-sizing: border-box;
    max-width: 100%;
}

nav {
    background: #f0f0f0;
    padding: 15px;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    color: black;
}

    nav ul {
        list-style: none;
        display: flex;
        justify-content: center;
        padding: 0;
    }

        nav ul li {
            margin: 0 20px;
        }

            nav ul li a {
                color: black;
                text-decoration: none;
                font-weight: bold;
                padding-bottom: 5px;
            }

                nav ul li a.active {
                    border-bottom: 3px solid black;
                }

/* Nav Links (Desktop) */
.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
}

    .nav-links li {
        display: inline-block;
    }

    .nav-links a {
        color: black;
        text-decoration: none;
        font-weight: bold;
    }

/* Style the menu toggle button */
.menu-toggle {
    display: none; /* Hide on desktop */
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    position: relative;
    z-index: 1500; /* Ensure it's above the menu */
}

    .menu-toggle span {
        display: block;
        width: 30px;
        height: 3px;
        background: black;
        transition: all 0.3s ease;
    }


/* ************ STYLE OF SECTIONS (background) ************* */
section {
    padding: 120px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.light-section {
    background-color: #2a2a2a;
}

.dark-section {
    background-color: #3a3a3a;
}

h1 {
    font-size: 2.5rem;
    text-align: center;
}

    h1 span {
        border-bottom: 3px solid white;
        padding-bottom: 5px;
    }

/* ************ ABOUT SECTION ************* */
#about {
    padding: 125px 20px 80px 20px; /* Add more space at the bottom */
    min-height: 600px; /* Adjust this value to control how tall the section is */
    background: url('images/background.png') center/cover no-repeat;
}

.about-title {
    font-size: 4rem;
    font-weight: bold;
    color: white;
    margin: 0;
    width: 100%;
    display: flex;
    align-items: flex-start; /* Aligns properly with text */
    padding-left: 1%;
    text-shadow: 4px 4px 4px rgba(0, 0, 0, 1), 2px 2px 2px rgba(0, 0, 0, 0.9);
}

.about-container {
    display: flex;
    flex-direction: column; /* Stack title + content */
    align-items: flex-start; /* Align to left (automatically works on all screens) */
    gap: 10px; /* Adds space between title and text */
    max-width: 1000px; /* Prevents it from stretching too wide */
    margin: 0 auto; /* Centers the whole section */
    padding: 0 20px; /* Prevents touching screen edges */
}

/* About Section Layout */
.about-content {
    display: flex;
    align-items: center; /*  Keeps text & image aligned */
    justify-content: space-between; /*  Ensures spacing */
    gap: 50px; /*  Space between text and image */
    padding: 20px;
    flex-wrap: wrap; /* Prevents breaking on small screens */
    width: 100%;
}

.about-text {
    flex: 2; /* Text takes up more space */
    color: #fff;
    font-size: 1rem;
    max-width: 700px; /* Limit text width */
    text-align: left; /* Align the text to the left */
    text-shadow: 4px 2px 6px rgba(0, 0, 0, 1), 1px 2px 1px rgba(0,0,0,0.9);
}

.about-image {
    flex: 1; /* Image takes up proportional space */
    max-width: 300px; /* Adjust this to your desired image size */
    display: flex;
    justify-content: center;
}

.profile-img {
    width: 100%; /* Make the image fill its container */
    height: 300px; /* Make the height larger */
    max-width: 300px; /* Make sure it doesn't get too large */
    border-radius: 50%; /* Make the image circular */
    object-fit: cover; /* Ensures the image fits the circle well */
}

body {
    font-family: 'Lato', sans-serif; /* Set Roboto font globally */
}

/* Style for links in the text */
.about-text a {
    color: #3498db; /* Link color */
    text-decoration: none; /* Remove underline */
    font-weight: bold; /* Make links stand out */
}

    .about-text a:hover {
        text-decoration: underline; /* Underline on hover */
    }

/* Responsive styles for smaller screens */
@media (max-width: 768px) {
    .about-content {
        flex-direction: column; /* Stack image and text vertically */
        text-align: center; /* Center text on smaller screens */
    }

    .profile-img {
        max-width: 250px; /* Resize image on small screens */
        height: 250px;
    }

    .about-text {
        font-size: 1rem; /* Adjust text size */
    }
}


/* ************ GAMES SECTION ************* */
/* General Section */
#games {
    text-align: center;
    padding: 50px 20px;
    color: white;
    scroll-margin-top: 20px; /* Adjust the offset as needed */
}

    #games p {
        font-size: 1.2rem;
        margin-bottom: 30px;
        color: #ccc;
    }

/* Mosaic Layout with Defined Sizes */
.games-mosaic {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(100px, auto); /* Ensures proper row height */
    gap: 30px;
    max-width: 1200px;
    margin: auto;
}

/* Ensure images scale properly */
.game-box {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
}

    .game-box:hover {
        transform: scale(1.05);
    }

    /* Ensure images fill the boxes */
    .game-box img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    /* Show WebP animation on hover */
    .game-box:hover .animated-image {
        opacity: 1;
    }

    /* Hide static image when hovering */
    .game-box:hover .static-image {
        opacity: 0;
    }

    /* Game title banners with different colors */
    /* Bullet */
    .game-box:nth-child(1) .game-banner {
        background: rgba(18,95,175, 0.8);
    }
    /* Duck */
    .game-box:nth-child(2) .game-banner {
        background: rgba(255, 87, 51, 0.8);
    }
    /* Wukong */
    .game-box:nth-child(3) .game-banner {
        background: rgba(102, 204, 102, 0.8);
    }
    /* BB */
    .game-box:nth-child(4) .game-banner {
        background: rgba(82,144,139, 0.8);
    }
    /* Dragon */
    .game-box:nth-child(5) .game-banner {
        background: rgba(196,129,61, 0.8);
    }
    /* Tactical Prototype */
    .game-box:nth-child(6) .game-banner {
        background: rgba(23,23,23, 0.8);
    }
    /* Fork It Up */
    .game-box:nth-child(7) .game-banner {
        background: rgba(21,41,131, 0.8);
    }
    /* Moon Patrol */
    .game-box:nth-child(8) .game-banner {
        background: rgba(36,18,0, 0.8);
    }
    /* Time Heist */
    .game-box:nth-child(9) .game-banner {
        background: rgba(106,75,64, 0.8);
    }
    /* Ordeal */
    .game-box:nth-child(10) .game-banner {
        background: rgba(98, 113, 175, 0.8);
    }
    /* Doom */
    .game-box:nth-child(11) .game-banner {
        background: rgba(95,21,13, 0.8);
    }
    /* Last Hope */
    .game-box:nth-child(12) .game-banner {
        background: rgba(23,23,23, 0.8);
    }

/* Ensure hover images fit inside game boxes */
.hover-image-container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Static image is always visible first */
.static-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

/* Animated image (WebP) starts hidden */
.animated-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    background-color: inherit;
}

/* Ensure static image is visible by default */
.static-image {
    opacity: 1;
}

/* Hide animated WebP by default */
.animated-image {
    opacity: 0;
    pointer-events: none; /* Prevent interaction issues */
}

/* Game title banner */
.game-banner {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    color: white;
    text-align: center;
    padding: 10px 5px;
    font-size: 1.2rem;
    font-weight: bold;
}

/* Adjust different box sizes */
.big-rectangle {
    grid-column: span 2;
    grid-row: span 2;
    height: 380px;
}

.rectangle {
    grid-column: span 2;
    grid-row: span 1;
    height: 220px;
}

.small-square {
    grid-column: span 1;
    grid-row: span 1;
    height: 220px;
}


/* ************ OtTHER PROJECT SECTION ************* */

/* General Section */
#projects {
    text-align: center;
    padding: 50px 20px;
    color: white;
    scroll-margin-top: 25px; /* Adjust the offset as needed */
}

    #projects p {
        font-size: 1.2rem;
        margin-bottom: 30px;
        color: #ccc;
    }

/* Mosaic Layout with Uniform Spacing */
.projects-mosaic {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Keep 4 columns */
    grid-auto-rows: minmax(100px, auto); /* Ensure consistent row height */
    gap: 30px; /* Uniform spacing for both rows and columns */
    max-width: 1200px; /* Allow more space horizontally */
    margin: auto;
}

/* Ensure images scale properly */
.project-box {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
}

    .project-box:hover {
        transform: scale(1.05);
    }

    /* Ensure images (including GIFs) fill the boxes */
    .project-box img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    .project-box video {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    /* Project title banners with different colors */
    /* Water */
    .project-box:nth-child(1) .project-banner {
        background: rgba(23,23,23, 0.8);
    }
    /* Custom Engine */
    .project-box:nth-child(2) .project-banner {
        background: rgba(227,124,95, 0.8);
    }
    /* Fractal */
    .project-box:nth-child(3) .project-banner {
        background: rgba(196,144,33, 0.5);
    }
    /* Wuwa */
    .project-box:nth-child(4) .project-banner {
        background: rgba(15,41,64, 0.8);
    }
    /* Bridge */
    .project-box:nth-child(5) .project-banner {
        background: rgba(93,59,46, 0.8);
    }
    /* Cable */
    .project-box:nth-child(6) .project-banner {
        background: rgba(57,131,111, 0.8);
    }
    /* Gun */
    .project-box:nth-child(7) .project-banner {
        background: rgba(41,64,100, 0.8);
    }
    /* Car */
    .project-box:nth-child(8) .project-banner {
        background: rgba(23,23,23, 0.8);
    }
    /* Pumpkins */
    .project-box:nth-child(9) .project-banner {
        background: rgba(23,23,23, 0.8);
    }

.project-banner {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    color: white;
    text-align: center;
    padding: 10px 5px;
    font-size: 1.2rem;
    font-weight: bold;
}

/* Adjust different box sizes */
.big-square {
    grid-column: span 2;
    grid-row: span 2;
    height: 470px;
}

.rectangle {
    grid-column: span 2;
    grid-row: span 1;
    height: 220px;
}

.long-rectangle{
    grid-column: span 1;
    grid-row: span 2;
    height: 380px;
}

.small-square {
    grid-column: span 1;
    grid-row: span 1;
    height: 220px;
}

/* ************ RESUME SECTION ************* */
#resume {
    padding: 50px 20px;
    min-height: 600px; /* Adjust based on your content */
    scroll-margin-top: 66px; /* Adjust the offset as needed */
}

/* ***** Experience SECTION ***** */
#experience, #education {
    margin-bottom: 30px;
}

    #experience h2, #skillTitle h2 {
        font-size: 2rem;
        text-decoration: underline;
        margin-bottom: 50px;
    }

#experience {
    padding: 0px 0px 0px 20px; /* Add more space at the bottom */
    min-height: 50px; /* Adjust this value to control how tall the section is */
}

.experience-section {
    position: relative;
    padding-left: 120px;
}

.experience-section::before {
    content: "";
    position: absolute;
    left: 34.6%;
    top: 130px;
    width: 4px;
    height: calc(100% - 105px);
    background: linear-gradient(to bottom, #ff5733, rgba(255, 87, 51, 0));
    transform: translateX(-50%);
}

.experience-entry {
    display: flex;
    align-items: flex-start;
    margin-bottom: 30px;
    position: relative;
}

.date {
    width: 280px;
    text-align: right;
    padding-top: 12px;
    padding-right: 30px;
    font-weight: bold;
    color: #ddd;
    font-size: 15px;
}

.circle {
    width: 25px;
    height: 25px;
    background-color: #ff5733;
    border-radius: 52%;
    position: absolute;
    left: 33.2%;
    top: 10px;
    transform: translateX(-50%);
}

.content {
    background: #3a3a3a;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.1);
    flex: 1;
    margin-left: 50px;
    color: white;
    text-align: left;
    width: 550px; /* Fixed width */
    min-height: 100px; /* Ensures proper height scaling */
    word-wrap : break-word;
}

.job-title {
    font-weight: bold;
}

.company {
    color: #bbb;
    font-size: 0.9em;
}

.description {
    margin-top: 10px;
}

.tech {
    margin-top: 10px;
    color: #aaa;
    font-size: 0.9em;
}

.description a {
    color: #f77458;
    text-decoration: none;
    font-weight: bold;
}

    .description a:hover {
        text-decoration: underline;
    }


/* ***** Education SECTION ***** */
.education {
    text-align: center;
    margin-bottom: 30px;
    background-color: #2a2a2a; /* Light gray background */
    padding: 10px 0px 60px 20px; /* Add more space at the bottom */
    width: 100vw; /* Ensures it spans the full width of the screen */
    box-sizing: border-box; /* Ensures padding doesn't overflow the width */
    color: #333; /* Dark text color for visibility on white background */
}

    .education h2 {
        font-size: 2rem;
        text-decoration: underline;
        margin-bottom: 50px;
        color: white;
    }

.education-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    max-width: 600px;
    margin: auto;
}

.education-entry {
    width: 100%;
    border: 1px solid #aaa;
    padding: 20px;
    text-align: left;
}

.education-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.education-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
}

.education-date {
    font-size: 0.9rem;
    color: #ddd;
}

.education-subtitle {
    font-size: 0.9rem;
    color: #ddd;
    margin-top: 5px;
}

.education-description {
    font-size: 0.85rem;
    color: #aaa;
    margin-top: 15px;
}

/* ***** Skill SECTION ***** */
/*Skills*/
#skills {
    display: flex;
    justify-content: center; /* Center both skill categories */
    gap: 0px; /* Reduce space between themes */
    margin-top: 10px; /* Reduce margin to bring closer to title */
    flex-wrap: wrap;
    max-width: 80%; /* Ensure it fits within its container */
    margin: auto;
    align-items: flex-start; /* Align titles with their boxes */
}

#skillTitle {
    margin-bottom: 0px; /* Reduce space below the title */
}

#languages, #software {
    display: flex;
    flex-direction: column; /* Stack boxes vertically */
    gap: 8px; /* Space between individual boxes */
    width: 38%; /* Ensure both themes fit side by side */
    align-items: center;
}

    #software h3 {
        margin-top: -10px;
        margin-bottom: 5px; /* Reduce space between Software title and first skill box */
    }

    #languages h3 {
        margin-top: -10px;
        margin-bottom: 5px;
    }

.skills-box {
    padding: 10px 10px;
    background-color: #ddd; /* Light gray background */
    text-align: center;
    font-weight: bold;
    font-size: 0.9rem;
    text-transform: uppercase;
    border: 1px solid #ccc; /* Adding a border */
    display: inline-block;
    width: fit-content; /* Make sure the box adjusts to text size */
    margin: 5px; /* Ensure spacing between boxes */
    color: #333; /* Darker text color for better visibility */
    white-space: nowrap;
}

.skills-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px; /* Reduce gap to encourage tighter layout */
    max-width: 80%; /* Ensure it fits within its container */
}

/* ************ CONTACT SECTION ************* */
#contact {
    padding: 0px 20px 80px 20px; /* Add more space at the bottom */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 600px; /* Adjust this value to control how tall the section is */
}

label {
    display: block; /* Makes the label take up full width */
    margin-bottom: 10px; /* Adds space below the label */
    font-size: 1rem; /* Optional: Adjust font size */
    text-align: left;
}

.form-container {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500px; /* Max width for the form */
}

    .form-container h1 {
        text-align: center;
        font-size: 2em;
        margin-bottom: 20px;
    }

input, textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 5px;
    border: 1px solid #ddd;
    font-size: 1em;
    box-sizing: border-box;
}

textarea {
    resize: none; /* Disable resizing */
    height: 150px;
    width: 500px;
}

button {
    width: 100%;
    padding: 12px;
    background-color: #007BFF;
    color: white;
    font-size: 1.1em;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
}

    button:hover {
        background-color: #ff4c4c;
        color: white;
        transform: scale(1.05);
    }



/* ************ BOTTOM BANNER ************* */
footer {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f0f0f0;
    padding: 20px 40px;
    position: relative;
    bottom: 0;
    color: black;
    gap : 1200px;
}

@media (min-width: 900px) {
    footer {
        flex-wrap: wrap;
        justify-content: center;
        gap: 600px;
    }
}

.footer-center {
    position: absolute; /* Absolute positioning to center the button */
    top: 50%; /* Position it vertically at the center */
    left: 50%; /* Position it horizontally at the center */
    transform: translate(-50%, -50%); /* Center using transform */
}

.footer-left, .footer-right {
    display: flex;
    align-items: center;
}

.footer-icon {
    width: 30px; /* Adjust size of the icons */
    height: 30px;
    margin-left: 15px; /* Space out the icons */
    transition: opacity 0.3s ease; /* Smooth hover effect */
}

    .footer-icon:hover {
        opacity: 0.5; /* Slight fade effect on hover */
    }

.footer-right a {
    color: black;
    margin-left: 15px;
    text-decoration: none;
    font-weight: bold;
}

.back-to-top {
    width: 40px;
    height: 40px;
    background: transparent;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background-image: url('images/arrow_button.png'); /* Correct path to the image */
    background-size: cover;
    background-position: center;
    transition: background 0.3s ease;
    text-decoration: none; /* Ensure no text shows */
    display: block; /* Make sure it's treated as a block-level element */
}

    .back-to-top:hover {
        opacity: 0.5;
    }

    .back-to-top span {
        display: none;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

section {
    animation: fadeIn 0.8s ease-in-out;
}

/* ************ POP UP ************* */
body.modal-open {
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    position: fixed;
}

/* ====== Fix Modal Display Issues ====== */
.modal {
    display: none; /* Ensure modal is hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8); /* Dark background */
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

    /* ====== Ensure Modal Shows When Clicking a Game ====== */
    .modal.show {
        display: flex; /* Ensure modal is visible */
        opacity: 1;
    }

/* ====== Centered Modal Content ====== */
.modal-content {
    width: 80%;
    max-width: 900px;
    background: white; /* Ensure the modal background is visible */
    border-radius: 10px;
    padding: 0; /* Remove padding to control header better */
    max-height: 85vh;
    overflow-y: auto; /* Ensures scrolling inside modal */
    display: flex;
    flex-direction: column;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
    position: relative;
}

/* ====== Modal Header (Top Banner with Title & Close Button) ====== */
.modal-header {
    background: #222222; /* Adjust color as needed */
    padding: 15px 20px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}
    /* Title in Header */
    .modal-header h2 {
        font-size: 22px;
        margin: 0;
        color: white; /* Ensure title is visible */
    }

/* ====== Fix Close Button & Hover ====== */
.close-icon {
    width: 28px;
    height: 28px;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

    .close-icon:hover {
        transform: scale(1.1);
        opacity: 0.8;
    }

/* ====== Modal Body (Content Section) ====== */
.modal-body {
    overflow-y: auto;
    flex-grow: 1;
    padding: 20px;
    color: #222; /* Make text readable */
    text-align: left;
}

/* ====== Fix Text Color ====== */
#game-release {
    font-size: 16px;
    color: #222; /* Ensure all text is readable */
    line-height: 1.6;
    text-align: center;
}

#game-description {
    font-size: 18px;
    color: #222;
    margin-bottom: 10px;
    font-weight: bold;
    text-align: left;
    margin-left: 20px;
}

#game-features {
    font-size: 16px;
    color: #222; /* Ensure all text is readable */
    line-height: 1.6;
    text-align: left;
    margin-left: 20px;
}

    /* Headings inside modal */
    #game-features h3 {
        font-size: 18px;
        color: #222;
        margin-bottom: 10px;
    }

#game-release {
    background: #f0f0f0; /* Light gray background */
    padding: 20px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    border-radius: 8px;
    margin: 30px 0;
    border: 2px solid #b0b0b0; /* Slightly darker gray border */
    box-shadow: 0px 0px 10px rgba(160, 160, 160, 0.6); /* Soft glow effect */
    animation: glowEffect 1.5s infinite alternate ease-in-out;
}

/* Glow Animation */
@keyframes glowEffect {
    0% {
        box-shadow: 0px 0px 8px rgba(160, 160, 160, 0.6);
    }

    100% {
        box-shadow: 0px 0px 15px rgba(160, 160, 160, 1);
    }
}


    /* Make Link More Visible & Add Animation */
    #game-release a {
        color: #333;
        text-decoration: none;
        font-weight: bold;
        font-size: 20px;
        position: relative;
        transition: color 0.3s ease-in-out;
    }

        /* Hover Animation - Underline expands */
        #game-release a::after {
            content: "";
            display: block;
            width: 0;
            height: 2px;
            background: #333;
            transition: width 0.3s ease-in-out;
            position: absolute;
            left: 50%;
            bottom: -5px;
            transform: translateX(-50%);
        }

        #game-release a:hover {
            color: #000; /* Darker on hover */
        }

            #game-release a:hover::after {
                width: 100%; /* Expanding underline effect */
            }


/* ====== Fix Game Images Display ====== */
.game-images-container {
    display: grid;
    grid-template-columns: repeat(6, 1fr); /* 6 equal columns */
    gap: 15px;
    margin-top: 20px;
    justify-content: center;
    align-items: center;
}

    /* Small images take 2/6 columns (1/3 of row) */
    .game-images-container img {
        height: 300px;
        width: 100%;
        object-fit: cover;
        border-radius: 5px;
        grid-column: span 2;
    }
        /* Large images take 4/6 columns (2/3 of row) */
        .game-images-container img[data-size="large"] {
            grid-column: span 4;
        }


        /* Half-large images take 3/6 columns (half of row) */
        .game-images-container img[data-size="half-large"] {
            grid-column: span 3;
        }

        /* Large images take 6/6 columns (2/3 of row) */
        .game-images-container img[data-size="huge"] {
            grid-column: span 6;
        }


.video-container iframe {
    width: 100%;
    height: 500px; /* Increased size */
    max-height: 60vh; /* Limits height to prevent overflow */
    border-radius: 5px;
}


/* ************ PHONE DESIGN ************* */
/* Responsive Design for Mobile */
/* Fix Full-Height for Mobile */
@media (max-width: 768px) {
    /* MOBILE NAV MENU */
    .nav-links {
        position: fixed;
        top: 0;
        left: -100%; /* Start hidden */
        width: 70%;
        height: 100vh; /* Full height */
        background: #1a1a1a;
        display: flex;
        flex-direction: column;
        align-items: flex-start; /* Align items to the left */
        justify-content: flex-start; /* Start from the top */
        padding-top: 80px; /* Space for the cross icon */
        transition: left 0.3s ease-in-out;
    }

        .nav-links.active {
            left: 0; /* Slide in */
        }

        .nav-links li {
            margin: 15px 30px; /* Proper spacing */
        }

        .nav-links a {
            font-size: 1.3rem;
            color: white;
            text-decoration: none;
            display: block;
        }

            /* Underline matches text color */
            .nav-links a::after {
                content: "";
                display: block;
                width: 0;
                height: 2px;
                background: currentColor; /* Same as text */
                transition: width 0.3s ease-in-out;
            }

            .nav-links a:hover::after {
                width: 100%;
            }

    /* Fix Underline Color to White */
    h1 span {
        border-bottom: 3px solid white !important; /* Ensures underline is always white */
        padding-bottom: 5px;
    }


    /* HAMBURGER MENU - Move to Left */
    .menu-toggle {
        display: flex;
        flex-direction: column;
        cursor: pointer;
        gap: 5px;
        position: fixed; /* Keep it fixed so it's always visible */
        top: 0;
        left: 0; /* Move to the very left */
        z-index: 2000; /* Ensure it's above everything */
        width: 100%; /* Make it full-width */
        height: 25px; /* Increase height so it's taller */
        background: #1a1a1a; /* Make sure the background covers the button */
        align-items: flex-start; /* Align icon to the left */
        padding: 15px 20px;
    }

        .menu-toggle span {
            display: block;
            width: 30px;
            height: 3px;
            background: white;
            transition: all 0.3s ease;
        }

        /* Hide bars when menu is open */
        .menu-toggle.open span {
            display: none;
        }

        /* Move Cross Icon to EXACT SAME POSITION as Hamburger */
        .menu-toggle img {
            display: none; /* Hidden by default */
            width: 30px;
            height: 30px;
            position: absolute;
            top: 15px; /* Keep inside banner */
            left: 20px; /* Align with where the hamburger menu was */
            cursor: pointer;
        }

        .menu-toggle.open img {
            display: block;
        }

    /* Style the new hamburger icon */
    .menu-icon {
        width: 35px; /* Adjust size */
        height: auto;
        cursor: pointer;
        display:block;
    }

    /* Style the cross icon */
    .close-icon {
        width: 35px;
        height: auto;
        cursor: pointer;
        display: block;
    }

    /* Show cross when menu is open */
    .menu-toggle.open .menu-icon {
        display: none;
    }

    .menu-toggle.open .close-icon {
        display: block;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 16px;
        padding: 0;
    }

    section {
        padding: 60px 10px;
    }

    /* About Section */
    .about-image{
        display: none;
    }

    .about-container {
        align-items: flex-start; /* Keep everything aligned to the left */
        text-align: left; /* Align text to the left */
        width: 100%;
    }

    .about-title {
        font-size: 3rem;
        text-align: left; /* Ensure "Hello!" is left-aligned */
        padding-left: 10px; /* Add some space from the edge */
        width: 100%;
    }

    .about-content {
        flex-direction: column;
        align-items: flex-start; /* Align the text box to the left */
        text-align: left; /* Keep paragraph text aligned left */
        width: 100%;
        padding-left: 10px; /* Keep some spacing from the edge */
    }

    .about-text {
        max-width: 90%;
        text-align: left; /* Ensure the paragraph text stays aligned */
    }

    .about-image {
        max-width: 200px;
    }

    .profile-img {
        max-width: 200px;
        height: 200px;
    }

    /* Games & Projects Mosaic */
    .games-mosaic, .projects-mosaic {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: minmax(120px, auto);
        gap: 15px;
        max-width: 100%;
        padding: 0 10px;
    }

    .game-box, .project-box {
        height: auto;
    }

    .big-rectangle, .big-square {
        grid-column: span 2;
        height: auto;
    }

    .rectangle, .small-square, .long-rectangle {
        height: auto;
    }

    .game-images-container {
        display: grid;
        grid-template-columns: repeat(6, 1fr); /* 6 columns for mobile */
        gap: 10px; /* Add space between images */
        justify-content: center;
    }

        .game-images-container img {
            grid-column: span 6;
        }

            .game-images-container img[data-size="half-large"] {
                grid-column: span 6 !important;
            }

            .game-images-container img[data-size="large"] {
                grid-column: span 6 ;
            }

    /* Experience Section - Hide lines and circles */
    .experience-section::before {
        display: none;
    }

    .circle {
        display: none;
    }

    .experience-entry {
        flex-direction: column;
        align-items: center;
        text-align: center;
        border-bottom: 2px solid rgba(255, 255, 255, 0.2);
        padding-bottom: 15px;
        margin-bottom: 15px;
    }

    .date {
        width: auto;
        text-align: center;
        padding-right: 0;
        margin-bottom: 5px; /* Moves the date higher */
    }

    .content {
        width: 90%;
        margin-left: 0;
        text-align: center;
    }

    /* Education Section - Ensure full visibility & centering */
    .education-container {
        max-width: 85%;
        padding: 0;
        margin: 0 auto; /*  Center the section */
        text-align: center; /*  Ensures text and content are centered */
    }

    /* Each Education Entry - Ensure proper width */
    .education-entry {
        width: 100%;
        text-align: left; /*  Keeps text left-aligned inside */
    }


    /* Skills Section - Keep two columns */
    #skills {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
        gap: 20px;
    }

    #languages, #software {
        width: 45%;
    }

    .skills-container {
        justify-content: center;
    }

    .skills-box {
        width: 100px; /* Set fixed width */
        text-align: center;
    }

    /* Contact Section - Fix layout */
    #contact {
        padding: 40px 20px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    form {
        width: 100%;
        max-width: 500px;
    }

    input, textarea {
        width: 100%;
    }

    /* Footer - Keep everything aligned properly */
    footer {
        display: flex;
        flex-direction: row;
        justify-content: center;
        gap: 15px;
        align-items: center;
        text-align: center;
        padding: 15px;
    }

    .footer-left {
        flex: 1;
        text-align: left;
        padding-left: 10px;
    }

    .footer-center {
        flex: 1;
        text-align: center;
    }

    .footer-right {
        flex: 1;
        text-align: right;
        padding-right: 5px;
    }

        .footer-right a {
            margin-left: 5px;
            padding-right: 5px;
        }

    /* GIF Handling for Mobile - Replace with Still Image */
    .game-box img, .project-box img {
        display: block;
        object-fit: cover;
    }


    /* POP UP */
    .modal-content {
        width: 90%;
        max-height: 85vh;
    }

    .game-images-container img {
        width: 100%;
    }

    .video-container iframe {
        height: 300px;
    }
}




