/* Premium Blog Styling */

:root {
    --blog-primary: #2563eb;
    --blog-secondary: #4f46e5;
    --blog-gradient: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    --blog-card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --blog-hover-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Hero Section */
.blog-hero {
    background: var(--blog-gradient);
    padding: 80px 0;
    margin-bottom: 50px;
    position: relative;
    overflow: hidden;
    color: white;
}

.blog-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.blog-hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.blog-hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
}

/* Blog Cards */
.blog-card {
    border: none;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--blog-card-shadow);
    height: 100%;
}

.blog-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--blog-hover-shadow);
}

.blog-card .card-img-container {
    overflow: hidden;
    position: relative;
    aspect-ratio: 16/9;
}

.blog-card .card-img-top {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.blog-card:hover .card-img-top {
    transform: scale(1.1);
}

.blog-card .category-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    color: var(--blog-primary);
    padding: 6px 15px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    z-index: 2;
}

.blog-card .card-body {
    padding: 1.5rem;
}

.blog-card .card-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    color: #111827;
    transition: color 0.3s;
}

.blog-card .card-title a:hover {
    color: var(--blog-primary);
}

.blog-card .card-text {
    color: #4b5563;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.blog-card .card-meta {
    font-size: 0.85rem;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Sidebar Styles */
.sidebar-card {
    border-radius: 20px;
    border: none;
    box-shadow: var(--blog-card-shadow);
    overflow: hidden;
}

.sidebar-title {
    font-weight: 700;
    color: #111827;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f3f4f6;
    margin-bottom: 1.5rem;
}

.category-list .list-group-item {
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 12px !important;
    margin-bottom: 0.5rem;
    transition: all 0.3s;
}

.category-list .list-group-item:hover {
    background: #eff6ff;
    color: var(--blog-primary);
    transform: translateX(-5px);
}

.search-widget .form-control {
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    padding-right: 40px;
    border-radius: 12px;
}

/* Pagination */
.pagination {
    gap: 8px;
    margin-top: 30px;
}

.page-link {
    border: none;
    border-radius: 12px !important;
    color: #4b5563;
    font-weight: 600;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
}

.page-link svg {
    width: 20px !important;
    height: 20px !important;
}

.page-item.active .page-link {
    background: var(--blog-primary);
    color: white !important;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
}

/* RTL Adjustments */
[dir="rtl"] .category-list .list-group-item:hover {
    transform: translateX(5px);
}

/* Blog Post Premium Redesign */
.post-hero {
    position: relative;
    padding: 100px 0 60px;
    background: var(--blog-gradient);
    color: white;
    margin-bottom: -100px;
    overflow: hidden;
}

.post-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.2;
    filter: blur(8px);
    transition: transform 0.5s ease;
}

.post-hero:hover .post-hero-bg {
    transform: scale(1.05);
}

.post-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(30, 64, 175, 0.5), rgba(17, 24, 39, 0.8));
}

.post-container {
    position: relative;
    z-index: 10;
}

.post-header-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.post-main-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    line-height: 1.8;
}

.post-body {
    font-size: 1.1rem;
    color: #374151;
}

.post-body h3 {
    font-size: 1.75rem;
    color: #111827;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
}

.post-body p {
    margin-bottom: 1.5rem;
}

.table-of-contents {
    position: sticky;
    top: 100px;
}

.toc-card {
    border-radius: 20px;
    border: none;
    background: #f9fafb;
    padding: 1.5rem;
}

.back-to-blog {
    transition: all 0.3s;
}

.back-to-blog:hover {
    transform: translateX(5px);
}

@media (max-width: 768px) {
    .post-main-card {
        padding: 1.5rem;
    }

    .post-header-card {
        padding: 1.5rem;
    }
}