/* General Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft Sans Serif', Arial, Helvetica, sans-serif;
}

/* --- THIS RULE IS FIXED --- */
body {
    min-height: 100vh;
    background-color: #000000;
    color: white;
    text-align: center;
    /* By removing 'display: flex', the body will behave like a normal
       document, allowing its height to grow with its content. */
}

/* Generic blur class to be applied by JavaScript */
.blurred-by-menu {
    transition: filter 0.3s ease-in-out;
    filter: blur(8px);
    pointer-events: none; /* Prevents clicking on blurred elements */
}

.pointer-shape {
    position: absolute;
    width: 40px;  /* Adjust size */
    height: 40px; /* Adjust size */
    background: rgb(255, 0, 0); /* Base color */
    pointer-events: none; /* Prevent interactions */
    z-index: 1000; /* Ensure it stays on top */
    animation: morph 1.5s infinite alternate; /* Apply morphing animation */
}
#video-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; /* Use 100% to fill the JS-defined parent height */
    object-fit: cover;
    filter: brightness(0.55);
    z-index: -1;
    background-color: #000; /* Fallback for when video is loading */
}

.intro {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.intro img {
    width: 500px; /* Set a specific width */
    height: auto; /* Maintain aspect ratio */
}

.intro h1 {
    font-size: 3rem;
    font-weight: bold;
    margin: 10px 0;
    color: #2c3e50;
}

.intro p {
    font-size: 1rem;
    color: #ffffff;
    mix-blend-mode: difference;
}

/* Polygons Container */
.polygons-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    width: 100%;
    max-width: 900px;
    margin: 20px auto;
    perspective: 1000px; /* Add perspective for 3D effect */
}

/* Polygon Styling */
.polygon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 150px;
    height: 150px;
    text-decoration: none;
    color: white;
    font-weight: bold;
    position: relative;
    background-color: #3498db;
    transition: transform 0.7s ease, background-color 0.3s ease, clip-path 0.3s ease;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

/* Hover Effects for Polygons */
.polygon:hover {
    transform: scale(1.1); /* Rotate and scale */
    background-color: #e74c3c; /* Change color */
    clip-path: polygon(50% 0%, 85% 15%, 100% 50%, 85% 85%, 50% 100%, 15% 85%, 0% 50%, 15% 15%);
}

/* Unique styles for each polygon */
.about-me {
    background-color: #e74c3c;
    clip-path: polygon(47% 5%, 59% 37%, 73% 25%, 84% 14%, 68% 43%, 92% 56%, 69% 55%, 91% 75%, 60% 66%, 62% 97%, 50% 66%, 40% 94%, 38% 67%, 15% 87%, 34% 58%, 5% 55%, 23% 47%, 13% 27%, 38% 44%);
}

.projects {
    background-color: #2ecc71;
    clip-path: polygon(47% 5%, 59% 37%, 73% 25%, 84% 14%, 68% 43%, 92% 56%, 69% 55%, 91% 75%, 60% 66%, 62% 97%, 50% 66%, 40% 94%, 38% 67%, 15% 87%, 34% 58%, 5% 55%, 23% 47%, 13% 27%, 38% 44%);
}

.showreel {
    background-color: #3498db;
    clip-path: polygon(47% 5%, 59% 37%, 73% 25%, 84% 14%, 68% 43%, 92% 56%, 69% 55%, 91% 75%, 60% 66%, 62% 97%, 50% 66%, 40% 94%, 38% 67%, 15% 87%, 34% 58%, 5% 55%, 23% 47%, 13% 27%, 38% 44%);
}

.contact {
    background-color: #f1c40f;
    clip-path: polygon(47% 5%, 59% 37%, 73% 25%, 84% 14%, 68% 43%, 92% 56%, 69% 55%, 91% 75%, 60% 66%, 62% 97%, 50% 66%, 40% 94%, 38% 67%, 15% 87%, 34% 58%, 5% 55%, 23% 47%, 13% 27%, 38% 44%);
}

