/* ===================================
   Fekr Tany Blog - Modern & Clean Design
   Responsive Blog System Styles
   =================================== */

/* ============= Blog Hero Section ============= */
.blog-hero {
    background: linear-gradient(135deg, #1B5278 0%, #2a6a93 50%, #1B5278 100%);
    padding: 8rem 0 6rem;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
    margin-top: 70px;
}

.blog-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 20s ease-in-out infinite;
}

.blog-hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    color: white;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
    z-index: 2;
}

.blog-hero p {
    font-size: 1.25rem;
    color: rgba(255,255,255,0.95);
    max-width: 700px;
    margin: 0 auto 2rem;
    line-height: 1.6;
    position: relative;
    z-index: 2;
}

.blog-hero .search-box {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.blog-hero .search-box input {
    width: 100%;
    padding: 1rem 3.5rem 1rem 1.5rem;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.blog-hero .search-box button {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: #e5893e;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
}

.blog-hero .search-box button:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 4px 16px rgba(255, 149, 0, 0.4);
}

/* ============= Category Filter Bar ============= */
.category-filter {
    background: white;
    padding: 2rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    position: sticky;
    top: 70px;
    z-index: 100;
    transition: all 0.3s;
}

.category-filter.scrolled {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.category-tabs {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 0 1rem;
    scrollbar-width: thin;
    scrollbar-color: #1b5278 #f0f0f0;
}

.category-tabs::-webkit-scrollbar {
    height: 4px;
}

.category-tabs::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 10px;
}

.category-tabs::-webkit-scrollbar-thumb {
    background: #1b5278;
    border-radius: 10px;
}

.category-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #f8f9fb;
    border: 2px solid transparent;
    border-radius: 50px;
    color: #5A6C7D;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.category-tab:hover {
    background: rgba(69, 183, 209, 0.1);
    border-color: #1b5278;
    color: #1b5278;
    transform: translateY(-2px);
}

.category-tab.active {
    background: linear-gradient(135deg, #1B5278 0%, #2a6a93 50%, #1B5278 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(69, 183, 209, 0.3);
}

.category-tab i {
    font-size: 1.125rem;
}

.category-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 0.5rem;
    background: rgba(255,255,255,0.3);
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 700;
}

.category-tab.active .category-count {
    background: rgba(255,255,255,0.25);
}

/* ============= Blog Posts Grid ============= */
.blog-section {
    padding: 4rem 0;
    background: #f8f9fb;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 4rem;
}

/* Featured Post (First post, full width) */
.blog-post.featured {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 55% 45%;
    gap: 0;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    transition: all 0.4s;
    max-height: 450px;
}

.blog-post.featured:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(0,0,0,0.15);
}

.blog-post.featured .post-image {
    height: 450px;
    width: 100%;
}

.blog-post.featured .post-content {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.blog-post.featured .post-title {
    font-size: 2rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.blog-post.featured .post-excerpt {
    font-size: 1rem;
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Regular Blog Post Card */
.blog-post {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.blog-post:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.15);
}

.post-badge {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: #e5893e;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(255, 149, 0, 0.3);
    z-index: 10;
}

[dir="rtl"] .post-badge {
    right: auto;
    left: 1.5rem;
}

.post-image {
    position: relative;
    height: 220px;
    overflow: hidden;
    background: #f7f8fa;
    flex-shrink: 0;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.blog-post:hover .post-image img {
    transform: scale(1.08);
}

.post-category-badge {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 5;
}

[dir="rtl"] .post-category-badge {
    left: auto;
    right: 1.5rem;
}

.post-category-badge i {
    font-size: 0.875rem;
}

.post-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    color: #8B96A5;
    font-size: 0.875rem;
    flex-wrap: wrap;
}

.post-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-meta i {
    color: #1b5278;
    font-size: 1rem;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #5A6C7D;
    font-weight: 600;
}

.post-author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1b5278, #5FCFE5);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    overflow: hidden;
}

.post-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-title {
    font-size: 21px;
    margin-bottom: 0.75rem;
    color: #2C3E50;
    font-weight: 700;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 3.8em;
}

.post-excerpt {
    color: #5A6C7D;
    margin-bottom: auto;
    line-height: 1.6;
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 4.8em;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid #E1E8ED;
}

.post-stats {
    display: flex;
    gap: 1.5rem;
    color: #8B96A5;
    font-size: 0.875rem;
}

.post-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-stat i {
    color: #1b5278;
}

.read-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #1b5278;
    font-weight: 600;
    text-decoration: none;
    transition: gap 0.3s;
}

