:root {
    --c-dark: #212529;
    --c-brand: #4e57d4;
    --font-base: "Inter", sans-serif;
}

body {
    font-family: var(--font-base);
    line-height: 1.6;
    /* Adds vertical breathing room */
    letter-spacing: -0.01em;
    /* Makes Inter look extra crisp */
}

h1,
h2,
h3 {
    font-family: var(--font-base);
    font-weight: 600;
    letter-spacing: -0.02em;
    /* Keeps headings tight but not squashed */
}

html {
    scroll-behavior: smooth;
}

.main-header {
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #111;
    /* Or your preferred dark background */
    color: white;
}

.header-top-row {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1200px;
    gap: 30px;
}

.header-side {
    flex: 1;
    /* Gives both text sides equal width */
    padding: 0 20px;
}

.text-left {
    text-align: left;
    /* Aligns toward the center image */
}

.text-right {
    text-align: right;
    /* Aligns toward the center image */
}

.portfolio-title {
    font-size: 1.8rem;
    margin: 0;
}

.portfolio-subtitle {
    font-size: 1.4rem;
    font-weight: 300;
    margin: 0;
    color: #bbb;
}

/* The Circle Image */
.profile-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #ffb300;
    /* Matching your orange accent color */
    background: #333;
    /* Placeholder color */
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Resume Button Styling */
.header-bottom-row {
    margin-top: 30px;
}

.resume-button {
    text-decoration: none;
    background: #ffb300;
    color: #111;
    padding: 12px 25px;
    border-radius: 30px;
    font-weight: bold;
    transition: all 0.3s ease;
    display: inline-block;
}

.resume-button:hover {
    background: #ffa000;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 179, 0, 0.4);
}


.single-icon {
    width: 50px;
    /* Adjust size as needed */
    height: auto;
    cursor: pointer;
    filter: grayscale(100%);
    /* Optional: icons look cleaner when grayed out until active */
    transition: all 0.3s ease;
}

.single-icon.active-skill {
    filter: grayscale(0%);
    transform: scale(1.1);
    border-bottom: 2px solid #007bff;
}

.single-icon:hover {
    transform: scale(1.1);
}

/* Optional: dim icons that aren't selected */
.single-icon.active {
    outline: 2px solid #007bff;
    border-radius: 50%;
}

.icon-container {
    display: flex;
    justify-content: center;
    /* Centers icons and the button */
    align-items: center;
    /* Vertically aligns icons and button */
    flex-wrap: wrap;
    /* Moves items to next line if screen is narrow */
    gap: 15px;
    /* Space between all items */
    padding: 20px 20px 10px 20px;
    /* Reduced bottom padding */
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 15px;
    /* Much smaller space below the container */
}

#show-all-icons:hover {
    background: rgba(255, 179, 0, 0.443);
    border-color: rgba(255, 157, 0, 0.8);
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(255, 174, 0, 0.4);
}

#show-all-icons:active {
    transform: scale(0.95);
}

.domain-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    /* Add space above and below the buttons */
    padding: 30px 0;
    /* Ensure it takes full width to keep items centered */
    width: 100%;
}

/* If you want the same spacing for the Skills section */
.skill-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    padding: 30px 0;
    width: 100%;
}

.reset-pill {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    /* Ensure your page background isn't white! */
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    display: inline-block;
    /* Ensures it respects padding/height */
    transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.reset-pill:hover {
    background: rgba(255, 179, 0, 0.443);
    border-color: rgba(255, 157, 0, 0.8);
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(255, 174, 0, 0.4);
}

.single-domain {
    padding: 8px 12px;
}

.single-skill {
    padding: 8px 12px;
}

/* Apply to both Domain and Skill text buttons */
.single-domain,
.single-skill {
    cursor: pointer;
    display: inline-block;
    /* Required for transform/scale to work properly */
    padding: 8px 12px;
    transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Hover effect: Scale up and add the glow */
.single-domain:hover,
.single-skill:hover {
    transform: scale(1.1);
}

/* Active (Clicking) effect: Slight shrink for feedback */
.single-domain:active,
.single-skill:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

/* Domain: Purple Aesthetic */
.single-domain.active-filter {
    background-color: rgba(147, 51, 234, 0.3);
    /* Purple background */
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.6);
    /* Purple glow */
    border-radius: 4px;
    transform: scale(1.05);
}

/* The Toggle Button Styling */
.filter-trigger {
    background: #222;
    color: white;
    border: 1px solid #444;
    padding: 10px 25px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 10px auto 20px auto;
    transition: background 0.3s, transform 0.2s;
}

.filter-trigger:hover {
    background: #333;
    transform: translateY(-2px);
}

.arrow {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    display: inline-block;
}

/* Rotate arrow when active */
.filter-trigger.active .arrow {
    transform: rotate(180deg);
}

/* Collapse Logic */
.filter-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s cubic-bezier(0, 1, 0, 1), opacity 0.3s ease;
}

