/* Custom font for better aesthetics */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');
@import "tailwindcss";

html {
    scroll-behavior: smooth;
    /* Enable native smooth scrolling for anchor links */
    scroll-padding-top: 5rem;
    /* Offset for fixed navbar height */
}

body {
    font-family: 'Poppins', sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Align items to the start vertically for scrolling */
    align-items: center;
    /* Center items horizontally */
    min-height: 100vh;
    /* Ensure body takes full height */
    background-color: #2D3748;
    /* A slightly lighter dark background for contrast */
    padding: 2rem 1rem;
    /* Added padding to the top and bottom for scrolling effect */

    padding-top: 5rem;
    /* Add padding to the top of the body to account for the fixed navbar */
}

/* CSS Variable for Navbar Height */
:root {
    --navbar-actual-height: 5rem;
    /* Default value, will be updated by JS */
}

/* Base styles for avatar container on larger screens */
.avatar-container-desktop {
    position: absolute;
    /* Top and right will be set dynamically by JS for precise alignment */
    display: block;
    /* Ensure it's block for absolute positioning */
}

/* Mobile specific styles for avatar container */
@media (max-width: 767px) {

    .content-container {
        margin-right: 5rem;
        text-align: center;
    }

    .main-desc {
        text-align: center;

    }

    .main-title {
        text-align: center;
    }

    /* Adjust for mobile screens */
    .avatar-container-mobile {
        position: static;
        /* Make avatar static on mobile */
        margin-bottom: 1rem;
        /* Add space below avatar on mobile */
        display: flex;
        justify-content: center;
        /* Center avatar on mobile */
        width: 100%;
        /* Take full width to center its content */
    }

    /* On mobile, the content-area itself doesn't need right padding for avatar */
    .content-area {
        padding-right: 0 !important;
    }

    .main-frame {
        flex-direction: column;
        /* Stack elements vertically on mobile */
        align-items: center;
        /* Center content horizontally on mobile */
    }

    /* Ensure background section padding is reset on mobile */
    #background-section {
        padding-right: 0 !important;
    }

    /* Adjust navbar for mobile */
    .navbar-links {
        position: fixed;
        /* Use fixed to cover the whole screen */
        top: var(--navbar-actual-height);
        /* Start below the main navbar */
        right: -100%;
        /* Start off-screen to the right */
        width: 100%;
        height: calc(100vh - var(--navbar-actual-height));
        /* Fill remaining viewport height */
        background-color: rgba(26, 26, 29, 0.95);
        /* Slightly transparent */
        flex-direction: column;
        justify-content: space-between;
        /* Distribute space and push last item to bottom */
        padding-top: 0;
        /* No extra padding here, height is calculated */
        align-items: center;
        /* Center items horizontally */
        transition: right 0.5s ease-out, opacity 0.5s ease-out;
        /* Smooth transition for menu */
        opacity: 0;
        /* Start hidden */
        z-index: 49;
        /* Below the main navbar, but above content */
        overflow-y: auto;
        /* Enable scrolling for many links */
        display: flex;
        /* Always flex on mobile, hide with opacity/right */
    }

    .navbar-links.active {
        right: 0;
        /* Slide in to the screen */
        opacity: 1;
        /* Fade in */
    }

    /* Styling for all direct children of navbar-links that are part of the animation */
    .navbar-links>.fade-in-item {
        display: block;
        /* Ensure full width */
        padding: 1rem 1.5rem;
        /* Consistent padding */
        text-align: center;
        width: 100%;
        /* Ensure links take full width for centering */
        border-bottom: 1px solid #31363F;
        /* Separator between items */
        opacity: 0;
        /* Start hidden for staggered animation */
        transform: translateX(20px);
        /* Start slightly right for staggered animation */
        transition: background-color 0.2s ease-in-out, transform 0.3s ease-out, opacity 0.3s ease-out;
    }

    .navbar-links.active>.fade-in-item {
        opacity: 1;
        /* Explicitly set opacity to 1 when active */
        transform: translateX(0);
    }

    .navbar-links>.fade-in-item:last-child {
        border-bottom: none;
        /* No border for the last item */
        margin-top: auto;
        /* Push to the bottom */
        padding-bottom: 7rem;
    }

    /* Specific styling for the social group heading */
    .mobile-menu-group h4 {
        margin-bottom: 0.5rem;
        /* Adjust spacing */
        margin-top: 0;
        /* Reset default margin-top from mb-2 mt-4 */
        padding-top: 0.5rem;
        /* Add some padding to separate from previous item */
    }

    /* Ensure the Github link within the group has correct padding and width */
    .mobile-menu-group a {
        padding: 0.75rem 1.5rem;
        /* Smaller padding for nested link */
        width: 100%;
        display: block;
        /* Ensure it takes full width */
    }

    /* Staggered animation for mobile links when active */
    .navbar-links.active>.fade-in-item:nth-child(1) {
        transition-delay: 0.1s;
    }

    .navbar-links.active>.fade-in-item:nth-child(2) {
        transition-delay: 0.15s;
    }

    .navbar-links.active>.fade-in-item:nth-child(3) {
        transition-delay: 0.20s;
    }

    .navbar-links.active>.fade-in-item:nth-child(4) {
        transition-delay: 0.25s;
    }

    /* Contact Me link */
    .navbar-links.active>.fade-in-item:nth-child(5) {
        transition-delay: 0.30s;
    }

    /* Social group */
    .navbar-links.active>.fade-in-item:nth-child(6) {
        transition-delay: 0.35s;
    }

    /* Contact email paragraph */


    .navbar-toggle {
        display: block;
        /* Show hamburger icon on mobile */
    }
}

