/* ─── Flavor Apps Theme - Main CSS ─── */
:root {
    --primary: #00c853;
    --primary-dark: #00a844;
    --primary-light: #e8f5e9;
    --bg: #f5f5f5;
    --card: #ffffff;
    --text: #212121;
    --text-secondary: #757575;
    --border: #e0e0e0;
    --radius: 12px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.12);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, -apple-system, 'Noto Sans Arabic', sans-serif; background: var(--bg); color: var(--text); line-height: 1.7; font-size: 15px; }
body.rtl { direction: rtl; }
a { color: var(--primary-dark); text-decoration: none; }
a:hover { color: var(--primary); }
img { max-width: 100%; height: auto; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ─── Header ─── */
.site-header { background: var(--card); box-shadow: var(--shadow); position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; gap: 20px; padding: 12px 0; }
.header-logo a { display: flex; align-items: center; }
.header-logo img { height: 36px; }
.logo-text { font-size: 22px; font-weight: 800; color: var(--primary-dark); }
.header-search { flex: 1; max-width: 500px; }
.search-wrapper { position: relative; }
.search-wrapper input { width: 100%; padding: 10px 16px; border: 2px solid var(--border); border-radius: 24px; font-size: 14px; outline: none; background: var(--bg); }
.search-wrapper input:focus { border-color: var(--primary); }
.search-btn { position: absolute; left: 4px; top: 50%; transform: translateY(-50%); background: none; border: none; font-size: 18px; cursor: pointer; }
body.rtl .search-btn { left: auto; right: 4px; }
.search-dropdown { position: absolute; top: 100%; left: 0; right: 0; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-lg); display: none; z-index: 200; max-height: 400px; overflow-y: auto; }
.search-dropdown.active { display: block; }
.search-dropdown .search-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.search-dropdown .search-item:hover { background: var(--primary-light); }
.search-dropdown .search-item img { width: 40px; height: 40px; border-radius: 10px; }
.search-dropdown .search-item .search-item-title { font-weight: 600; }
.search-dropdown .search-item .search-item-cat { font-size: 12px; color: var(--text-secondary); }
.header-nav ul { display: flex; gap: 5px; list-style: none; }
.header-nav a { padding: 8px 14px; border-radius: 8px; color: var(--text); font-weight: 500; font-size: 14px; }
.header-nav a:hover { background: var(--primary-light); color: var(--primary-dark); }
.mobile-menu-toggle { display: none; background: none; border: none; font-size: 24px; cursor: pointer; }

/* ─── Layout ─── */
.page-layout { display: flex; gap: 24px; padding: 20px 0; }
.page-layout.with-sidebar .main-content { flex: 1; min-width: 0; }
.page-layout:not(.with-sidebar) .main-content { flex: 1; }
.sidebar { width: 300px; flex-shrink: 0; }
.sidebar .widget { background: var(--card); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow); }
.widget-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid var(--primary); }

/* ─── Breadcrumbs ─── */
.breadcrumbs { padding: 12px 0; font-size: 13px; color: var(--text-secondary); }
.breadcrumbs a { color: var(--text-secondary); }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs span { margin: 0 6px; }

