/* Base Styles */
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: #000000;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', sans-serif;
    overflow-x: hidden;
    overflow-y: scroll;
}

/* Home Button - Matches Navigation Bar EXACTLY */
#home-button-container {
    position: fixed;
    top: 20px;
    right: 50%;
    margin-right: 360px;
    z-index: 1000;
    pointer-events: auto;
}

#home-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 40px;
    gap: 40px;
    background: rgba(0, 0, 0, 0.05);
    backdrop-filter: brightness(0.9) blur(20px) url(#liquidGlassFilter);
    -webkit-backdrop-filter: brightness(0.9) blur(20px) url(#liquidGlassFilter);
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: inset 6px 6px 0px -6px rgba(255, 255, 255, 0.4),
                inset 0 0 8px 1px rgba(255, 255, 255, 0.3),
                0 8px 32px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: visible;
    text-decoration: none;
    outline: none;
}

#home-button:visited,
#home-button:active,
#home-button:focus {
    text-decoration: none;
    outline: none;
}

#home-button span {
    color: rgba(255, 255, 255, 1.0);
    text-decoration: none;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', sans-serif;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 2px;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    text-transform: uppercase;
    white-space: nowrap;
    position: relative;
    display: inline-block;
    transform: scale(1);
    transform-origin: center center;
    transition: transform 0.3s ease-out;
}

#home-button:hover span {
    transform: scale(1.07);
}

/* Navigation Bar - EXACT same as MainBrain */
#brain-navigation-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    pointer-events: auto;
}

#brain-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 40px;
    gap: 40px;
    background: rgba(0, 0, 0, 0.05);
    backdrop-filter: brightness(0.9) blur(20px) url(#liquidGlassFilter);
    -webkit-backdrop-filter: brightness(0.9) blur(20px) url(#liquidGlassFilter);
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: inset 6px 6px 0px -6px rgba(255, 255, 255, 0.4),
                inset 0 0 8px 1px rgba(255, 255, 255, 0.3),
                0 8px 32px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: visible;
}

#brain-navigation a {
    color: rgba(255, 255, 255, 1.0);
    text-decoration: none;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', sans-serif;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 2px;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    text-transform: uppercase;
    white-space: nowrap;
    position: relative;
    display: inline-block;
    transform: scale(1);
    transform-origin: center center;
    transition: transform 0.3s ease-out;
}

#brain-navigation a:hover {
    transform: scale(1.07);
}

#brain-navigation a.active {
    color: rgba(255, 255, 255, 1.0);
}

/* Main Container */
.page-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 100px 40px 60px 40px;
    text-align: center;
}

/* Filter Bar */
.filter-bar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 auto 40px auto;
    padding: 20px;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: brightness(0.9) blur(20px);
    -webkit-backdrop-filter: brightness(0.9) blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: inset 4px 4px 0px -4px rgba(255, 255, 255, 0.3),
                inset 0 0 8px 1px rgba(255, 255, 255, 0.1),
                0 8px 32px rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
    transform: translateZ(0);
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.filter-tag {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(184, 197, 207, 0.15);
    border: 1px solid rgba(184, 197, 207, 0.3);
    border-radius: 12px;
    font-size: 13px;
    color: rgba(184, 197, 207, 0.9);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.filter-tag:hover {
    background: rgba(184, 197, 207, 0.25);
    border-color: rgba(184, 197, 207, 0.5);
    transform: translateY(-2px);
}

.filter-tag.active {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.9);
    color: #000000;
}

.filter-tag.all-filter {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

.filter-tag.all-filter.active {
    background: rgba(255, 255, 255, 0.9);
    color: #000000;
}

/* Projects Grid - Using flex columns for true independence */
.projects-grid {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    text-align: left;
}

.projects-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* Project Card */
.project-card {
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: brightness(0.9) blur(20px);
    -webkit-backdrop-filter: brightness(0.9) blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: inset 4px 4px 0px -4px rgba(255, 255, 255, 0.3),
                inset 0 0 8px 1px rgba(255, 255, 255, 0.1),
                0 8px 32px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
}

/* Remove animation delays */

.project-card.hidden {
    display: none;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: inset 4px 4px 0px -4px rgba(255, 255, 255, 0.4),
                inset 0 0 12px 2px rgba(255, 255, 255, 0.15),
                0 12px 48px rgba(0, 0, 0, 0.6);
}

/* Media Container with Gallery Navigation */
.project-media-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000000;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.project-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

/* Gallery Navigation Arrows */
.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: rgba(255, 255, 255, 0.9);
    font-size: 28px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
    z-index: 20;
    transition: all 0.3s ease;
    opacity: 0;
    user-select: none;
    pointer-events: auto;
    line-height: 1;
    box-sizing: border-box;
    padding: 0 0 4px 0;
}

.project-media-container:hover .gallery-arrow {
    opacity: 1;
}

.gallery-arrow:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-50%) scale(1.1);
}

.gallery-arrow.left {
    left: 12px;
}

.gallery-arrow.right {
    right: 12px;
}

.gallery-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

/* Gallery Dots Indicator */
.gallery-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: auto;
}

.project-media-container:hover .gallery-dots {
    opacity: 1;
}

.gallery-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-dot.active {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.3);
}