/* Desktop specific styles for navbar links - ensure they are flex on desktop */
@media (min-width: 768px) {

    /* Tailwind's 'md' breakpoint */
    .navbar-links {
        display: flex !important;
        /* Force display flex on desktop */
        position: static !important;
        /* Reset position */
        top: auto !important;
        right: auto !important;
        width: auto !important;
        height: auto !important;
        padding-top: 0 !important;
        opacity: 1 !important;
        /* Ensure visible */
        z-index: auto !important;
        overflow-y: visible !important;
        flex-direction: row !important;
        /* Ensure row direction on desktop */
    }

    .navbar-links a {
        padding: 0.5rem 1rem;
        /* Added padding for desktop buttons */
        opacity: 1 !important;
        /* Ensure links are visible on desktop */
        transform: translateX(0) !important;
        transition-delay: 0s !important;
        border-bottom: none !important;
        /* No border on desktop */
        width: auto !important;
        /* Reset width */
    }

    /* Hide mobile-specific elements on desktop */
    .mobile-menu-group,
    .navbar-links p.fade-in-item:last-child {
        display: none !important;
    }
}

.nav-logo {
    width: 3rem;
    height: 2rem;

}

#image-viewer-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    /* Darker overlay */

    /* Controlled by JS now */
    justify-content: center;
    align-items: center;
    z-index: 1010;
    /* Higher than game-details-modal */
    transition: background-color 0.3s ease-out;
    /* Transition for the overlay itself */
}

/* Modal specific styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;

}

.modal-content {
    background-color: #1A1A1D;

    /* Reverted to previous color */
    width: 90%;
    max-width: 800px;
    /* Increased max-width */
    border-radius: 0.75rem;
    /* rounded-xl */
    padding: 0 3rem 3rem 3rem;
    /* Adjusted padding: 0 top, 3rem sides/bottom */
    position: relative;
    /* Needed for sticky positioning of children */
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.3);
    color: white;
    overflow-y: auto;
    /* Enable scrolling for long content */
    max-height: 90vh;
    /* Limit height to viewport */

    /* Custom Scrollbar Styling (Vertical) */
    scrollbar-width: thin;
    /* Firefox */
    scrollbar-color: #888888 transparent;
    /* Firefox: thumb color track color */
}

/* Webkit browsers (Chrome, Safari, Edge) vertical scrollbar styling */
.modal-content::-webkit-scrollbar {
    width: 12px;
    /* Width of the vertical scrollbar */
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
    /* Color of the scrollbar track */
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background-color: #888888;
    /* Color of the scrollbar thumb */
    border-radius: 10px;
    border: 3px solid transparent;
    /* Padding around the thumb, now transparent */
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background-color: #AAAAAA;
    /* Color of the scrollbar thumb on hover */
}


