/* ============================================
   أخبار مدينتي - التنسيق الرئيسي
   خط Tajawal - خط عربي جميل
   ============================================ */

/* استيراد خط Tajawal من Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', 'Tahoma', 'Segoe UI', Arial, sans-serif;
    background: #f0f2f5;
    direction: rtl;
    line-height: 1.6;
}

/* ============================================
   الشريط العلوي الثابت (Sticky Header)
   ============================================ */
.sticky-header {
    position: sticky;
    top: 0;
    background: white;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    z-index: 1000;
    padding: 15px 0;
      align-items: center;
}

.sticky-header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #333;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.3s;
}

.menu-toggle:hover {
    background: #f0f0f0;
}

.logo h1 {
    font-size: 24px;
    color: #2c3e50;
    margin: 0;
    font-weight: 800;
}

.logo a {
    text-decoration: none;
    color: inherit;
}
/* ============================================
   الطقس (Weather Widget) - متجاوب مع الجوال
   ============================================ */

.weather-widget {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 15px;
    border-radius: 25px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.3s ease;
}

/* للجوال */
@media (max-width: 768px) {
    .weather-widget {
        padding: 5px 10px;
        font-size: 11px;
        gap: 4px;
    }
    
    .weather-widget i {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .weather-widget {
        padding: 4px 8px;
        font-size: 10px;
        gap: 3px;
    }
    
    /* إذا كان النص طويل جداً في الجوال الصغير */
    .weather-widget {
        max-width: 130px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}
/* ============================================
   القائمة الجانبية المنزلقة (Off-Canvas Sidebar)
   ============================================ */
.offcanvas-sidebar {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100%;
    background: #2c3e50;
    color: white;
    transition: right 0.3s ease-in-out;
    z-index: 1001;
    overflow-y: auto;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
}

.offcanvas-sidebar.open {
    right: 0;
}

.sidebar-header {
    padding: 20px;
    background: #1a252f;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #34495e;
}

.sidebar-header h3 {
    margin: 0;
    color: white;
    font-weight: 700;
}

.close-sidebar {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    border-bottom: 1px solid #34495e;
}

.sidebar-menu li a {
    display: block;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    transition: background 0.3s;
    font-weight: 500;
}

.sidebar-menu li a:hover {
    background: #34495e;
}

.sidebar-menu li a i {
    margin-left: 10px;
    width: 20px;
}

/* الطبقة الخلفية (Overlay) */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: none;
}

.overlay.active {
    display: block;
}

/* ============================================
   المحتوى الرئيسي والتبويبات
   ============================================ */
.main-content {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.tabs {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    color: #666;
    transition: all 0.3s;
    border-radius: 25px;
    font-family: 'Tajawal', sans-serif;
    font-weight: 500;
}

.tab-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.tab-btn.active {
    background: #2c3e50;
    color: white;
}

/* ============================================
   الكروت (Cards)
   ============================================ */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

.news-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* الخبر المثبت */
.news-card.pinned {
    border: 2px solid #f39c12;
    background: #fffef7;
    box-shadow: 0 4px 15px rgba(243,156,18,0.2);
}

.pin-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #f39c12;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    z-index: 10;
    font-family: 'Tajawal', sans-serif;
}

.news-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.placeholder-img {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 48px;
}

.card-content {
    padding: 20px;
}

.card-date {
    color: #888;
    font-size: 13px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.news-card h3 {
    font-size: 18px;
    color: #2c3e50;
    margin-bottom: 12px;
    line-height: 1.4;
    font-weight: 700;
}

.news-card p {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
    font-weight: 400;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #3498db;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: gap 0.3s;
}

.read-more:hover {
    gap: 12px;
    color: #2980b9;
}

/* ============================================
   صفحة عرض المقال (article.php)
   ============================================ */
.article-container {
    max-width: 800px;
    margin: 30px auto;
    padding: 0 20px;
}

.article-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.article-card img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
}

.article-content {
    padding: 30px;
}

.article-title {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 800;
    line-height: 1.3;
}

.article-meta {
    color: #888;
    font-size: 14px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.article-body {
    font-size: 16px;
    line-height: 1.8;
    color: #444;
    font-weight: 400;
}

.article-body p {
    margin-bottom: 20px;
}

.back-button {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 20px;
    background: #2c3e50;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.3s;
    font-weight: 500;
}

.back-button:hover {
    background: #1a252f;
}

/* ============================================
   تصميم متجاوب (Responsive)
   ============================================ */
@media (max-width: 768px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
  .sticky-header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
    .logo h1 {
    font-size: 20px;
    margin: 0;
    white-space: nowrap;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #333;
    padding: 8px;
    border-radius: 8px;
    flex-shrink: 0;
}

    
    .weather-widget {
        font-size: 12px;
        padding: 5px 10px;
    }
    
    .article-title {
        font-size: 22px;
    }
    
    .article-content {
        padding: 20px;
    }
}

/* للجوال */
@media (max-width: 768px) {
    .sticky-header .container {
        padding: 0 10px;
        gap: 8px;
          align-items: center;
    }
    
    .logo h1 {
        font-size: 16px;
    }
    
    .menu-toggle {
        font-size: 20px;
        padding: 6px;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 14px;
    }
    
    .logo h1 i {
        display: none; /* إخفاء الأيقونة في الجوال الصغير لتوفير مساحة */
    }
}
/* ============================================
   أدوات مساعدة
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    align-items: center;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}


/* تنسيقات إضافية للتبويبات */
.tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.tab-btn {
    background: #f5f5f5;
    border: none;
    padding: 10px 25px;
    font-size: 16px;
    font-weight: 500;
    font-family: 'Tajawal', sans-serif;
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
    border-radius: 30px;
}

.tab-btn:hover {
    background: #e0e0e0;
    color: #333;
    transform: translateY(-2px);
}

.tab-btn.active {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    box-shadow: 0 4px 10px rgba(52,152,219,0.3);
}

/* رسالة عدم وجود نتائج */
.no-news {
    text-align: center;
    padding: 60px;
    background: white;
    border-radius: 15px;
    grid-column: 1 / -1;
}

.no-news i {
    color: #ccc;
    margin-bottom: 15px;
}

.no-news p {
    color: #999;
    font-size: 18px;
}

/* تأثيرات حركية للبطاقات عند التصفية */
.news-card {
    transition: all 0.3s ease;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* عدد الأخبار في كل قسم (اختياري) */
.tab-count {
    display: inline-block;
    background: rgba(0,0,0,0.1);
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 12px;
    margin-right: 5px;
}

.tab-btn.active .tab-count {
    background: rgba(255,255,255,0.2);
}

/* ============================================
   التبويبات (Tabs) - مع دعم السكرول الأفقي للجوال
   ============================================ */

/* حاوية التبويبات الخارجية */
.tabs-container {
    position: relative;
    margin-bottom: 30px;
    width: 100%;
    overflow: hidden;
}

/* حاوية التبويبات القابلة للسكرول */
.tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; /* سكرول سلس في iOS */
    scrollbar-width: thin; /* تصغير شريط التمرير في Firefox */
    padding-bottom: 10px; /* مساحة لشريط التمرير */
    margin-bottom: 0;
    border-bottom: 2px solid #e0e0e0;
}

/* تخصيص شريط التمرير في Webkit (Chrome, Safari, Edge) */
.tabs::-webkit-scrollbar {
    height: 4px;
}

.tabs::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.tabs::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.tabs::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* إخفاء شريط التمرير في بعض المتصفحات مع إبقاء السكرول فعالاً */
@media (max-width: 768px) {
    .tabs {
        scrollbar-width: thin;
    }
    
    /* إخفاء شريط التمرير ولكن مع بقاء السكرول */
    .tabs::-webkit-scrollbar {
        height: 2px;
    }
}

/* أزرار التبويبات */
.tab-btn {
    background: #f5f5f5;
    border: none;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 500;
    font-family: 'Tajawal', sans-serif;
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
    border-radius: 30px;
    white-space: nowrap; /* منع التفاف النص */
    flex-shrink: 0; /* منع تقلص الأزرار */
}

.tab-btn:hover {
    background: #e0e0e0;
    color: #333;
    transform: translateY(-2px);
}

.tab-btn.active {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    box-shadow: 0 4px 10px rgba(52,152,219,0.3);
}

/* عدد الأخبار في التبويب */
.tab-count {
    display: inline-block;
    background: rgba(0,0,0,0.1);
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 11px;
    margin-right: 5px;
}

.tab-btn.active .tab-count {
    background: rgba(255,255,255,0.2);
}



















/* ============================================
   التبويبات (Tabs) - نسخة نظيفة بدون تعقيد
   ============================================ */

.tabs-wrapper {
    width: 100%;
    margin-bottom: 30px;
}

.tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
    flex-wrap: nowrap;
}

/* إخفاء شريط التمرير مع بقاء السكرول */
.tabs::-webkit-scrollbar {
    height: 3px;
}

.tabs::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.tabs::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.tab-btn {
    background: #f5f5f5;
    border: none;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 500;
    font-family: 'Tajawal', sans-serif;
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
    border-radius: 30px;
    white-space: nowrap;
    flex-shrink: 0;
}

.tab-btn:hover {
    background: #e0e0e0;
    color: #333;
}

.tab-btn.active {
    background: #2c3e50;
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.tab-count {
    display: inline-block;
    background: rgba(0,0,0,0.1);
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 11px;
    margin-right: 5px;
}

.tab-btn.active .tab-count {
    background: rgba(255,255,255,0.2);
}

/* للجوال */
@media (max-width: 768px) {
    .tab-btn {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .tab-count {
        font-size: 10px;
        padding: 1px 6px;
    }
}



/* تنسيقات إضافية لـ Lightbox */
.lightbox .lb-image {
    border-radius: 10px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.3);
}

.lightbox .lb-data .lb-caption {
    font-size: 16px;
    font-weight: normal;
    direction: rtl;
}

.lightbox .lb-number {
    direction: ltr;
}

/* تخصيص أزرار التنقل */
.lb-nav a.lb-prev,
.lb-nav a.lb-next {
    opacity: 0.7;
    transition: opacity 0.3s;
}

.lb-nav a.lb-prev:hover,
.lb-nav a.lb-next:hover {
    opacity: 1;
}

/* خلفية Lightbox */
.lightboxOverlay {
    background-color: rgba(0, 0, 0, 0.9);
}












/* تحسين تجربة اللمس على الجوال */
.glightbox {
    touch-action: manipulation;  /* تحسين استجابة اللمس */
}

@media (max-width: 768px) {
    .gallery-item {
        touch-action: pan-y pinch-zoom;  /* تحسين السحب العمودي */
    }
    
    /* تكبير منطقة اللمس للأزرار */
    .glightbox .gnext,
    .glightbox .gprev {
        width: 60px !important;
        min-width: 60px !important;
    }
    
    .glightbox .gclose {
        width: 50px !important;
        height: 50px !important;
        top: 20px !important;
        right: 20px !important;
    }
}

/* ============================================
   أزرار المشاركة الثابتة (Floating Share Buttons)
   ============================================ */

.floating-share-buttons {
    position: fixed;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.share-floating {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.share-floating i {
    font-size: 20px;
    transition: all 0.3s ease;
}

.share-floating .share-text {
    position: absolute;
    right: 60px;
    background: #333;
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10;
    font-family: 'Tajawal', sans-serif;
}

.share-floating .share-text::before {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent transparent #333;
}

.share-floating:hover {
    transform: translateX(-5px);
}

.share-floating:hover .share-text {
    opacity: 1;
    visibility: visible;
    right: 55px;
}

/* ألوان الأزرار */
.share-floating.share-facebook {
    color: #3b5998;
    background: rgba(255, 255, 255, 0.95);
}

.share-floating.share-facebook:hover {
    background: #3b5998;
    color: white;
}

.share-floating.share-twitter {
    color: #1da1f2;
}

.share-floating.share-twitter:hover {
    background: #1da1f2;
    color: white;
}

.share-floating.share-whatsapp {
    color: #25d366;
}

.share-floating.share-whatsapp:hover {
    background: #25d366;
    color: white;
}

.share-floating.share-telegram {
    color: #0088cc;
}

.share-floating.share-telegram:hover {
    background: #0088cc;
    color: white;
}

.share-floating.share-copy {
    color: #6c5ce7;
    cursor: pointer;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    font-family: inherit;
}

.share-floating.share-copy:hover {
    background: #6c5ce7;
    color: white;
}

/* للجوال - تصغير الأزرار وتغيير مكانها */
@media (max-width: 768px) {
    .floating-share-buttons {
        right: 10px;
        gap: 8px;
    }
    
    .share-floating {
        width: 40px;
        height: 40px;
    }
    
    .share-floating i {
        font-size: 18px;
    }
    
    .share-floating:hover {
        transform: translateX(-3px);
    }
    
    .share-floating .share-text {
        font-size: 11px;
        padding: 4px 10px;
        right: 50px;
    }
    
    .share-floating:hover .share-text {
        right: 48px;
    }
}

/* للجوال الصغير جداً - إخفاء النصوص */
@media (max-width: 480px) {
    .share-floating {
        width: 38px;
        height: 38px;
    }
    
    .share-floating .share-text {
        display: none;
    }
}

/* تأثير التحميل */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.floating-share-buttons {
    animation: fadeInRight 0.5s ease;
}

/* عند سكرول الصفحة - تأثير بسيط */
.floating-share-buttons.scrolled .share-floating {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* تنسيق رسالة النسخ */
.copy-toast {
    animation: slideUp 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}