:root {
    /* Phase colors - Based on GLPI brand colors */
    --bugfix-color-start: #1E2B62;
    --bugfix-color-end: #0091d1;
    --security-color: #24b1ee;
    --extended-color: #98E0FF;
    --eol-text-color: rgb(0, 122, 179);

    /* UI colors */
    --background-color: #fbfbf9;
    --text-primary: #2c3e50;
    --accent-highlight: #ffe02e;
    --text-secondary: #666;
    --text-tertiary: #999;
    --text-light: #555;
    --heading-color:rgb(30, 43, 98);
    --container-bg: white;

    /* Timeline colors */
    --timeline-marker: #7691aa;
    --timeline-label: #34495e;
    --today-marker: #e74c3c;

    /* Effects */
    --shadow-light: rgba(0, 0, 0, 0.07);
    --shadow-medium: rgba(0, 0, 0, 0.08);
    --shadow-dark: rgba(0, 0, 0, 0.15);
    --stripe-overlay: rgba(255, 255, 255, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background-color);
    color: var(--text-primary);
    padding: 40px 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--container-bg);
    border-radius: 12px;
    box-shadow: 0 4px 6px var(--shadow-light);
    padding: 40px;
    overflow: hidden;
    position: relative;

    &::before {
        content: '';
        position: absolute;
        top: -500px;
        right: -500px;
        width: 100%;
        height: 100%;
        background-image: url('assets/Vector.svg');
        background-repeat: no-repeat;
        background-position: left top;
        background-size: auto 80%;
        opacity: 0.35;
        transform: rotate(-90deg);
        transform-origin: center;
        pointer-events: none;
        z-index: 0;
    }

    header {
        text-align: center;
        margin-bottom: 50px;
        position: relative;
        z-index: 1;

        h1 {
            font-size: 3.5em;
            color: var(--heading-color);
            margin-bottom: 10px;

            .highlight-glpi {
                background-image: url('assets/Header_blue_marker.png');
                background-repeat: no-repeat;
                background-position: center bottom;
                background-size: 100% 60%;
                padding: 0 10px 5px;
                display: inline-block;
            }
        }

        .subtitle {
            margin-left: 15px;
            color: var(--text-secondary);
            font-size: 1.1em;
            list-style: none;
            padding: 0;
            display: inline-flex;
            flex-direction: column;
            gap: 8px;
            text-align: left;

            li {
                &::before {
                    content: '•';
                    margin-right: 8px;
                    color: var(--text-tertiary);
                }
            }

            strong {
                background-image: url('assets/Header_yellow_marker.png');
                background-repeat: no-repeat;
                background-position: center bottom;
                background-size: 90% 60%;
                padding: 2px 8px -6px;
                display: inline-block;
            }
        }
    }
}

/* Timeline */
.timeline {
    display: flex;
    height: 60px;
    margin: 40px 0 10px 0;
    position: relative;
    z-index: 1;

    .timeline-spacer {
        width: 0px;
        flex-shrink: 0;
    }

    .timeline-track {
        flex: 1;
        position: relative;
        margin-right: 60px;

        .timeline-marker {
            position: absolute;
            top: 0;
            transform: translateX(-50%);

            &::after {
                content: '';
                position: absolute;
                width: 1px;
                height: 40px;
                background: repeating-linear-gradient(
                    to bottom,
                    var(--timeline-marker) 0px,
                    var(--timeline-marker) 8px,
                    transparent 8px,
                    transparent 16px
                );
                left: 50%;
                transform: translateX(-50%);
                top: 22px;
                z-index: -1;
            }

            &:nth-last-of-type(-n+3)::after {
                height: 128px;
            }
            &:nth-last-of-type(-n+2)::after {
                height: 200px;
            }

            .timeline-label {
                position: absolute;
                top: 0;
                left: 50%;
                transform: translateX(-50%);
                font-size: 0.9em;
                font-weight: 600;
                color: var(--timeline-label);
                white-space: nowrap;
            }
        }

        .today-marker {
            position: absolute;
            top: 35px;
            bottom: 0;
            width: 2px;
            background: var(--today-marker);
            transform: translateX(-50%);
            z-index: 10;
            box-shadow: 0 0 4px rgba(231, 76, 60, 0.5);

            &::before {
                content: '';
                position: absolute;
                top: -5px;
                left: 50%;
                transform: translateX(-50%);
                width: 0;
                height: 0;
                border-left: 5px solid transparent;
                border-right: 5px solid transparent;
                border-top: 8px solid var(--today-marker);
            }

            &::after {
                content: '';
                position: absolute;
                top: 22px;
                left: 50%;
                transform: translateX(-50%);
                width: 2px;
                height: 340px;
                background: var(--today-marker);
                opacity: 0.3;
            }
        }
    }
}

