.sidebar-widget {
    background: var(--tab-glass-bg, rgba(255, 255, 255, 0.12));
    backdrop-filter: blur(50px) saturate(200%);
    -webkit-backdrop-filter: blur(50px) saturate(200%);
    border: 1px solid var(--tab-glass-border, rgba(255, 255, 255, 0.2));
    border-radius: 20px;
    padding: 22px 20px;
    box-shadow: 
        0 40px 80px -20px var(--tab-glass-shadow, rgba(0, 0, 0, 0.1)),
        0 10px 30px -10px var(--tab-glass-shadow, rgba(0, 0, 0, 0.1)),
        inset 0 2px 3px -1px var(--tab-glass-highlight, rgba(255, 255, 255, 0.3)),
        inset 0 -2px 4px -1px var(--tab-glass-caustic, rgba(255, 255, 255, 0.1)),
        inset 0 0 0 1px var(--tab-glass-border, rgba(255, 255, 255, 0.2));
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.sidebar-widget::before {
    content: '';
    position: absolute;
    top: 1px;
    left: 1px;
    right: 1px;
    height: 46%;
    border-radius: 20px 20px 12px 12px / 20px 20px 8px 8px;
    background: transparent;
    pointer-events: none;
    z-index: 6;
    transition: background 0.5s ease;
}

body.dark-theme .sidebar-widget::before {
    background: linear-gradient(180deg, 
        var(--tab-reflection-start, rgba(255, 255, 255, 0.06)) 0%, 
        var(--tab-reflection-end, rgba(255, 255, 255, 0.0)) 100%
    );
}

.sidebar-glare-container {
    position: absolute;
    inset: 0;
    border-radius: 20px;
    overflow: hidden;
    pointer-events: none;
    z-index: 5;
}

.sidebar-glare {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
    background: radial-gradient(circle 80px at var(--sx, 50%) var(--sy, 50%), 
        rgba(255, 255, 255, 0.2) 0%, 
        transparent 100%
    );
    mix-blend-mode: overlay;
    pointer-events: none;
}

.sidebar-widget:hover .sidebar-glare {
    opacity: 1;
}

body.dark-theme .sidebar-glare {
    background: radial-gradient(circle 80px at var(--sx, 50%) var(--sy, 50%), 
        rgba(255, 255, 255, 0.2) 0%, 
        transparent 100%
    );
}

body.dark-theme .sidebar-widget {
    --tab-glass-bg: rgba(30, 30, 35, 0.35);
    --tab-glass-border: rgba(255, 255, 255, 0.08);
    --tab-glass-shadow: rgba(0, 0, 0, 0.4);
    --tab-glass-highlight: rgba(255, 255, 255, 0.05);
    --tab-glass-caustic: rgba(255, 255, 255, 0.02);
    --tab-reflection-start: rgba(255, 255, 255, 0.06);
    --tab-reflection-end: rgba(255, 255, 255, 0.0);
}

.widget-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
    font-family: 'Estedad', 'Vazirmatn', sans-serif;
    color: #1a1a1a;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s ease;
}

.sidebar-widget:hover .widget-title {
    color: #000000;
}

body.dark-theme .widget-title {
    color: #e0e0e0;
}

body.dark-theme .sidebar-widget:hover .widget-title {
    color: #ffd700;
}

.widget-title i {
    width: 18px;
    height: 18px;
    color: #8b5e3c;
    transition: color 0.3s ease;
}

.sidebar-widget:hover .widget-title i {
    color: #000000;
}

body.dark-theme .widget-title i {
    color: #ffd700;
}

body.dark-theme .sidebar-widget:hover .widget-title i {
    color: #ffd700;
}

.widget-title-line {
    width: 40px;
    height: 2px;
    background: #8b5e3c;
    margin-bottom: 16px;
    border-radius: 4px;
    position: relative;
    z-index: 1;
    transition: background 0.3s ease;
}

.sidebar-widget:hover .widget-title-line {
    background: #000000;
}

