/*
Theme Name: Rawafid Master Pro
Description: قالب مركز روافد الشامل مع التحديثات واستطلاع الرأي.
Author: Rawafid Center
Version: 20.0
*/

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;700;800&display=swap');

:root {
    --primary: #1b62a5;
    --gold: #966f46;
    --gold-light: #cfa968;
    --bg: #f4f5f8;
    --header-bg: #ffffff;
    --text-color: #333333;
    --text-muted: #888888;
    --border-color: #e0e0e0;
    --card-bg: #ffffff;
    --font-main: 'Cairo', sans-serif;
}

body.dark-theme { --bg: #121212; --header-bg: #1e1e1e; --text-color: #f1f1f1; --text-muted: #aaaaaa; --border-color: #333333; --card-bg: #1e1e1e; }
* { margin: 0; padding: 0; box-sizing: border-box; font-family: var(--font-main); }
body { background: var(--bg); direction: rtl; color: var(--text-color); transition: background 0.3s, color 0.3s; line-height: 1.6; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }
img { max-width: 100%; height: auto; }

/* الهيدر، السلايدر، البيانات، والفئات تبقى كما هي تماماً */
.site-header { background: var(--header-bg); border-bottom: 1px solid var(--border-color); padding: 15px 0; transition: 0.3s; position: relative; z-index: 999; }
.header-flex { display: flex; justify-content: space-between; align-items: center; }
.header-right { display: flex; align-items: center; gap: 20px; }
.header-tools { display: flex; gap: 15px; align-items: center; position: relative; }
.tool-btn { background: none; border: none; cursor: pointer; color: var(--text-color); transition: 0.3s; display: flex; align-items: center; justify-content: center; }
.tool-btn:hover { color: var(--primary); }
.search-dropdown { position: absolute; top: 40px; right: 0; background: var(--header-bg); border: 1px solid var(--border-color); padding: 15px; border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.1); display: none; width: 260px; z-index: 1000; }
.search-dropdown.active { display: block; }
.search-dropdown form { display: flex; gap: 5px; }
.search-dropdown input { flex: 1; padding: 8px 12px; border: 1px solid var(--border-color); border-radius: 4px; background: var(--bg); color: var(--text-color); font-family: var(--font-main); outline: none; }
.search-dropdown button { background: var(--primary); color: #fff; border: none; padding: 8px 15px; border-radius: 4px; cursor: pointer; font-family: var(--font-main); }
.nav-links { display: flex; gap: 25px; list-style: none; }
.nav-links li a { font-size: 18px; font-weight: 700; transition: 0.3s; }
.nav-links li a:hover { color: var(--primary); }
.nav-links li:first-child a { color: var(--primary); } 
.mobile-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--text-color); }
.logo { display: flex; align-items: center; }
.logo img { max-height: 70px; max-width: 250px; object-fit: contain; }
.logo h1 { color: var(--primary); font-size: 28px; font-weight: 800; }

