/* ============== LAYOUT PRINCIPAL ============== */
#projects-main {
    flex: 1;
    min-height: 0;
    display: flex;
    gap: var(--gap);
    overflow: hidden;
}

/* ============== NAVIGATION FIXE ============== */
#projects-nav {
    width: 280px;
    flex-shrink: 0;
    background: var(--background-color-two);
    border-radius: var(--border-radius-one);
    padding: var(--padding-one);
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: hidden;
    color: var(--text-color);

    > .nav-header {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        padding-bottom: 12px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);

        > h3 {
            font-size: 1.4em;
            font-weight: 700;
            margin: 0;
        }

        > .nav-counter {
            font-size: 0.85em;
            opacity: 0.6;
            font-variant-numeric: tabular-nums;
        }
    }

    > .nav-list-wrapper {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        gap: 8px;

        > .nav-arrow {
            background: transparent;
            border: none;
            padding: 6px;
            cursor: pointer;
            opacity: 0.5;
            transition: opacity 0.2s ease, transform 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 8px;

            > svg {
                width: 20px;
                height: 20px;
            }

            &:hover:not(:disabled) {
                opacity: 1;
                background: rgba(0, 0, 0, 0.05);
            }

            &:disabled {
                opacity: 0.15;
                cursor: not-allowed;
            }
        }

        > .nav-list {
            flex: 1;
            min-height: 0;
            display: flex;
            flex-direction: column;
            gap: 6px;
            overflow-y: auto;

            > .nav-item {
                background: transparent;
                border: none;
                text-align: left;
                padding: 12px 14px;
                border-radius: 10px;
                cursor: pointer;
                display: flex;
                flex-direction: column;
                gap: 2px;
                transition: all 0.25s ease;
                position: relative;
                font-family: inherit;
                color: inherit;

                > .nav-item-name {
                    font-size: 1em;
                    font-weight: 600;
                    transition: transform 0.25s ease;
                }

                > .nav-item-sub {
                    font-size: 0.8em;
                    opacity: 0.6;
                    font-weight: 400;
                }

                &::before {
                    content: "";
                    position: absolute;
                    left: 0;
                    top: 50%;
                    transform: translateY(-50%);
                    width: 3px;
                    height: 0;
                    background: var(--secondary-color, currentColor);
                    border-radius: 2px;
                    transition: height 0.25s ease;
                }

                &:hover {
                    background: rgba(0, 0, 0, 0.04);

                    > .nav-item-name {
                        transform: translateX(4px);
                    }
                }

                &.active {
                    background: rgba(0, 0, 0, 0.06);
                    color: var(--secondary-color, currentColor);

                    > .nav-item-name {
                        font-weight: 700;
                    }

                    &::before {
                        height: 60%;
                    }
                }
            }
        }
    }

    > .nav-pagination {
        display: flex;
        justify-content: center;
        gap: 6px;
        padding-top: 12px;
        border-top: 1px solid rgba(0, 0, 0, 0.08);

        > .page-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            border: none;
            background: rgba(0, 0, 0, 0.15);
            cursor: pointer;
            transition: all 0.25s ease;
            padding: 0;

            &:hover {
                background: rgba(0, 0, 0, 0.3);
            }

            &.active {
                background: var(--secondary-color, currentColor);
                width: 24px;
                border-radius: 4px;
            }
        }
    }
}

/* ============== SÉPARATEURS ENTRE NAV-ITEMS ============== */
#projects-nav .nav-list .nav-item {
    position: relative;
}

/* Séparateur sur tous les items SAUF le dernier */
#projects-nav .nav-list .nav-item:not(:last-of-type)::after {
    content: "";
    position: absolute;
    background: currentColor;
    opacity: 0.12;
    border-radius: 1px;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

/* === DESKTOP : séparateur horizontal en bas de chaque item === */
@media (min-width: 901px) {
    #projects-nav .nav-list .nav-item:not(:last-of-type)::after {
        bottom: -4px; /* moitié du gap entre items */
        left: 14px;
        right: 14px;
        height: 1px;
    }
}

/* === MOBILE/TABLETTE : séparateur vertical à droite de chaque item === */
@media (max-width: 900px) {
    #projects-nav .nav-list .nav-item:not(:last-of-type)::after {
        top: 14px;
        bottom: 14px;
        right: -4px; /* moitié du gap entre items */
        width: 1px;
        height: auto;
    }
}

/* Cacher le séparateur de l'item actif et de celui juste avant 
   (pour ne pas couper visuellement le highlight) */
#projects-nav .nav-list .nav-item.active::after,
#projects-nav .nav-list .nav-item:has(+ .nav-item.active)::after {
    opacity: 0;
}

