﻿:root {
    --sidebar-width: 220px;
    --sidebar-collapsed-width: 55px;
    --text-light: #E0E0E0;
    --accent-color: #9B63E2;
    --hover-color: #7A4DD1;
    --font-family: 'Vazir', Tahoma, 'Segoe UI', Geneva, Verdana, sans-serif;
}

#sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, rgba(60, 45, 90, 0.85) 0%, rgba(30, 25, 45, 0.9) 100%);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 10px;
    right: 0;
    height: calc(100vh - 20px);
    z-index: 999;
    border-top-left-radius: 18px;
    border-bottom-left-radius: 18px;
    overflow: hidden;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.82rem;
}

    #sidebar.collapsed {
        width: var(--sidebar-collapsed-width);
    }

        #sidebar.collapsed .nav-text,
        #sidebar.collapsed .user-details,
        #sidebar.collapsed .logout-text,
        #sidebar.collapsed .sidebar-date,
        #sidebar.collapsed .sidebar-time {
            display: none;
        }

        #sidebar.collapsed .sidebar-user-panel,
        #sidebar.collapsed .sidebar-datetime {
            padding: 0.7rem 0.3rem;
            align-items: center;
        }

        #sidebar.collapsed .user-image {
            margin-left: 0;
        }

        #sidebar.collapsed .btn-logout-sidebar {
            width: auto;
            padding: 5px;
        }

.sidebar-user-panel {
    padding: 1rem 0.7rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    margin-bottom: 0.7rem;
    width: 100%;
}


/*.user-details {
    flex-grow: 1;
    gap:0;
}*/

.user-name {
    font-weight: bold;
    font-size: 0.82rem;
    margin-bottom: 0;
    text-align: center;
    width: 100%;
}

.user-role {
    font-size: 0.72rem;
    opacity: 0.8;
    text-align: center;
    width: 100%;
    margin-top: 0; /* حذف فاصله */
}

.btn-logout-sidebar {
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #fff;
    padding: 5px 10px;
    border-radius: 16px;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 0.78rem;
}

    .btn-logout-sidebar:hover {
        background: rgba(255, 255, 255, 0.2);
    }

.sidebar-datetime {
    padding: 0.7rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar-date {
    font-size: 0.78rem;
    margin-bottom: 0.2rem;
    opacity: 0.9;
}

.sidebar-time {
    font-size: 1rem;
    font-weight: bold;
    color: #B36DE2;
}

.sidebar-menu {
    flex: 1;
    padding: 0.7rem 0;
    overflow-y: auto;
}

#sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

    #sidebar ul li a {
        padding: 0.65rem 1rem;
        display: flex;
        align-items: center;
        color: var(--text-light);
        text-decoration: none;
        border-radius: 10px;
        margin: 0.2rem 0.5rem;
        gap: 8px;
        font-size: 0.82rem;
    }

        #sidebar ul li a:hover {
            background: rgba(138, 99, 210, 0.25);
            color: #fff;
        }

    #sidebar ul li.active > a {
        background: rgba(138, 99, 210, 0.35);
        font-weight: bold;
        color: #fff;
        box-shadow: 0 0 15px rgba(138, 99, 210, 0.35);
    }

    #sidebar ul li a i {
        width: 16px;
        text-align: center;
        font-size: 0.95rem;
        color: #B36DE2;
    }

#sidebar .collapse li a {
    padding: 0.55rem 0.7rem;
    font-size: 0.78rem;
}

.sidebar-brand {
    padding: 1.5rem 0.7rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    position: relative;
    overflow: hidden;
}

    .sidebar-brand::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 1px;
        background: linear-gradient(90deg, transparent, rgba(179, 109, 226, 0.6), transparent);
    }

.brand-logo {
    width: 70px;
    height: 70px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(179, 109, 226, 0.25) 0%, rgba(138, 99, 210, 0.2) 50%, rgba(100, 80, 180, 0.15) 100%);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

    .brand-logo::before {
        content: '';
        position: absolute;
        width: 100%;
        height: 100%;
        border-radius: 18px;
        background: conic-gradient( from 0deg at 50% 50%, rgba(179, 109, 226, 0.4) 0deg, rgba(138, 99, 210, 0.2) 90deg, rgba(100, 80, 180, 0.1) 180deg, rgba(179, 109, 226, 0.3) 270deg, rgba(179, 109, 226, 0.4) 360deg );
        opacity: 0.6;
    }

.logo-icon {
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FFD700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    position: relative;
    z-index: 2;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.brand-content {
    text-align: center;
}

.brand-main {
    font-size: 1.8rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 0.3rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.5px;
    font-family: 'Vazir', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.2;
    position: relative;
}

    .brand-main::after {
        content: '';
        position: absolute;
        bottom: -5px;
        left: 50%;
        width: 40px;
        height: 3px;
        background: linear-gradient(90deg, transparent, #B36DE2, transparent);
        border-radius: 3px;
        opacity: 0.8;
    }

.brand-subtitle {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
    font-style: italic;
    letter-spacing: 0.8px;
    line-height: 1.4;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    font-family: 'Vazir', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 200px;
    margin: 0 auto;
}

#sidebar.collapsed .sidebar-brand {
    padding: 1rem 0.3rem;
    gap: 0.5rem;
}

#sidebar.collapsed .brand-content {
    display: none;
}

#sidebar.collapsed .brand-logo {
    width: 45px;
    height: 45px;
    border-radius: 12px;
}

#sidebar.collapsed .logo-icon {
    font-size: 1.2rem;
}

@media screen and (max-width: 768px) {
    #sidebar {
        width: 280px;
        right: -280px;
        border-radius: 0;
        font-size: 0.8rem;
        top: 0;
        height: 100vh;
    }

        #sidebar.active {
            right: 0;
        }

    .sidebar-brand {
        padding: 1.2rem 0.5rem;
        gap: 0.6rem;
    }

    .brand-logo {
        width: 60px;
        height: 60px;
        border-radius: 16px;
    }

    .logo-icon {
        font-size: 1.6rem;
    }

    .brand-main {
        font-size: 1.5rem;
    }

    .brand-subtitle {
        font-size: 0.75rem;
    }
}

@media screen and (max-width: 480px) {
    #sidebar {
        width: 100%;
        right: -100%;
    }

        #sidebar.active {
            right: 0;
        }
}

@supports not (backdrop-filter: blur(15px)) {
    .brand-logo {
        background: linear-gradient(135deg, rgba(179, 109, 226, 0.4) 0%, rgba(138, 99, 210, 0.3) 50%, rgba(100, 80, 180, 0.25) 100%);
    }
}