/* Gantt Chart */
.gantt-chart {
    margin: 5px 0 40px 0;
    position: relative;
    z-index: 1;

    .version-row {
        display: flex;
        align-items: center;
        margin-bottom: 25px;
        position: relative;

        .version-spacer {
            width: 0px;
            flex-shrink: 0;
        }

        .timeline-bars {
            flex: 1;
            position: relative;
            height: 60px;
            margin-right: 60px;
            padding-left: 0;

            .bar-ellipsis-left {
                position: absolute;
                left: -35px;
                top: 0;
                width: 30px;
                height: 100%;
                background: repeating-linear-gradient(
                    to right,
                    var(--bugfix-color-start) 0px,
                    var(--bugfix-color-start) 6px,
                    transparent 6px,
                    transparent 12px
                );
                -webkit-mask-image: linear-gradient(to right, transparent, var(--bugfix-color-start));
                mask-image: linear-gradient(to right, transparent, var(--bugfix-color-start));
                border-radius: 6px 0 0 6px;

                &::after {
                    content: '';
                    position: absolute;
                    left: 10px;
                    top: 10px;
                    width: 100%;
                    height: 100%;
                    background: repeating-linear-gradient(
                        to right,
                        var(--shadow-medium) 0px,
                        var(--shadow-medium) 6px,
                        transparent 6px,
                        transparent 12px
                    );
                    -webkit-mask-image: linear-gradient(to right, transparent, var(--shadow-medium));
                    mask-image: linear-gradient(to right, transparent, var(--shadow-medium));
                    border-radius: 6px 0 0 6px;
                    z-index: -1;
                }
            }

            .bar-ellipsis-right {
                position: relative;
                width: 15%;
                height: 100%;
                background: linear-gradient(to right, var(--extended-color), transparent);
                border-radius: 0 6px 6px 0;

                &::before {
                    content: '';
                    position: absolute;
                    width: 100%;
                    height: 100%;
                    background: repeating-linear-gradient(
                        45deg,
                        transparent 0,
                        transparent 10px,
                        var(--stripe-overlay) 10px,
                        var(--stripe-overlay) 20px
                    );
                    z-index: 1;
                }
            }

            .bar-container {
                position: absolute;
                height: 100%;
                display: flex;
                border-radius: 6px;

                &::before {
                    content: '';
                    position: absolute;
                    width: 100%;
                    height: 100%;
                    background: linear-gradient(to right, rgba(0,0,0,0.25), transparent);
                    border-radius: 6px;
                    left: 10px;
                    top: 10px;
                    z-index: 0;
                }

                &.short-shadow::before {
                    width: 72%;
                }

                &::after {
                    content: '';
                    position: absolute;
                    width: 50%;
                    height: 100%;
                    border-radius: 6px;
                    z-index: 2;
                    right: 0;
                    top: 0;
                    pointer-events: none;
                    background: repeating-linear-gradient(
                        45deg,
                        transparent 0,
                        transparent 10px,
                        var(--stripe-overlay) 10px,
                        var(--stripe-overlay) 20px
                    );
                }

                &:hover {
                    transform: translateY(-2px);

                    &::after {
                        box-shadow: 0 4px 12px var(--shadow-dark);
                    }
                }

                .bar {
                    height: 100%;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    position: relative;
                    z-index: 1;

                    &.bugfix-phase {
                        background: linear-gradient(135deg, var(--bugfix-color-start) 0%, var(--bugfix-color-end) 100%);
                        width: 50%;
                        border-radius: 6px 0 0 6px;

                        &.no-left-radius {
                            border-radius: 0;
                        }
                    }

                    &.security-phase {
                        background: var(--security-color);
                        width: 16.67%;
                        border-radius: 0;

                        &.no-right-radius {
                            border-radius: 0;
                        }
                    }

                    &.extended-phase {
                        background: var(--extended-color);
                        width: 33.33%;
                        border-radius: 0 6px 6px 0;
                        position: relative;

                        &::after {
                            content: 'EOL';
                            position: absolute;
                            right: 2px;
                            top: 50%;
                            transform: translateY(-50%) rotate(90deg);
                            font-size: 0.75em;
                            font-weight: 600;
                            color: var(--eol-text-color, white);
                            text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
                            text-rendering: optimizeLegibility;
                            -webkit-font-smoothing: antialiased;
                            -moz-osx-font-smoothing: grayscale;
                        }

                        &.no-right-radius {
                            border-radius: 0;
                        }

                        &.no-eol::after {
                            content: none;
                        }
                    }

                    .version-label {
                        position: absolute;
                        left: 15px;
                        top: 50%;
                        transform: translateY(-50%);
                        font-weight: bold;
                        font-size: 1.4em;
                        color: white;
                        z-index: 10;
                        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
                    }
                }
            }
        }
    }
}

/* Legend */
.legend {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 50px;
    padding-top: 30px;
    position: relative;
    z-index: 1;

    .legend-item {
        display: flex;
        align-items: flex-start;
        gap: 10px;

        .legend-color {
            width: 30px;
            height: 20px;
            border-radius: 4px;
            position: relative;

            &.bugfix-color {
                background: linear-gradient(135deg, var(--bugfix-color-start) 0%, var(--bugfix-color-end) 100%);
            }

            &.security-color {
                background: var(--security-color);

                &::after {
                    content: '';
                    position: absolute;
                    width: 100%;
                    height: 100%;
                    background: repeating-linear-gradient(
                        45deg,
                        transparent 0,
                        transparent 2px,
                        var(--stripe-overlay) 2px,
                        var(--stripe-overlay) 4px
                    );
                    border-radius: 4px;
                    top: 0;
                    left: 0;
                }
            }

            &.extended-color {
                background: var(--extended-color);

                &::after {
                    content: '';
                    position: absolute;
                    width: 100%;
                    height: 100%;
                    background: repeating-linear-gradient(
                        45deg,
                        transparent 0,
                        transparent 2px,
                        var(--stripe-overlay) 2px,
                        var(--stripe-overlay) 4px
                    );
                    border-radius: 4px;
                    top: 0;
                    left: 0;
                }
            }
        }

        .legend-text {
            display: flex;
            flex-direction: column;
            gap: 2px;

            span {
                font-size: 0.95em;
                color: var(--text-light);

                &.legend-period {
                    font-size: 0.85em;
                    color: var(--text-tertiary);
                }
            }
        }
    }
}

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

    h1 {
        font-size: 1.8em;
    }

    .timeline-label {
        font-size: 0.75em;
    }

    .legend {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }

    .version-label {
        width: 60px;
        font-size: 1em;
    }
}