/* Open State */
.filter-content.show {
    max-height: 1000px;
    /* High value to accommodate content */
    opacity: 1;
    transition: max-height 0.5s ease-in, opacity 0.5s ease;
    margin-bottom: 30px;
}

/* Ensuring the buttons stay centered when revealed */
.domain-container,
.skill-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* Skills: Blue Aesthetic */
.single-skill.active-filter {
    background-color: rgba(50, 118, 254, 0.2);
    /* Your original Blue */
    box-shadow: 0 0 10px rgba(0, 26, 255, 0.4);
    /* Your original Blue glow */
    border-radius: 4px;
    transform: scale(1.05);
}

.project-container {
    display: grid;
    /* Defines 3 columns of equal width */
    grid-template-columns: repeat(3, 1fr);
    /* Gap between items (vertically and horizontally) */
    gap: 30px;
    grid-auto-rows: 1fr;
}

.project-item {
    /* We remove flex: 1; Grid now handles the sizing */
    width: 100%;
    height: 100%;
    display: block;
    display: flex;
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.project-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

/* 1. Setup the container for the image and text */
.project-image-wrapper {
    width: 100%;
    /* 1. Force a consistent shape (16:10 or 4:3 works well for portfolios) */
    aspect-ratio: 16 / 10;
    overflow: hidden;
    position: relative;
    border-radius: 8px;
    background: #000;
    /* Black background to fill gaps if any */
}

.project-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
    /* Smooth zoom effect on hover */
}

/* 2. Create the hidden overlay */
.project-title {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* 3. Style the H2 title */
.project-title h2 {
    color: white;
    margin: 0;
    font-size: 2rem;
    padding: 12px 24px;
    border-radius: 4px;

    /* The "Box" around the text */
    background: rgba(0, 0, 0, 0.7);

    /* Hide the box and text by default on desktop */
    opacity: 0;
    transform: scale(0.9);
    /* Subtle "pop-in" effect */
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.project-image-wrapper:hover .project-title h2 {
    opacity: 1;
    transform: translateY(0);
    /* Slides text into place */
}

.project-image-wrapper:hover img {
    transform: scale(1.05);
    opacity: 0.7;
}

.project-skills-bar img {
    width: 25px;
    /* Small icon size */
    height: 25px;
    object-fit: contain;
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
}

.mini-skill-icon {
    width: 25px;
    height: 25px;
    display: block;
    object-fit: contain;
}

.project-title {
    margin-top: -30px;
}

.project-title h2 {
    text-align: center;
    /* Centers both single and multi-line text */
    margin: 0 auto;
    /* Ensures the block itself is centered if it has a width */
    width: 100%;
    /* Forces the h2 to span the full width of its container */
}

.project-info-stack {
    position: absolute;
    bottom: 15px;
    left: 0;
    display: flex;
    flex-direction: column;
    /* Stacks items from bottom to top */
    align-items: flex-start;
    /* Keeps them flush to the left */
    gap: 8px;
    /* Space between the bars */
    z-index: 5;
    pointer-events: none;
}

/* Base style for all bars to ensure they look like matching tabs */
.project-skills-bar,
.project-domain-bar,
.project-type-bar {
    position: relative;
    /* Change from absolute to relative to stay in the stack */
    width: auto;
    background: rgba(0, 0, 0, 0.7);
    padding: 6px 14px 6px 10px;
    border-radius: 0 6px 6px 0;
    /* Flat on the left, rounded on the right */
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    display: flex;
    align-items: center;
}



/* Skill icon bar specifics */
.project-skills-bar {
    gap: 10px;
}

.single-domain,
.single-skill {
    cursor: pointer;
    transition: all 0.3s ease;
}

.icons,
.domains,
.skills {
    margin-bottom: 30px;
}

/* Ensure the hover title appears ABOVE the skill bar */
.project-title {
    z-index: 10;
}

/* Ensure the title doesn't overlap the icons too much if it's large */
.project-title {
    z-index: 3;
}

/* --- Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

/* When this class is added via JS, the modal shows up */
.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    /* Or your dark theme color */
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 1100px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 20px;

    /* --- SCROLL LOGIC --- */
    max-height: 85vh;
    /* 1. Limits height to 85% of the screen */
    overflow-y: auto;
    /* 2. Adds a vertical scrollbar if content is too long */
    overflow-x: hidden;
    /* 3. Prevents accidental horizontal shifting */

    /* 1. Hide scrollbar for Chrome, Safari, and newer versions of Edge */
    &::-webkit-scrollbar {
        display: none;
    }

    /* 2. Hide scrollbar for Firefox */
    scrollbar-width: none;

    /* 3. Hide scrollbar for IE and older Edge */
    -ms-overflow-style: none;
}

/* Ensure the image doesn't get squashed in the flex layout */
.modal-content img {
    width: 80%;
    display: block;
    margin: 0 auto 20px auto;
    height: auto;
    flex-shrink: 0;
    /* 4. Prevents the image from shrinking to fit the box */
    border-radius: 8px;
    object-fit: contain;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    /* Adds depth */
    opacity: 0;
    animation: fadeIn 0.8s ease-in forwards;
}

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

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

.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Container to handle the horizontal alignment */
.skill-icon-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 40px
}

