:root {
    --project-width: 200px;
    --project-height: var(--project-width);
    --animation-duration: 0.6s;
    --animation-easing: cubic-bezier(0.4, 0, 0.2, 1);
    --selection-color: #007bff;
    --selection-hover-color: #0056b3;
}

body {
    max-height: 100vh;
    overflow-y: scroll !important;
    overflow-x: hidden !important;
}



.left,
.right {
    float: left;
}

.left {
    width: 45% !important;
}

.right {
    width: 55% !important;
}

#project {
    width: 100%;

    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;


    padding-top: 50px;
    margin-bottom: 50px;
    padding-right: 20px;

    margin: 0 auto;
    margin-top: 70px;
    margin-bottom: 70px;

    overflow-x: hidden;
    overflow-y: scroll;

    float: right;
}

#project>div {
    width: var(--project-width);
    height: var(--project-height);
}

/* ANIMAZIONI PROGETTI */
#project .item {
    position: relative;
    opacity: 1;
    overflow: hidden;
    cursor: pointer;

    /* Animazione base più fluida */
    transition:
        transform var(--animation-duration) var(--animation-easing),
        opacity var(--animation-duration) var(--animation-easing),
        filter 0.3s ease,
        box-shadow 0.3s ease,
        box-shadow 0.3s ease;

    /* Effetto hover */
    filter: brightness(1);
    box-shadow: 0 0px 0px rgba(0, 0, 0, 0);
}

#project .item:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
    backdrop-filter: blur(10px);
}

/* ANIMAZIONE NASCONDERE PROGETTI */
#project .item.hidden {
    opacity: 0;
    display: block;
    transform: scale(0.8) translateY(-20px);
    filter: blur(0px);

    pointer-events: none;
    z-index: 0;

    /* Animazione di uscita più drammatica */
    transition:
        transform 0.4s var(--animation-easing),
        opacity 0.3s ease-out,
        filter 0.3s ease-out;
}

.hidden_display {
    display: none;
    position: absolute;
}

/* ANIMAZIONE MOSTRARE PROGETTI */
#project .item.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);

    z-index: 99;

    /* Animazione di entrata con bounce leggero */
    transition:
        transform var(--animation-duration) cubic-bezier(0.175, 0.885, 0.32, 1.275),
        opacity var(--animation-duration) ease-out,
        filter 0.4s ease-out;
}

/* AGGIUNTA: Animazione stagger per progetti multipli */
#project .item.visible:nth-child(1) {
    transition-delay: 0.05s;
}

#project .item.visible:nth-child(2) {
    transition-delay: 0.1s;
}

#project .item.visible:nth-child(3) {
    transition-delay: 0.2s;
}

#project .item.visible:nth-child(4) {
    transition-delay: 0.3s;
}

#project .item.visible:nth-child(5) {
    transition-delay: 0.6s;
}

#project .item.visible:nth-child(6) {
    transition-delay: 0.9 s;
}

.right {
    height: 100%;
    width: calc(50%);
}

.left {
    width: 50%;
}

.left .category {
    margin-top: 80px;
    margin-bottom: 0;
    width: 100%;
}

.left .category .link {
    width: 100%;
    margin-top: 0px !important;
    transform: translateY(-34px) translateX(250px);
}

/* SELEZIONE CATEGORIE */
.left .category .link a {
    color: black !important;
    font-size: 15px !important;

    display: block;
    margin-bottom: -5px;
    text-decoration: none;

    /* Animazioni fluide per stati */
    transition:
        all 0.3s var(--animation-easing),
        transform 0.2s ease;

    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

/* Effetto hover per link categorie */
.left .category .link a:hover {
    color: rgb(138, 8, 8) !important;
    transform: translateX(3px);
}

/* SELEZIONE CATEGORIA */
.left .category .link a.selected {
    color: rgb(138, 8, 8) !important;
    font-weight: 500;
}

/* Effetto ripple per selezione */
/* .left .category .link a.selected::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
} */

.left .category .link a.selected:hover::before {
    width: 100%;
    height: 100%;
}

.left .category h2 {
    font-size: 18px;
    padding-top: 0px;

    letter-spacing: normal !important;
    font-weight: 400 !important;

    /* Animazione sottile per titoli */
    transition: color 0.3s ease;
}

/* Indicatore visivo per selezione multipla */
.category h2:nth-of-type(2)::after {
    font-size: 12px;
    font-weight: normal;
    opacity: 0.6;
    color: var(--selection-color);
    font-style: italic;
    animation: fadeInText 0.5s ease-in-out;
}

@keyframes fadeInText {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

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

/* INFO PROGETTO CON ANIMAZIONI */
#project_info {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.2));
    backdrop-filter: blur(3px);

    color: rgb(138, 8, 8) !important;

    width: 100%;
    height: 100%;
    margin: 0;
    padding: 20px;

    transform: translate(-200px, 0);
    transition:
        transform 0.4s var(--animation-easing),
        background 0.3s ease;
}

.item:hover>#project_info {
    transform: translate(0, 0);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.2));
}

#title_project {
    margin: 0;
    width: calc(200px - 40px);
    font-size: 16px;
    font-weight: 400;

    /* Animazione testo */
    transition: color 0.3s ease;
}

#date_project {
    position: absolute;
    margin: 0;
    left: 20px;
    bottom: 20px;
    font-size: 15px;
    font-weight: 500;

    /* Animazione data */
    transition:
        color 0.3s ease,
        transform 0.3s ease;
}

.item:hover #date_project {
    transform: translateY(-2px);
    color: var(--selection-color);
}

#place_project {
    margin: 0;
    margin-top: 5px;
    font-size: 10px;
}

#project_image {
    position: absolute;
    background-color: gray;
    width: 200px;
    height: 200px;
    left: 0;
    top: 0;
    z-index: -99;

    /* Animazione immagine */
    transition:
        transform 0.4s ease,
        filter 0.3s ease;
    overflow: hidden;
}

.item:hover #project_image {
    transform: scale(1.05);
    filter: brightness(1.1) saturate(1.1);
}

#project_image>img {
    width: var(--project-width);
    height: var(--project-height);
    object-fit: cover;

    /* Animazione immagine */
    transition: transform 0.4s ease;
}

.item:hover #project_image>img {
    transform: scale(1.1);
}

#project_id {
    display: none;
}

/* TRANSIZIONE PAGINA */
#change_page_transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 1) 100%);
    opacity: 0;
    z-index: 9999;
    transition: opacity 0.4s var(--animation-easing);
    pointer-events: none;
    backdrop-filter: blur(5px);
}

/* SCROLLBAR PERSONALIZZATA */
#project::-webkit-scrollbar {
    width: 6px;
}

#project::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

#project::-webkit-scrollbar-thumb {
    background: rgba(0, 123, 255, 0.3);
    border-radius: 10px;
    transition: background 0.3s ease;
}

#project::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 123, 255, 0.5);
}

/* Transizione fluida per le posizioni */
#project .item {
    transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        top 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.5s ease,
        transform 0.4s ease !important;
}

/* Override per nascondere completamente dopo l'animazione */
#project .item.hidden_display {
    display: none !important;
}

/* Assicura che il container progetti sia relative per il posizionamento assoluto */
#project {
    position: relative !important;
}

/* Smooth transition per altezza container */
#project {
    transition: height 0.4s ease;
}