/* Sticky header for modal title and close button */
#modal-sticky-header {
    position: sticky;
    top: 0;
    background-color: #1A1A1D;
    /* Match modal background */
    padding: 1.5rem 0;
    /* Padding for header content */
    z-index: 20;
    /* Ensure it's above all other content */
    /* Adjust margins to extend background across full modal width */
    margin-left: -3rem;
    margin-right: -3rem;
    padding-left: 3rem;
    padding-right: 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close-button {
    background: none;
    border: none;
    color: #ccc;
    font-size: 2rem;
    /* Made 'X' larger */
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: color 0.2s ease-in-out;
    flex-shrink: 0;
    /* Prevent button from shrinking */
}

.modal-close-button:hover {
    color: #fff;
}

/* Styling for the main image display in the modal */
#main-game-display-image {
    border-radius: 0.5rem;
    /* rounded-lg */
    object-fit: cover;
    border: 2px solid #4A5568;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Styling for thumbnails */
.thumbnail-image {
    flex-shrink: 0;
    /* Prevent shrinking */
    border: 2px solid transparent;
    /* Default transparent border */
    transition: border-color 0.2s ease-in-out;
    /* Smooth transition for hover */
}

.thumbnail-image:hover {
    border-color: #63B3ED;
    /* Highlight color on hover (Tailwind blue-400) */
}

/* Custom Scrollbar Styling (Horizontal for thumbnail-container) */
#thumbnail-container {
    /* Existing styles for flex, overflow-x-auto, space-x-3, p-2, rounded-lg, mb-6 */
    background-color: #31363F;
    /* Reverted to previous color */
    scrollbar-width: thin;
    /* Firefox */
    scrollbar-color: #888888 #31363F;
    /* Firefox: thumb color track color */
}

#thumbnail-container::-webkit-scrollbar {
    height: 12px;
    /* Height of the horizontal scrollbar */
}

#thumbnail-container::-webkit-scrollbar-track {
    background: #31363F;
    /* Reverted to previous color */
    border-radius: 10px;
}

#thumbnail-container::-webkit-scrollbar-thumb {
    background-color: #888838;
    /* Color of the horizontal scrollbar thumb */
    border-radius: 10px;
    border: 3px solid #31363F;
    /* Padding around the thumb */
}

#thumbnail-container::-webkit-scrollbar-thumb:hover {
    background-color: #AAAAAA;
    /* Color of the horizontal scrollbar thumb on hover */
}

/* Active button style for project categories */
.active-category-button {
    background-color: #5C2E4B !important;
    /* Darker purple for active state */
    box-shadow: 0 44px 6px rgba(0, 0, 0, 0.2);
    /* Add a subtle shadow */
    transform: scale(1.02);
    /* Slightly larger */
}

/* Styles for scroll-reveal effect */
.main-frame,
.fade-in-scroll {
    opacity: 0;
    /* Start invisible */
    transform: translateY(50px);
    /* Start slightly below */
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    /* Smooth transition */
}

.main-frame.is-visible,
.fade-in-scroll.is-visible {
    opacity: 0.8;
    /* Final visible opacity */
    transform: translateY(0);
    /* Move to original position */
}

/* Project Card specific styles for background image and hover effect */
.project-card {
    position: relative;
    overflow: hidden;

    height: 150px;
    /* Fixed height for cards to ensure consistent layout */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    border-radius: 0.5rem;
    /* rounded-lg */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease-in-out;
    margin-top: 1rem;
    /* Added margin-top for spacing */
    background-color: #222831;
    /* Fallback background color */
}

.project-card:hover {
    transform: scale(1.03);
    /* Slightly enlarge card on hover */
}

.project-card-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: filter 0.3s ease-in-out, transform 0.3s ease-in-out;
    z-index: 1;
}

.project-card-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    /* Start transparent */
    backdrop-filter: blur(0px);
    /* Start unblurred */
    transition: background-color 0.3s ease-in-out, backdrop-filter 0.3s ease-in-out;
    z-index: 2;
}

.project-card:hover .project-card-background {
    filter: blur(5px);
    transform: scale(1.05);
    /* Slight zoom on image */
}

.project-card:hover .project-card-background::before {
    background-color: rgba(0, 0, 0, 0.6);
    /* Darken overlay on hover */
    backdrop-filter: blur(5px);
    /* Blur overlay on hover */
}

