/* ================= Glass Sidebar Modern ================= */

.khaliq-sidebar {
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: 64px;
    background: var(--main-bg-glass);
    box-shadow: -2.5px 0 32px 0 rgba(68,80,130,0.11);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    z-index: 100;
    transition: width 0.23s cubic-bezier(.55,.12,.48,.89), background 0.3s;
    backdrop-filter: blur(var(--sidebar-blur, 0px)) saturate(170%);
    -webkit-backdrop-filter: blur(var(--sidebar-blur, 0px)) saturate(170%);
    border-left: var(--glass-border);
    overflow-x: hidden;
    padding-bottom: 18px;
}

.khaliq-sidebar:hover,
.khaliq-sidebar:focus-within {
    width: 192px;
    background: var(--main-bg-glass);
}

.sidebar-logo {
    width: 100%;
    font-size: 1.11em;
    font-weight: 800;
    padding: 28px 10px 18px 0;
    display: flex;
    align-items: center;
    gap: 0.7em;
    color: var(--text-main);
    border-bottom: 1.3px solid rgba(220, 235, 255, 0.12);
    margin-bottom: 6px;
    background: none;
    text-shadow: 0 3px 16px #e7eaff2c, 0 1px 2px #eef2ff55;
    white-space: nowrap;
    overflow: hidden;
}
.sidebar-logo i {
    font-size: 1.32em;
    color: var(--text-main);
    margin-left: 4px;
}
.sidebar-logo span {
    opacity: 0;
    transition: opacity 0.16s;
    margin-right: 6px;
    white-space: nowrap;
}
.khaliq-sidebar:hover .sidebar-logo span,
.khaliq-sidebar:focus-within .sidebar-logo span {
    opacity: 1;
}

.sidebar-links {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 13px 5px 0 0;
    gap: 6px;
}
.sidebar-links a {
    display: flex;
    align-items: center;
    gap: 1.05em;
    color: var(--text-main);
    background: var(--glass-field-bg);
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 600;
    padding: 11px 12px 11px 0;
    border-radius: 19px 0 0 19px;
    transition: background 0.15s, color 0.11s, box-shadow 0.11s;
    margin-bottom: 2px;
    box-shadow: 0 2px 10px #7db2fa0f;
    border: none;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    letter-spacing: 0.01em;
}
.sidebar-links a i {
    font-size: 1.26em;
    min-width: 31px;
    text-align: center;
    filter: drop-shadow(0 2px 5px #d4e2ff16);
    color: var(--primary);
}
.sidebar-links a span {
    opacity: 0;
    transition: opacity 0.13s;
    white-space: nowrap;
}
.khaliq-sidebar:hover .sidebar-links a span,
.khaliq-sidebar:focus-within .sidebar-links a span {
    opacity: 1;
}
.sidebar-links a:hover,
.sidebar-links a.active {
    background: var(--accent);
    color: var(--primary);
    box-shadow: 0 7px 22px #c6f8ff13, 0 1px 8px #e1e8f822;
    font-weight: bold;
}

/* زر تبديل الوضع الليلي */
.sidebar-theme-toggle {
    margin-top: 2em;
    background: var(--main-bg-glass);
    color: var(--primary) !important;
    border-radius: 15px;
    font-weight: 700;
    font-size: 1.05em;
    border: 1.2px solid var(--primary);
    box-shadow: 0 1px 8px #aac6ff18;
    transition: background .12s, color .11s;
}
.sidebar-theme-toggle:hover {
    background: var(--accent);
    color: var(--primary) !important;
}

/* Responsive */
@media (max-width: 850px) {
    .khaliq-sidebar, .khaliq-sidebar:hover, .khaliq-sidebar:focus-within {
        width: 45px !important;
        min-width: 36px;
        padding: 0;
        display: flex;
        flex-direction: column;

        align-items: flex-end; /* تغيير من center إلى flex-end */
    }
    .sidebar-logo span,
    .sidebar-links a span { display: none !important; }
    body { padding-right: 45px !important; }
    .sidebar-links {
        align-items: flex-end; /* تغيير من center إلى flex-end */
    }
}

@media (max-width: 600px) {
    .khaliq-sidebar, .khaliq-sidebar:hover, .khaliq-sidebar:focus-within {
        width: 34px !important;
        min-width: 25px;
        padding: 0;
        display: flex;
        flex-direction: column;

        align-items: flex-end; /* تغيير من center إلى flex-end */
    }
    .sidebar-links {
        align-items: flex-end; /* تغيير من center إلى flex-end */
    }
}