/* The individual chip containing icon + both labels */
.skill-chip {
    display: inline-flex;
    align-items: center;
    /* Centers the icon and text group vertically */
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px;
    /* This creates the space for your box shadow to be visible */
    gap: 15px;
}

/* The vertical stack for text */
.skill-text-group {
    display: flex;
    flex-direction: column;
    /* This performs the stacking */
    justify-content: center;
    padding: 5px 0;
    gap: 8px;
    /* This creates the vertical gap between Domain and Skill */
    flex-grow: 1;
    min-width: 120px;
}

.label-prefix {
    text-decoration: underline;
    text-underline-offset: 2px;
    /* Makes the underline look cleaner */
    margin-right: 4px;
    /* Space between prefix and the actual name */
}

/* Enforcing icon size */
.skill-icon-modal {
    height: 25px !important;
    width: auto !important;
    object-fit: contain;
}

/* Domain Label Styling */
.domain-label,
.skill-label {
    font-size: 1rem;
    color: #515151;
    /* Slightly dimmed to distinguish from skill */
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Optional: Vertical line between Domain and Skill */
.domain-label::after {
    content: "|";
    margin-left: 15px;
    color: rgba(255, 255, 255, 0.2);
}

/* Updated for smaller icon size */
.skill-icon-modal {
    height: 100% !important;
    /* Take up 100% of the chip's height */
    width: auto !important;
    display: block;
    /* Removes the baseline text gap */
    margin: 0 !important;
    /* Removes any mystery margins */
    padding: 5px;
    /* Optional: small internal padding so it doesn't touch the VERY edge */
    background: rgba(255, 255, 255, 0.05)
}

/* Using the container + class ensures this takes priority */
.skill-icon-container,
.skill-icon-modal {
    height: 80px !important;
    /* The !important is a last resort, but useful for testing */
    width: auto;
    object-fit: contain;
    display: inline-block;
}

/* Isolated container for the Development Modal */
.dev-skills-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    /* This centers the group of icons */
    align-items: center;
    gap: 20px;
    /* Clean spacing between raw icons */
    margin: 15px 0 25px 0;
    padding: 10px;
}

