/* ============================================================================
 * Archivet.Hub — sidebar2.css
 * ----------------------------------------------------------------------------
 * Geometria della sidebar collassabile dell'Hub. La palette e i font
 * derivano dai token del Design System (design-tokens.css).
 * Manteniamo la geometria storica (250px aperta / 88px chiusa).
 * ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-sans);
}

.sidebar,
.sidebar * {
    /* Mappatura interna sui token DS, così i selettori storici continuano a girare */
    --body-color: var(--bg);
    --sidebar-color: var(--surface);
    --primary-color: var(--accent2);
    --primary-color-light: var(--accent-light);
    --toggle-color: var(--steel-light);
    --text-color: var(--text2);
    --tran-03: all 0.2s var(--ease);
    --tran-04: all 0.3s var(--ease);
    --tran-05: all 0.3s var(--ease);
}

body {
    min-height: 100vh;
    background-color: var(--bg);
    transition: background-color var(--dur-3) var(--ease);
}

::selection {
    background-color: var(--accent2);
    color: #fff;
}

/* ===== Sidebar ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 250px;
    padding: 10px 14px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    transition: width var(--dur-3) var(--ease);
    z-index: 100;
}

    .sidebar.close {
        width: 88px;
    }

    /* ===== Reusable code - Here ===== */
    .sidebar li {
        height: 50px;
        list-style: none;
        display: flex;
        align-items: center;
        margin-top: 10px;
    }

    .sidebar header .image,
    .sidebar .icon {
        min-width: 60px;
        border-radius: 6px;
    }

    .sidebar .icon {
        min-width: 60px;
        border-radius: 6px;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
    }

    .sidebar .text,
    .sidebar .icon {
        color: var(--text-color);
        transition: var(--tran-03);
    }

    .sidebar .text {
        font-size: 17px;
        font-weight: 500;
        white-space: nowrap;
        opacity: 1;
    }

    .sidebar.close .text {
        opacity: 0;
    }
    /* =========================== */

    .sidebar header {
        position: relative;
    }

        .sidebar header .image-text {
            display: flex;
            align-items: center;
        }

        .sidebar header .logo-text {
            display: flex;
            flex-direction: column;
        }

header .image-text .name {
    margin-top: 2px;
    font-size: 18px;
    font-weight: 600;
}

header .image-text .profession {
    font-size: 16px;
    margin-top: -2px;
    display: block;
}

.sidebar header .image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar header .image img {
    width: 40px;
    border-radius: 6px;
}

.sidebar header .toggle {
    position: absolute;
    top: 50%;
    right: -25px;
    transform: translateY(-50%) rotate(180deg);
    height: 25px;
    width: 25px;
    background-color: var(--primary-color);
    color: var(--sidebar-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    transition: var(--tran-05);
}

body.dark .sidebar header .toggle {
    color: var(--text-color);
}

.sidebar.close .toggle {
    transform: translateY(-50%) rotate(0deg);
}

.sidebar .menu {
    margin-top: 25px;
}

.sidebar li.search-box {
    border-radius: var(--radius-sm);
    background-color: var(--bg2);
    cursor: pointer;
    transition: background-color var(--dur-2) var(--ease);
}

.sidebar li.search-box input {
    height: 100%;
    width: 100%;
    outline: none;
    border: none;
    background-color: var(--bg2);
    color: var(--text);
    border-radius: var(--radius-sm);
    font-size: var(--text-base);
    font-weight: 500;
    transition: background-color var(--dur-2) var(--ease);
}

.sidebar li a {
    list-style: none;
    height: 100%;
    background-color: transparent;
    display: flex;
    align-items: center;
    height: 100%;
    width: 100%;
    border-radius: 6px;
    text-decoration: none;
    transition: var(--tran-03);
}

.sidebar li a:hover {
    background-color: var(--accent2);
}

.sidebar li a:hover .icon,
.sidebar li a:hover .text {
    color: #fff;
}

body.dark .sidebar li a:hover .icon,
body.dark .sidebar li a:hover .text {
    color: var(--text-color);
}

.sidebar .menu-bar {
    height: calc(100% - 55px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-y: scroll;
}

.menu-bar::-webkit-scrollbar {
    display: none;
}

.sidebar .menu-bar .mode {
    border-radius: 6px;
    background-color: var(--primary-color-light);
    position: relative;
    transition: var(--tran-05);
}

.menu-bar .mode .sun-moon {
    height: 50px;
    width: 60px;
}

.mode .sun-moon i {
    position: absolute;
}

    .mode .sun-moon i.sun {
        opacity: 0;
    }

body.dark .mode .sun-moon i.sun {
    opacity: 1;
}

body.dark .mode .sun-moon i.moon {
    opacity: 0;
}

.menu-bar .bottom-content .toggle-switch {
    position: absolute;
    right: 0;
    height: 100%;
    min-width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
}

.toggle-switch .switch {
    position: relative;
    height: 22px;
    width: 40px;
    border-radius: 25px;
    background-color: var(--toggle-color);
    transition: var(--tran-05);
}

.switch::before {
    content: '';
    position: absolute;
    height: 15px;
    width: 15px;
    border-radius: 50%;
    top: 50%;
    left: 5px;
    transform: translateY(-50%);
    background-color: var(--sidebar-color);
    transition: var(--tran-04);
}

body.dark .switch::before {
    left: 20px;
}

.home {
    position: absolute;
    top: 0;
    left: 250px;
    height: 100vh;
    width: calc(100% - 250px);
    background-color: var(--bg);
    transition: left var(--dur-3) var(--ease), width var(--dur-3) var(--ease);
}

.home .text {
    font-size: 30px;
    font-weight: 500;
    color: var(--text);
    padding: 10px 35px;
}

.home .text .title {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    color: var(--text);
}

.home .text .subtitle {
    font-size: var(--text-sm);
    color: var(--text2);
    font-weight: 400;
}

.sidebar.close ~ .home {
    left: 78px;
    height: 100vh;
    width: calc(100% - 78px);
}

body.dark .home .text {
    color: var(--text-color);
}

.menu-links {
    padding-left: 0px;
}

.menu-links .nav-link {
    padding: 0px;
}