/* ============== CONTAINER PROJET SCROLLABLE ============== */
#projects-container {
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: var(--gap);
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;

    &::-webkit-scrollbar {
        width: 6px;
    }

    &::-webkit-scrollbar-track {
        background: transparent;
    }

    &::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.15);
        border-radius: 3px;

        &:hover {
            background: rgba(0, 0, 0, 0.3);
        }
    }
}

/* ============== HEADER PROJET ============== */
#project-header {
    flex-shrink: 0;

    > #name {
        background: var(--background-color-two);
        border-radius: var(--border-radius-one);
        padding: calc(var(--padding-one) * 1.2);
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 20px;
        flex-wrap: wrap;

        > .project-title-wrapper {
            display: flex;
            flex-direction: column;
            gap: 4px;

            > h1 {
                font-size: 2.2em;
                font-weight: 700;
                margin: 0;
                line-height: 1.1;
                letter-spacing: -0.02em;
            }

            > .project-subtitle {
                font-size: 1em;
                opacity: 0.65;
                margin: 0;
            }
        }

        > .project-link {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 10px 18px;
            background: var(--secondary-color);
            color: var(--secondary-text-color);
            border-radius: 999px;
            text-decoration: none;
            font-weight: 600;
            font-size: 0.95em;
            transition: transform 0.2s ease, box-shadow 0.2s ease;
            white-space: nowrap;

            > svg {
                width: 16px;
                height: 16px;
            }

            &:hover {
                transform: translateY(-2px);
                box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
            }
        }
    }
}

/* ============== CONTENU PROJET ============== */
#project-content {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--gap);

    > #left-part, > #right-part {
        display: flex;
        flex-direction: column;
        gap: var(--gap);
        min-width: 0;
    }
}

/* ============== SECTIONS CONTENU ============== */
.content {
    background: var(--background-color-two);
    border-radius: var(--border-radius-one);
    padding: calc(var(--padding-one) * 1.2);

    > h3 {
        font-size: 1.1em;
        font-weight: 700;
        margin: 0 0 12px 0;
        opacity: 0.55;
        text-transform: uppercase;
        letter-spacing: 0.08em;
    }

    > p {
        font-size: 1em;
        line-height: 1.6;
        margin: 0;
        opacity: 0.9;
    }
}

/* ============== CAROUSELS — agrandis ============== */
.carousel {
    background: var(--background-color-two);
    border-radius: var(--border-radius-one);
    overflow: hidden;
    height: 340px; /* augmenté */
    position: relative;
    padding: 16px 0;

    > .carousel-inner {
        position: relative;
        width: 100%;
        height: 100%;

        > .carousel-item {
            position: absolute;
            inset: 0;
            opacity: 0;

            &.active {
                opacity: 1;
            }

            > img {
                width: 100%;
                height: 100%;
                object-fit: contain;
            }
        }
    }
}

/* ============== SKILLS — agrandi ============== */
#skills {
    > .skills-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;

        > .skill-chip {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 8px 14px;
            background: rgba(0, 0, 0, 0.04);
            border-radius: 999px;
            font-size: 0.9em;
            font-weight: 500;
            transition: transform 0.2s ease, background 0.2s ease;

            > svg {
                width: 20px;
                height: 20px;
                flex-shrink: 0;
            }

            &:hover {
                transform: translateY(-2px);
                background: rgba(0, 0, 0, 0.08);
            }
        }
    }
}

/* ============== FEATURES ============== */
#feature {
    > .features-list {
        list-style: none;
        padding: 0;
        margin: 0;
        display: flex;
        flex-direction: column;
        gap: 10px;

        > li {
            position: relative;
            padding-left: 22px;
            font-size: 0.98em;
            line-height: 1.5;
            opacity: 0.9;

            &::before {
                content: "";
                position: absolute;
                left: 0;
                top: 8px;
                width: 8px;
                height: 8px;
                border-radius: 50%;
                background: var(--secondary-color, currentColor);
            }
        }
    }
}

/* ============== RESPONSIVE ============== */
@media (max-width: 900px) {
    #projects-main {
        flex-direction: column;
        overflow: auto;
    }

    #projects-nav {
        width: 100%;
        height: auto;
        flex-shrink: 0;
        box-sizing: border-box;

        > .nav-list-wrapper > .nav-list {
            flex-direction: row;
            overflow-x: auto;
            
            > .nav-item {
                flex-shrink: 0;
                min-width: 160px;
                max-width: 220px;
            }
        }

        > .nav-list-wrapper > .nav-arrow {
            display: none;
        }
    }

    #project-content {
        grid-template-columns: 1fr;
    }

    .carousel {
        height: 260px;
    }
}

@media (max-width: 600px) {
    #project-header > #name {
        flex-direction: column;
        align-items: flex-start;

        > .project-title-wrapper > h1 {
            font-size: 1.8em;
        }
    }
}