
.hover-categories-sidebar {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.hover-trigger {
    background: #4361EE;
    color: white;
    padding: 15px 8px;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 2px 0 10px rgba(67, 97, 238, 0.3);
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

.hover-trigger:hover {
    background: #3651d4;
    padding-right: 12px;
    box-shadow: 2px 0 15px rgba(67, 97, 238, 0.5);
}

.hover-trigger svg {
    transform: rotate(90deg);
    transition: transform 0.3s ease;
}

.trigger-text {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
}

.sidebar-content {
    position: absolute;
    left: 100%;
    top: 0;
    width: 300px;
    max-height: 80vh;
    background: white;
    border-radius: 0 8px 8px 0;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.hover-categories-sidebar:hover .sidebar-content,
.sidebar-content:hover {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.sidebar-header {
    background: #4361EE;
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0 8px 0 0;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.categories-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.loading {
    padding: 20px;
    text-align: center;
    color: #666;
}

.categories-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.category-item {
    border-bottom: 1px solid #f0f0f0;
}

.category-item:last-child {
    border-bottom: none;
}

.category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease;
}

.category-link:hover {
    background: #f8f9ff;
    color: #4361EE;
    text-decoration: none;
}

.category-name {
    font-weight: 500;
    flex: 1;
}

.post-count {
    background: #4361EE;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.category-link:hover .post-count {
    background: #3651d4;
}

.no-categories {
    padding: 20px;
    text-align: center;
    color: #666;
    margin: 0;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hover-categories-sidebar {
        top: auto;
        bottom: 20px;
        transform: none;
    }
    
    .sidebar-content {
        width: calc(100vw - 40px);
        max-width: 300px;
        max-height: 60vh;
        left: 20px;
        top: auto;
        bottom: 100%;
        margin-bottom: 10px;
        border-radius: 8px;
        box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.15);
    }
    
    .sidebar-header {
        border-radius: 8px 8px 0 0;
    }
    
    .hover-trigger {
        border-radius: 8px;
        padding: 12px;
        writing-mode: horizontal-tb;
        text-orientation: unset;
    }
    
    .hover-trigger svg {
        transform: none;
    }
    
    .trigger-text {
        display: block;
    }
}

@media (max-width: 480px) {
    .sidebar-content {
        width: calc(100vw - 20px);
        left: 10px;
    }
    
    .hover-trigger {
        padding: 10px;
    }
    
    .trigger-text {
        font-size: 12px;
    }
    
    .category-link {
        padding: 10px 15px;
    }
    
    .sidebar-header {
        padding: 12px 15px;
    }
}

/* Smooth scrollbar for categories list */
.categories-list::-webkit-scrollbar {
    width: 6px;
}

.categories-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.categories-list::-webkit-scrollbar-thumb {
    background: #4361EE;
    border-radius: 3px;
}

.categories-list::-webkit-scrollbar-thumb:hover {
    background: #3651d4;
}