/* ─── Apps Grid ─── */
.apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.app-card { background: var(--card); border-radius: var(--radius); overflow: hidden; transition: transform 0.2s, box-shadow 0.2s; box-shadow: var(--shadow); }
.app-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.app-card-link { display: block; padding: 16px; text-align: center; color: var(--text); }
.app-card-icon img, .app-card-icon-placeholder { width: 72px; height: 72px; border-radius: 16px; margin: 0 auto 12px; display: block; object-fit: cover; }
.app-card-icon-placeholder { background: var(--primary-light); display: flex; align-items: center; justify-content: center; font-size: 28px; }
.app-card-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-card-cat { font-size: 12px; color: var(--text-secondary); }
.app-card-meta { display: flex; justify-content: center; gap: 8px; margin-top: 8px; font-size: 12px; }
.app-card-rating { color: #f59e0b; font-weight: 600; }
.app-card-price.free { color: var(--primary-dark); font-weight: 600; }

/* ─── Section Header ─── */
.section-header { margin-bottom: 20px; }
.section-header h2 { font-size: 22px; font-weight: 700; }

/* ─── Single App ─── */
.app-header-card { background: var(--card); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 20px; }
.app-header-top { display: flex; gap: 24px; align-items: flex-start; }
.app-icon-large img { width: 128px; height: 128px; border-radius: 24px; box-shadow: var(--shadow); }
.app-header-info { flex: 1; }
.app-title { font-size: 26px; font-weight: 800; margin-bottom: 4px; }
.app-developer { color: var(--primary-dark); font-weight: 600; margin-bottom: 12px; }
.app-meta-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.badge { background: var(--bg); padding: 6px 12px; border-radius: 20px; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.badge.free { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }
.download-btn-hero { display: inline-flex; align-items: center; gap: 8px; background: var(--primary); color: #fff; padding: 12px 32px; border-radius: 12px; font-size: 16px; font-weight: 700; transition: background 0.2s; }
.download-btn-hero:hover { background: var(--primary-dark); color: #fff; }
.download-btn-hero small { opacity: 0.8; font-weight: 400; }

/* ─── Star Rating ─── */
.star-rating { display: inline-flex; align-items: center; gap: 2px; }
.star-rating .star { color: #f59e0b; font-size: 14px; }
.star-rating .star.empty { color: #e0e0e0; }
.star-rating .rating-num { margin-inline-start: 4px; font-weight: 600; color: var(--text); }

/* ─── App Info Grid ─── */
.app-info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.info-item { background: var(--card); border-radius: var(--radius); padding: 14px; text-align: center; box-shadow: var(--shadow); }
.info-label { display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.info-value { font-weight: 700; font-size: 14px; }

/* ─── App Sections ─── */
.app-section { background: var(--card); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow); }
.app-section h2 { font-size: 18px; font-weight: 700; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 2px solid var(--bg); }
.app-content-body { line-height: 1.8; }
.app-content-body h2, .app-content-body h3 { margin: 20px 0 10px; }
.app-content-body p { margin-bottom: 12px; }
.app-content-body ul, .app-content-body ol { margin: 10px 20px; }

/* ─── Screenshots ─── */
.screenshots-scroll { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x mandatory; }
.screenshot-img { height: 280px; border-radius: 12px; flex-shrink: 0; scroll-snap-align: start; cursor: pointer; box-shadow: var(--shadow); }
.screenshots-scroll::-webkit-scrollbar { height: 6px; }
.screenshots-scroll::-webkit-scrollbar-track { background: var(--bg); border-radius: 3px; }
.screenshots-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ─── Video ─── */
.video-wrapper { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 12px; }
.video-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

/* ─── Download Links ─── */
.download-links-list { display: flex; flex-direction: column; gap: 10px; }
.download-link-item { display: flex; align-items: center; gap: 12px; padding: 14px 20px; background: var(--primary); color: #fff; border-radius: 12px; font-weight: 600; transition: background 0.2s; }
.download-link-item:hover { background: var(--primary-dark); color: #fff; }
.dl-type { background: rgba(255,255,255,0.2); padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 700; }
.dl-label { flex: 1; }
.dl-arrow { font-size: 18px; }

/* ─── What's New ─── */
.whats-new-box { background: var(--bg); padding: 16px; border-radius: 8px; }

/* ─── Play Store Link ─── */
.playstore-link { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border: 2px solid var(--border); border-radius: 10px; color: var(--text); font-weight: 600; }
.playstore-link:hover { border-color: var(--primary); color: var(--primary-dark); }

/* ─── Pagination ─── */
.pagination { margin: 30px 0; text-align: center; }
.pagination .nav-links { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.pagination .page-numbers { padding: 8px 14px; border-radius: 8px; background: var(--card); box-shadow: var(--shadow); font-weight: 600; color: var(--text); }
.pagination .page-numbers.current { background: var(--primary); color: #fff; }
.pagination .page-numbers:hover:not(.current) { background: var(--primary-light); }

/* ─── No Results ─── */
.no-results { text-align: center; padding: 60px 20px; }
.no-results h2 { font-size: 24px; margin-bottom: 10px; }

/* ─── Footer ─── */
.site-footer { background: #1e293b; color: #94a3b8; padding: 40px 0 0; margin-top: 40px; }
.footer-inner { display: flex; justify-content: space-between; gap: 30px; padding-bottom: 30px; border-bottom: 1px solid #334155; }
.footer-info h3 { color: #fff; margin-bottom: 8px; }
.footer-nav ul { list-style: none; display: flex; gap: 20px; }
.footer-nav a { color: #94a3b8; }
.footer-nav a:hover { color: #fff; }
.footer-bottom { padding: 16px 0; text-align: center; font-size: 13px; }

/* ─── Search Results Page ─── */
.search-page-title { margin-bottom: 20px; }

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .header-inner { flex-wrap: wrap; }
    .header-search { order: 3; flex: 100%; }
    .header-nav { display: none; }
    .mobile-menu-toggle { display: block; margin-inline-start: auto; }
    .page-layout { flex-direction: column; }
    .sidebar { width: 100%; }
    .apps-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .app-header-top { flex-direction: column; align-items: center; text-align: center; }
    .app-meta-badges { justify-content: center; }
    .app-info-grid { grid-template-columns: repeat(3, 1fr); }
    .footer-inner { flex-direction: column; }
    .screenshot-img { height: 200px; }
}

/* ─── Categories Bar ─── */
.categories-bar { display: flex; gap: 8px; overflow-x: auto; padding: 16px 0; margin-bottom: 16px; }
.categories-bar::-webkit-scrollbar { height: 0; }
.cat-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; background: var(--card); border-radius: 20px; font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; box-shadow: var(--shadow); transition: all 0.2s; }
.cat-chip:hover, .cat-chip.active { background: var(--primary); color: #fff; }
.cat-count { background: rgba(0,0,0,0.1); padding: 2px 8px; border-radius: 10px; font-size: 11px; }
.cat-chip.active .cat-count { background: rgba(255,255,255,0.3); }

/* ─── Mobile Nav Open ─── */
.header-nav.mobile-open { display: block !important; position: absolute; top: 100%; left: 0; right: 0; background: var(--card); box-shadow: var(--shadow-lg); padding: 10px; z-index: 200; }
.header-nav.mobile-open ul { flex-direction: column; }
.header-nav.mobile-open a { display: block; padding: 12px 16px; }

/* ─── Comment Form ─── */
#commentform label { display: block; margin-bottom: 4px; font-weight: 600; }
#commentform input[type="text"], #commentform input[type="email"], #commentform input[type="url"], #commentform textarea { width: 100%; padding: 10px 14px; border: 2px solid var(--border); border-radius: 8px; font-size: 14px; margin-bottom: 12px; }
#commentform input:focus, #commentform textarea:focus { border-color: var(--primary); outline: none; }
.comment-list li { padding: 16px 0; border-bottom: 1px solid var(--border); }
.comment-author img { border-radius: 50%; margin-inline-end: 8px; vertical-align: middle; }

/* ══════════════════════════════════════════
   APKPure-Style Single App Page
   ══════════════════════════════════════════ */

/* ─── Breadcrumbs ─── */
.apk-breadcrumbs { padding: 14px 0; font-size: 13px; color: #999; }
.apk-breadcrumbs a { color: #00b853; }
.apk-breadcrumbs a:hover { text-decoration: underline; }
.apk-breadcrumbs span { margin: 0 4px; }
.apk-breadcrumbs .current { color: #666; }

/* ─── App Header ─── */
.apk-app-header { background: #fff; border-radius: 0; padding: 30px 0; border-bottom: 1px solid #eee; margin: 0 -20px; padding: 30px 20px; }
.apk-app-header-inner { display: flex; align-items: flex-start; justify-content: space-between; max-width: 900px; margin: 0 auto; gap: 30px; }
.apk-app-info-side { flex: 1; }
.apk-app-icon-side { flex-shrink: 0; }

.apk-main-icon { width: 180px; height: 180px; border-radius: 24px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }

.apk-share-btn { width: 36px; height: 36px; border: 1px solid #ddd; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #999; cursor: pointer; margin-bottom: 12px; transition: all 0.2s; }
.apk-share-btn:hover { border-color: #00b853; color: #00b853; }

.apk-app-title { font-size: 28px; font-weight: 700; color: #333; margin-bottom: 6px; line-height: 1.3; }
.apk-developer a { color: #00b853; font-size: 15px; font-weight: 500; }
.apk-developer a:hover { text-decoration: underline; }
.apk-date { color: #999; font-size: 13px; margin-top: 4px; margin-bottom: 20px; }

/* ─── Stats Bar ─── */
.apk-stats-bar { display: flex; gap: 0; margin-bottom: 24px; }
.apk-stat-item { text-align: center; padding: 0 20px; border-left: 1px solid #eee; }
body.rtl .apk-stat-item { border-left: none; border-right: 1px solid #eee; }
.apk-stat-item:first-child { padding-inline-start: 0; border: none; }
.apk-stat-value { font-size: 16px; font-weight: 700; color: #333; display: flex; align-items: center; justify-content: center; gap: 4px; }
.apk-stat-label { font-size: 11px; color: #999; margin-top: 2px; }
.apk-star { color: #ffc107; }
.apk-safe-icon { color: #00b853; font-size: 18px; font-weight: 700; background: #e8f5e9; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }

/* ─── Download Buttons (Top) ─── */
.apk-download-buttons { display: flex; gap: 12px; flex-wrap: wrap; }
.apk-btn-download { display: inline-flex; align-items: center; gap: 10px; background: #00b853; color: #fff; padding: 14px 40px; border-radius: 8px; font-size: 16px; font-weight: 700; transition: background 0.2s; cursor: pointer; text-decoration: none; }
.apk-btn-download:hover { background: #00a347; color: #fff; }
.apk-btn-download.full-width { width: 100%; justify-content: center; }
.apk-btn-telegram { display: inline-flex; align-items: center; gap: 10px; background: #00897b; color: #fff; padding: 14px 40px; border-radius: 8px; font-size: 16px; font-weight: 700; transition: background 0.2s; cursor: pointer; text-decoration: none; }
.apk-btn-telegram:hover { background: #00796b; color: #fff; }

/* ─── Content Wrapper ─── */
.apk-content-wrapper { max-width: 900px; margin: 0 auto; padding: 20px 0; }
.apk-main-col { width: 100%; }

/* ─── Sections ─── */
.apk-section { background: #fff; margin-bottom: 20px; padding: 24px 28px; border-radius: 0; border: 1px solid #f0f0f0; }
.apk-section-title { font-size: 18px; font-weight: 700; color: #333; margin-bottom: 16px; padding-bottom: 0; border: none; }

/* ─── Description ─── */
.apk-badges-row { margin-bottom: 12px; }
.apk-badge { background: #fff3e0; color: #e65100; padding: 4px 12px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.apk-description-body { color: #555; line-height: 1.8; font-size: 15px; text-align: justify; }
.apk-description-body h2 { font-size: 18px; color: #333; margin: 22px 0 10px; font-weight: 700; }
.apk-description-body h3 { font-size: 16px; color: #444; margin: 18px 0 8px; font-weight: 600; }
.apk-description-body p { margin-bottom: 12px; }
.apk-description-body ul, .apk-description-body ol { margin: 10px 24px; }
.apk-description-body li { margin-bottom: 6px; }
.apk-description-body strong { color: #333; }

/* ─── What's New ─── */
.apk-last-updated { color: #999; font-size: 13px; margin-bottom: 12px; }
.apk-whatsnew-content { color: #555; line-height: 1.8; }

/* ─── Screenshots Carousel ─── */
.apk-screenshots-carousel { position: relative; overflow: hidden; }
.apk-screenshots-track { display: flex; gap: 12px; overflow-x: auto; scroll-behavior: smooth; padding: 4px 0; scrollbar-width: none; -ms-overflow-style: none; }
.apk-screenshots-track::-webkit-scrollbar { display: none; }
.apk-ss-item { flex-shrink: 0; width: 200px; height: 360px; border-radius: 12px; overflow: hidden; position: relative; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.apk-ss-item img { width: 100%; height: 100%; object-fit: cover; }
.apk-play-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; font-size: 40px; color: #fff; }
.apk-carousel-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; background: #fff; border: 1px solid #ddd; border-radius: 50%; font-size: 20px; cursor: pointer; z-index: 2; display: flex; align-items: center; justify-content: center; color: #333; box-shadow: 0 2px 6px rgba(0,0,0,0.1); }
.apk-carousel-btn.prev { left: 4px; }
.apk-carousel-btn.next { right: 4px; }
body.rtl .apk-carousel-btn.prev { left: auto; right: 4px; }
body.rtl .apk-carousel-btn.next { right: auto; left: 4px; }

/* ─── Info Table ─── */
.apk-info-table { border: 1px solid #f0f0f0; border-radius: 8px; overflow: hidden; }
.apk-info-row { display: flex; border-bottom: 1px solid #f0f0f0; }
.apk-info-row:last-child { border-bottom: none; }
.apk-info-cell { flex: 1; padding: 14px 18px; display: flex; flex-direction: column; gap: 4px; border-left: 1px solid #f0f0f0; }
body.rtl .apk-info-cell { border-left: none; border-right: 1px solid #f0f0f0; }
.apk-info-cell:first-child { border: none; }
.apk-info-label { font-size: 12px; color: #999; }
.apk-info-val { font-size: 14px; font-weight: 600; color: #333; }
.apk-info-val a { color: #00b853; }

/* ─── Security Box ─── */
.apk-security-box { border: 2px solid #e8f5e9; }
.apk-security-header { margin-bottom: 12px; }
.apk-safe-badge { color: #00b853; font-size: 16px; font-weight: 700; }
.apk-safe-text { color: #00b853; }
.apk-security-details { display: flex; gap: 24px; margin-bottom: 12px; }
.apk-security-item { color: #555; font-size: 13px; }
.apk-security-item::before { content: ''; }
.apk-security-id { color: #999; font-size: 12px; }
.apk-verified-badge { display: inline-block; background: #e8f5e9; border: 1px solid #a5d6a7; padding: 4px 10px; border-radius: 4px; font-size: 11px; color: #2e7d32; font-weight: 600; margin-top: 8px; }

/* ─── Download Section (Bottom) ─── */
.apk-download-section { border: 2px solid #00b853; }
.apk-dl-list { display: flex; flex-direction: column; gap: 10px; }
.apk-dl-item { display: flex; align-items: center; gap: 16px; padding: 16px 20px; background: #00b853; color: #fff; border-radius: 10px; transition: background 0.2s; }
.apk-dl-item:hover { background: #00a347; color: #fff; }
.apk-dl-icon { flex-shrink: 0; }
.apk-dl-info { flex: 1; }
.apk-dl-name { font-size: 16px; font-weight: 700; }
.apk-dl-meta { font-size: 12px; opacity: 0.85; margin-top: 2px; }

/* ─── Related Apps Grid ─── */
.apk-related-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.apk-related-card { text-align: center; padding: 12px 8px; border-radius: 10px; transition: all 0.2s; color: #333; }
.apk-related-card:hover { background: #f5f5f5; }
.apk-related-icon { width: 72px; height: 72px; border-radius: 16px; margin: 0 auto 8px; display: block; box-shadow: 0 2px 6px rgba(0,0,0,0.08); }
.apk-related-name { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 2px; }
.apk-related-dev { font-size: 11px; color: #999; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apk-related-rating { font-size: 12px; color: #ffc107; font-weight: 600; margin-top: 4px; }

/* ─── Video Modal ─── */
.apk-modal { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; }
.apk-modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.85); }
.apk-modal-content { position: relative; width: 90%; max-width: 800px; aspect-ratio: 16/9; }
.apk-modal-close { position: absolute; top: -40px; right: 0; background: none; border: none; color: #fff; font-size: 28px; cursor: pointer; }
.apk-modal-video iframe { width: 100%; height: 100%; border: none; border-radius: 12px; }

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .apk-app-header-inner { flex-direction: column-reverse; align-items: center; text-align: center; }
    .apk-main-icon { width: 120px; height: 120px; }
    .apk-stats-bar { flex-wrap: wrap; justify-content: center; gap: 8px; }
    .apk-stat-item { padding: 8px 12px; border: none !important; }
    .apk-download-buttons { justify-content: center; }
    .apk-share-btn { margin: 0 auto 12px; }
    .apk-related-grid { grid-template-columns: repeat(3, 1fr); }
    .apk-ss-item { width: 150px; height: 270px; }
    .apk-info-row { flex-direction: column; }
    .apk-info-cell { border: none !important; border-bottom: 1px solid #f0f0f0 !important; }
    .apk-section { padding: 18px 16px; }
    .apk-app-title { font-size: 22px; }
}
/* ═══════════════════════════════════════════════
   Homepage Sections — التطبيقات والمقالات
   ═══════════════════════════════════════════════ */

.home-section {
    margin-bottom: 48px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
}
.section-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}
.section-more {
    font-size: 14px;
    color: #4CAF50;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s;
    white-space: nowrap;
}
.section-more:hover { opacity: 0.75; }

.posts-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.post-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #f0f0f0;
}
.post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.post-card-thumb {
    display: block;
    overflow: hidden;
    aspect-ratio: 16/9;
}
.post-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.post-card:hover .post-card-thumb img {
    transform: scale(1.04);
}

.post-card-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}
.post-card-date { color: #999; }
.post-card-cat {
    background: #e8f5e9;
    color: #388e3c;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
    text-decoration: none;
    font-size: 11px;
}
.post-card-cat:hover { background: #c8e6c9; }

.post-card-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
}
.post-card-title a { color: #1a1a1a; text-decoration: none; }
.post-card-title a:hover { color: #4CAF50; }

.post-card-excerpt {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    margin: 0;
    flex: 1;
}

@media (max-width: 768px) {
    .section-header h2 { font-size: 17px; }
    .posts-list { grid-template-columns: 1fr; }
    .home-section { margin-bottom: 32px; }
}

/* ═══════════════════════════════════════════════
   ADDITIONS: Homepage Sections + Ads + Posts
   الصق هذا الكود في نهاية ملف assets/css/main.css
   ═══════════════════════════════════════════════ */

/* ─── Home Sections ─── */
.home-section { margin-bottom: 32px; }
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}
.section-header h2 { font-size: 20px; font-weight: 700; margin: 0; }
.section-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--primary-dark);
    font-size: 14px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--primary-light);
    transition: all 0.2s;
}
.section-more-btn:hover {
    background: var(--primary);
    color: #fff;
}

/* ─── View All Button ─── */
.section-footer {
    text-align: center;
    margin-top: 20px;
}
.view-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 32px;
    border: 2px solid var(--primary);
    border-radius: 10px;
    color: var(--primary-dark);
    font-size: 15px;
    font-weight: 700;
    transition: all 0.2s;
}
.view-all-btn:hover {
    background: var(--primary);
    color: #fff;
}

/* ─── Categories Grid ─── */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}
.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 12px;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: all 0.2s;
    color: var(--text);
    text-align: center;
}
.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    color: var(--primary-dark);
}
.category-icon { font-size: 32px; margin-bottom: 8px; }
.category-name { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.category-count { font-size: 12px; color: var(--text-light); }

/* ─── Posts Grid ─── */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}
.post-card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}
.post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.post-card-thumb img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}
.post-card-body { padding: 16px; }
.post-card-meta {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 8px;
}
.post-card-cat {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}
.post-card-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.4;
}
.post-card-title a { color: var(--text); }
.post-card-title a:hover { color: var(--primary-dark); }
.post-card-excerpt {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.6;
}

/* ─── Ads ─── */
.flavor-ad {
    margin: 20px 0;
    text-align: center;
    overflow: hidden;
    min-height: 10px;
}
.flavor-ad:empty { display: none; }
.sidebar .flavor-ad { margin: 0 0 20px; }

/* ─── Responsive Additions ─── */
@media (max-width: 768px) {
    .categories-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .category-card { padding: 14px 8px; }
    .category-icon { font-size: 24px; }
    .category-name { font-size: 12px; }
    .posts-grid { grid-template-columns: 1fr; }
    .post-card-thumb img { height: 150px; }
    .section-header h2 { font-size: 18px; }
}
