/* Syncfusion SfSidebar navigation styling for Progetto Posa */

:root {
    --pp-sidebar-bg-start: #7B3F99;
    --pp-sidebar-bg-end: #5B2F79;
    --pp-sidebar-hover: rgba(255, 255, 255, 0.18);
    --pp-sidebar-active: rgba(255, 255, 255, 0.28);
    --pp-sidebar-muted: rgba(255, 255, 255, 0.65);
}

/*
 * Il componente SfSidebar non sempre applica CssClass al wrapper radice.
 * Applichiamo quindi lo stile sia alla shell (quando presente) sia al contenitore interno
 * in modo che il gradiente e il contrasto risultino sempre visibili.
 */
.pp-sidebar-shell,
.pp-sidebar {
    background: linear-gradient(180deg, var(--pp-sidebar-bg-start) 0%, var(--pp-sidebar-bg-end) 100%);
    color: #ffffff;
    border-right: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 4px 0 16px rgba(91, 47, 121, 0.25);
}

.pp-sidebar {
    position: relative;
}

.pp-sidebar {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.pp-sidebar__brand {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 72px;
    padding: 0 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    position: sticky;
    top: 0;
    z-index: 2;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0));
}

.pp-sidebar__brand-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    color: #ffffff;
    text-decoration: none;
}

.pp-sidebar__brand-link img {
    max-height: 42px;
    object-fit: contain;
}

.pp-sidebar__brand-link i {
    font-size: 1.4rem;
}

.pp-sidebar__body {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.pp-sidebar__body::-webkit-scrollbar {
    width: 6px;
}

.pp-sidebar__body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 4px;
}

.pp-sidebar__feedback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    color: var(--pp-sidebar-muted);
    padding: 1.25rem 0.75rem;
    text-align: center;
    font-size: 0.85rem;
}

.pp-sidebar__retry {
    border: none;
    background: none;
    color: #ffffff;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.25rem 0.4rem;
}

.pp-sidebar__section {
    margin-bottom: 0.5rem;
    border-radius: 8px;
    overflow: hidden;
}

.pp-sidebar__section-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #CCCCCC;
    border: none;
    color: #333333;
    padding: 0.65rem 0.85rem;
    font-size: 0.72rem;
    letter-spacing: 0.08rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.pp-sidebar__section-header:disabled {
    cursor: default;
    opacity: 0.6;
}

.pp-sidebar__section-header:hover:not(:disabled) {
    background: #BBBBBB;
}

.pp-sidebar__section.is-collapsed .pp-sidebar__items {
    display: none;
}

.pp-sidebar__items {
    display: flex;
    flex-direction: column;
    padding: 0.25rem 0;
}

.pp-sidebar__item {
    margin: 2px 0;
}

.pp-sidebar__link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.85rem;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.pp-sidebar__link:hover {
    background: var(--pp-sidebar-hover);
    color: #ffffff;
}

.pp-sidebar__link.active {
    background: var(--pp-sidebar-active);
    color: #ffffff;
    box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.7);
}

.pp-sidebar__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
}

.pp-sidebar__icon i {
    font-size: 1rem;
}

.pp-sidebar__text {
    flex: 1;
    font-size: 0.92rem;
    line-height: 1.1rem;
}

.pp-sidebar__chevron {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.pp-sidebar__section.is-collapsed .pp-sidebar__chevron {
    transform: rotate(-90deg);
}

.pp-sidebar__label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.85rem;
    color: var(--pp-sidebar-muted);
    font-size: 0.7rem;
    letter-spacing: 0.06rem;
    text-transform: uppercase;
}

.pp-sidebar__footer {
    padding: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.pp-sidebar__dock-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    border-radius: 8px;
    color: #ffffff;
    padding: 0.55rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.pp-sidebar__dock-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Docked state */
.pp-sidebar--docked .pp-sidebar__text,
.pp-sidebar--docked .pp-sidebar__chevron,
.pp-sidebar--docked .pp-sidebar__dock-btn span {
    display: none;
}

.pp-sidebar--docked .pp-sidebar__section-header {
    justify-content: center;
    padding: 0.75rem 0;
}

.pp-sidebar--docked .pp-sidebar__link {
    justify-content: center;
    padding: 0.8rem 0;
}

.pp-sidebar--docked .pp-sidebar__label {
    justify-content: center;
    padding: 0.5rem 0;
}

/* Overlay adjustments for mobile */
.pp-sidebar--overlay-closed .pp-sidebar__body {
    pointer-events: none;
}

@media (max-width: 767.98px) {
    .pp-sidebar-shell {
        box-shadow: none;
    }
}

/* Layout container adjustments */
.pp-layout {
    display: flex;
    min-height: 100vh;
    background: #f7f8fa;
}

.pp-layout__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-left: var(--sidebar-offset, 260px);
    transition: margin-left 0.3s ease;
    min-height: 100vh;
    background: #f7f8fa;
}

.pp-layout__topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
    padding: 0 2rem;
    background: #ffffff;
    border-bottom: 1px solid #e3e6ef;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
    position: sticky;
    top: 0;
    z-index: 10;
}

.pp-layout__topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pp-layout__toggle {
    border: none;
    background: none;
    font-size: 1.2rem;
    color: #4b5563;
    padding: 0.4rem 0.45rem;
    border-radius: 8px;
    transition: background 0.2s ease, color 0.2s ease;
}

.pp-layout__toggle:hover {
    background: rgba(123, 63, 153, 0.1);
    color: #7B3F99;
}

.pp-layout__subtitle {
    font-size: 0.95rem;
    color: #6b7280;
}

.pp-layout__main {
    flex: 1;
    padding: 1.5rem 2.25rem;
    overflow-y: auto;
    overflow-x: hidden;
}

@media (max-width: 991.98px) {
    .pp-layout__topbar {
        padding: 0 1.25rem;
    }

    .pp-layout__main {
        padding: 1.25rem;
    }
}
