/* ═══════════════════════════════════════════════════════════════════
   BAZARKOOM — Brand Identity Design System
   Light theme, blue primary (#003580), Cairo font, RTL-FIRST
   All layout uses CSS logical properties for proper RTL support
   ═══════════════════════════════════════════════════════════════════ */

:root {
    --primary: #003580;
    --primary-hover: #002a66;
    --accent: #007bff;
    --accent-hover: #0069d9;
    --secondary: #6c757d;
    --success: #28a745;
    --warning: #ffc107;
    --featured-gold: #f59e0b;
    --featured-gold-hover: #d97706;
    --danger: #dc3545;
    --bg-body: #f9fafb;
    --bg-white: #ffffff;
    --bg-card: #ffffff;
    --border-light: #e5e7eb;
    --border-medium: #d1d5db;
    --text-dark: #1f2937;
    --text-medium: #4b5563;
    --text-light: #6b7280;
    --text-muted: #9ca3af;
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
    --transition: 0.3s ease;
}

/* ── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: 'Cairo', 'Tahoma', sans-serif; background: var(--bg-body); color: var(--text-dark); line-height: 1.7; text-align: start; }
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary); }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; font-family: inherit; }
ul { list-style: none; }
input, select, textarea { font-family: inherit; text-align: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ── Container ────────────────────────────────────────────────── */
.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 1rem; }

