/* =========================================
   NAVBAR CONTAINER
========================================= */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 30px;
    background: var(--bg);
    border-bottom: 1px solid #dcdcdc;
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* LEFT SIDE */
.nav-left {
    display: flex;
    align-items: center;
    gap: 25px;
}

.nav-left .logo-title {
    font-size: 22px;
    font-weight: 700;
}

/* MENU LINKS */
.nav-links {
    display: flex;
    gap: 15px;
    position: relative;
}

.nav-links a {
    color: var(--text);
    padding: 8px 12px;
    text-decoration: none;
    font-weight: 500;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    transition: background .2s;
}

.nav-links a:hover,
.nav-links a.active {
    background: var(--primary);
    color: #fff;
}

/* MOBILE ICON */
.menu-toggle {
    font-size: 26px;
    cursor: pointer;
    display: none;
}

/* RIGHT SIDE BUTTONS */
.nav-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* =========================================
   LANGUAGE SWITCH
========================================= */
.lang-switch input {
    display: none;
}

.lang-toggle {
    width: 70px;
    height: 36px;
    background: var(--card-bg);
    border-radius: 50px;
    padding: 3px; /* leggermente meno padding */
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.lang-toggle span {
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    font-size: 18px;
}

.lang-toggle::after {
    content: "";
    position: absolute;
    width: 30px;
    height: 30px;
    background: var(--accent);
    border-radius: 50%;
    top: 50%;        
    left: 3px;           
    transform: translate(0, -50%); 
    transition: transform 0.3s ease;
}

#langToggle:checked + .lang-toggle::after {
    transform: translateX(32px) translateY(-50%);
}



#langToggle:not(:checked) + .lang-toggle .lang-it { opacity: 1; }
#langToggle:checked + .lang-toggle .lang-en { opacity: 1; }

/* =========================================
   THEME BUTTON
========================================= */
.theme-toggle {
    width: 40px;
    height: 40px;
    background: var(--card-bg);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center; 
    cursor: pointer;
    font-size: 20px;
}

/* =========================================
   TOOLTIP
========================================= */
.tooltip {
    position: relative;
}

.tooltip-label {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    top: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--card-bg);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    transition: opacity .3s;
    color: var(--text);
}

.tooltip:hover .tooltip-label {
    opacity: 1;
    visibility: visible;
}

/* =========================================
   MOBILE
========================================= */
@media (max-width: 820px) {

    .menu-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        background: var(--bg);
        position: absolute;
        right: 0;
        top: 75px;
        width: 220px;
        padding: 20px;
        border-left: 1px solid #ccc;
        gap: 10px;
    }

    .nav-links.nav-open {
        display: flex;
    }
}
