:root {
    --bg: #0f0f1b;
    --primary: #00ffff;
    --secondary: #8800ff;
    --text: #f0f0f0;
    --glass: rgba(255, 255, 255, 0.05);
}

body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(15, 15, 27, 0.9);
    backdrop-filter: blur(5px);
    z-index: 1000;
}

/* Aggiungi queste regole al tuo style.css */

/* Stile migliorato per lo slider */
.controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin: 2rem 0;
    padding: 1rem;
    background: rgba(0, 204, 255, 0.05);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 255, 255, 0.1);
}

/* Stile personalizzato per l'input range */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    max-width: 300px;
    height: 8px;
    background: rgba(0, 204, 255, 0.2);
    border-radius: 10px;
    outline: none;
    transition: all 0.3s ease;
}

/* Track (la barra dello slider) */
input[type="range"]::-webkit-slider-runnable-track {
    height: 8px;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Thumb (il cursore dello slider) */
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    margin-top: -7px;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.7);
    border: 2px solid white;
    transition: all 0.3s ease;
}

/* Effetto hover per il thumb */
input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.9);
}

/* Stile per il valore visualizzato */
#beamwidthValue {
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--primary);
    min-width: 40px;
    text-align: center;
    background: rgba(0, 204, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--primary);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
}

/* Etichetta dello slider */
.controls label {
    font-weight: 500;
    color: var(--text);
    opacity: 0.8;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Animazione al cambiamento del valore */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.changing {
    animation: pulse 0.3s ease;
}

.logo {
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--primary);
}

.logo span {
    color: var(--secondary);
}

nav {
    display: flex;
    gap: 1.5rem;
    max-width: 100%;
    box-sizing: border-box;
    padding-right: 3rem;
}

nav a {
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: color 0.3s, background 0.3s;
}

nav a:hover {
    color: var(--primary);
    background: rgba(0, 204, 255, 0.1);
}

main {
    padding: 7rem 2rem 4rem;
    max-width: 800px;
    margin: 0 auto;
}

section {
    margin-bottom: 3rem;
    background: var(--glass);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.1);
    animation: fadeIn 0.5s ease-out;
}

h1, h2 {
    color: var(--primary);
    margin-top: 0;
}

h2 {
    font-size: 1.4rem;
}

ul {
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
}

footer {
    text-align: center;
    padding: 2rem;
    font-size: 0.9rem;
    color: #999;
}

/* Grafico Interattivo */
#grafico {
    text-align: center;
}

.controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.svg-container {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}

#grafico-svg {
    width: 100%;
    max-width: 400px;
    height: auto;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

#beamwidthValue {
    font-weight: bold;
    color: var(--primary);
    min-width: 20px;
}

/* Quiz */
.quiz-container {
    max-width: 600px;
    margin: 0 auto;
}

.quiz-question {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.quiz-options {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.quiz-option {
    padding: 1rem;
    background: rgba(0, 204, 255, 0.1);
    border: 1px solid var(--primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.quiz-option:hover {
    background: rgba(0, 204, 255, 0.3);
}

.quiz-option.selected {
    background: var(--primary);
    color: var(--bg);
    font-weight: bold;
}

.quiz-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
}

.quiz-button {
    padding: 0.8rem 1.5rem;
    background: var(--primary);
    color: var(--bg);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.quiz-button:hover {
    background: var(--secondary);
    color: white;
}

.quiz-button:disabled {
    background: #666;
    cursor: not-allowed;
}

.quiz-result {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(0, 204, 255, 0.1);
    border-radius: 8px;
    text-align: center;
    font-size: 1.2rem;
    display: none;
}

/* Menu Mobile */
.hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--primary);
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
    transition: transform 0.3s ease;
}

.hamburger.active {
    transform: rotate(90deg);
}

/* Animazioni */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    header {
        padding: 1rem;
    }

    .hamburger {
        display: block;
        position: fixed;
        top: 1rem;
        right: 1rem;
    }

    nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(10, 10, 20, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        clip-path: circle(0% at 90% 5%);
        -webkit-clip-path: circle(0% at 90% 5%);
        transition: all 0.4s cubic-bezier(0.65, 0, 0.35, 1);
        pointer-events: none;
        gap: 1.5rem;
        padding: 20vh 0;
    }

    nav.show {
        clip-path: circle(150% at 90% 5%);
        -webkit-clip-path: circle(150% at 90% 5%);
        pointer-events: all;
    }

    nav a {
        font-size: 1.5rem;
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.3s ease;
        background: rgba(0, 204, 255, 0.1);
        border: 1px solid var(--primary);
        border-radius: 8px;
        padding: 1rem 2rem;
        width: 80%;
        max-width: 300px;
        text-align: center;
    }

    nav.show a {
        opacity: 1;
        transform: translateY(0);
    }

    body.menu-open {
        overflow: hidden;
    }

    main {
        padding: 6rem 1rem 2rem;
    }

    section {
        padding: 1.5rem;
    }
}
