/*
Theme Name: Marsad News RTL Responsive 
Description: RTL Responsive  theme similar structure, using external News API.
Version: 1.0.0
Author: Your Name
Text Domain: marsad
RTL Support: Yes
*/

/* Basic RTL and responsive setup */
body {
    direction: rtl;
    font-family: var(--font-body-primary);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 12px;
}

/* Header styles */
.header {
    position: sticky;
    top: 0;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1000;
    border-bottom: 3px solid #e74c3c;
}
header#site-header {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
}

.header-left {
    flex: 0 0 auto;
}

.logo {
    font-size: 28px;
    font-weight: 900;
    font-family: var(--font-title-primary);
    color: #2c3e50;
    text-decoration: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1 1 auto;
    justify-content: flex-end;
}

.header-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Countries Dropdown */
.countries-dropdown {
    position: relative;
}

.countries-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 16px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font-body-primary);
    font-size: 14px;
    font-weight: 600;
    color: #333;
    transition: all 0.3s ease;
}

.countries-btn:hover {
    background: #fff;
    border-color: #e74c3c;
    color: #e74c3c;
}

.dropdown-arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.countries-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    min-width: 250px;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 8px;
    display: none;
    z-index: 2000;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.countries-menu.active {
    display: block;
}

.country-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.country-item:last-child {
    border-bottom: none;
}

.country-item:hover {
    background: #f8f9fa;
    padding-right: 20px;
    color: #e74c3c;
}

.country-item.active {
    background: #ffe5e0;
    color: #e74c3c;
    font-weight: 600;
}

.flag-icon {
    width: 24px;
    height: 16px;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid #ddd;
}

.country-name {
    flex: 1;
    font-size: 14px;
}

/* Urgent Button */
.urgent-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.urgent-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.urgent-icon {
    font-size: 16px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Search Button */
.search-btn {
    padding: 10px 14px;
    background: #ecf0f1;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: #fff;
    border-color: #e74c3c;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    margin: 0 12px;
}

.nav-menu a {
    text-decoration: none;
    color: #333;
}

/* Responsive nav */
@media (max-width: 768px) {
    .nav-menu {
        display: none; /* Implement mobile menu as needed */
    }
}

/* Sections */
.section {
    margin: 24px 0;
}

.section-title {
    font-size: 20px;
    margin-bottom: 12px;
}

/* News cards */
.news-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 12px;
    display: block;
    text-decoration: none;
    transition: all 0.3s ease;
}

.news-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
    transition: all 0.3s ease;
}

.news-card-link:hover {
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.news-card-link:hover .news-card-title {
    color: var(--primary-color, #0066cc);
}

.news-card-link img {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    transition: transform 0.3s ease;
}

.news-card-link:hover img {
    transform: scale(1.05);
}

.news-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
}

.news-card-content {
    padding: 12px;
}

.news-card-title {
    font-size: 16px;
    margin: 0 0 8px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
    text-decoration: none !important;
}

.news-card-title:hover {
    text-decoration: none !important;
}

.news-card-meta {
    font-size: 12px;
    color: #666;
    text-decoration: none !important;
}

.news-card-meta * {
    text-decoration: none !important;
}

/* Grid layouts */
.grid-3x2 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 768px) {
    .grid-3x2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .grid-3x2 {
        grid-template-columns: 1fr;
    }
}

/* Infinite scroll */
.loading {
    text-align: center;
    padding: 12px;
}

/* Search overlay */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    z-index: 2000;
}

.search-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-box {
    background: white;
    padding: 24px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background: #121212;
        color: #e0e0e0;
    }
    .header, .news-card {
        background: #1e1e1e;
    }
    .nav-menu a {
        color: #e0e0e0;
    }
}

/* Additional styles for complete design */

/* Variables */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --background-color: #f8f9fa;
    --card-background: #ffffff;
    --text-color: #212529;
    --border-color: #dee2e6;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
    --border-radius: 8px;
    --spacing: 12px;
}

/* Body and Container */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing);
}

/* Header */
.header {
    background: var(--card-background);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: var(--spacing) 0;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: var(--spacing);
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.search-btn, .urgent-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
}

.search-btn:hover, .urgent-btn:hover {
    background: #0056b3;
}

/* Search Overlay */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-box {
    background: var(--card-background);
    padding: 24px;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow);
}