body.dark-theme .widget-title-line {
    background: #ffd700;
}

body.dark-theme .sidebar-widget:hover .widget-title-line {
    background: #ffd700;
}

.popular-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    z-index: 1;
}

.popular-item {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 10px 12px;
    border-radius: 12px;
    transition: all 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
    position: relative;
    border: 1px solid transparent;
    will-change: auto;
    backface-visibility: hidden;
}

.popular-item::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: transparent;
    transition: all 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
    z-index: 0;
    pointer-events: none;
}

.popular-item:hover::before {
    background: rgba(255, 255, 255, 0.35);
    box-shadow: 
        inset 0 1px 1px rgba(255, 255, 255, 0.6),
        0 4px 12px rgba(0, 0, 0, 0.03);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

body.dark-theme .popular-item::before {
    inset: 2px 4px;
    border-radius: 10px;
}

body.dark-theme .popular-item:hover::before {
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.2),
        inset 0 1px 1px rgba(255, 255, 255, 0.05);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.popular-item .popular-number,
.popular-item .popular-title {
    position: relative;
    z-index: 1;
}

.popular-number {
    font-size: 0.85rem;
    font-weight: 700;
    color: #8b5e3c;
    min-width: 28px;
    font-family: 'Estedad', 'Vazirmatn', sans-serif;
    transition: all 0.3s ease;
    will-change: transform;
    backface-visibility: hidden;
    display: inline-block;
}

body.dark-theme .popular-number {
    color: #ffd700;
}

.popular-item:hover .popular-number {
    transform: scale(1.05);
}

.popular-title {
    font-size: 0.85rem;
    line-height: 1.5;
    color: #444;
    font-family: 'Estedad', 'Vazirmatn', sans-serif;
    flex: 1;
    transition: all 0.3s ease;
    will-change: transform;
    backface-visibility: hidden;
}

body.dark-theme .popular-title {
    color: #b0b8c8;
}

.popular-item:hover .popular-title {
    color: #1a1a1a;
}

body.dark-theme .popular-item:hover .popular-title {
    color: #ffffff;
}

.popular-item:nth-child(1) .popular-number {
    color: #ffd700;
}

body.dark-theme .popular-item:nth-child(1) .popular-number {
    color: #ffd700;
}

.popular-item:nth-child(2) .popular-number {
    color: #c0c0c0;
}

body.dark-theme .popular-item:nth-child(2) .popular-number {
    color: #c0c0c0;
}

.popular-item:nth-child(3) .popular-number {
    color: #cd7f32;
}

body.dark-theme .popular-item:nth-child(3) .popular-number {
    color: #cd7f32;
}

.popular-item:nth-child(n+4) .popular-number {
    color: #8b5e3c;
    opacity: 0.6;
}

body.dark-theme .popular-item:nth-child(n+4) .popular-number {
    color: #ffd700;
    opacity: 0.5;
}

@media (max-width: 768px) {
    .sidebar-widget {
        padding: 18px 16px;
        border-radius: 18px;
    }
    .widget-title {
        font-size: 0.95rem;
    }
    .popular-item {
        padding: 8px 10px;
        gap: 10px;
    }
    .popular-item:hover::before {
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
    }
    body.dark-theme .popular-item::before {
        inset: 2px 4px;
        border-radius: 8px;
    }
    .popular-number {
        font-size: 0.8rem;
        min-width: 24px;
    }
    .popular-title {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .sidebar-widget {
        padding: 16px 14px;
        border-radius: 16px;
    }
    .widget-title {
        font-size: 0.9rem;
    }
    .popular-item {
        padding: 6px 8px;
        gap: 8px;
    }
    .popular-item:hover::before {
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }
    body.dark-theme .popular-item::before {
        inset: 1px 3px;
        border-radius: 6px;
    }
    .popular-number {
        font-size: 0.75rem;
        min-width: 20px;
    }
    .popular-title {
        font-size: 0.75rem;
    }
}