/**
 * Blog Sidebar Widgets - Modern Card Design
 * Matches the Continue Reading section from homepage
 */

/* Base widget styling */
.blog-sidebar-widget {
    background: rgba(26, 26, 26, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
}

.sidebar-widget-header {
    padding: 14px 16px;
    background: rgba(30, 30, 30, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.blog-sidebar-widget .sidebar-widget-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #e0e0e0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.blog-sidebar-widget .sidebar-widget-title i {
    font-size: 14px;
    color: #e50914;
}

.sidebar-widget-content {
    padding: 8px;
}

/* Post card styling */
.sidebar-post-card {
    background: linear-gradient(135deg, rgba(35, 35, 35, 0.8) 0%, rgba(30, 30, 30, 0.9) 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.sidebar-post-card:hover {
    background: linear-gradient(135deg, rgba(45, 45, 45, 0.9) 0%, rgba(35, 35, 35, 1) 100%);
    border-color: rgba(229, 9, 20, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229, 9, 20, 0.2);
}

.sidebar-post-card:last-child {
    margin-bottom: 0;
}

.sidebar-post-card .post-card-link {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    text-decoration: none;
    color: inherit;
}

.sidebar-post-card .post-card-cover {
    position: relative;
    width: 100%;
    height: 90px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 6px;
    background: linear-gradient(135deg, #1a1a1a 0%, #252525 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.sidebar-post-card .post-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-post-card:hover .post-card-cover img {
    transform: scale(1.1);
}

.sidebar-post-card .post-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gray-300) 0%, var(--gray-400) 100%);
    color: var(--text-secondary);
    opacity: 0.25;
    font-size: 36px;
}

.sidebar-post-card .post-card-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-post-card .post-card-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.sidebar-post-card:hover .post-card-title {
    color: #e50914;
}

.sidebar-post-card .post-card-meta {
    margin: 0;
    font-size: 11px;
    color: #999;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 5px;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-post-card .post-card-meta i {
    font-size: 10px;
    color: #e50914;
}

.sidebar-post-card .post-card-badge {
    display: inline-block;
    padding: 2px 6px;
    background: rgba(229, 9, 20, 0.2);
    color: #e50914;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Categories widget styling */
.sidebar-categories-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(35, 35, 35, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    text-decoration: none;
    color: #e0e0e0;
    transition: all 0.25s ease;
}

.sidebar-category-item:hover {
    background: rgba(40, 40, 40, 0.8);
    border-color: rgba(229, 9, 20, 0.5);
    transform: translateX(2px);
}

.sidebar-category-name {
    font-size: 13px;
    font-weight: 500;
}

.sidebar-category-count {
    font-size: 11px;
    padding: 3px 8px;
    background: rgba(229, 9, 20, 0.2);
    color: #e50914;
    border-radius: 10px;
    font-weight: 600;
}

/* Popular posts with view count */
.sidebar-post-card .post-views {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: #888;
    margin-top: 2px;
}

.sidebar-post-card .post-views i {
    font-size: 9px;
    color: #666;
}

/* Scrollbar styling for widget content */
.sidebar-widget-content {
    overflow-y: auto;
    max-height: calc(100vh - 200px);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sidebar-widget-content::-webkit-scrollbar {
    width: 4px;
}

.sidebar-widget-content::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-widget-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

/* Special styling for Back to Blog button */
.blog-sidebar-widget .btn-back-to-blog {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: rgba(229, 9, 20, 0.9);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.25s ease;
    border: 1px solid rgba(229, 9, 20, 1);
}

.blog-sidebar-widget .btn-back-to-blog:hover {
    background: rgba(229, 9, 20, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.4);
}

.blog-sidebar-widget .btn-back-to-blog i {
    font-size: 14px;
}

/* Responsive adjustments */
@media (max-width: 991px) {
    .blog-sidebar-widget {
        margin-bottom: 20px;
    }

    .sidebar-widget-content {
        max-height: 400px;
    }

    .sidebar-post-card .post-card-cover {
        height: 85px;
    }
}

@media (max-width: 767px) {
    .blog-sidebar-widget {
        margin-bottom: 16px;
    }

    .sidebar-widget-header {
        padding: 12px 14px;
    }

    .blog-sidebar-widget .sidebar-widget-title {
        font-size: 14px;
    }

    .sidebar-post-card .post-card-cover {
        height: 75px;
    }

    .sidebar-post-card .post-card-title {
        font-size: 13px;
    }

    .sidebar-post-card .post-card-link {
        padding: 10px;
    }
}