.search-box input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing);
}

.search-box button {
    width: 100%;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px;
    border-radius: var(--border-radius);
    cursor: pointer;
}

/* Sections */
.section {
    margin: 24px 0;
    background: var(--card-background);
    padding: var(--spacing);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.section-title {
    font-size: 20px;
    margin-bottom: var(--spacing);
    color: var(--text-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 8px;
}

/* Slider */
.slider {
    display: flex;
    overflow-x: auto;
    gap: var(--spacing);
    padding: var(--spacing) 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.slider::-webkit-scrollbar {
    display: none;
}

.slider-item {
    flex: 0 0 300px;
}

/* Feed and Grid */
.feed {
    display: grid;
    gap: var(--spacing);
}

.grid-3x2 {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

@media (max-width: 768px) {
    .grid-3x2 {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 480px) {
    .grid-3x2 {
        grid-template-columns: 1fr;
    }
}

/* News Cards */
.news-card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.news-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.news-card-content {
    padding: var(--spacing);
}

.news-card-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-color);
}

.news-card-meta {
    font-size: 12px;
    color: var(--secondary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.badge {
    background: var(--primary-color);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    text-transform: uppercase;
}

.badge.news {
    background: #28a745;
}

.badge.reel {
    background: #dc3545;
}

/* More Button */
.more-btn {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: var(--border-radius);
    margin-top: var(--spacing);
    font-weight: 500;
    transition: background 0.3s;
}

.more-btn:hover {
    background: #0056b3;
}

/* Loading */
.loading {
    text-align: center;
    padding: var(--spacing);
    color: var(--secondary-color);
}

/* Enhanced News Article Styles */
.news-article {
    background: white;
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    margin: 20px 0;
}

.breadcrumb {
    padding: 16px 24px;
    font-size: 13px;
    background: #f5f5f5;
    border-bottom: 1px solid #eee;
}

.breadcrumb a {
    color: var(--primary-color, #0066cc);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb .current {
    color: #666;
}

/* Article Header */
.article-header {
    padding: 32px 24px;
    border-bottom: 2px solid #f0f0f0;
}

.article-title {
    font-size: 42px;
    font-weight: 700;
    margin: 0 0 24px 0;
    line-height: 1.2;
    color: #222;
}

.article-meta-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.source-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.source-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.source-name {
    font-weight: 600;
    color: var(--primary-color, #0066cc);
}

.meta-info {
    display: flex;
    gap: 24px;
    font-size: 14px;
    color: #666;
}

.meta-info span {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Featured Image */
.article-featured-image {
    width: 100%;
    margin: 0;
    padding: 0;
}

.article-featured-image img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.placeholder-image {
    width: 100%;
    padding: 60px 24px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    text-align: center;
    color: #999;
    font-size: 18px;
}

/* Article Body */
.article-body {
    padding: 1px 24px;
}

.article-excerpt {
    font-size: 18px;
    line-height: 1.6;
    color: #555;
    font-style: italic;
    margin: 0 0 24px 0;
    padding: 16px;
    background: #f9f9f9;
    border-right: 4px solid var(--primary-color, #0066cc);
}

.article-content {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
    margin: 24px 0;
}

.article-content p {
    margin: 16px 0;
}

.article-content h2 {
    font-size: 28px;
    margin: 32px 0 16px;
    color: #222;
    font-weight: 700;
}

.article-content h3 {
    font-size: 22px;
    margin: 24px 0 12px;
    color: #333;
    font-weight: 600;
}

.article-content blockquote {
    border-right: 4px solid var(--primary-color, #0066cc);
    padding: 16px;
    margin: 20px 0;
    background: #f9f9f9;
}

.article-content strong {
    color: #222;
    font-weight: 600;
}

/* Gallery */
.article-gallery {
    margin: 40px 0;
}

.gallery-title {
    font-size: 20px;
    margin: 0 0 16px 0;
    color: #222;
    font-weight: 600;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    aspect-ratio: 4/3;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Media */
.article-media {
    margin: 40px 0;
}

.media-title {
    font-size: 20px;
    margin: 0 0 16px 0;
    color: #222;
    font-weight: 600;
}

.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    background: #000;
}

.video-container video,
.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Article Actions */
.article-actions {
    padding: 24px;
    background: #f9f9f9;
    border-top: 1px solid #eee;
    text-align: center;
}

.share-btn {
    background: linear-gradient(135deg, var(--primary-color, #0066cc) 0%, #0052a3 100%);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.4);
}

/* Comments Section */
.comments-section {
    margin: 40px 0;
    padding: 32px 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f0;
}

.comments-header h3 {
    margin: 0;
    font-size: 24px;
    color: #222;
}

.comments-count {
    background: var(--primary-color, #0066cc);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.comments-list {
    margin: 24px 0;
}

.comment-item {
    padding: 20px;
    margin-bottom: 16px;
    background: #f9f9f9;
    border-right: 4px solid var(--primary-color, #0066cc);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.comment-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 12px;
}

.comment-author {
    color: var(--primary-color, #0066cc);
    font-weight: 600;
    font-size: 15px;
}

.comment-date {
    font-size: 12px;
    color: #999;
}

.comment-text {
    margin: 8px 0 0 0;
    color: #333;
    line-height: 1.6;
}

.comment-stats {
    margin-top: 12px;
    font-size: 12px;
    color: #666;
}

.comment-stats .likes {
    cursor: pointer;
    transition: color 0.3s ease;
}

.comment-stats .likes:hover {
    color: var(--primary-color, #0066cc);
}

/* Comment Replies */
.comment-replies {
    margin-top: 16px;
    padding: 12px;
    background: white;
    border-radius: 6px;
}

.reply-item {
    padding: 12px;
    margin-bottom: 8px;
    background: #f5f5f5;
    border-right: 2px solid #ddd;
    border-radius: 4px;
}

.reply-author {
    color: #666;
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

.reply-text {
    margin: 0;
    font-size: 14px;
    color: #333;
}

.no-comments {
    text-align: center;
    color: #999;
    padding: 20px;
    font-size: 14px;
}

/* Comment Form */
.comment-form-container {
    margin-top: 40px;
    padding: 24px;
    background: #f9f9f9;
    border-radius: 8px;
}

.comment-form-container h3 {
    margin: 0 0 16px 0;
    font-size: 20px;
    color: #222;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comment-textarea {
    padding: 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    min-height: 120px;
    resize: vertical;
    transition: all 0.3s ease;
}

.comment-textarea:focus {
    outline: none;
    border-color: var(--primary-color, #0066cc);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.comment-form .btn {
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--primary-color, #0066cc) 0%, #0052a3 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.comment-form .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.3);
}

/* Error Box */
.error-box {
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    margin: 20px 0;
}

.error {
    color: #c33;
    font-size: 16px;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .article-header {
        padding: 24px 16px;
    }

    .article-title {
        font-size: 32px;
    }

    .article-meta-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .article-body {
        padding: 24px 16px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .comment-item {
        padding: 16px;
    }

    .comment-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .article-header {
        padding: 16px 12px;
    }

    .article-title {
        font-size: 24px;
        margin-bottom: 16px;
    }

    .article-body {
        padding: 16px 12px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .article-actions {
        padding: 16px 12px;
    }

    .share-btn {
        width: 100%;
    }

    .comment-form .btn {
        width: 100%;
    }
}

.article-meta .source {
    font-weight: 600;
    color: var(--primary-color, #0066cc);
}

.article-meta .date {
    color: #999;
}

.article-image {
    margin: 20px 0;
    text-align: center;
}

/* Country Section Styling */
.country-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 30px;
    margin: 40px 0;
}

.country-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid #0066cc;
}

.country-header .section-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    flex: 1;
}

.country-header .more-btn {
    background: linear-gradient(135deg, #0066cc 0%, #004aa3 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}

.country-header .more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.4);
}

.country-section .grid-3x2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Footer */
.footer {
    background: var(--text-color);
    color: white;
    text-align: center;
    padding: var(--spacing);
    margin-top: 24px;
}

/* Responsive */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: var(--spacing);
    }

    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }

    .section {
        margin: var(--spacing) 0;
        padding: var(--spacing);
    }

    .country-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .country-header .more-btn {
        width: 100%;
        text-align: center;
    }

    .country-section .grid-3x2 {
        grid-template-columns: 1fr;
    }
}

/* Categories Navigation - تصميم احترافي حديث */
.categories-nav {
    background: #ffffff;
    border-bottom: 1px solid #e8e8e8;
    position: static;
    z-index: 999;
}

.categories-nav .container {
    padding: 0;
    margin: 0;
}

.categories-list {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    -webkit-overflow-scrolling: touch;
    align-items: center;
}

/* إخفاء الـ scrollbar بشكل احترافي */
.categories-list::-webkit-scrollbar {
    height: 3px;
}

.categories-list::-webkit-scrollbar-track {
    background: transparent;
}

.categories-list::-webkit-scrollbar-thumb {
    background: #e0e0e0;
    border-radius: 3px;
}

.categories-list::-webkit-scrollbar-thumb:hover {
    background: #d0d0d0;
}

/* كل رابط قسم */
.category-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    white-space: nowrap;
    text-decoration: none;
    color: #555;
    font-family: var(--font-body-primary, 'Segoe UI', Tahoma);
    font-size: 13px;
    font-weight: 500;
    border: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    position: relative;
    border-bottom: 3px solid transparent;
}

/* صورة القسم */
.category-link .category-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    display: block;
    opacity: 0.8;
    transition: opacity 0.25s ease;
}

/* نص القسم */
.category-link .category-name {
    display: inline-block;
    font-weight: 500;
}

/* الرئيسية - تصميم خاص */
.categories-list > a:first-child {
    background-color: #1a1a1a;
    color: white;
    font-weight: 600;
    border-bottom: 3px solid #1a1a1a;
}

.categories-list > a:first-child:hover {
    background-color: #2d2d2d;
    border-bottom-color: #2d2d2d;
}

.categories-list > a:first-child .category-icon {
    opacity: 1;
}

/* Hover effect */
.category-link:hover {
    color: #333;
    background-color: #fafafa;
}

.category-link:hover .category-icon {
    opacity: 1;
}

/* Active state - تحت الخط ملون */
.category-link.active {
    color: #fff !important;
    border-bottom-color: currentColor;
    font-weight: 600;
}

.category-link.active .category-icon {
    opacity: 1;
}

/* الأقسام تأخذ لون خاص عند النشاط */
.category-link:not(:first-child).active {
    color: #fff;
    font-weight: 600;
}

/* Media Queries */
@media (max-width: 1024px) {
    .category-link {
        padding: 11px 14px;
        font-size: 12px;
    }

    .category-link .category-icon {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 768px) {
    .header .container {
        padding: 10px 12px;
    }

    .header-right {
        gap: 10px;
    }

    .countries-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .urgent-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .category-link {
        padding: 10px 12px;
        font-size: 12px;
    }

    .category-link .category-icon {
        width: 16px;
        height: 16px;
    }

    .countries-menu {
        min-width: 200px;
    }
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none ;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 12px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2.5px;
    background: #333;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(10px, 10px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobile Categories Dropdown */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .categories-nav {
        max-height: 60px;
        transition: max-height 0.3s ease, padding 0.3s ease;
    }

    .categories-nav.mobile-open {
        max-height: 400px;
        padding: 10px 0;
    }

    .categories-list {
        flex-direction: column;
        align-items: stretch;
    }

    .categories-list.mobile-open {
        flex-direction: column;
    }

    .category-link {
        border-bottom: 1px solid #f0f0f0;
        padding: 12px 16px;
        border-radius: 0;
        margin: 0;
    }

    .category-link.active {
        background-color: #f5f5f5;
        border-right: 4px solid #333;
        border-bottom: 1px solid #f0f0f0;
    }

    .categories-list > a:first-child {
        background-color: #1a1a1a;
        color: white;
        border-bottom: 1px solid #000;
    }
}

@media (max-width: 480px) {
    .mobile-menu-toggle {
        display: flex;
        width: 28px;
        height: 28px;
        margin-left: 8px;
    }

    .mobile-menu-toggle span {
        width: 20px;
        height: 2px;
    }

    .categories-nav {
        max-height: 50px;
    }

    .categories-nav.mobile-open {
        max-height: 500px;
    }

    .category-link {
        padding: 14px 16px;
        font-size: 13px;
    }

    .category-link .category-icon {
        width: 18px;
        height: 18px;
    }

    .categories-list {
        flex-direction: column;
    }
}
@media (max-width: 480px) {
    .category-link {
        padding: 10px 10px;
        font-size: 11px;
        gap: 6px;
    }

    .category-link .category-icon {
        width: 15px;
        height: 15px;
    }

    .category-link .category-name {
        display: none;
    }

    .category-link {
        justify-content: center;
        width: 44px;
        height: 44px;
        padding: 0;
        border-radius: 4px;
    }

    .categories-list > a:first-child {
        width: auto;
        padding: 10px 10px;
    }

    .categories-list > a:first-child .category-name {
        display: inline-block;
    }
}
/* ============================
   Header + Categories Fix Pack
   Place at END of style.css
   ============================ */

/* 1) Header: ثابت وسطر واحد */
:root{
  --header-h: 64px;
}

.header.sticky{
  position: sticky;
  top: 0;
  z-index: 1200;
  padding: 0; /* نتحكم في padding من container */
}

.header .container{
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
}

/* منع التحول لعمود في الموبايل (ده كان بيكسر الهيدر) */
@media (max-width: 768px){
  .header .container{
    flex-direction: row !important;
    flex-wrap: nowrap;
  }

  .header-left{
    display:flex;
    align-items:center;
    gap: 10px;
    min-width: 0;
  }

  .logo{
    font-size: 18px;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 52vw;
  }

  .header-right{
    display:flex;
    align-items:center;
    gap: 8px;
    flex-shrink: 0;
  }

  .header-menu{
    display:flex;
    align-items:center;
    gap: 8px;
  }

  .countries-btn,
  .urgent-btn{
    padding: 8px 10px;
    font-size: 12px;
    border-radius: 10px;
  }

  /* لو الزحمة كبيرة: اخفي كلمة "الدول" وخلي السهم فقط (اختياري) */
  .countries-label{ display:none; }
}

/* 2) Countries dropdown: لا يطلع بره الشاشة */
.countries-dropdown{ position: relative; }

.countries-menu{
  right: 0;
  left: auto;
  max-height: min(70vh, 520px);
  overflow: auto;
}

@media (max-width: 768px){
  .countries-menu{
    width: min(92vw, 360px);
  }
}

/* 3) Categories Nav: Sticky تحت الهيدر */
.categories-nav{
  position: static !important;
  top: var(--header-h);
  z-index: 1100;
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
}

/* 4) Categories strip: أفقي دايمًا (على كل المقاسات) */
.categories-list{
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 6px !important;
  padding: 6px 8px !important;
  margin: 0;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scrollbar-width: thin;
}

/* الروابط تبقى نفس الارتفاع ومقاس ثابت */
.category-link{
  flex: 0 0 auto !important;
  border-radius: 12px;
  padding: 10px 12px;
  border-bottom: 0 !important;   /* بوقف underline القديم اللي كان بيعمل اختلافات */
  background: transparent;
}

/* “الرئيسية” شكلها ثابت */
.categories-list > a:first-child{
  border-radius: 12px;
}

/* 5) Mobile open: بدل ما يقلبها عمودي في نفس الشريط… نخليها “لوحة” Grid */
@media (max-width: 768px){
  /* امنع قواعد max-height + column القديمة من انها تكسر الشكل */
  .categories-nav{
    max-height: none !important;
    padding: 0 !important;
  }

  /* عند الفتح: اعرض Panel بشكل Grid منظم */
  .categories-nav.mobile-open .categories-list{
    white-space: normal;
    overflow: visible;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px !important;
    padding: 12px !important;
  }

  .categories-nav.mobile-open .category-link{
    justify-content: center;
    padding: 10px 10px;
    border: 1px solid #f0f0f0;
    background: #fff;
    height: auto; /* عكس قاعدة 44×44 القديمة */
  }

  /* خلي اسم القسم يظهر دائمًا في لوحة الموبايل */
  .categories-nav.mobile-open .category-name{
    display: inline-block !important;
    font-size: 12px;
  }

  .categories-nav.mobile-open .category-icon{
    width: 20px;
    height: 20px;
    opacity: 1;
  }
}

@media (max-width: 480px){
  .categories-nav.mobile-open .categories-list{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 6) إزالة/تعطيل قواعد 480px القديمة اللي كانت بتخفي الاسم وتحوّلها لأيقونات فقط */
@media (max-width: 480px){
  .category-link .category-name{
    display: inline-block !important;
  }
  .category-link{
    width: auto !important;
    height: auto !important;
  }
}
/* =========================
   Mobile Header + Categories (Hard Override)
   Put at VERY END of style.css
   ========================= */

/* 0) Fix header layout conflicts coming from other CSS */
@media (max-width: 768px){
    .header .container{
      flex-direction: row !important;
      flex-wrap: nowrap !important;
      align-items: center !important;
      justify-content: space-between !important;
    }
  
    /* زر الأقسام قبل اللوجو لازم يفضل ظاهر */
    .mobile-menu-toggle{
      display: flex !important;
      visibility: visible !important;
      opacity: 1 !important;
      pointer-events: auto !important;
    }
  
    .header-left{
      display:flex !important;
      align-items:center !important;
      gap: 10px !important;
      min-width: 0 !important;
    }
  
    .logo{
      max-width: 55vw !important;
      white-space: nowrap !important;
      overflow: hidden !important;
      text-overflow: ellipsis !important;
    }
  }
  
  /* 1) On Mobile: hide desktop categories strip by default */
  @media (max-width: 768px){
    .categories-nav{
      display: none !important;              /* << أهم سطر: يمنع ظهور “قائمة الديسكتوب” على الجوال */
      position: static !important;
      top: var(--header-h, 64px) !important;
      left: 0 !important;
      right: 0 !important;
      z-index: 1400 !important;
      background: #fff !important;
      border-bottom: 1px solid #e8e8e8 !important;
      box-shadow: 0 10px 24px rgba(0,0,0,.08) !important;
      max-height: calc(100vh - var(--header-h, 64px)) !important;
      overflow: auto !important;
    }
  
    /* 2) Open state */
    .categories-nav.mobile-open{
      display: block !important;
    }
  
    /* 3) Grid panel for categories */
    .categories-nav .categories-list{
      display: grid !important;
      grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
      gap: 10px !important;
      padding: 12px !important;
      margin: 0 !important;
      overflow: visible !important;
      white-space: normal !important;
    }
  
    .categories-nav .category-link{
      justify-content: center !important;
      border: 1px solid #f0f0f0 !important;
      border-radius: 12px !important;
      padding: 10px 10px !important;
      margin: 0 !important;
      background: #fff !important;
    }
  
    .categories-nav .category-name{
      display: inline-block !important;
      font-size: 12px !important;
    }
  
    .categories-nav .category-icon{
      width: 20px !important;
      height: 20px !important;
    }
  }
  
  /* 4) Smaller phones: 2 columns */
  @media (max-width: 480px){
    .categories-nav .categories-list{
      grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
  }
  
  /* 5) Countries dropdown: keep it inside viewport on mobile */
  @media (max-width: 768px){
    .countries-menu{
      position: fixed !important;
      top: var(--header-h, 64px) !important;
      left: 10px !important;
      right: 10px !important;
      width: auto !important;
      max-height: 70vh !important;
      overflow: auto !important;
      border-radius: 12px !important;
      box-shadow: 0 12px 28px rgba(0,0,0,.12) !important;
    }
  }
  /* إخفاء زر قائمة الأقسام على الشاشات الكبيرة */
#mobile-menu-toggle{
    display: none;
  }
  
  /* إظهاره على الجوالات والأجهزة اللوحية */
  @media (max-width: 1024px){
    #mobile-menu-toggle{
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 40px;
      height: 40px;
      cursor: pointer;
    }
  }
/* ===== Article Tags Section ===== */
.article-tags-section {
    margin: 24px 0;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.article-tags-section .tags-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e9ecef;
}

.article-tags-section .tags-header i {
    font-size: 18px;
    color: #6c757d;
}

.article-tags-section .tags-title {
    font-size: 16px;
    font-weight: 700;
    color: #343a40;
}

.article-tags-section .tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.article-tag-item {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    text-decoration: none;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.article-tag-item:hover {
    background: #e74c3c;
    border-color: #e74c3c;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.25);
}

.article-tag-item .tag-hash {
    margin-left: 4px;
    font-weight: 600;
    opacity: 0.7;
}

.article-tag-item:hover .tag-hash {
    opacity: 1;
}

/* Responsive Tags */
@media (max-width: 768px) {
    .article-tags-section {
        padding: 16px;
        margin: 16px 0;
    }
    
    .article-tags-section .tags-list {
        gap: 8px;
    }
    
    .article-tag-item {
        padding: 6px 12px;
        font-size: 13px;
    }
}  