/* Stili Generali e Desktop */
body {
    margin: 0;
    background-color: #565454;
    font-family: 'Montserrat', sans-serif;
    color: #fff;
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    top: 250px;
    left: 20px;
    width: 150px;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 30px 15px;
    border-radius: 10px;
    box-sizing: border-box;
    z-index: 1000;
}

.main-content {
    margin-left: 185px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sidebar ul {
    list-style-position: inside;
    padding-left: 0;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    width: 100%;
}

.sidebar nav a {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    padding: 8px 0;
    text-align: center;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    animation: flicker-disappear 5s infinite;
}

.sidebar nav a:hover {
    color: #ff4081;
    border-bottom-color: #ff4081;
    transform: scale(1.05);
    animation-play-state: paused;
}

.title-container {
    margin-top: 40px;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
}

.title {
    font-family: 'Great Vibes', cursive;
    font-size: 64px;
    font-weight: 400;
    letter-spacing: 1px;
    white-space: nowrap;
    overflow: hidden;
    border-right: 2px solid #fff;
    width: 0;
    animation: loopTyping 8s steps(20, end) infinite,
    blink 0.7s step-end infinite,
    colorShift 6s infinite,
    shine 3s infinite;
    background: linear-gradient(120deg, #fff, #ff4081, #40c4ff, #fff);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes loopTyping {
    0% { width: 0; }
    30% { width: 100%; }
    60% { width: 100%; }
    100% { width: 0; }
}

@keyframes blink {
    50% { border-color: transparent; }
}

@keyframes colorShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes shine {
    0% {
        text-shadow: 0 0 10px #fff, 0 0 20px #ff4081, 0 0 30px #40c4ff;
    }
    50% {
        text-shadow: 0 0 20px #40c4ff, 0 0 30px #fff, 0 0 40px #ff4081;
    }
    100% {
        text-shadow: 0 0 10px #fff, 0 0 20px #ff4081, 0 0 30px #40c4ff;
    }
}

.subtitle {
    font-size: 20px;
    font-weight: 300;
    color: #ccc;
    margin-top: 5px;
    animation: fadeIn 3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slideshow-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.slideshow-container {
    position: relative;
    width: 90%;
    max-width: 1200px;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background-color: #565454;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.slide {
    position: absolute;
    width: 75%;
    height: 75%;
    object-fit: contain;
    opacity: 0;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateX(100%); 
    transition: opacity 1.5s ease-in-out, transform 1.5s ease-in-out;
}

.slide.active {
    opacity: 1;
    z-index: 1;
    transform: translate(-50%, -50%) translateX(0);
}

.slide.vertical {
    background-color: #565454;
    padding: 10px;
    box-sizing: border-box;
}

.slide.zoomed {
    transform: scale(1.2) translate(-50%, -50%);
    transition: transform 0.5s ease;
    z-index: 2;
}

/* Stili per il testo verticale sinistro */
.left-text-container {
    position: fixed;
    top: 50%;
    left: 190px;
    transform: translateY(-50%);
    z-index: 1000;
}

.vertical-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 24px;
    font-weight: 300;
    color: #fff;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
}

/* Stili per la nuova scritta sopra il riquadro */
.slideshow-title {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    z-index: 1001;
    display: flex;
    flex-direction: row; /* Modifica per disporre le parole affiancate */
    align-items: flex-start;
    gap: 15px; /* Spazio tra le parole */
}

.word-container {
    display: flex;
    flex-direction: column; /* Dispone le lettere una sotto l'altra */
    align-items: center;
    gap: 0; /* Rimuove lo spazio tra i caratteri */
}

.word-container span {
    font-family: 'Montserrat', sans-serif;
    font-size: 24px;
    font-weight: 300;
    color: #b33939; /* Rosso scuro come nella foto */
    line-height: 1.2; /* Spazio tra le lettere */
    position: relative;
    overflow: hidden;
}

/* Aggiunta dell'effetto luce per la scritta verticale */
.word-container {
    position: relative;
    overflow: hidden;
}

.word-container::before {
    content: '';
    position: absolute;
    top: -100%; /* Inizia sopra il contenitore */
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, transparent, rgba(255,255,255,0.8), transparent);
    animation: shine-down 2s linear infinite;
}

@keyframes shine-down {
    0% { top: -100%; }
    100% { top: 100%; }
}

/* Responsive per dispositivi mobili */
@media (max-width: 768px) {
    body {
        flex-direction: column;
        padding: 0;
    }
    .sidebar {
        position: static;
        left: auto;
        top: auto;
        width: 100%;
        margin: 20px 0;
        text-align: center;
    }
    .main-content {
        margin-left: 0;
        padding: 0;
        width: 100%;
    }
    .sidebar nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 15px;
        justify-content: center;
    }
    .sidebar nav a {
        font-size: 12px;
        padding: 5px 10px;
    }
    .title {
        font-size: 40px;
    }
    .subtitle {
        font-size: 16px;
    }
    .slideshow-container {
        aspect-ratio: 3 / 2;
        max-width: 90%;
    }
    .left-text-container {
        display: none;
    }
    .slideshow-title {
        display: none;
    }
}

@media (max-width: 600px) {
    .title {
        font-size: 40px;
    }
    .subtitle {
        font-size: 16px;
    }
    .slideshow-container {
        aspect-ratio: 3 / 2;
    }
}

@keyframes flicker-disappear {
    0%, 100% { opacity: 1; }
    2% { opacity: 0; }
    4% { opacity: 1; }
    6% { opacity: 0; }
    8% { opacity: 1; }
    10% { opacity: 0; }
    12% { opacity: 1; }
    98% { opacity: 1; }
}
