/* PROJECTS PAGE LAYOUT */

.projects-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 4rem 2rem;
}

.projects-content {
    max-width: 650px;
    width: 100%;
    text-align: left;
    opacity: 0;
    animation: fadeInUp 1s ease-out 0.2s forwards;
}

/* PROJECT ITEMS AND ANIMATIONS */

.project {
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

/* Staggered animation delays for sequential appearance */
.project:nth-child(3) {
    animation-delay: 0.4s;
}

.project:nth-child(5) {
    animation-delay: 0.6s;
}

.project:nth-child(7) {
    animation-delay: 0.8s;
}

.project:nth-child(9) {
    animation-delay: 1s;
}

/* PROJECT TYPOGRAPHY */

.project-name {
    font-size: 1.8rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

.project-title-link {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
    position: relative;
    display: inline-block;
}

/* Gradient background hover effect */
.project-title-link:before {
    content: '';
    position: absolute;
    top: -2px;
    left: -4px;
    right: -4px;
    bottom: -2px;
    background: linear-gradient(to left, rgba(238, 142, 78, 0.4), rgba(238, 142, 78, 0.35), rgba(238, 142, 78, 0.3), rgba(238, 142, 78, 0.35), rgba(238, 142, 78, 0.4));
    opacity: 0;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s ease-in-out, opacity 0.5s ease-in-out;
    z-index: -1;
    border-radius: 2px;
}

/* Activate hover effects */
.project-title-link:hover::before {
    opacity: 1;
    transform: scaleX(1);
    transform-origin: left;
}

.project-title-link:hover::after {
    opacity: 1;
}

.project-description {
    font-size: 1.1rem;
    color: var(--text-primary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

/* PROJECT LINKS LAYOUT */

.project-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
}

.project-link {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s ease;
    position: relative;
    padding: 4px;
    display: inline-block;
    z-index: 2;
}

/* PROJECT LINK HOVER EFFECTS */

/* Gradient background hover effect */
.project-link:not(.tech-stack-container)::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0px;
    right: -4px;
    bottom: -2px;
    background: linear-gradient(to left, rgba(238, 142, 78, 0.5), rgba(238, 142, 78, 0.3));
    opacity: 0;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out;
    z-index: -1;
    border-radius: 2px;
}

/* Left accent bar hover effect */
.project-link:not(.tech-stack-container)::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    width: 2px;
    bottom: -2px;
    background-color: rgba(238, 142, 78, 0.7);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: -1;
    border-radius: 1px;
}

/* Activate hover effects */
.project-link:not(.tech-stack-container):hover::before {
    opacity: 1;
    transform: scaleX(1);
    transform-origin: left;
}

.project-link:not(.tech-stack-container):hover::after {
    opacity: 1;
}

/* TECH STACK DISPLAY WITH ANIMATION */

.tech-stack-container {
    position: relative;
    cursor: default;
    height: 24px;
    line-height: 24px; /* Fixed height to prevent layout shifts */
    left: 4px;
}

.tech-stack-label,
.tech-stack-list {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
}

.tech-stack-label {
    transition: opacity 0.2s ease-in-out;
}

.tech-stack-list {
    display: flex;
    gap: 0.5rem;
}

/* Hide label on hover */
.tech-stack-container:hover .tech-stack-label {
    opacity: 0;
}

/* Tech tag styling and animation */
.tech-tag {
    font-size: 0.8rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(90, 108, 125, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    white-space: nowrap;

    /* Initial state: invisible and shifted left */
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

/* Animate tags to visible state on hover */
.tech-stack-container:hover .tech-tag {
    opacity: 1;
    transform: translateX(0);
}

/* Staggered animation delays for sequential appearance */
.tech-stack-container:hover .tech-tag:nth-child(1) {
    transition-delay: 0.05s;
}

.tech-stack-container:hover .tech-tag:nth-child(2) {
    transition-delay: 0.15s;
}

.tech-stack-container:hover .tech-tag:nth-child(3) {
    transition-delay: 0.25s;
}

.tech-stack-container:hover .tech-tag:nth-child(4) {
    transition-delay: 0.35s;
}

/* RESPONSIVE DESIGN */

@media (max-width: 768px) {
    .projects-container {
        padding: 2rem 1rem;
    }

    .projects-content {
        max-width: 100%;
    }

    .projects-title {
        font-size: 2.5rem;
    }

    .project-name {
        font-size: 1.5rem;
    }

    .project-description {
        font-size: 1rem;
    }

    .back-nav {
        top: 2rem;
        left: 1rem;
    }

    .social-links {
        bottom: 1rem;
        right: 1rem;
        gap: 0.75rem;
    }
}