/* =========================================
   1. System Variables & Reset
   ========================================= */
:root {
    /* Colors */
    --neon-green: #bbe3a1;
    --neon-green-glow: rgba(187, 227, 161, 0.4);
    --neon-red: #ff5555;
    --neon-red-glow: rgba(255, 85, 85, 0.4);
    --neon-yellow: #ffcc00;
    --neon-yellow-glow: rgba(255, 204, 0, 0.4);

    --bg-dark: #0a0a0a;
    --bg-gradient-start: #121212;
    --bg-gradient-end: #000000;

    --glass-bg: rgba(20, 20, 20, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: 12px;

    /* Typography */
    --font-ui: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-ui);
}

body {
    background-color: #000000;
    min-height: 100vh;
    color: #ffffff;
    overflow-x: hidden;
    line-height: 1.6;
}

html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #050505;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--neon-green);
}

/* Animations */
@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   2. Header & Navigation
   ========================================= */
header {
    padding: 40px 20px;
    text-align: center;
    animation: fadeInSlide 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

header #menu {
    margin-top: 20px;
}

header #menu a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    margin: 0 15px;
    padding: 5px 10px;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

header #menu a:hover {
    color: var(--neon-green);
    filter: drop-shadow(0 0 8px var(--neon-green-glow));
    transform: translateY(-3px);
    text-shadow: none;
    /* Drop-shadow handles the glow better for this effect */
}

header #banner img {
    margin-top: 30px;
    width: 100%;
    max-width: 900px;
    height: auto;
    border-radius: 8px;
    opacity: 0.9;
    /* Subtle reflection effect */
    -webkit-mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
}

/* =========================================
   3. Main Layout & Text
   ========================================= */
main #title-text {
    color: white;
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    margin: 40px auto;
    max-width: 800px;
    line-height: 1.3;
    letter-spacing: -0.5px;
    animation: fadeInSlide 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s backwards;
}

/* =========================================
   4. Glassmorphism Components
   ========================================= */

/* Shared Container Styles */
main #result-box,
/* Shared Container Styles */
main #result-box,
main #opzioni,
main #about-box {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));

    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 40px;

    max-width: 550px;
    margin: 30px auto;
    text-align: center;

    /* Default Glow */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);

    transition: all 0.4s ease;
}

main #result-box {
    animation: fadeInSlide 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s backwards;
}

main #opzioni {
    animation: fadeInSlide 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s backwards;
}

main #about-box {
    animation: fadeInSlide 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s backwards;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.8;
}

main #about-box strong {
    color: var(--neon-green);
}

/* Image in Chi Sono page */
main img.chi-sono-img {
    display: block;
    margin: 20px auto;
    border-radius: 50%;
    border-radius: 15px;
    max-width: 150px;
    border: 2px solid var(--neon-green);
    box-shadow: 0 0 20px var(--neon-green-glow);
    animation: fadeInSlide 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s backwards;
}

main #result-box {
    animation: fadeInSlide 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s backwards;
}

main #opzioni {
    animation: fadeInSlide 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s backwards;
}

/* Focus Glows (Controlled by JS classes) */
main #result-box.insufficiente {
    border-color: var(--neon-red);
    box-shadow: 0 0 30px var(--neon-red-glow);
}

main #result-box.medio {
    border-color: var(--neon-yellow);
    box-shadow: 0 0 30px var(--neon-yellow-glow);
}

main #result-box.ottimo {
    border-color: var(--neon-green);
    box-shadow: 0 0 30px var(--neon-green-glow);
}

/* Inputs */
input[type="text"],
input[type="number"] {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #333;
    border-radius: 12px;
    color: white;
    font-family: var(--font-mono);
    outline: none;
    transition: all 0.3s ease;
}

main #result-box input {
    width: 100%;
    padding: 18px;
    font-size: 22px;
    letter-spacing: 2px;
    margin-bottom: 5px;
    text-align: center;
}

/* Dynamic Text Colors matching strength */
main #result-box.insufficiente input {
    color: var(--neon-red);
    border-color: var(--neon-red);
}

main #result-box.medio input {
    color: var(--neon-yellow);
    border-color: var(--neon-yellow);
}

main #result-box.ottimo input {
    color: var(--neon-green);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Buttons */
button {
    background: var(--neon-green);
    color: #000;
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 16px 40px;
    margin-top: 10px;
    width: auto;
    display: inline-block;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px var(--neon-green-glow);
    background: #fff;
}

button:active {
    transform: translateY(0);
}

#result-box button {
    width: auto;
    margin-top: 15px;
}

#opzioni #genera {
    width: 100%;
    margin-top: 25px;
    font-size: 18px;
}

/* Strength Text */
.strength-text {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 5px;
    margin-bottom: 20px;
    opacity: 0.9;
}

main #result-box.insufficiente .strength-text {
    color: var(--neon-red);
}

main #result-box.medio .strength-text {
    color: var(--neon-yellow);
}

main #result-box.ottimo .strength-text {
    color: var(--neon-green);
}

/* =========================================
   5. Options Section
   ========================================= */
main #opzioni {
    display: flex;
    flex-direction: column;
    gap: 0;
    /* Handled by padding */
}

.opzione-riga {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.opzione-riga:last-of-type {
    border-bottom: none;
}

.opzione-riga label {
    font-size: 16px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: color 0.2s;
}

.opzione-riga:hover label {
    color: white;
}

.opzione-riga input[type="number"] {
    width: 70px;
    padding: 8px;
    font-size: 16px;
    text-align: center;
}

.opzione-riga input[type="number"]:focus {
    border-color: var(--neon-green);
    box-shadow: 0 0 10px var(--neon-green-glow);
}

/* Custom Checkbox */
.opzione-riga input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.opzione-riga input[type="checkbox"]:checked {
    background: var(--neon-green);
    border-color: var(--neon-green);
    box-shadow: 0 0 15px var(--neon-green-glow);
}

.opzione-riga input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 12px;
    border: solid black;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

/* =========================================
   6. Footer
   ========================================= */
footer {
    text-align: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 13px;
    margin-top: 50px;
    animation: fadeInSlide 0.8s backwards 0.6s;
    background: linear-gradient(to top, rgba(10, 10, 10, 1), transparent);
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
}

.social-icons a {
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-icons svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    transition: transform 0.3s ease;
}

.social-icons a:hover {
    color: var(--neon-green);
    /* Neon Glow */
    filter: drop-shadow(0 0 8px var(--neon-green-glow));
    transform: translateY(-3px);
}

.social-icons a:hover svg {
    transform: scale(1.1);
}

/* =========================================
   7. Mobile Responsive
   ========================================= */
@media (max-width: 600px) {
    header {
        padding: 20px 10px;
    }

    main #title-text {
        font-size: 22px;
        margin: 20px;
    }

    main #result-box,
    main #opzioni {
        margin: 20px 15px;
        padding: 25px;
    }

    header #menu a {
        display: block;
        margin: 10px 0;
    }
}