.read-more-btn:hover {
    gap: 1rem;
}

[dir="rtl"] .read-more-btn:hover {
    gap: 0rem;
}

/* ============= Pagination ============= */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 3rem 0;
}

.pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 48px;
    padding: 0 1rem;
    background: white;
    border: 2px solid #E1E8ED;
    border-radius: 12px;
    color: #5A6C7D;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.pagination-btn:hover {
    background: #1b5278;
    border-color: #1b5278;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(69, 183, 209, 0.3);
}

.pagination-btn.active {
    background: linear-gradient(135deg, #1b5278, #5FCFE5);
    border-color: #1b5278;
    color: white;
    box-shadow: 0 4px 16px rgba(69, 183, 209, 0.3);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn:disabled:hover {
    background: white;
    border-color: #E1E8ED;
    color: #5A6C7D;
    transform: none;
    box-shadow: none;
}

/* ============= Single Blog Post Page ============= */
.blog-post-page {
    padding: 2rem 0 6rem;
    background: #f8f9fb;
    margin-top: 70px;
}

.post-container {
    max-width: 900px;
    margin: 0 auto;
}

.post-header {
    background: white;
    padding: 3rem;
    border-radius: 24px 24px 0 0;
    text-align: center;
}

.post-header .post-category-badge {
    position: static;
    margin-bottom: 1.5rem;
}

.post-header .post-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    -webkit-line-clamp: unset;
    display: block;
}

.post-header .post-meta {
    justify-content: center;
    font-size: 1rem;
}

.post-featured-image {
    position: relative;
    height: 500px;
    overflow: hidden;
    border-radius: 0;
}

.post-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.post-body {
    background: white;
    padding: 3rem;
    border-radius: 0 0 24px 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}

.post-content-text {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #2C3E50;
}

.post-content-text h2 {
    font-size: 2rem;
    margin: 2rem 0 1rem;
    color: #2C3E50;
}

.post-content-text h3 {
    font-size: 1.5rem;
    margin: 1.5rem 0 1rem;
    color: #2C3E50;
}

.post-content-text p {
    margin-bottom: 1.5rem;
    color: #5A6C7D;
}

.post-content-text ul,
.post-content-text ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
    color: #5A6C7D;
}

[dir="rtl"] .post-content-text ul,
[dir="rtl"] .post-content-text ol {
    padding-left: 0;
    padding-right: 2rem;
}

.post-content-text li {
    margin-bottom: 0.75rem;
    line-height: 1.8;
}

.post-content-text blockquote {
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    background: rgba(69, 183, 209, 0.05);
    border-left: 4px solid #1b5278;
    border-radius: 8px;
    font-style: italic;
    color: #2C3E50;
}

[dir="rtl"] .post-content-text blockquote {
    border-left: none;
    border-right: 4px solid #1b5278;
}

.post-content-text img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 2rem 0;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #E1E8ED;
}

.post-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(69, 183, 209, 0.1);
    color: #1b5278;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
}

.post-tag:hover {
    background: #1b5278;
    color: white;
    transform: translateY(-2px);
}

.post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #E1E8ED;
}

.post-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.75rem;
    background: rgba(69, 183, 209, 0.1);
    color: #1b5278;
    border: 2px solid #1b5278;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.post-like-btn:hover {
    background: #1b5278;
    color: white;
    transform: scale(1.05);
}

.post-like-btn.liked {
    background: #1b5278;
    color: white;
}

.post-like-btn i {
    font-size: 1.25rem;
}

.post-share {
    display: flex;
    gap: 0.75rem;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: white;
    border: 2px solid #E1E8ED;
    border-radius: 50%;
    color: #5A6C7D;
    font-size: 1.125rem;
    cursor: pointer;
    transition: all 0.3s;
}

.share-btn:hover {
    background: #1b5278;
    border-color: #1b5278;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(69, 183, 209, 0.3);
}