.main-wrapper { padding: 50px 0; min-height: 70vh; }
.grid-container { display: flex; gap: 40px; align-items: flex-start; margin-bottom: 60px; }
.col-data { width: calc(50% - 20px); }
.col-slider { width: calc(50% - 20px); }
.sec-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.sec-title h2 { color: var(--primary); font-size: 26px; font-weight: 800; }
.view-all { color: var(--gold-light); font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.view-all:hover { opacity: 0.8; }
.data-list { display: flex; flex-direction: column; }
.data-item { display: flex; gap: 15px; padding: 18px 0; border-bottom: 1px solid var(--border-color); align-items: center; }
.data-item:last-child { border-bottom: none; }
.data-img { width: 130px; height: 85px; border-radius: 6px; object-fit: cover; border: 1px solid var(--border-color); flex-shrink: 0; }
.data-content { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.data-date { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; display: flex; align-items: center; }
.data-date svg { margin-left: 6px; }
.data-title { font-size: 16px; font-weight: 700; line-height: 1.6; color: var(--text-color); }
.data-title a:hover { color: var(--primary); }

.slider-container { width: 100%; position: relative; }
.slider-box { display: flex; width: 100%; height: 400px; border-radius: 12px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; -ms-overflow-style: none; background: #2c3e50; }
.slider-box::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; width: 100%; height: 100%; scroll-snap-align: start; position: relative; }
.slide a.slide-link { display: block; width: 100%; height: 100%; position: relative; }
.slide img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.slide-text { position: absolute; bottom: 0; right: 0; width: 100%; padding: 35px 25px; background: linear-gradient(transparent, rgba(0,0,0,0.9)); color: #fff; pointer-events: none; }
.slide-text span { font-size: 13px; color: #ddd; margin-bottom: 8px; display: block; }
.slide-text h3 { font-size: 20px; font-weight: 700; line-height: 1.5; color: #fff; }
.slider-nav { display: flex; justify-content: center; gap: 12px; margin-top: 20px; }
.dot { width: 12px; height: 12px; background: var(--border-color); border-radius: 50%; cursor: pointer; transition: 0.3s; }
.dot.active { background: var(--primary); transform: scale(1.3); }

.cats-section { margin-top: 20px; }
.cats-header { text-align: right; margin-bottom: 30px; }
.cats-header h2 { color: var(--gold); font-size: 24px; font-weight: 800; }
.cats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 25px; }
.cat-card { background: var(--card-bg); border-radius: 12px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.03); border: 1px solid var(--border-color); display: flex; flex-direction: column; transition: transform 0.3s ease; }
.cat-card:hover { transform: translateY(-5px); border-color: var(--primary); }
.cat-img { width: 100%; height: 150px; object-fit: cover; border-bottom: 1px solid var(--border-color); }
.cat-content { padding: 20px 15px; text-align: center; } 
.cat-title { font-size: 17px; color: var(--text-color); font-weight: 800; margin-bottom: 10px; }
.cat-title a:hover { color: var(--primary); }
.cat-excerpt { font-size: 13px; color: var(--text-muted); line-height: 1.6; }

.partners-section { position: relative; padding: 60px 0; margin: 40px 0; background-color: var(--header-bg); border-radius: 12px; border: 1px solid var(--border-color); box-shadow: 0 5px 25px rgba(0,0,0,0.02); overflow: hidden; }
.partners-section .animated-bg { position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(circle, rgba(27,98,165,0.04) 15%, transparent 25%), radial-gradient(circle, rgba(207,169,104,0.04) 15%, transparent 25%); background-size: 50px 50px; background-position: 0 0, 25px 25px; animation: floatingBg 15s linear infinite; z-index: 1; pointer-events: none; transition: all 0.5s ease; }
.partners-section:hover .animated-bg { animation-duration: 5s; transform: scale(1.1); }
@keyframes floatingBg { 0% { transform: translate(0, 0) rotate(0deg); } 100% { transform: translate(50px, 50px) rotate(3deg); } }
.partners-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 25px; }
.partner-item { width: 170px; height: 100px; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 15px; cursor: pointer; transition: all 0.4s ease; box-shadow: 0 2px 10px rgba(0,0,0,0.02); }
.partner-item img { max-width: 100%; max-height: 100%; object-fit: contain; filter: grayscale(100%) opacity(0.7); transition: all 0.4s ease; }
.partner-item:hover { transform: translateY(-8px); border-color: var(--primary); box-shadow: 0 10px 25px rgba(27,98,165,0.1); }
.partner-item:hover img { filter: grayscale(0%) opacity(1); transform: scale(1.05); }

.stats-section { position: relative; padding: 60px 0; background: var(--primary); color: #ffffff; margin: 60px 0; border-radius: 12px; background-image: linear-gradient(135deg, var(--primary) 0%, #154d82 100%); box-shadow: 0 10px 30px rgba(27, 98, 165, 0.2); overflow: hidden; }
.stats-section::before { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(circle, rgba(255,255,255,0.06) 10%, transparent 20%), radial-gradient(circle, rgba(255,255,255,0.03) 15%, transparent 25%); background-size: 60px 60px; background-position: 0 0, 30px 30px; animation: floatingStats 15s linear infinite; z-index: 1; pointer-events: none; }
@keyframes floatingStats { 0% { transform: translate(0, 0) rotate(0deg); } 100% { transform: translate(60px, 60px) rotate(3deg); } }
.stats-section .container { position: relative; z-index: 2; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; text-align: center; }
.stat-item { padding: 10px; display: flex; flex-direction: column; align-items: center; }
.stat-icon { margin-bottom: 15px; color: var(--gold-light); display: flex; justify-content: center; align-items: center; }
.stat-number { display: block; font-size: 42px; font-weight: 800; margin-bottom: 8px; color: var(--gold-light); line-height: 1; }
.stat-label { font-size: 18px; font-weight: 700; opacity: 0.95; }

/* ======== قسم استطلاع الرأي (الجديد) ======== */
.poll-section {
    position: relative;
    margin: 60px 0;
    padding: 60px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.poll-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.4); /* تظليل لضمان وضوح النص فوق الصورة */
    z-index: 1;
}
.poll-container { position: relative; z-index: 2; display: flex; justify-content: center; }
.poll-content-wrapper {
    width: 100%;
    max-width: 600px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 40px;
    border-radius: 16px;
}
.poll-title { font-size: 24px; font-weight: 800; margin-bottom: 30px; text-align: center; line-height: 1.5; }

.poll-label {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    margin-bottom: 15px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
    font-size: 16px;
    font-weight: 600;
}
.poll-label:hover { background: rgba(255,255,255,0.1); }
.poll-label input[type="radio"] { display: none; }
.poll-custom-radio {
    width: 20px; height: 20px;
    border: 2px solid #fff;
    border-radius: 50%;
    margin-left: 15px;
    position: relative;
    display: inline-block;
}
.poll-label input[type="radio"]:checked + .poll-custom-radio::after {
    content: ''; position: absolute;
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 10px; height: 10px;
    background: currentColor;
    border-radius: 50%;
}

.poll-btn {
    display: block; width: 100%;
    padding: 15px; margin-top: 25px;
    background: transparent;
    border: 2px solid #fff;
    border-radius: 8px;
    font-size: 18px; font-weight: 700;
    cursor: pointer; transition: 0.3s;
}
.poll-btn:hover { background: rgba(255,255,255,0.1); }

/* نتيجة التصويت (شريط التقدم) */
.result-item { margin-bottom: 15px; }
.result-info { display: flex; justify-content: space-between; margin-bottom: 8px; font-weight: 700; font-size: 15px; }
.result-bar-bg { width: 100%; height: 10px; background: rgba(255,255,255,0.2); border-radius: 10px; overflow: hidden; }
.result-bar-fill { height: 100%; background: var(--gold-light); width: 0; transition: width 1.5s ease-in-out; border-radius: 10px; }

.location-section { margin-top: 60px; margin-bottom: 20px; }
.location-box { display: flex; background: var(--card-bg); border-radius: 12px; border: 1px solid var(--border-color); overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.03); }
.location-info { width: 40%; padding: 40px; display: flex; flex-direction: column; justify-content: center; }
.location-info .icon-pin { width: 60px; height: 60px; background: var(--bg); border: 1px solid var(--border-color); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--primary); margin-bottom: 20px; }
.location-info h3 { font-size: 26px; color: var(--primary); font-weight: 800; margin-bottom: 10px; }
.location-info p { color: var(--text-muted); font-size: 16px; line-height: 1.6; }
.location-map { width: 60%; position: relative; background: #e5e3df; }
.location-map iframe { width: 100%; height: 100%; min-height: 350px; border: none; filter: grayscale(30%) contrast(110%); }
body.dark-theme .location-map iframe { filter: invert(90%) hue-rotate(180deg) grayscale(30%) contrast(110%); }

.single-layout { display: flex; gap: 40px; align-items: flex-start; }
.single-main { width: 70%; background: var(--card-bg); padding: 40px; border-radius: 12px; border: 1px solid var(--border-color); box-shadow: 0 5px 20px rgba(0,0,0,0.02); }
.single-sidebar { width: 30%; display: flex; flex-direction: column; gap: 30px; }
.single-header { margin-bottom: 20px; }
.single-title { font-size: 32px; color: var(--primary); font-weight: 800; line-height: 1.4; margin-bottom: 15px; }
.single-meta { display: flex; gap: 20px; color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }
.single-meta span { display: flex; align-items: center; gap: 5px; }
.post-tools { display: flex; justify-content: space-between; align-items: center; padding: 15px 0; border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); margin-bottom: 30px; }
.tools-left, .tools-right { display: flex; gap: 15px; align-items: center; }
.tool-action { background: none; border: none; cursor: pointer; color: var(--text-muted); display: flex; align-items: center; justify-content: center; transition: 0.3s; padding: 5px; }
.tool-action:hover { color: var(--primary); }
.single-content { font-size: 18px; color: var(--text-color); line-height: 1.9; transition: font-size 0.3s; }
.single-content p { text-align: justify; margin-bottom: 20px; }
.single-content h2, .single-content h3 { color: var(--primary); margin: 30px 0 15px; font-weight: 700; }
.single-content img { border-radius: 8px; margin: 20px 0; }
.related-posts { margin-top: 50px; border-top: 2px solid var(--border-color); padding-top: 30px; }
.related-posts h3 { color: var(--primary); font-size: 22px; margin-bottom: 20px; }
.related-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.related-item { display: flex; gap: 15px; align-items: center; background: var(--bg); padding: 10px; border-radius: 8px; border: 1px solid var(--border-color); transition: 0.3s; }
.related-item:hover { border-color: var(--primary); }
.related-img { width: 90px; height: 70px; object-fit: cover; border-radius: 4px; }
.related-title { font-size: 14px; font-weight: 700; line-height: 1.5; color: var(--text-color); }
.sidebar-widget { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; padding: 25px; box-shadow: 0 4px 10px rgba(0,0,0,0.02); }
.widget-title { font-size: 20px; color: var(--gold); border-bottom: 2px solid var(--primary); padding-bottom: 10px; margin-bottom: 20px; display: inline-block; font-weight: 800; }
.widget-list { display: flex; flex-direction: column; gap: 15px; }
.widget-item { display: flex; gap: 12px; align-items: center; border-bottom: 1px dashed var(--border-color); padding-bottom: 15px; }
.widget-item:last-child { border-bottom: none; padding-bottom: 0; }
.widget-img { width: 70px; height: 55px; border-radius: 4px; object-fit: cover; }
.widget-info h4 { font-size: 14px; line-height: 1.4; font-weight: 700; }
.widget-info h4 a:hover { color: var(--primary); }