.gallery-dot:hover {
    background: rgba(255, 255, 255, 0.7);
}

/* Project Content */
.project-content {
    padding: 24px;
}

.project-title {
    font-size: 24px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 12px 0;
    letter-spacing: -0.3px;
}

.project-summary {
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 16px 0;
}

/* Technical Description (Initially Hidden) */
.project-description {
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, margin 0.4s ease;
    white-space: pre-line;
}

.project-description.expanded {
    max-height: 1000px;
    margin: 12px 0 0 0;
}

/* View More Button */
.view-more-btn {
    background: none;
    border: none;
    color: rgba(184, 197, 207, 0.9);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    margin: 0 0 4px 0;
    text-decoration: underline;
    transition: color 0.2s ease;
    display: inline-block;
}

.view-more-btn:hover {
    color: rgba(255, 255, 255, 1.0);
}

/* Social Links */
.project-links {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 18px 0 12px 0;
}

/* Tech Stack and Links Row */
.project-footer {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.project-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.stack-tag {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(184, 197, 207, 0.15);
    border: 1px solid rgba(184, 197, 207, 0.3);
    border-radius: 12px;
    font-size: 12px;
    color: rgba(184, 197, 207, 0.9);
    font-weight: 500;
    /* Colors are applied dynamically via JavaScript for consistency across projects */
}

.project-link {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    cursor: not-allowed;
}

.project-link img {
    width: 20px;
    height: 20px;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.project-link.active {
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.project-link.active img {
    opacity: 0.8;
}

.project-link.active:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.project-link.active:hover img {
    opacity: 1;
}

/* Live link - more blue styling for clickable live site links */
.project-link.live-link-active {
    background: rgba(80, 150, 220, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
}

.project-link.live-link-active img {
    opacity: 1 !important;
}

.project-link.live-link-active:hover {
    background: rgba(100, 170, 240, 0.4) !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
    transform: translateY(-2px);
}

.project-link.live-link-active:hover img {
    opacity: 1;
}

/* Gallery Modal */
.gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.gallery-modal.active {
    display: flex;
}

.gallery-modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 100px 80px 100px; /* Space for navigation arrows (left/right) and counter (bottom) */
    box-sizing: border-box;
}

.gallery-modal-content img {
    width: auto;
    height: auto;
    max-width: calc(100vw - 240px); /* Account for arrow space (100px each side + 40px margin) */
    max-height: calc(100vh - 180px); /* Account for counter (80px) and padding */
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.gallery-close {
    display: none;
}

.gallery-nav {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    font-size: 48px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all 0.3s ease;
    line-height: 1;
    user-select: none;
    box-sizing: border-box;
    padding: 0 0 6px 0;
}

.gallery-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.gallery-prev {
    left: 20px;
}

.gallery-next {
    right: 20px;
}

.gallery-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 20px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 10;
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-container {
        padding: 100px 24px 40px 24px;
    }

    .filter-bar {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px;
    }

    .projects-grid {
        flex-direction: column;
    }
    
    .projects-column {
        width: 100%;
    }

    .project-footer {
        flex-direction: column;
    }

    .gallery-prev {
        left: 10px;
    }

    .gallery-next {
        right: 10px;
    }
}

@media (max-width: 640px) {
    /* Hide home button on mobile - it's already in the VIEW TABS dropdown */
    #home-button-container {
        display: none !important;
    }

    #home-button {
        padding: 8px 12px !important;
        gap: 8px !important;
    }

    #home-button span {
        font-size: 10px !important;
        letter-spacing: 1px !important;
        padding: 8px 12px !important;
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    #brain-navigation-container {
        top: 10px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: calc(100% - 130px) !important;
        max-width: calc(100vw - 130px) !important;
        margin-left: 0 !important;
    }

    #brain-navigation {
        padding: 8px 12px !important;
        gap: 8px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        justify-content: flex-start !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
    }

    #brain-navigation::-webkit-scrollbar {
        display: none !important;
    }

    #brain-navigation a {
        font-size: 10px !important;
        letter-spacing: 1px !important;
        padding: 8px 12px !important;
        flex-shrink: 0 !important;
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .page-container {
        padding: 90px 16px 30px 16px;
    }

    .section-header h1 {
        font-size: 32px;
    }

    .gallery-arrow {
        width: 36px;
        height: 36px;
        font-size: 22px;
    }

    .gallery-arrow.left {
        left: 8px;
    }

    .gallery-arrow.right {
        right: 8px;
    }
}

@media (max-width: 480px) {
    #home-button {
        padding: 6px 8px !important;
        gap: 6px !important;
    }

    #home-button span {
        font-size: 9px !important;
        padding: 6px 10px !important;
    }

    #brain-navigation-container {
        width: calc(100% - 110px) !important;
        max-width: calc(100vw - 110px) !important;
    }

    #brain-navigation {
        padding: 6px 8px !important;
        gap: 6px !important;
    }

    #brain-navigation a {
        font-size: 9px !important;
        padding: 6px 10px !important;
    }

    .page-container {
        padding: 80px 12px 25px 12px;
    }
    
    .filter-bar {
        padding: 12px;
    }
    
    .project-card {
        border-radius: 16px;
    }
    
    .project-content {
        padding: 20px;
    }
}