/* Hover Effects */
.about-me:hover {
    clip-path: polygon(47% 5%, 61% 17%, 73% 25%, 84% 14%, 94% 32%, 92% 56%, 84% 65%, 91% 75%, 78% 83%, 62% 97%, 51% 88%, 40% 94%, 14% 91%, 22% 71%, 13% 68%, 5% 55%, 12% 45%, 13% 27%, 14% 8%);
    background-color: #1e9b52;
}

.projects:hover {
    clip-path: polygon(42% 38%, 64% 3%, 63% 38%, 84% 14%, 94% 32%, 73% 46%, 96% 47%, 91% 75%, 65% 79%, 61% 90%, 46% 74%, 40% 88%, 14% 91%, 27% 80%, 4% 75%, 5% 55%, 15% 47%, 7% 14%, 28% 37%);
    background-color: #5418e1;
}

.showreel:hover {
    clip-path: polygon(44% 18%, 64% 3%, 65% 28%, 75% 22%, 85% 27%, 94% 43%, 93% 59%, 79% 63%, 63% 63%, 61% 90%, 54% 69%, 40% 88%, 24% 81%, 24% 69%, 3% 62%, 19% 52%, 26% 39%, 7% 14%, 25% 19%);
    background-color: #e18709;
}

.contact:hover {
    clip-path: polygon(44% 18%, 64% 3%, 61% 34%, 93% 21%, 75% 38%, 90% 46%, 76% 58%, 94% 78%, 70% 76%, 61% 90%, 45% 75%, 21% 93%, 27% 78%, 23% 66%, 3% 62%, 19% 52%, 26% 39%, 7% 14%, 25% 19%);
    background-color: #f39c12;
}

/* --- Windows XP Style --- */

/* Apply Tahoma font and black color to the content inside the XP windows */
body {
    font-family: Tahoma, Verdana, sans-serif;
    color: #000000;
}

/* Main window container */
.xp-window {
    background-color: #ECE9D8; /* XP's default window background color */
    border-top: 2px solid #FFFFFF;
    border-left: 2px solid #FFFFFF;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.4);
    padding: 3px;
    margin-top: 2rem; /* Adds space between windows */
    text-align: left; /* Aligns text to the left within the window */
}

/* Window title bar */
.xp-title-bar {
    background: linear-gradient(to right, #0058D0, #1883F8); /* XP's blue gradient */
    color: #FFFFFF;
    font-weight: bold;
    padding: 4px 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    margin-bottom: 3px;
}

/* Decorative window buttons (minimize, maximize, close) */
.xp-title-bar-buttons {
    display: flex;
}

.xp-button {
    background-color: #D34A3C;
    border: 1px solid white;
    box-shadow: inset -1px -1px 0 #000, inset 1px 1px 0 #FFF;
    color: white;
    font-family: "Courier New", monospace;
    font-weight: bold;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 2px;
    font-size: 12px;
}

/* The main content area inside the window */
.xp-content {
    background-color: #FFFFFF;
    padding: 15px;
    border-top: 1px solid #808080;
    border-left: 1px solid #808080;
    border-right: 1px solid #FFFFFF;
    border-bottom: 1px solid #FFFFFF;
    min-height: 100px; /* Ensures window has some height */
}

/* This generic rule is commented out as it's not needed and #acknowledgements has more specific styles */
/*
footer {
    position: fixed;
    bottom: 10px;
    width: 100%;
    text-align: center;
    font-size: 0.9rem;
    color: #95a5a6;
}
*/

.blank-container-main {
    height: 150vh;
    width: 100vw;
}

#projects-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 20px;
    justify-items: center;
}