.project-card-content {
    position: relative;
    z-index: 3;
    opacity: 0;
    /* Hidden by default */
    transition: opacity 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    height: 100%;
    width: 100%;
    padding: 1rem;
    /* Add padding to content */
    color: white;
}

.project-card:hover .project-card-content {
    opacity: 1;
    /* Visible on hover */
}

.project-card-content h3 {
    font-size: 1.25rem;
    /* text-xl */
    font-weight: 600;
    /* font-semibold */
    margin-bottom: 0.25rem;
    /* mb-1 */
    color: #F7FAFC;
    /* text-gray-100 */
}

.project-card-content p {
    font-size: 0.875rem;
    /* text-sm */
    color: #CBD5E0;
    /* text-gray-300 */
}

/* Styles for the animated hamburger icon */
.animated-icon {
    width: 24px;
    height: 24px;
    position: relative;
    cursor: pointer;
}

.animated-icon .line {
    fill: none;
    stroke: currentColor;
    /* Use current text color */
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    transform-origin: center;
}

/* Initial state for hamburger lines */
.animated-icon .line-top {
    transform: translateY(-6px);
}

.animated-icon .line-middle {
    opacity: 1;
}

.animated-icon .line-bottom {
    transform: translateY(6px);
}

/* Active state for arrow icon */
.animated-icon.active .line-top {
    transform: translateY(0) rotate(-45deg);
}

.animated-icon.active .line-middle {
    opacity: 0;
    transform: translateX(10px);
    /* Move out of view */
}

.animated-icon.active .line-bottom {
    transform: translateY(0) rotate(45deg);
}

/* Navbar background and shadow transition */
#main-navbar {
    background-color: transparent;
    /* Default transparent */
    box-shadow: none;
    /* Default no shadow */
    transition: background-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

#main-navbar.scrolled {
    background-color: #1A1A1D;
    /* Solid background when scrolled */
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.3);
    /* Add shadow when scrolled */
}

#about-me-section {
    width: 90vw;
}

#virtual-pc-section {
    width: 90vw;
}

#projects-section {
    width: 90vw;
}

/* New styles for the image viewer modal */


#image-viewer-modal.active-viewer {
    /* This class will be added by JS */
    background-color: rgba(0, 0, 0, 0.9);
    /* Ensure full opacity when active */
}

#image-viewer-modal .image-viewer-container {
    /* This is the element that zooms and holds header + image */
    display: flex;
    flex-direction: column;
    position: relative;
    max-width: 95%;
    max-height: 95%;
    border-radius: 0.1rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    background-color: black;
    /* Solid background for the container that holds image+header */
    overflow: hidden;
    /* Ensures border-radius applies to image edges if they touch */

    /* Initial state for zoom-in effect */
    transform: scale(0.7);
    opacity: 0;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

#image-viewer-modal.active-viewer .image-viewer-container {
    transform: scale(0.95);
    opacity: 1;
}

#image-viewer-modal .image-viewer-header {
    width: 100%;
    height: 2vh;
    background-color: rgba(0, 0, 0, 0.2);
    /* 50% opacity */
    padding: 0rem 1rem;
    display: flex;
    justify-content: flex-end;
    z-index: 10;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-top-left-radius: 0.5rem;
    /* Match container border-radius */
    border-top-right-radius: 0.5rem;
}

#image-viewer-modal img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    flex-grow: 1;
    /* Allow image to fill available space in column */
    padding: 1rem;
    /* Padding between header and image, and image and container edges */
}


#image-viewer-modal .close-image-viewer {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: color 0.2s ease-in-out;
    flex-shrink: 0;
    /* Prevent button from shrinking */
}

#image-viewer-modal .close-image-viewer:hover {
    color: #ccc;
}

/* Styles for navigation arrows in image viewer modal */
.image-viewer-nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    /* Semi-transparent background */
    color: white;
    font-size: 2.5rem;
    /* Large arrow size */
    padding: 0.5rem 1rem;
    border: none;
    cursor: pointer;
    z-index: 1020;
    /* Above image and header */
    border-radius: 0.5rem;
    transition: background-color 0.3s ease, color 0.3s ease;
    opacity: 0.7;
    /* Slightly transparent when not hovered */
}

.image-viewer-nav-button:hover {
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    opacity: 1;
}

.image-viewer-nav-button.left {
    left: 1rem;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.image-viewer-nav-button.right {
    right: 1rem;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}