/* Global styles for body */
body {
    background-color: #121212; /* Dark background color */
    color: #e0e0e0; /* Light text color for contrast */
    font-family: 'Roboto', sans-serif; /* Primary font family */
    margin: 0;
    padding: 0;
    transition: background-color 1s ease; /* Smooth background transition */
    overflow-x: hidden; /* Hide horizontal scrollbar */
    max-width: 100vw; /* Prevent horizontal overflow */
}
/* Hero section styles */
.section-hero {
    text-align: center;
    flex-direction: column;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh; /* Full viewport height */
    position: relative;
}
.hero-title-container {
    display: flex;
    justify-content: center;
    align-items: baseline;
    flex-wrap: wrap; /* Allow wrapping for smaller screens */
}
.hero-title {
    font-size: 4rem;
    font-weight: 700;
    margin: 0 10px;
}
.biography-link {
    color: #7e57c2; /* Purple color for emphasis */
    text-decoration: none;
}
.hero-text {
    font-size: 1.5rem;
    margin-top: 20px;
    max-width: 80vw;
}
/* Scroll-down icon animation */
.scroll-down {
    position: absolute;
    bottom: 20px;
    animation: bounce 2s infinite; /* Bouncing animation */
    cursor: pointer; /* Show pointer cursor on hover */
}
.scroll-down img {
    width: 40px;
    height: auto;
    filter: invert(1); /* Invert color for contrast */
    pointer-events: none; /* Disable pointer events on image */
}
/* Keyframes for bounce animation */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}
/* Biography section styles */
.section-biography {
    padding: 80px 20px;
    background-color: #ffffff00; /* White background color */
    color: #121212; /* Dark text color */
    min-height: 70vh; /* Full viewport height */
    margin-inline: 10vw;
    @media (max-width: 768px) {
        height: auto; /* Auto height for smaller screens */
        
    };
}
.biography-container {
    flex: 1;
    min-width: 100%;
    max-height: fit-content;
    margin-bottom: 64px;
}
.biography-title {
    font-size: 3rem;
    margin-bottom: 20px;
    text-align: left;
}
.biography-text {
    line-height: 1.6;
    font-size: 1.5rem;
    text-align: left;
    max-width: 60vw;
    font-weight: 600;
}
.stats-container {
    flex: 1;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
}
.stat-box {
    width: 100%;
    /*max-width: 600px;*/
    display: flex;
    height: fit-content;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 1px solid #000000;
    border-radius: 4px;
    padding: 20px;
    background-color: #ffffff00;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}
/* on big screen, stat-box have 2 columns */
@media (min-width: 769px) {
    .stat-box {
        max-width: 600px;
    }
}
.stat-icon {
    img{
        width: 50px;
        height: auto;
    }
}
.stat {
    font-size: 2rem;
    font-weight: bold;
    color: #121212;
}
.stat-label {
    font-size: 1rem;
    color: #424242;
    margin-top: 5px;
    margin-bottom: 10px;
    font-weight: 600;
}
.stat-button {
    margin-top: 15px;
    cursor: pointer;
    img {
        width: 35px;
        height: auto;
    }
}
.stat-description {
    font-size: 1rem;
    color: #424242;
    display: none;
    text-align: left;
}
/* Timeline section styles */
.section-timeline {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    overflow-x: hidden; /* Abilita lo scroll orizzontale */
    overflow-y: hidden; /* Disabilita lo scroll verticale */
    padding: 80px 20px;
    margin-inline: 10vw;
    color: #e0e0e0; /* Testo chiaro per lo sfondo nero */
}

.timeline-container {
    flex: 1;
    overflow: hidden;
}

.timeline {
    display: flex;
    height: 100%;
    overflow-x: auto; /* Abilita lo scroll orizzontale */
    overflow-y: hidden; /* Disabilita lo scroll verticale */
    scroll-snap-type: x mandatory; /* Abilita lo scroll snap orizzontale */
    -webkit-overflow-scrolling: touch; /* Abilita lo scroll fluido su dispositivi touch */
    align-items: stretch; /* Assicura che tutte le card abbiano la stessa altezza */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
    &::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }
}

.timeline-item {
    position: relative;
    min-width: 30vw;
    min-height: 20vh;
    flex: none;
    margin-right: 20px;
    padding: 20px;
    border-radius: 10px;
    flex-shrink: 0;
    width: 30vw; /* Ogni elemento occupa l'intera viewport */
    scroll-snap-align: start; /* Allinea l'elemento all'inizio durante lo scroll */
    display: flex; /* Imposta il layout flex per le card */
    flex-direction: column; /* Allinea il contenuto verticalmente */
    justify-content: center;
    align-items: center;
}