.project-card {
    height: 10vh;
    width: 12vw;
    background-color: grey;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.project-card:hover {
    transform: scale(1.1);
    background-color: #4a90e2;
}

.preview-box {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform: scale(0.8);
    opacity: 0;
    pointer-events: none;
}

.preview-box.show {
    transform: scale(1);
    opacity: 1;
    pointer-events: auto;
}

.preview-box img {
    max-width: 80px;
    max-height: 80px;
    object-fit: cover;
}

/* Header Main Container */
.all-page-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    width: 100%;
    position: relative; /* Needed for z-index to work correctly with menu */
    z-index: 1002; /* Ensures header is above the blur overlay */
}

/* Header Logo */
.header-logo-container img {
    height: 70px;
    width: auto;
}

/* Header Navigation Links (Desktop) */
.header-links {
    display: flex;
    gap: 25px;
}

.header-links a {
    text-decoration: none;
    color: #f4f4f4;
    font-size: 1.1rem;
    font-weight: bold;
    mix-blend-mode: luminosity;
    transition: color 0.3s ease;
}

.header-links a:hover {
    color: #3498db;
}

/* Hamburger Menu Button */
.hamburger-menu {
    display: none; /* Hidden on desktop */
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger-menu .bar {
    width: 100%;
    height: 3px;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
}

.about_text {
    width: 80%;
    justify-content: center;
}

.about_cols {
    display: flex;
}

.about_cols div {
    padding: 20px;
}

.skills_text {
    display: flex;
}

.skills_text div {
    padding: 20px;
}

.prof_summary {
    width: 70%;
}

.project_writeup {
    width: 80vw;
}

.socials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 50%;
    max-width: 1200px; /* Adjusted for better logo size */
    margin: 20px auto;
}

.socials-grid img {
    width: 100%;
    height: auto;
    transition: transform 0.2s ease-in-out;
}

.socials-grid img:hover {
    transform: scale(1.1);
}

/* Acknowledgements Footer */
#acknowledgements {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background-color: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    color: #ffd900;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    z-index: 100;

    /* Hidden by default */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

/* Class to show the footer */
#acknowledgements.visible {
    opacity: 1;
    visibility: visible;
}

.ack-image-placeholder {
    width: 150px;
    height: 150px;
    border: 2px dashed #555;
    border-radius: 50%;
}

.ack-text {
    font-size: 1.2rem;
}

/* --- RESPONSIVE STYLES --- */
@media (max-width: 768px) {
    .polygon {
        width: 120px;
        height: 120px;
        font-size: 0.8rem;
    }

    #name-image {
        margin-top: 15vh;
    }

    .intro h1 {
        font-size: 2.5rem;
    }

    .intro p {
        font-size: 0.9rem;
    }

    .intro img {
        width: 150px;
    }

    #contact-image {
        scale: 1.5;
        margin-bottom: 10vh;
        margin-top: 10vh;
    }

    #projects-grid {
        margin-top: 10vh;
        grid-template-columns: repeat(2, minmax(150px, 1fr));
    }

    .socials-grid {
        grid-template-columns: repeat(2, 1fr);
        width: 70%;
    }

    .about_cols {
        flex-direction: column; /* Stack the columns vertically */
        margin: 0;              /* Reset horizontal margins */
        padding: 0;             /* Keep padding reset */
    }

    /* Hamburger Menu and Mobile Nav Styles */
    .hamburger-menu {
        display: flex; /* Show hamburger on mobile */
    }

    .header-links {
        /* Start hidden with no visibility */
        visibility: hidden;
        opacity: 0;
        
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.85);
        
        display: flex; /* Keep flex for alignment */
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 30px;
        z-index: 1000;
        
        /* Add transition for the fade effect */
        transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    }

    .header-links.active {
        /* Make menu visible and fade in */
        opacity: 1;
        visibility: visible;
    }

    .header-links a {
        font-size: 1.5rem;
    }

    .intro img {
        scale: 1.5;
    }

    .wip_sign {
        scale: 0.3;
    }

    #acknowledgements {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
        text-align: center;
    }

    .ack-text {
        font-size: 0.8rem;
    }
}

.wip_sign {
    margin-right: 50px;
}