/* =====================================================================
   City2Day (المدينة اليوم) — ثيم الواجهة العامة
   الهوية: أزرق ملكي #1E3C96 + سماوي #1EA5F0 + تدرّج 135°
   نسخة مُحسّنة: حِرفية أعلى، ظلال أنعم، تباين ووصولية أفضل
   ===================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600;700;800&display=swap');

:root {
    --primary: #1E3C96;        /* أزرق ملكي */
    --primary-rgb: 30, 60, 150;
    --primary-dark: #0F1F5C;
    --primary-light: #1EA5F0;
    --accent: #1EA5F0;          /* سماوي */
    --accent-rgb: 30, 165, 240;
    --gradient: linear-gradient(135deg, #1E3C96 0%, #1EA5F0 100%);
    --gradient-dark: linear-gradient(160deg, #0F1F5C 0%, #1E3C96 100%);

    --ink: #16213D;
    --text: #28354a;
    --muted: #5D6B8A;
    --bg: #ffffff;
    --bg-alt: #F5F8FD;
    --tint: #EBF3FD;
    --border: #DCE6F5;
    --border-soft: #E9F0FA;
    --star: #F6A609;

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 26px;

    /* ظلال متعددة الطبقات — أنعم وأكثر واقعية */
    --shadow-sm: 0 1px 2px rgba(16,33,61,.04), 0 4px 14px rgba(30,60,150,.07);
    --shadow-md: 0 2px 6px rgba(16,33,61,.05), 0 16px 38px rgba(30,60,150,.12);
    --shadow-lg: 0 4px 10px rgba(16,33,61,.06), 0 28px 64px rgba(30,60,150,.18);
    --shadow-primary: 0 10px 24px rgba(var(--primary-rgb), .28);
    --shadow-accent: 0 10px 24px rgba(var(--accent-rgb), .30);
    --ease: cubic-bezier(.22,.61,.36,1);
}

html { scroll-behavior: smooth; }
body {
    font-family: 'Cairo','Montserrat',sans-serif; color: var(--text); background: var(--bg);
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
a { text-decoration: none; }
.container { max-width: 1240px; }
/* استغلال أوسع لعرض الصفحة على الشاشات الكبيرة (يطبّق على كل الصفحات) */
@media (min-width: 1200px) { .container { max-width: 1480px; } }
@media (min-width: 1600px) { .container { max-width: 1660px; } }
::selection { background: rgba(var(--accent-rgb), .22); color: var(--ink); }

/* وصولية: حلقة تركيز واضحة للكيبورد فقط */
a:focus-visible, button:focus-visible, .btn:focus-visible,
.form-control:focus-visible, .form-select:focus-visible {
    outline: 3px solid rgba(var(--accent-rgb), .45); outline-offset: 2px;
}
.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 .22rem rgba(var(--accent-rgb), .18);
}

/* ====== علامة City2Day (SVG داخلي) ====== */
.c2d-mark {
    display: inline-block; width: 1.6em; height: 1.6em; vertical-align: -.4em; margin-inline-end: 8px;
    background-repeat: no-repeat; background-position: center; background-size: contain;
    background-image: url('../img/logo-icon-color.png');
}
.c2d-brand { font-weight: 800; font-size: 1.45rem; color: var(--primary); display: inline-block; direction: ltr; letter-spacing: -.01em; }
.c2d-brand .two { color: var(--accent); }
.brand-img { height: 40px; width: auto; display: block; }
.site-nav .brand-img { height: 38px; }
.c2d-brand.on-dark { color: #fff; }
.c2d-brand.on-dark .two { color: var(--accent); }

/* ====== Navbar ====== */
.site-nav {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255,255,255,.85);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--border-soft);
}
.site-nav .brand { font-weight: 800; font-size: 1.45rem; color: var(--primary); display:inline-block; direction:ltr; }
.site-nav .brand .dot { color: var(--accent); }
.site-nav .nav-link-c { color: var(--ink); font-weight: 600; margin-inline: 10px; padding: 6px 4px; position: relative; transition: color .2s var(--ease); }
.site-nav .nav-link-c::after {
    content: ""; position: absolute; inset-inline: 4px; bottom: 0; height: 2px; border-radius: 2px;
    background: var(--gradient); transform: scaleX(0); transform-origin: center; transition: transform .25s var(--ease);
}
.site-nav .nav-link-c:hover { color: var(--primary); }
.site-nav .nav-link-c:hover::after { transform: scaleX(1); }
.btn-ghost { color: var(--ink); font-weight: 700; }
.btn-cta { background: var(--gradient); color: #fff; font-weight: 700; border: none; box-shadow: var(--shadow-primary); border-radius: var(--radius-md); transition: transform .2s var(--ease), filter .2s var(--ease), box-shadow .2s var(--ease); }
.btn-cta:hover { filter: brightness(1.05); color: #fff; transform: translateY(-2px); box-shadow: 0 16px 32px rgba(var(--primary-rgb), .34); }
.btn-cta:active { transform: translateY(0); }
.btn-primary { background: var(--primary) !important; border: none !important; border-radius: var(--radius-md); transition: background .2s var(--ease), transform .15s var(--ease); }
.btn-primary:hover { background: var(--primary-dark) !important; transform: translateY(-1px); }
.btn-outline-secondary { border-radius: var(--radius-md); }

/* مبدّل اللغة/العملة في الهيدر */
.pref-switch { gap: 8px; }
.pref-switch .pref-btn { font-size: .82rem; font-weight: 700; color: var(--ink); background: var(--tint); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; display: inline-flex; align-items: center; gap: 6px; transition: background .2s, color .2s; cursor: pointer; }
.pref-switch .pref-btn:hover { background: var(--primary); color: #fff; }
.pref-switch .dropdown-menu { min-width: 170px; border-radius: 12px; border-color: var(--border); box-shadow: var(--shadow-md); }
.pref-switch .dropdown-item.active, .pref-switch .dropdown-item:active { background: var(--primary); }
/* على الهيدر الداكن (صفحة النتائج) */
.hl-header .pref-switch .pref-btn { color: #eaf2ff; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); }
.hl-header .pref-switch .pref-btn:hover { background: #fff; color: var(--primary); }

/* قائمة حساب المستخدم في الشريط العلوي */
.acct { position: relative; display: inline-block; margin-inline-start: 6px; }
.acct-btn { font-size: .85rem; font-weight: 700; color: var(--ink); background: var(--tint); border: 1px solid var(--border); border-radius: 999px; padding: 5px 14px; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-family: inherit; transition: background .2s, color .2s; }
.acct-btn:hover { background: var(--primary); color: #fff; }
.acct-name { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hl-header .acct-btn { color: #eaf2ff; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); }
.hl-header .acct-btn:hover { background: #fff; color: var(--primary); }
.acct-menu { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-md); min-width: 210px; padding: 8px; display: none; z-index: 1000; }
.acct:hover .acct-menu, .acct:focus-within .acct-menu { display: block; }
.acct-menu a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; color: var(--ink); text-decoration: none; font-size: .9rem; font-weight: 600; white-space: nowrap; }
.acct-menu a:hover { background: var(--bg-alt); color: var(--primary); }
.acct-menu a.acct-logout { color: #c0392b; }
.acct-menu a.acct-logout:hover { background: #fdeeee; color: #c0392b; }
.acct-divider { height: 1px; background: var(--border); margin: 6px 4px; }

/* ====== Hero ====== */
.hero {
    position: relative; color: #fff; overflow: hidden;
    padding: clamp(64px, 9vw, 128px) 0 clamp(96px, 12vw, 160px);
    background:
        linear-gradient(135deg, rgba(15,31,92,.93) 0%, rgba(30,60,150,.82) 45%, rgba(30,165,240,.60) 100%),
        url('https://images.unsplash.com/photo-1571003123894-1f0594d2b5d9?auto=format&fit=crop&w=1920&q=70') center/cover no-repeat;
    background-color: var(--primary-dark);
}
.hero::after {
    content: ""; position: absolute; inset: 0; opacity: .35; mix-blend-mode: screen;
    background: radial-gradient(900px circle at 85% 0%, rgba(30,165,240,.6), transparent 60%);
}
/* تظليل سفلي خفيف لزيادة وضوح النص وكارت البحث */
.hero::before {
    content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 45%; z-index: 1;
    background: linear-gradient(to top, rgba(15,31,92,.55), transparent);
}
.hero > .container { position: relative; z-index: 2; }
.hero h1 { font-weight: 800; font-size: clamp(2.1rem, 5vw, 3.5rem); line-height: 1.14; letter-spacing: -.02em; text-shadow: 0 2px 18px rgba(0,0,0,.18); }
.hero p.lead { font-size: clamp(1.02rem, 2vw, 1.3rem); opacity: .94; max-width: 60ch; }
.hero .trust { gap: 14px 22px; opacity: .95; font-size: .9rem; }
.hero .trust span { display: inline-flex; align-items: center; gap: 7px; padding: 6px 14px; border-radius: 999px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(4px); }
.hero .trust i { color: #8fd6ff; }

/* ====== Search card ====== */
.search-card {
    background: rgba(255,255,255,.98); border: 1px solid rgba(255,255,255,.6);
    border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-lg); color: var(--text); margin-top: 30px;
}
.search-card .field { position: relative; }
.search-card .field i { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); z-index: 2; }
.search-card .field .form-control, .search-card .field .form-select { padding-inline-start: 40px; height: 54px; border-radius: var(--radius-md); border-color: var(--border); }
.search-card label { font-size: .8rem; color: var(--muted); font-weight: 700; margin-bottom: 5px; }
.btn-search { background: var(--gradient); color: #fff; font-weight: 800; height: 54px; border: none; border-radius: var(--radius-md); box-shadow: var(--shadow-primary); transition: transform .2s var(--ease), filter .2s var(--ease); }
.btn-search:hover { filter: brightness(1.06); color: #fff; transform: translateY(-2px); }
.btn-search:active { transform: translateY(0); }

/* ====== Sections ====== */
section.block { padding: clamp(48px, 7vw, 88px) 0; }
.section-title { font-weight: 800; color: var(--ink); font-size: clamp(1.55rem, 3.5vw, 2.15rem); letter-spacing: -.01em; }
.section-title::before {
    content: ""; display: block; width: 46px; height: 4px; border-radius: 4px; margin-bottom: 14px;
    background: var(--gradient);
}
.section-sub { color: var(--muted); font-size: 1.02rem; }

/* ====== Destination cards ====== */
.dest { position: relative; display: block; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); height: 230px; transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.dest:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.dest img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); background: #dde6f0; }
.dest:hover img { transform: scale(1.07); }
.dest .grad { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15,31,92,0) 35%, rgba(15,31,92,.72) 100%); }
.dest .cap { position: absolute; inset-inline: 18px; bottom: 16px; color: #fff; z-index: 2; }
.dest .cap .name { font-weight: 800; font-size: 1.28rem; text-shadow: 0 2px 12px rgba(0,0,0,.45); }
.dest .cap .meta { font-size: .82rem; opacity: .92; }
.dest.sm { height: 170px; }
.dest.sm .cap .name { font-size: 1.05rem; }

/* ====== Feature/trust ====== */
.feature { text-align: center; padding: 28px 22px; border-radius: var(--radius-lg); background: #fff; border: 1px solid var(--border-soft); box-shadow: var(--shadow-sm); height: 100%; transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.feature .ic { width: 66px; height: 66px; border-radius: var(--radius-lg); display: grid; place-items: center; margin: 0 auto 16px; background: var(--tint); color: var(--primary); font-size: 1.65rem; transition: transform .3s var(--ease); }
.feature:hover .ic { transform: scale(1.06) rotate(-3deg); }
.feature h5 { font-weight: 800; color: var(--ink); }
.feature p { color: var(--muted); font-size: .92rem; margin-bottom: 0; }

/* ====== Property types ====== */
.ptype { display: block; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.ptype:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.ptype img { width: 100%; height: 150px; object-fit: cover; background:#dde6f0; transition: transform .5s var(--ease); }
.ptype:hover img { transform: scale(1.05); }
.ptype .t { padding: 13px 15px; font-weight: 800; color: var(--ink); }

/* ====== App download CTA ====== */
.app-cta { background: var(--gradient); color: #fff; padding: clamp(44px, 6vw, 74px) 0; overflow: hidden; position: relative; }
.app-cta::after { content: ""; position: absolute; inset: 0; opacity: .25; mix-blend-mode: screen; background: radial-gradient(700px circle at 12% 120%, rgba(255,255,255,.5), transparent 55%); }
.app-cta .container { position: relative; z-index: 2; }
.app-cta h3 { font-weight: 800; font-size: clamp(1.4rem, 3vw, 2.1rem); letter-spacing: -.01em; }
.app-cta p { opacity: .92; }
.app-cta .phone-art { font-size: clamp(7rem, 16vw, 12rem); line-height: 1; color: rgba(255,255,255,.92); filter: drop-shadow(0 18px 30px rgba(0,0,0,.25)); }
.store-badge { display: inline-flex; align-items: center; gap: 10px; background: #0b1220; color: #fff !important; border-radius: 12px; padding: 9px 18px; min-width: 168px; border: 1px solid rgba(255,255,255,.12); transition: transform .2s var(--ease), background .2s; }
.store-badge:hover { background: #000; transform: translateY(-2px); }
.store-badge i { font-size: 1.9rem; }
.store-badge .s { font-size: .68rem; opacity: .85; line-height: 1.1; }
.store-badge .b { font-size: 1.05rem; font-weight: 800; line-height: 1.1; }

/* ====== Footer ====== */
.site-footer { background: var(--primary-dark); color: #aebfd0; padding: 56px 0 26px; }
.site-footer h6 { color: #fff; font-weight: 800; margin-bottom: 16px; position: relative; }
.site-footer a { color: #c6d6ec; transition: color .2s, padding-inline-start .2s; }
.site-footer a:hover { color: #fff; padding-inline-start: 3px; }
.site-footer .brand { color: #fff; font-weight: 800; font-size: 1.5rem; }
.site-footer .social a { width: 38px; height: 38px; border-radius: 10px; display: inline-grid; place-items: center; background: rgba(255,255,255,.08); color: #fff; font-size: 1.1rem; transition: background .2s, transform .2s; }
.site-footer .social a:hover { background: var(--accent); transform: translateY(-2px); }

/* ====== Reveal on scroll ====== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; transition: none; }
    .dest, .dest img, .ptype, .ptype img, .feature, .feature .ic, .btn-cta, .btn-search { transition: none; }
}

/* ====== تحسينات الجوال للهيدر العام (إضافي) ====== */
@media (max-width: 768px) {
    /* منع تكسّر الهيدر أفقيًا: عناصر أصغر + التفاف مرتب */
    .site-nav .container { flex-wrap: wrap; row-gap: 6px; }
    .site-nav .brand-img { height: 28px; }

    .pref-switch { gap: 5px; }
    .pref-switch .pref-btn { font-size: .72rem; padding: 4px 9px; }

    .site-nav .nav-link-c { margin-inline: 6px; font-size: .84rem; white-space: nowrap; }
    .site-nav .btn-cta,
    .site-nav .btn { padding: 5px 12px; font-size: .8rem; white-space: nowrap; }

    .acct .acct-btn { font-size: .8rem; padding: 5px 10px; }
    .acct .acct-name { max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
}

@media (max-width: 400px) {
    .site-nav .brand-img { height: 24px; }
    .pref-switch .pref-btn { font-size: .68rem; padding: 3px 7px; }
}
