.tag-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 15px;
}

.tag-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.tag-title {
    color: #2c3e50;
    font-size: 1.8rem;
    margin: 0;
}

.tag-title i {
    color: #e74c3c;
    margin-left: 10px;
}

.tag-count {
    background: #f8f9fa;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.no-posts {
    text-align: center;
    padding: 3rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.no-posts i {
    font-size: 3rem;
    color: #bdc3c7;
    margin-bottom: 1rem;
}

.no-posts p {
    color: #7f8c8d;
    font-size: 1.2rem;
    margin: 0;
}

.tag-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.tag-post-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tag-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.post-link {
    text-decoration: none;
    color: inherit;
}

.post-image {
    height: 180px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.default-image {
    background: #3498db;
    display: flex;
    align-items: center;
    justify-content: center;
}

.default-image i {
    color: white;
    font-size: 3rem;
}

.post-content {
    padding: 1.2rem;
}

.post-title {
    color: #2c3e50;
    font-size: 1.2rem;
    margin: 0 0 0.8rem 0;
    line-height: 1.4;
}

.post-meta {
    display: flex;
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-bottom: 0.8rem;
}

.post-meta span {
    display: flex;
    align-items: center;
    margin-left: 15px;
}

.post-meta i {
    margin-left: 5px;
    font-size: 0.7rem;
}

.post-excerpt {
    color: #34495e;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

.tag-pagination {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
}

/* التنسيق للروابط في pagination */
.pagination {
    display: flex;
    list-style: none;
    padding: 0;
}

.pagination li {
    margin: 0 5px;
}

.pagination a, .pagination span {
    display: inline-block;
    padding: 8px 15px;
    border-radius: 4px;
    text-decoration: none;
    color: #3498db;
    border: 1px solid #ddd;
}

.pagination .active span {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.pagination a:hover {
    background: #f8f9fa;
}

@media (max-width: 768px) {
    .tag-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .tag-count {
        margin-top: 10px;
    }
    
    .tag-posts-grid {
        grid-template-columns: 1fr;
    }
}