.card {
    background-color: #1e1e1e;
    color: #e0e0e0; /* Testo scuro per contrasto */
    border-radius: 8px;
    border: 1px solid #424242;
    padding: 20px;
    max-width: 400px;
    width: 100%;
    flex: 1; /* Permette alla card di espandersi uniformemente */
    display: flex;
    flex-direction: column;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
}

.card-title {
    font-size: 1.3rem;
    font-weight: 700;
    max-width: 80%;
    margin: 0;
}

.card-date {
    font-size: 0.9rem;
    color: rgb(255, 152, 0); /* Leggero contrasto per le date */
}

.card-company4{
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.card-description {
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.card-keypoints {
    list-style-type: disc;
    padding-left: 20px;
}

.card-keypoints li {
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.card-body {
    flex: 1; /* Fa sì che il corpo della card occupi lo spazio disponibile */
}

/* Responsività per dispositivi mobili */
@media (max-width: 768px) {
    .timeline-item {
        min-width: 50vw; /* Riduce ulteriormente la larghezza minima delle card su dispositivi mobili */
        margin-right: 10px; /* Riduce il margine tra le card su dispositivi mobili */
    }

    .card {
        max-width: 100%;
        padding: 15px; /* Riduce il padding delle card su dispositivi mobili */
    }

    .card-title {
        font-size: 1rem; /* Riduce la dimensione del font del titolo su dispositivi mobili */
    }

    .card-description {
        font-size: 0.85rem; /* Riduce la dimensione del font della descrizione su dispositivi mobili */
    }

    .card-keywords li {
        font-size: 0.85rem; /* Riduce la dimensione del font delle parole chiave su dispositivi mobili */
    }
}

/* Nasconde la scrollbar orizzontale se indesiderata */
.section-timeline::-webkit-scrollbar {
    display: none;
}
.section-timeline {
    -ms-overflow-style: none;  /* IE 10+ */
    scrollbar-width: none;  /* Firefox */
    color: #121212; /* Testo scuro per contrasto */
}

.timeline::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.timeline-title {
    font-size: 3rem;
    margin-bottom: 20px;
    text-align: left;
}

.timeline-text {
    line-height: 1.6;
    font-size: 1.5rem;
    text-align: left;
    max-width: 60vw;
    font-weight: 600;
}
.timeline-year {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ff9800;
    margin-bottom: 5px;
}
.sticky-timeline {
    position: sticky;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #000000;
    height: 80px;
    display: flex;
    align-items: center;
    box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.3);
    z-index: 100;
}
.timeline-bar {
    position: relative;
    width: 100%;
    height: 5px;
    background: #424242;
    border-radius: 4px;
    overflow: hidden;
}
.timeline-cursor {
    position: absolute;
    top: -10px;
    left: 0;
    width: 20px;
    height: 20px;
    background-color: #ff9800;
    border-radius: 50%;
    transform: translateX(0);
    transition: transform 0.2s ease-out;
}
.years {
    display: flex;
    justify-content: space-between;
    position: absolute;
    top: 15px;
    left: 0;
    width: 100%;
    color: #fff;
    font-size: 0.8rem;
}
.timeline-content {
    background-color: #000000;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); /* Box shadow for depth */
}
/* Press section styles */
.section-press {
    margin-top: 80px;
    padding: 80px 20px;
    margin-inline: 10vw;
    color: #e0e0e0;
}

.press-title {
    font-size: 3rem;
    margin-bottom: 20px;
    text-align: left;
}

.press-text {
    line-height: 1.6;
    font-size: 1.5rem;
    text-align: left;
    max-width: 60vw;
    font-weight: 600;
    margin-bottom: 40px;
}

.press-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.press-card {
    position: relative;
    background: linear-gradient(145deg, #fff, #f5f5f5);
    border: 1px solid #1e1e1e;
    border-radius: 12px;
    padding: 25px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.press-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #ff9800;
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.3s ease;
}

.press-card:hover {
    transform: translateY(-5px) translateX(2px);
    box-shadow: 0 8px 25px rgba(255, 152, 0, 0.1);
    border-color: #ff9800;
}

.press-card:hover::before {
    transform: scaleY(1);
}

.press-source {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ff9800;
    display: flex;
    align-items: center;
    gap: 8px;
}

.press-source::before {
    content: '📰';
    font-size: 1.2rem;
}

.press-date {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.press-date::before {
    content: '📅';
    font-size: 1rem;
}

.press-card p {
    font-size: 1rem;
    line-height: 1.5;
    color: #1e1e1e;
    margin: 8px 0;
    font-weight: 400;
}

.press-card:hover p {
    color: #000000;
}

.press-link {
    position: absolute;
    inset: 0;
    cursor: pointer;
    opacity: 0;
}

.press-card::after {
    content: '→';
    position: absolute;
    bottom: 15px;
    right: 20px;
    font-size: 1.5rem;
    color: #ff9800;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.press-card:hover::after {
    opacity: 1;
    transform: translateX(0);
}

@media (max-width: 768px) {
    .press-grid {
        grid-template-columns: 1fr;
    }
    
    .press-card {
        padding: 20px;
    }
}

/* Software section styles */
.section-software {
    padding: 80px 20px;
    margin-inline: 10vw;
    color: #e0e0e0;
    min-height: 80vh;
}

.software-title {
    font-size: 3rem;
    margin-bottom: 20px;
    text-align: left;
}

.software-text {
    line-height: 1.6;
    font-size: 1.5rem;
    text-align: left;
    max-width: 60vw;
    font-weight: 600;
    margin-bottom: 40px;
}

.software-container {
    display: flex;
    gap: 40px;
    min-height: 600px;
}

.software-list {
    flex: 0 0 300px;
    border-right: 1px solid #333;
    padding-right: 20px;
}

.software-item {
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    background: #1e1e1e;
    border: 1px solid #333;
}

.software-item:hover {
    background: #2a2a2a;
    transform: translateX(5px);
    border-color: #ff9800;
}

.software-item.active {
    background: #2a2a2a;
    border-color: #ff9800;
}

.software-item-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #e0e0e0;
    margin-bottom: 5px;
}

.software-item-desc {
    font-size: 0.9rem;
    color: #808080;
}

.diagram-container {
    flex: 1;
    position: relative;
    min-height: 600px;
    background: #121212;
    border-radius: 8px;
    border: 1px solid #333;
    overflow: hidden;
}


.diagram-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    transition: all 0.3s ease;
    pointer-events: unset!important; /*add this it*/

}

.diagram-svg {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 20px;
    touch-action: none; /* Previene il comportamento touch di default */
    transform-origin: 0 0; /* Imposta il punto di origine per le trasformazioni */
}

.diagram-svg.active {
    display: block;
}

/* Aggiungi controlli zoom su mobile */
.zoom-controls {
    display: none;
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 10;
    background: rgba(30, 30, 30, 0.8);
    border-radius: 8px;
    padding: 8px;
    gap: 8px;
}

.zoom-button {
    width: 40px;
    height: 40px;
    border: none;
    background: #333;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.zoom-button:hover {
    background: #444;
}

@media (max-width: 768px) {
    .zoom-controls {
        display: flex;
    }
}

@media (min-width: 769px) {
    .diagram-svg {
        display: none !important; /* Nascondi sempre gli SVG su desktop */
    }

    .diagram-frame.active {
        display: block;
    }
}

@media (max-width: 768px) {
    .software-container {
        flex-direction: column;
    }

    .software-list {
        flex: none;
        border-right: none;
        padding-right: 0;
        display: flex;
        overflow-x: auto;
        gap: 10px;
        margin-top: 20px;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE and Edge */
    }

    .software-list::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }

    .software-item {
        flex: 0 0 auto;
        width: auto;
        min-width: unset;
        padding: 8px 15px;
        margin-bottom: 0;
        white-space: nowrap;
        background: #1e1e1e50;
        -webkit-backdrop-filter: blur(8px);
        backdrop-filter: blur(8px);
        border: 1px solid #333;
    }

    .software-item-title {
        font-size: 0.9rem;
        margin-bottom: 0;
    }

    .software-item-desc {
        display: none;
    }

    .software-item.active {
        background: #ff9800;
        border-color: #ff9800;
    }

    .software-item.active .software-item-title {
        color: #121212;
    }
    .software-item.active .software-item-title span.highlight {
        color: #121212;
    }

    .diagram-container {
        height: 70vh;
        margin-top: 0;
    }

    .diagram-frame {
        height: 100%;
    }

    .software-text {
        max-width: 100%;
        margin-bottom: 20px;
    }
    .diagram-frame {
        display: none !important; /* Nascondi sempre gli iframe su mobile */
    }

    .diagram-svg {
        position: absolute;
        top: 0;
        left: 0;
        display: none; /* Default nascosto, .active lo mostrerà */
    }

    .diagram-svg.active {
        display: block;
    }
}

/* Footer styles */
footer {
    text-align: center;
    padding: 20px;
    background-color: #121212; /* Match body background */
}
.chart-container {
    height: 100%;
    max-height: 600px;
    width:100%;
    max-width: 600px;
    margin-top: 20px;
    display: none;
}
.highlight {
    color: #ff9800;
    font-weight: bold;
}