/* ============= Comments Section ============= */
.comments-section {
    max-width: 900px;
    margin: 3rem auto 0;
    background: white;
    padding: 3rem;
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}

.comments-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #E1E8ED;
}

.comments-header h3 {
    font-size: 1.75rem;
    color: #2C3E50;
    margin: 0;
}

.comments-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 0.75rem;
    background: linear-gradient(135deg, #1b5278, #5FCFE5);
    color: white;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 700;
}

.comment-form {
    margin-bottom: 3rem;
}

.comment-form textarea {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    border: 2px solid #E1E8ED;
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Cairo', sans-serif;
    resize: vertical;
    transition: all 0.3s;
}

.comment-form textarea:focus {
    outline: none;
    border-color: #1b5278;
    box-shadow: 0 0 0 4px rgba(69, 183, 209, 0.1);
}

.comment-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
}

.btn-submit-comment {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, #1b5278, #5FCFE5);
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 16px rgba(69, 183, 209, 0.3);
}

.btn-submit-comment:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(69, 183, 209, 0.4);
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.comment {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    background: #f8f9fb;
    border-radius: 16px;
    transition: all 0.3s;
}

.comment:hover {
    background: rgba(69, 183, 209, 0.05);
}

.comment-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1b5278, #5FCFE5);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
    flex-shrink: 0;
    overflow: hidden;
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.comment-author {
    font-weight: 700;
    color: #2C3E50;
    font-size: 1rem;
}

.comment-date {
    color: #8B96A5;
    font-size: 0.875rem;
}

.comment-text {
    color: #5A6C7D;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.comment-actions {
    display: flex;
    gap: 1.5rem;
}

.comment-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #8B96A5;
    font-size: 0.875rem;
    font-weight: 600;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    padding: 0;
}

.comment-action-btn:hover {
    color: #1b5278;
}

.comment-action-btn.liked {
    color: #FF9500;
}

/* Nested Reply */
.comment-reply {
    margin-left: 4rem;
    margin-top: 1.5rem;
}

[dir="rtl"] .comment-reply {
    margin-left: 0;
    margin-right: 4rem;
}

/* ============= Related Posts ============= */
.related-posts {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 1rem;
}

.related-posts h3 {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 3rem;
    color: #2C3E50;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* ============= Empty State ============= */
.empty-state {
    text-align: center;
    padding: 6rem 2rem;
    color: #8B96A5;
}

.empty-state i {
    font-size: 5rem;
    color: #E1E8ED;
    margin-bottom: 1.5rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: #5A6C7D;
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 1rem;
    margin: 0;
}

/* ============= Loading Spinner ============= */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem 0;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #E1E8ED;
    border-top-color: #1b5278;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============= Responsive Design ============= */
@media (max-width: 1200px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 1024px) {
    .blog-post.featured {
        grid-template-columns: 1fr;
        max-height: none;
    }
    
    .blog-post.featured .post-image {
        height: 350px;
    }
    
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .blog-hero h1 {
        font-size: 2.5rem;
    }
    
    .blog-hero p {
        font-size: 1rem;
    }
    
    .category-tabs {
        justify-content: flex-start;
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .blog-post.featured .post-content {
        padding: 2rem;
    }
    
    .blog-post.featured .post-title {
        font-size: 2rem;
    }
    
    .post-header {
        padding: 2rem;
    }
    
    .post-header .post-title {
        font-size: 2rem;
    }
    
    .post-featured-image {
        height: 300px;
    }
    
    .post-body {
        padding: 2rem;
    }
    
    .comments-section {
        padding: 2rem;
    }
    
    .comment-reply {
        margin-left: 2rem;
    }
    
    [dir="rtl"] .comment-reply {
        margin-right: 2rem;
    }
}

@media (max-width: 480px) {
    .blog-hero {
        padding: 6rem 0 4rem;
    }
    
    .blog-hero h1 {
        font-size: 2rem;
    }
    
    .post-header .post-title {
        font-size: 1.75rem;
    }
    
    .post-content {
        padding: 1.5rem;
    }
    
    .post-body {
        padding: 1.5rem;
    }
    
    .post-featured-image {
        height: 250px;
    }
    
    .pagination-btn {
        min-width: 40px;
        height: 40px;
    }
}