.archive-wrapper { padding: 50px 0; min-height: 60vh; }
.page-header { text-align: center; margin-bottom: 50px; padding-bottom: 20px; border-bottom: 2px solid var(--border-color); }
.page-title { font-size: 32px; color: var(--primary); font-weight: 800; margin-bottom: 10px; }
.page-desc { color: var(--text-muted); font-size: 16px; }
.archive-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 25px; }
.no-results { text-align: center; font-size: 18px; color: var(--text-muted); padding: 50px 0; grid-column: 1 / -1; }
.pagination { display: flex; justify-content: center; gap: 10px; margin-top: 40px; }
.pagination .page-numbers { padding: 8px 15px; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 6px; font-weight: bold; }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination a.page-numbers:hover { background: var(--primary); color: #fff; }
.site-footer { background: var(--primary); color: #ffffff; padding: 30px 0; text-align: center; margin-top: auto; }
.site-footer p { font-size: 15px; font-weight: 500; opacity: 0.9; }

@media (max-width: 1024px) {
    .cats-grid, .archive-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
    .mobile-toggle { display: block; }
    .nav-links { display: none; position: absolute; top: 100%; right: 0; width: 100%; background: var(--header-bg); flex-direction: column; padding: 20px; box-shadow: 0 10px 15px rgba(0,0,0,0.1); border-top: 1px solid var(--border-color); z-index: 1000; }
    .nav-links.show-menu { display: flex; }
    .header-right { position: static; }
    .grid-container { flex-direction: column; gap: 40px; margin-bottom: 40px; }
    .col-slider { width: 100%; order: 1; }
    .col-data { width: 100%; order: 2; }
    .data-list { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
    .data-item { flex-direction: column; align-items: flex-start; padding: 15px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--card-bg); }
    .data-img { width: 100%; height: 130px; } 
    .slider-box { height: 300px; }
    .single-layout { flex-direction: column; }
    .single-main, .single-sidebar { width: 100%; padding: 20px; }
    .related-grid { grid-template-columns: 1fr; }
    .post-tools { flex-direction: column; gap: 15px; align-items: flex-start; }
    .location-box { flex-direction: column; }
    .location-info { width: 100%; padding: 30px; align-items: center; text-align: center; }
    .location-map { width: 100%; }
    .location-map iframe { min-height: 250px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 40px 20px; }
    .partner-item { width: calc(50% - 13px); }
    .poll-content-wrapper { padding: 30px 20px; }
}
@media (max-width: 600px) {
    .cats-grid, .archive-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    .cat-img { height: 120px; }
    .cat-content { padding: 15px 10px; }
    .cat-title { font-size: 15px; margin-bottom: 8px; }
    .cat-excerpt { font-size: 11px; }
    .data-list { grid-template-columns: 1fr 1fr; }
}
@media print {
    .site-header, .post-tools, .single-sidebar, .related-posts, .site-footer, .location-section, .stats-section, .partners-section, .poll-section { display: none !important; }
    .single-main { width: 100% !important; border: none !important; box-shadow: none !important; padding: 0 !important; }
    body { background: #fff; color: #000; }
}