/* ── Top Bar ──────────────────────────────────────────────────── */
.top-bar { background: var(--primary); color: white; padding: 0.5rem 0; font-size: 0.85rem; }
.top-bar .container { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; }
.top-bar a { color: white; transition: color var(--transition); }
.top-bar a:hover { color: #93c5fd; }
.top-bar-info { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.top-bar-info i { margin-inline-end: 0.25rem; }
.top-bar-actions { display: flex; align-items: center; gap: 1rem; }
.top-bar-actions a i { margin-inline-end: 0.35rem; }
.top-bar-social { display: inline-flex; gap: 0.5rem; }

/* ── Main Header ──────────────────────────────────────────────── */
.main-header { background: white; box-shadow: var(--shadow-sm); padding: 1rem 0; }
.main-header .container { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; }
.header-logo { display: flex; align-items: center; gap: 0.75rem; color: inherit; text-decoration: none; }
.header-logo .logo-icon { width: 48px; height: 48px; background: var(--primary); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; color: white; font-size: 1.5rem; flex-shrink: 0; }
.header-logo h1 { font-size: 1.5rem; font-weight: 700; color: var(--primary); margin: 0; }
.logo-desktop { max-height: 44px; width: auto; object-fit: contain; }
.logo-mobile { display: none; }
.header-logo p { font-size: 0.8rem; color: var(--text-light); margin: 0; }
.header-search { flex: 1; max-width: 480px; min-width: 200px; }
.header-search form { display: flex; position: relative; }
/* RTL: button on the LEFT (inline-start), input on the RIGHT (inline-end) */
.header-search input {
    width: 100%; padding: 0.75rem 1rem;
    border: 1px solid var(--border-medium);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    outline: none; font-size: 0.95rem; order: 2;
}
[dir="rtl"] .header-search input {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}
.header-search input:focus { border-color: var(--primary); }
.header-search button {
    padding: 0 1.25rem; background: var(--primary); color: white; border: none;
    border-radius: var(--radius-md) 0 0 var(--radius-md); order: 1;
}
[dir="rtl"] .header-search button {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.header-search button:hover { background: var(--primary-hover); }
.header-actions { display: flex; align-items: center; gap: 0.75rem; }

/* ── Navigation ───────────────────────────────────────────────── */
.main-nav { background: white; border-top: 1px solid var(--border-light); }
.main-nav .container { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; padding-top: 0.75rem; padding-bottom: 0.75rem; }
.nav-links { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.nav-links a { color: var(--text-medium); font-weight: 500; transition: color var(--transition); font-size: 0.95rem; }
.nav-links a:hover { color: var(--primary); }
.nav-links a i, .nav-links button i { margin-inline-end: 0.4rem; }
.dropdown { position: relative; }
.dropdown-toggle { color: var(--text-medium); font-weight: 500; background: none; border: none; display: flex; align-items: center; gap: 0.25rem; font-size: 0.95rem; padding: 0.5rem 0; cursor: pointer; }
.dropdown-menu { display: none; position: absolute; inset-inline-start: 0; top: 100%; min-width: 256px; background: white; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); z-index: 50; padding: 1rem; }
.dropdown:hover .dropdown-menu { display: block; }
.dropdown-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem; background: var(--bg-body); border-radius: var(--radius-sm); margin-bottom: 0.5rem; transition: background var(--transition); color: var(--text-dark); }
.dropdown-item:hover { background: #eff6ff; color: var(--primary); }
.dropdown-item i { margin-inline-end: 0.25rem; color: var(--primary); }
.location-select { border: 1px solid var(--border-medium); border-radius: var(--radius-md); padding: 0.5rem 0.75rem; outline: none; font-family: inherit; }
.location-select:focus { border-color: var(--primary); }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.75rem 1.5rem; border: none; border-radius: var(--radius-md); font-weight: 700; font-size: 0.95rem; transition: all var(--transition); }
.btn i { margin-inline-end: 0.15rem; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); color: white; }
.btn-post { background: #2563eb; color: white; }
.btn-post:hover { background: #1d4ed8; color: white; }
.btn-featured { background: var(--featured-gold); color: #1e3a5f; }
.btn-featured:hover { background: var(--featured-gold-hover); color: white; }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-white-outline { background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.3); color: white; }
.btn-white-outline:hover { background: rgba(255,255,255,0.3); color: white; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1.1rem; }
.btn-block { width: 100%; }

/* ── Hero — Premium ───────────────────────────────────────────── */
.hero {
    position: relative;
    background: linear-gradient(145deg, #001d47 0%, #003580 35%, #004fa8 65%, #1a56db 100%);
    color: white; padding: 4.5rem 0 3.5rem; text-align: center;
    overflow: hidden;
}
.hero::before {
    content: ''; position: absolute; inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% 80%, rgba(26,86,219,0.3) 0%, transparent 70%),
        radial-gradient(ellipse 60% 40% at 80% 20%, rgba(0,79,168,0.25) 0%, transparent 60%);
    pointer-events: none;
}
.hero-container { position: relative; z-index: 1; }

/* Decorative floating shapes */
.hero-shapes { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.hero-shape {
    position: absolute; border-radius: 50%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
}
.hero-shape--1 { width: 400px; height: 400px; top: -120px; inset-inline-end: -100px; animation: floatShape 18s ease-in-out infinite; }
.hero-shape--2 { width: 250px; height: 250px; bottom: -80px; inset-inline-start: -60px; animation: floatShape 22s ease-in-out infinite reverse; }
.hero-shape--3 { width: 160px; height: 160px; top: 50%; inset-inline-end: 15%; animation: floatShape 15s ease-in-out infinite 3s; }
@keyframes floatShape {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(15px, -20px) rotate(5deg); }
    50% { transform: translate(-10px, 15px) rotate(-3deg); }
    75% { transform: translate(8px, -8px) rotate(2deg); }
}

/* Hero badge */
.hero-badge {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: rgba(255,255,255,0.1); backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.15);
    padding: 0.5rem 1.25rem; border-radius: var(--radius-full);
    font-size: 0.85rem; font-weight: 500; margin-bottom: 1.5rem;
    color: rgba(255,255,255,0.9); letter-spacing: 0.3px;
}
.hero-badge i { color: #fcd34d; font-size: 0.9rem; }

/* Hero typography */
.hero h2 { font-size: clamp(1.75rem, 4vw, 3rem); font-weight: 800; margin-bottom: 0.75rem; line-height: 1.3; }
.hero-brand { color: #fcd34d; position: relative; }
.hero-subtitle { font-size: 1.1rem; opacity: 0.85; margin-bottom: 2.25rem; max-width: 650px; margin-inline: auto; line-height: 1.7; }

/* Search card */
.hero-search {
    max-width: 960px; margin: 0 auto;
    background: rgba(255,255,255,0.08); backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-xl); padding: 1.5rem; text-align: start;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.hero-search-label {
    color: rgba(255,255,255,0.7); font-size: 0.8rem; font-weight: 600;
    margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.5rem;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.hero-search-label i { font-size: 0.7rem; }
.hero-search .grid { display: grid; gap: 0.75rem; margin-bottom: 0.75rem; }
.hero-search .grid-4 { grid-template-columns: repeat(4, 1fr); }
.hero-search input, .hero-search select {
    width: 100%; padding: 0.75rem 1rem; border-radius: var(--radius-lg);
    border: 1px solid rgba(255,255,255,0.08); color: var(--text-dark);
    font-size: 0.95rem; box-shadow: var(--shadow-md); font-family: inherit;
    background: rgba(255,255,255,0.95);
    transition: all 0.2s ease;
}
.hero-search input:focus, .hero-search select:focus {
    outline: none; box-shadow: 0 0 0 3px rgba(252, 211, 77, 0.5);
    background: white;
}
.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.5rem; }

/* ── Stats Bar — Premium ─────────────────────────────────────── */
.stats-bar {
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.08); backdrop-filter: blur(12px);
    border-radius: var(--radius-xl); padding: 1.5rem 2rem;
    border: 1px solid rgba(255,255,255,0.15);
    margin-top: 2.5rem;
    box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}
.stat-item { flex: 1; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 0.3rem; }
.stat-icon {
    width: 44px; height: 44px; border-radius: 50%;
    background: rgba(252,211,77,0.15); border: 1px solid rgba(252,211,77,0.25);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 0.25rem;
}
.stat-icon i { color: #fcd34d; font-size: 1rem; }
.stat-value { font-size: 1.65rem; font-weight: 800; letter-spacing: -0.5px; }
.stat-label { font-size: 0.8rem; opacity: 0.75; font-weight: 500; }
.stat-divider { width: 1px; height: 50px; background: rgba(255,255,255,0.15); flex-shrink: 0; margin: 0 0.5rem; }

/* ── Quick Options Bar ────────────────────────────────────────── */
.quick-bar { background: white; border-bottom: 1px solid var(--border-light); padding: 0.75rem 0; box-shadow: var(--shadow-sm); }
.quick-bar .container { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.75rem; }
.quick-bar-label { color: #1d4ed8; font-weight: 500; white-space: nowrap; font-size: 0.9rem; }
.quick-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.quick-tag { background: #f3f4f6; color: var(--text-medium); padding: 0.25rem 0.75rem; border-radius: var(--radius-full); font-size: 0.85rem; transition: all var(--transition); }
.quick-tag:hover { background: #dbeafe; color: #1d4ed8; }
.popular-tag { background: #eff6ff; color: #1d4ed8; }
.popular-tag:hover { background: #dbeafe; color: #1e3a8a; }

/* ── Featured Ads Section ─────────────────────────────────────── */
.featured-section { background: linear-gradient(135deg, #fefce8, white); border-top: 1px solid #fde68a; border-bottom: 1px solid #fde68a; padding: 2rem 0; }
.section-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; gap: 1rem; }
.section-header h2 { font-size: 1.75rem; font-weight: 700; color: var(--text-dark); }
.section-header h2 i { color: var(--featured-gold); margin-inline-end: 0.4rem; }
.section-header p { color: var(--text-light); margin-top: 0.25rem; }

/* ── Cards ────────────────────────────────────────────────────── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.card-grid-4 { grid-template-columns: repeat(4, 1fr); }
/* ── Ad Card — Premium Design ──────────────────────────────────── */
.ad-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.06);
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-align: start;
    display: flex;
    flex-direction: column;
    position: relative;
}
.ad-card:hover {
    box-shadow: 0 20px 40px rgba(0,53,128,0.12), 0 8px 16px rgba(0,0,0,0.06);
    transform: translateY(-6px);
    border-color: rgba(37,99,235,0.15);
}
.ad-card-featured {
    border: 2px solid #f59e0b;
    background: linear-gradient(180deg, #fffbeb 0%, white 40%);
}
.ad-card-featured:hover { border-color: #d97706; }

/* Image */
.ad-card-link { display: block; text-decoration: none; }
.ad-card-image {
    position: relative;
    width: 100%;
    height: 210px;
    overflow: hidden;
    background: #f1f5f9;
}
.ad-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.ad-card:hover .ad-card-image img { transform: scale(1.08); }
.ad-card-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to top, rgba(0,0,0,0.25), transparent);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}
.ad-card:hover .ad-card-image::after { opacity: 1; }
.ad-card-noimg {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #cbd5e1;
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
}

/* Badges */
.ad-card-badges {
    position: absolute;
    top: 0.65rem;
    inset-inline-start: 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    z-index: 2;
}
.ad-card-badge {
    padding: 0.25rem 0.65rem;
    border-radius: 2rem;
    font-size: 0.72rem;
    font-weight: 700;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    letter-spacing: 0.02em;
}
.ad-card-badge--featured {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    box-shadow: 0 2px 8px rgba(245,158,11,0.35);
}
.ad-card-badge--featured i { margin-inline-end: 0.2rem; font-size: 0.65rem; }
.ad-card-badge--new {
    background: linear-gradient(135deg, #059669, #047857);
    color: white;
    box-shadow: 0 2px 8px rgba(5,150,105,0.3);
}

/* Favorite */
.ad-card-fav {
    position: absolute;
    top: 0.65rem;
    inset-inline-end: 0.65rem;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.25s ease;
    z-index: 2;
}
.ad-card-fav:hover { background: white; color: #ef4444; transform: scale(1.15); box-shadow: 0 4px 12px rgba(0,0,0,0.12); }

/* Image count */
.ad-card-imgcount {
    position: absolute;
    bottom: 0.65rem;
    inset-inline-end: 0.65rem;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    color: white;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 1rem;
    z-index: 2;
}
.ad-card-imgcount i { margin-inline-end: 0.25rem; font-size: 0.68rem; }

/* Body */
.ad-card-body {
    padding: 1rem 1.15rem 1.15rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Category tag */
.ad-card-cat {
    font-size: 0.72rem;
    font-weight: 600;
    color: #2563eb;
    background: #eff6ff;
    padding: 0.18rem 0.55rem;
    border-radius: 1rem;
    display: inline-block;
    margin-bottom: 0.55rem;
    width: fit-content;
}

/* Title */
.ad-card-title {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 0.98rem;
    margin-bottom: 0.5rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
}
.ad-card-title a { color: inherit; text-decoration: none; }
.ad-card-title a:hover { color: #1d4ed8; }

/* Info row */
.ad-card-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.78rem;
    color: #94a3b8;
    margin-bottom: 0.75rem;
}
.ad-card-info i { font-size: 0.72rem; margin-inline-end: 0.2rem; }
.ad-card-loc i { color: #ef4444; }
.ad-card-time i { color: #94a3b8; }

/* Bottom / Price */
.ad-card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
}
.ad-card-price__amount {
    font-size: 1.25rem;
    font-weight: 800;
    color: #003580;
    letter-spacing: -0.01em;
}
.ad-card-price__currency {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    margin-inline-start: 0.25rem;
}
.ad-card-price__nego {
    display: block;
    font-size: 0.68rem;
    color: #059669;
    font-weight: 500;
    margin-top: 0.15rem;
}
.ad-card-price--contact {
    font-size: 0.88rem;
    font-weight: 600;
    color: #2563eb;
}
.ad-card-price--contact i { margin-inline-end: 0.3rem; font-size: 0.78rem; }
.ad-card-stats {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #94a3b8;
}
.ad-card-stats i { margin-inline-end: 0.15rem; }
.currency-converted { display: block; font-size: 0.72rem; font-weight: 600; color: #059669; margin-top: 0.15rem; }

/* Owner actions */
.ad-card-owner {
    display: flex;
    gap: 0;
    border-top: 1px solid #f1f5f9;
}
.ad-card-obtn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.65rem;
    font-size: 0.8rem;
    font-weight: 600;
    border: none;
    background: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.ad-card-obtn--edit { color: #2563eb; }
.ad-card-obtn--edit:hover { background: #eff6ff; color: #1d4ed8; }
.ad-card-obtn--del { color: #94a3b8; border-inline-start: 1px solid #f1f5f9; }
.ad-card-obtn--del:hover { background: #fef2f2; color: #dc2626; }

/* Placeholder image */
.ad-card-placeholder-img { width: 60%; height: 60%; object-fit: contain; opacity: 0.4; }

/* ── Main Content + Sidebar Layout ────────────────────────────── */
.content-layout { display: grid; grid-template-columns: 1fr 4fr; gap: 1.5rem; padding: 2rem 0; }
.sidebar { display: flex; flex-direction: column; gap: 1.5rem; }
.sidebar-widget { background: white; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 1.25rem; text-align: start; }
.sidebar-widget-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.sidebar-widget-header .icon-box { padding: 0.5rem; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; }
.sidebar-widget-header h3 { font-size: 1.05rem; font-weight: 700; color: var(--text-dark); }
.sidebar-widget-link { display: flex; align-items: center; justify-content: space-between; padding: 0.5rem; border-radius: var(--radius-sm); transition: background var(--transition); }
.sidebar-widget-link:hover { background: var(--bg-body); }
.sidebar-cta { background: linear-gradient(135deg, #1d4ed8, #1e3a8a); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 1.25rem; color: white; text-align: start; }
.sidebar-cta h3 { font-weight: 700; margin-bottom: 0.75rem; }
.sidebar-cta a { display: flex; align-items: center; justify-content: space-between; padding: 0.5rem; border-radius: var(--radius-sm); color: white; transition: background var(--transition); font-size: 0.9rem; }
.sidebar-cta a:hover { background: rgba(255,255,255,0.1); color: white; }

/* ── Category Cards ───────────────────────────────────────────── */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.category-card { background: white; border-radius: var(--radius-lg); padding: 1.5rem 1rem; text-align: center; border: 1px solid var(--border-light); transition: all var(--transition); display: block; color: var(--text-dark); }
.category-card:hover { border-color: #2563eb; box-shadow: 0 10px 25px rgba(37,99,235,0.15); transform: translateY(-6px); color: var(--primary); }
.category-icon { width: 60px; height: 60px; background: linear-gradient(135deg, #eff6ff, #dbeafe); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; font-size: 1.5rem; color: #2563eb; transition: all var(--transition); }
.category-card:hover .category-icon { background: linear-gradient(135deg, #2563eb, #1d4ed8); color: white; }
.category-name { font-weight: 600; color: var(--text-dark); font-size: 0.95rem; }
.category-count { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ── Dashboard Sidebar — Premium ──────────────────────────────── */
.dash-wrap { padding: 2rem 0; background: var(--bg-body); min-height: 70vh; }
.dash-grid { display: grid; grid-template-columns: 270px 1fr; gap: 2rem; }
@media (max-width: 768px) { .dash-grid { grid-template-columns: 1fr; } }

.dash-sidebar {
    background: white; border-radius: var(--radius-xl);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 8px 32px rgba(0,0,0,0.06);
    overflow: hidden; position: sticky; top: 1.5rem; align-self: start;
    border: 1px solid rgba(0,0,0,0.04);
}

/* ── Sidebar header — gradient with decorative shapes ── */
.dash-sidebar-header {
    background: linear-gradient(135deg, #003580 0%, #1a56db 50%, #2563eb 100%);
    padding: 2rem 1.5rem 1.75rem; text-align: center; color: white;
    position: relative; overflow: hidden;
}
.dash-sidebar-header::before {
    content: ''; position: absolute; top: -40%; right: -25%;
    width: 180px; height: 180px; border-radius: 50%;
    background: rgba(255,255,255,0.06);
}
.dash-sidebar-header::after {
    content: ''; position: absolute; bottom: -30%; left: -15%;
    width: 120px; height: 120px; border-radius: 50%;
    background: rgba(255,255,255,0.04);
}

/* ── Avatar with gold ring ── */
.dash-sidebar-avatar {
    width: 82px; height: 82px; border-radius: 50%;
    background: rgba(255,255,255,0.12);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 0.85rem; font-size: 2rem;
    border: 3px solid rgba(252,211,77,0.5);
    box-shadow: 0 0 0 4px rgba(255,255,255,0.1), 0 4px 16px rgba(0,0,0,0.2);
    overflow: hidden; position: relative; z-index: 1;
    transition: transform 0.3s, box-shadow 0.3s;
}
.dash-sidebar-avatar:hover { transform: scale(1.05); box-shadow: 0 0 0 4px rgba(252,211,77,0.3), 0 6px 24px rgba(0,0,0,0.25); }
.dash-sidebar-avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.dash-sidebar-name { font-weight: 700; font-size: 1.1rem; margin-bottom: 0.2rem; position: relative; z-index: 1; letter-spacing: -0.2px; }
.dash-sidebar-email { font-size: 0.78rem; opacity: 0.75; position: relative; z-index: 1; margin: 0; }

/* ── Navigation links ── */
.dash-sidebar-nav { padding: 0.75rem 0.75rem 1rem; }
.dash-nav-link {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.7rem 1rem; border-radius: var(--radius-md);
    margin-bottom: 0.15rem; color: var(--text-medium); font-weight: 500;
    transition: all 0.2s; text-decoration: none; font-size: 0.9rem;
    position: relative;
}
.dash-nav-link:hover { background: #f0f4ff; color: var(--primary); transform: translateX(-3px); }
[dir="ltr"] .dash-nav-link:hover { transform: translateX(3px); }
.dash-nav-link.active {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: var(--primary); font-weight: 700;
    border-inline-start: 3px solid var(--primary);
    padding-inline-start: calc(1rem - 3px);
}
.dash-nav-icon {
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm); font-size: 0.85rem; flex-shrink: 0;
    background: #f3f4f6; color: var(--text-muted);
    transition: all 0.2s;
}
.dash-nav-link:hover .dash-nav-icon,
.dash-nav-link.active .dash-nav-icon { background: var(--primary); color: white; }
.dash-nav-divider { border: none; border-top: 1px solid var(--border-light); margin: 0.5rem 0.5rem; }

/* ── CTA button ── */
.dash-nav-cta {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem 1rem; border-radius: var(--radius-md);
    color: white; background: linear-gradient(135deg, var(--primary), #1a56db);
    font-weight: 600; transition: all 0.2s; text-decoration: none; font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(0,53,128,0.2);
}
.dash-nav-cta:hover { background: linear-gradient(135deg, #1a56db, #1e3a8a); color: white; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,53,128,0.3); }
.dash-nav-cta .dash-nav-icon { background: rgba(255,255,255,0.2); color: white; }

/* ── Page title ── */
.dash-page-title { font-size: 1.3rem; font-weight: 800; color: var(--text-dark); margin-bottom: 1.5rem; display: flex; align-items: center; gap: 0.5rem; }
.dash-page-title i { color: var(--primary); }
.dash-empty { text-align: center; padding: 4rem 2rem; background: white; border-radius: var(--radius-lg); border: 1px solid var(--border-light); }
.dash-empty-icon { font-size: 3rem; color: var(--border-medium); margin-bottom: 1rem; display: block; }
.dash-empty-text { color: var(--text-muted); font-size: 0.95rem; }
.dash-pagination { margin-top: 1.5rem; display: flex; justify-content: center; }

/* ── Forms ─────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; margin-bottom: 0.5rem; font-weight: 500; color: var(--text-medium); font-size: 0.9rem; }
.form-input { width: 100%; padding: 0.75rem 1rem; background: white; border: 1px solid var(--border-medium); border-radius: var(--radius-md); color: var(--text-dark); font-size: 1rem; transition: border-color var(--transition); font-family: inherit; }
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,53,128,0.1); }

/* ── Share Modal ──────────────────────────────────────────────── */
.share-modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200; justify-content: center; align-items: center; }
.share-modal-overlay.active { display: flex; }
.share-modal { background: white; border-radius: var(--radius-xl); padding: 2rem; max-width: 420px; width: 90%; box-shadow: var(--shadow-lg); }
.share-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.5rem; }
.share-btn { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; padding: 1rem; border-radius: var(--radius-md); border: 1px solid var(--border-light); background: var(--bg-body); color: var(--text-dark); transition: all var(--transition); cursor: pointer; }
.share-btn:hover { transform: scale(1.05); border-color: var(--accent); }
.share-btn i { font-size: 1.5rem; }
.share-btn span { font-size: 0.75rem; }
.share-btn.facebook i { color: #1877F2; }
.share-btn.twitter i { color: #1DA1F2; }
.share-btn.whatsapp i { color: #25D366; }
.share-btn.telegram i { color: #0088CC; }
.share-btn.linkedin i { color: #0A66C2; }
.share-btn.copy i { color: var(--featured-gold); }

/* ── Footer ───────────────────────────────────────────────────── */
.footer { background: var(--primary); color: white; padding: 3rem 0 1.5rem; margin-top: 3rem; text-align: start; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; margin-bottom: 2rem; }
.footer h4 { font-weight: 700; margin-bottom: 1rem; font-size: 1.05rem; }
.footer a { color: rgba(255,255,255,0.7); font-size: 0.9rem; }
.footer a:hover { color: white; }
.footer li { margin-bottom: 0.5rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.15); padding-top: 1.5rem; text-align: center; color: rgba(255,255,255,0.6); font-size: 0.85rem; }
.footer-social { display: flex; gap: 0.75rem; margin-top: 1rem; }
.footer-social a { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-full); background: rgba(255,255,255,0.1); color: white; transition: all var(--transition); }
.footer-social a:hover { background: rgba(255,255,255,0.25); transform: scale(1.1); }

/* ── Notification Badge ───────────────────────────────────────── */
.notif-badge { position: absolute; top: -5px; inset-inline-start: -5px; background: var(--danger); color: white; border-radius: 50%; width: 18px; height: 18px; font-size: 10px; display: flex; align-items: center; justify-content: center; }

/* ── Animations ───────────────────────────────────────────────── */
.hover-lift { transition: transform var(--transition), box-shadow var(--transition); }
.hover-lift:hover { transform: translateY(-8px); box-shadow: 0 20px 40px rgba(0,0,0,0.12); }

/* ── RTL-Specific Directional Icon Fix ────────────────────────── */
/* ── Form Controls ────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-medium); margin-bottom: 0.35rem; }
.form-input {
    width: 100%; padding: 0.7rem 1rem; border: 1px solid var(--border-medium);
    border-radius: var(--radius-md); font-size: 0.9rem; color: var(--text-dark);
    background: white; transition: border-color var(--transition);
    text-align: inherit; font-family: inherit;
}
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0, 53, 128, 0.1); }
select.form-input { appearance: auto; }
textarea.form-input { resize: vertical; min-height: 80px; }

/* ── Auth Pages ──────────────────────────────────────────────── */
.auth-container { max-width: 480px; margin: 3rem auto; padding: 0 1rem; }
.auth-card { background: white; border-radius: var(--radius-xl); box-shadow: var(--shadow-md); padding: 2.5rem; }
.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-header h1 { font-size: 1.5rem; font-weight: 700; color: var(--text-dark); margin-bottom: 0.25rem; }
.auth-header p { color: var(--text-light); font-size: 0.9rem; }
.auth-divider { display: flex; align-items: center; gap: 0.75rem; margin: 1.5rem 0; color: var(--text-muted); font-size: 0.85rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border-light); }

/* Flip directional arrows in RTL so "forward" points left */
[dir="rtl"] .icon-flip { transform: scaleX(-1); }

/* ══════════════════════════════════════════════════════════════════
   MOBILE DRAWER & COMPACT HEADER SYSTEM
   ══════════════════════════════════════════════════════════════════ */

/* ── Mobile-only elements (hidden on desktop) ── */
.mob-hamburger, .mob-search-toggle, .mob-search-bar,
.mob-drawer-overlay, .mob-drawer { display: none; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .content-layout { grid-template-columns: 1fr; }
    .sidebar { order: 2; display: grid; grid-template-columns: repeat(2, 1fr); }
    .hero-search .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .card-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    /* ── Hide desktop-only elements ── */
    .top-bar { display: none !important; }
    .main-nav { display: none !important; }
    .header-search { display: none !important; }
    .header-logo div { display: none !important; }
    .header-actions .header-icon-link { display: none !important; }
    .header-actions .header-profile-link { display: none !important; }

    /* ── Sticky BLUE compact header ── */
    .main-header {
        position: sticky !important; top: 0; z-index: 90;
        padding: 0 !important;
        background: linear-gradient(135deg, #003580 0%, #004fa8 100%) !important;
        box-shadow: 0 2px 16px rgba(0,53,128,0.3) !important;
    }
    .main-header .container {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 0.5rem !important;
        align-items: center !important;
        justify-content: flex-start !important;
        padding: 0.5rem 1rem !important;
        min-height: 56px;
    }

    /* ── Hamburger (white lines on blue) ── */
    .mob-hamburger {
        display: flex !important; flex-direction: column; justify-content: center;
        align-items: center; gap: 5px;
        background: none; border: none; cursor: pointer;
        width: 42px; height: 42px; flex-shrink: 0;
        padding: 8px; order: 1;
        border-radius: var(--radius-sm);
        transition: background 0.2s;
    }
    .mob-hamburger:hover { background: rgba(255,255,255,0.15); }
    .mob-hamburger span {
        display: block; width: 22px; height: 2px;
        background: white !important; border-radius: 2px;
        transition: all 0.3s ease;
    }

    /* ── Logo (icon only, white on blue) ── */
    .header-logo {
        flex-shrink: 0; order: 2;
        margin-inline-start: 0 !important;
    }
    .logo-desktop { display: none !important; }
    .logo-mobile {
        display: block !important;
        width: 38px !important; height: 38px !important;
        border-radius: var(--radius-sm);
    }

    /* ── Spacer pushes icons to the end ── */
    .mob-search-toggle { order: 3; margin-inline-start: auto !important; }

    /* ── Mobile search toggle icon (white) ── */
    .mob-search-toggle {
        display: flex !important; align-items: center; justify-content: center;
        background: none; border: none; cursor: pointer;
        width: 42px; height: 42px; flex-shrink: 0;
        color: white !important; font-size: 1.15rem;
        border-radius: var(--radius-sm);
        transition: background 0.2s;
    }
    .mob-search-toggle:hover { background: rgba(255,255,255,0.15); color: white; }

    /* ── Post Ad button (white pill on blue) ── */
    .header-actions { margin-inline-start: 0; gap: 0 !important; order: 4; }
    .header-actions .btn-post {
        padding: 0.45rem 1rem; font-size: 0.8rem; border-radius: var(--radius-full);
        white-space: nowrap;
        background: white !important;
        color: var(--primary) !important;
        font-weight: 700;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    }
    .header-actions .btn-post:hover {
        background: #f0f4ff !important;
    }
    .header-actions .btn-post span { display: none; }
    .header-actions .btn-post i { margin: 0; }

    /* ── Expandable mobile search bar ── */
    .mob-search-bar {
        display: none; /* toggled by JS */
        background: white;
        border-top: 1px solid var(--border-light);
        padding: 0.5rem 0;
        animation: slideDown 0.25s ease;
    }
    .mob-search-bar.open { display: block; }
    .mob-search-bar form {
        display: flex; gap: 0;
    }
    .mob-search-bar input {
        flex: 1; padding: 0.6rem 1rem;
        border: 1px solid var(--border-medium);
        border-radius: 0 var(--radius-md) var(--radius-md) 0;
        font-size: 0.9rem; outline: none;
    }
    [dir="rtl"] .mob-search-bar input {
        border-radius: var(--radius-md) 0 0 var(--radius-md);
    }
    .mob-search-bar button {
        padding: 0 1rem; background: var(--primary); color: white;
        border: none; border-radius: var(--radius-md) 0 0 var(--radius-md);
        font-size: 1rem;
    }
    [dir="rtl"] .mob-search-bar button {
        border-radius: 0 var(--radius-md) var(--radius-md) 0;
    }

    @keyframes slideDown {
        from { opacity: 0; transform: translateY(-8px); }
        to { opacity: 1; transform: translateY(0); }
    }

    /* ═══ MOBILE DRAWER ═══ */
    .mob-drawer-overlay {
        display: block;
        position: fixed; inset: 0;
        background: rgba(0,0,0,0.5);
        backdrop-filter: blur(3px);
        z-index: 998;
        opacity: 0; visibility: hidden;
        transition: all 0.35s ease;
    }
    .mob-drawer-overlay.open {
        opacity: 1; visibility: visible;
    }

    .mob-drawer {
        display: flex; flex-direction: column;
        position: fixed; top: 0;
        inset-inline-end: 0;
        width: 300px; max-width: 85vw;
        height: 100vh; height: 100dvh;
        background: white;
        z-index: 999;
        overflow-y: auto;
        transform: translateX(100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -8px 0 30px rgba(0,0,0,0.15);
    }
    [dir="rtl"] .mob-drawer {
        transform: translateX(-100%);
    }
    .mob-drawer.open {
        transform: translateX(0) !important;
    }

    /* ── Drawer header ── */
    .mob-drawer-header {
        display: flex; align-items: center; justify-content: space-between;
        padding: 1rem 1.25rem;
        background: linear-gradient(135deg, #003580, #004fa8);
        color: white;
    }
    .mob-drawer-brand {
        display: flex; align-items: center; gap: 0.75rem; color: white;
    }
    .mob-drawer-brand img {
        width: 40px; height: 40px; border-radius: var(--radius-sm);
    }
    .mob-drawer-brand strong { font-size: 1.1rem; display: block; }
    .mob-drawer-brand small { font-size: 0.7rem; opacity: 0.8; display: block; }
    .mob-drawer-close {
        background: rgba(255,255,255,0.15); border: none; color: white;
        width: 36px; height: 36px; border-radius: 50%;
        display: flex; align-items: center; justify-content: center;
        font-size: 1rem; cursor: pointer;
        transition: background 0.2s;
    }
    .mob-drawer-close:hover { background: rgba(255,255,255,0.3); }

    /* ── Drawer user section ── */
    .mob-drawer-user {
        display: flex; align-items: center; gap: 0.75rem;
        padding: 1rem 1.25rem;
        background: #f8fafc;
        border-bottom: 1px solid var(--border-light);
    }
    .mob-drawer-avatar {
        width: 44px; height: 44px; border-radius: 50%;
        background: linear-gradient(135deg, #dbeafe, #bfdbfe);
        display: flex; align-items: center; justify-content: center;
        color: var(--primary); font-size: 1.1rem; flex-shrink: 0;
    }
    .mob-drawer-user-info strong { display: block; font-size: 0.95rem; color: var(--text-dark); }
    .mob-drawer-user-info a { font-size: 0.8rem; color: var(--accent); }
    .mob-drawer-login-btn { margin-inline-end: 0.5rem; }

    /* ── Drawer navigation ── */
    .mob-drawer-nav {
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--border-light);
    }
    .mob-drawer-nav a {
        display: flex; align-items: center; gap: 0.75rem;
        padding: 0.85rem 1.25rem;
        color: var(--text-dark); font-size: 0.95rem; font-weight: 500;
        transition: all 0.2s;
    }
    .mob-drawer-nav a:hover {
        background: #eff6ff; color: var(--primary);
    }
    .mob-drawer-nav a i {
        width: 20px; text-align: center; color: var(--primary); font-size: 0.95rem;
    }

    /* ── Drawer sections (categories, countries) ── */
    .mob-drawer-section {
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--border-light);
    }
    .mob-drawer-section-title {
        padding: 0.5rem 1.25rem;
        font-size: 0.75rem; font-weight: 700;
        color: var(--text-muted); text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    .mob-drawer-cat {
        display: flex; align-items: center; gap: 0.75rem;
        padding: 0.65rem 1.25rem 0.65rem 1.75rem;
        color: var(--text-medium); font-size: 0.9rem;
        transition: all 0.2s;
    }
    .mob-drawer-cat:hover { background: #eff6ff; color: var(--primary); }
    .mob-drawer-cat i { width: 18px; text-align: center; color: var(--accent); font-size: 0.85rem; }

    /* ── Drawer footer ── */
    .mob-drawer-footer {
        padding: 1rem 1.25rem;
        margin-top: auto;
        background: #f8fafc;
        border-top: 1px solid var(--border-light);
    }
    .mob-drawer-contact {
        display: flex; flex-direction: column; gap: 0.35rem;
        font-size: 0.8rem; color: var(--text-light);
        margin-bottom: 0.75rem;
    }
    .mob-drawer-contact i { margin-inline-end: 0.35rem; color: var(--accent); }
    .mob-drawer-social {
        display: flex; gap: 0.5rem; margin-bottom: 0.75rem;
    }
    .mob-drawer-social a {
        width: 34px; height: 34px; border-radius: 50%;
        background: var(--primary); color: white;
        display: flex; align-items: center; justify-content: center;
        font-size: 0.85rem; transition: all 0.2s;
    }
    .mob-drawer-social a:hover { background: var(--primary-hover); transform: scale(1.1); }
    .mob-drawer-lang {
        display: inline-flex; align-items: center; gap: 0.4rem;
        padding: 0.4rem 0.75rem; border-radius: var(--radius-full);
        background: #e0e7ff; color: var(--primary);
        font-size: 0.8rem; font-weight: 600;
        transition: background 0.2s;
    }
    .mob-drawer-lang:hover { background: #c7d2fe; }
    .mob-drawer-logout {
        display: inline-flex; align-items: center; gap: 0.4rem;
        padding: 0.4rem 0.75rem; border-radius: var(--radius-full);
        background: #fee2e2; color: var(--danger);
        font-size: 0.8rem; font-weight: 600;
        margin-inline-start: 0.5rem;
        transition: background 0.2s;
    }
    .mob-drawer-logout:hover { background: #fecaca; }

    /* ── Other responsive layout fixes ── */
    .hero { padding: 3rem 0 2.5rem; }
    .hero-badge { font-size: 0.75rem; padding: 0.4rem 1rem; }
    .hero-shapes { display: none; }
    .hero-search .grid-4 { grid-template-columns: 1fr; }
    .stats-bar { flex-wrap: wrap; padding: 1rem; gap: 0.5rem; }
    .stat-item { flex: 0 0 calc(50% - 0.5rem); }
    .stat-divider { display: none; }
    .stat-icon { width: 36px; height: 36px; }
    .stat-icon i { font-size: 0.85rem; }
    .stat-value { font-size: 1.3rem; }
    .card-grid, .card-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .sidebar { grid-template-columns: 1fr; }
    .category-grid { grid-template-columns: repeat(3, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .card-grid, .card-grid-4 { grid-template-columns: 1fr; }
    .category-grid { grid-template-columns: repeat(2, 1fr); }
    .share-grid { grid-template-columns: repeat(2, 1fr); }
    .mob-drawer { width: 280px; }
}