/* Reset icon behavior for this specific container only */
.dev-skills-container .skill-icon-modal {
    height: 80px !important;
    /* Slightly larger for visibility since there is no text */
    width: auto !important;
    display: inline-block !important;
    margin: 0 !important;
    filter: none;
    /* Clean look without the heavy project drop-shadow */
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.dev-skills-container .skill-icon-modal:hover {
    opacity: 1;
}

.close-button {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 30px;
    cursor: pointer;
    color: #333;
    /* Styling to make it visible against images */
    font-size: 2rem;
    font-weight: bold;
    color: white;
    background: rgba(0, 0, 0, 0.5);
    /* Semi-transparent circle background */
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
    transition: background 0.3s ease;

    /* Prevent the button from pushing content down */
    margin-bottom: -40px;
}

.main-footer {
    background: #111;
    color: #bbb;
    padding: 40px 20px;
    margin-top: 50px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.footer-side {
    flex: 1;
    font-size: 0.9rem;
}

.footer-center {
    flex: 0 0 auto;
}

.text-right {
    text-align: right;
}

/* Footer Link Styling */
.footer-contact-link {
    color: #ffb300;
    text-decoration: none;
    font-weight: bold;
    padding: 10px 20px;
    border: 1px solid #ffb300;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.footer-contact-link:hover {
    background: #ffb300;
    color: #111;
    box-shadow: 0 0 15px rgba(255, 179, 0, 0.3);
}

.back-to-top {
    color: #888;
    text-decoration: none;
    transition: color 0.3s ease;
}

.back-to-top:hover {
    color: #ffb300;
}

.footer-icon {
    width: 54px;
    /* Adjust size as needed */
    height: auto;
    vertical-align: middle;
    margin-right: 15px;
    /* Adds space between the icon and "Back to Top" */
    transition: transform 0.2s ease, opacity 0.2s ease;
}

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

/* Ensure the text-right div keeps items in a single line */
.footer-side.text-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    /* Keeps it to the edge of your constrained container */
}


/* Mobile Adjustment */
/* Mobile sizing */
@media (max-width: 768px) {

    .header-top-row {
        flex-direction: column;
        text-align: center;
    }

    .text-left,
    .text-right {
        text-align: center;
    }

    .profile-circle {
        order: -1;
        /* Puts image at the very top on mobile */
    }

    .project-container {
        grid-template-columns: 1fr;
    }

    .project-title {
        margin-top: -60px;
    }

    .project-title h2 {
        opacity: 1 !important;
        font-size: 1.2rem;
        padding: 10px 20px;
        /* Remove any transform if you had one, to keep it static */
        transform: none !important;
    }

    .project-image-wrapper img {
        /* Ensure image is slightly dimmed on mobile so text pops */
        opacity: 0.8;
    }

    .project-item {
        width: 100%;
    }

    .project-item img {
        height: 250px;
        object-fit: cover;
    }

    .project-skills-bar img {
        width: 20px;
        /* Even smaller for mobile */
        height: 20px;
    }

    .modal-content {
        width: 100%;
        height: 80vh;
        /* Takes up 80% of the screen height */
        overflow-y: auto;
        /* Allows scrolling if the description is long */
    }

    .skill-icon-container {
        display: block;
        width: 100%;
        margin-bottom: 140px;
    }

    /* 2. Update the chip to stack and push content */
    .skill-chip {
        display: flex;
        /* Changed from inline-flex */
        width: 100%;
        /* Ensures it takes up the row to push text down */

        /* Stacks icons on top of text labels */

        padding: 15px;
        /* Extra breathing room */
        gap: 10px;
        margin-bottom: 15px;
        /* Secondary push for the following content */
    }


    .icon-container {
        flex-direction: row;
        /* Keep icons side-by-side */
        justify-content: center;
    }

    /* Target only the reset buttons inside icon containers */
    .icon-container .reset-pill {
        flex-basis: 100%;
        /* Forces the button to take up the full width of a row */
        width: fit-content;
        /* Keeps the button itself from stretching */
        margin: 15px auto 5px auto;
        /* Centers it and adds space above */
        order: 10;
        /* Ensures it always stays at the very bottom */
    }

    .domain-container,
    .skill-container {
        display: flex;
        flex-wrap: wrap;
        /* THIS IS THE KEY */
        justify-content: center;
        /* Keeps the top icons centered */
    }

    .domain-container .reset-pill,
    .skill-container .reset-pill {
        /* 1. Force the break: This item now MUST start a new row */
        flex-basis: 100%;

        /* 2. Control visual width using margins instead of the width property */
        /* (100% - 60% = 40% total margin, or 20% on each side) */
        margin-left: 25%;
        margin-right: 25%;

        /* 3. Add vertical spacing */
        margin-top: 15px;
        margin-bottom: 5px;

        /* 4. Keeps it at the very bottom */
        order: 10;

        /* 5. Clean up any conflicting width properties */
        width: auto;
        max-width: none;
    }



    /* Target all images inside the modal */
    .modal-content img {
        display: block;
        width: 100%;
        /* Makes the image almost full width of the modal */
        max-width: 1000px;
        /* Prevents it from becoming blurry on giant screens */
        height: auto;
        /* Maintains aspect ratio */
        margin: 20px auto;
        /* Centers the image with space above and below */
        border-radius: 8px;
        /* Optional: keeps the clean look of your cards */
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
        /* Adds depth */
    }

    /* Specifically for the text-heavy areas, ensure the text doesn't
    get squeezed by the wider images */
    .modal-text-content {
        width: 100%;
        margin: 0 auto;
    }

    .footer-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .text-right {
        text-align: center;
    }
}
