/* ========= static\pages\css\base\layout.css - الهيكل العام والتخطيط ========= */

/* ----- خلفية الموقع ----- */
.video-bg,
.image-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}
.video-bg {
    display: none;
}
.image-bg {
    width: 120%;
    height: 120%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-image 0.3s ease;
}
.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 1, 12, 0.55);
    z-index: 1;
    pointer-events: none;
    transition: background 0.4s ease;
}
.hide { display: none; }
.show { display: block; }

/* ----- غلاف المحتوى العام ----- */
.ui-wrapper {
    position: relative;
    z-index: 20;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: auto;
}
/* العناصر التي تسمح بالتفاعل */
.navbar, .hero, .cards-section, .expanded-view, .btn-emp, .back-btn, .card, .footer,
.cities-bar, .city-btn, .budget-box, .class-buttons, .control-section,
.rent-sale-buttons, .rent-sale-btn, .realestate-categories-grid,
.realestate-items-grid, .expanded-sidebar, .expanded-main,
.filters-section, .filter-group, .filter-buttons, .additional-filters,
.checkbox-group, .property-detail-view {
    pointer-events: auto;
}

/* ----- شريط التنقل (navbar) ----- */
.navbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1.2rem;
    padding: 0.5rem 1.5rem;
    background: rgba(5, 1, 12, 0.94);
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: slideDown 1s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    min-height: 150px;
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
    position: sticky;
    top: 0;
    z-index: 1000;
}
.navbar-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.navbar-logo img {
    max-height: 120px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(212,175,55,0.3));
    transition: filter 0.4s ease;
}
.navbar-logo img:hover {
    transform: scale(1.02);
    filter: drop-shadow(0 0 12px rgba(212,175,55,0.6));
}
.logo h1 {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #f9ecc7, #d4af37, #f5e7b2, #b87c1a, #f9ecc7);
    background-size: 300% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: 2px;
    font-family: 'Cinzel', serif;
    text-shadow: 0 0 8px rgba(212,175,55,0.5);
    animation: goldShimmer 8s ease-in-out infinite;
}
.logo p {
    font-size: 0.7rem;
    letter-spacing: 2px;
    color: #d4af37;
    text-align: right;
    margin-top: -5px;
    text-shadow: 0 0 4px rgba(212,175,55,0.3);
}
.exchange-rate {
    font-family: 'Cinzel', serif;
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, #e8ffd0 0%, #a0e57e 25%, #4caf50 50%, #a0e57e 75%, #e8ffd0 100%);
    background-size: 300% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 20px rgba(76, 175, 80, 0.5);
    letter-spacing: 1px;
    direction: ltr;
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    white-space: nowrap;
    flex-shrink: 0;
    animation: goldShimmer 8s ease-in-out infinite;
}
.exchange-rate span:first-child {
    font-size: 1.5rem;
    font-family: 'Cairo', sans-serif;
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    color: #e9dba9;
    font-weight: 500;
    letter-spacing: 1px;
    text-shadow: 0 0 4px rgba(212,175,55,0.3);
}
.currency-select {
    background: rgba(0, 0, 0, 0.82);
    border: none;
    border-radius: 30px;
    color: #f5e7b2;
    padding: 6px 28px 6px 16px;
    font-size: 0.9rem;
    font-family: 'Cairo', sans-serif;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23d4af37' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
    background-repeat: no-repeat;
    background-position: left 12px center;
    background-size: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.currency-select:hover,
.currency-select:focus {
    background-color: rgba(212, 175, 55, 0.2);
    color: #fff0c0;
    box-shadow: 0 0 12px rgba(212,175,55,0.4);
}
.currency-select option {
    background: #0a0515;
    color: #e9e2c7;
}
.nav-links {
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
    margin: 0 auto;
}
.nav-links a {
    color: #e9e2c7;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: 0.3s;
    position: relative;
    white-space: nowrap;
}
.nav-links a:before {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -6px;
    right: 0;
    background: linear-gradient(90deg, #d4af37, #f5e7b2);
    transition: 0.3s;
}
.nav-links a:hover {
    color: #d4af37;
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
}
.nav-links a:hover:before {
    width: 100%;
}

/* ----- قسم الترحيب (Hero) ----- */
.hero {
    text-align: center;
    margin: 6vh 0 5vh;
    animation: fadeUp 1.2s ease-out;
}
.hero h2 {
    font-size: 4rem;
    font-weight: 800;
    font-family: 'Cinzel', serif;
    background: linear-gradient(135deg, #ffffff 0%, #e0e8ff 25%, #c0ccff 50%, #e0e8ff 75%, #ffffff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 10px rgba(200, 210, 255, 0.6), 0 0 2px rgba(255,255,255,0.8);
    letter-spacing: 6px;
    animation: silverShimmer 6s ease-in-out infinite;
}
.hero .sub {
    font-size: 1.2rem;
    letter-spacing: 2px;
    color: #e8e8e8;
    margin-top: 1rem;
    font-weight: 300;
    text-shadow: 0 0 8px rgba(255,255,255,0.3);
}
.hero::after {
    content: '';
    display: block;
    width: 120px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #3cb371, transparent);
    margin: 2rem auto 0;
    opacity: 0.9;
}

/* ----- أقسام البطاقات الرئيسية ----- */
.cards-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 3rem;
}
.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}
.cards-section::after {
    content: '';
    display: block;
    width: 150px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #3cb371, transparent);
    margin: 3rem auto 0;
    opacity: 0.8;
}

/* ----- العرض الموسع (Expanded View) ----- */
.expanded-view {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem 3rem;
    display: none;
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    opacity: 0;
    transform: translateY(20px);
}
.expanded-view.visible {
    opacity: 1;
    transform: translateY(0);
}
.expanded-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 0;
}
.back-btn {
    background: rgba(212, 175, 55, 0.2);
    border: 1px solid #d4af37;
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    color: #f5e7b2;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, transform 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.back-btn:hover {
    background: #d4af37;
    color: #0a0515;
    transform: scale(1.02) translateX(-4px);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.4);
}
.expanded-title-wrapper {
    text-align: center;
    margin: 1rem auto 1.5rem;
    background: rgba(0, 0, 0, 0.85) !important;
    border-radius: 48px;
    padding: 0.6rem 1.2rem;
    width: fit-content;
    max-width: 90%;
    transition: opacity 0.3s ease, transform 0.3s ease;
    border: 1px solid rgba(212, 175, 55, 0.5);
}
.expanded-title {
    display: inline-block;
    font-size: 2rem;
    font-family: 'Cinzel', serif;
    background: linear-gradient(135deg, #f9ecc7, #d4af37, #f5e7b2, #b87c1a, #f9ecc7);
    background-size: 300% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 8px rgba(212,175,55,0.5);
    letter-spacing: 2px;
    animation: goldShimmer 8s ease-in-out infinite;
}

/* ----- تخطيط الشريط الجانبي والمحتوى (مُلغى الشريط الجانبي) ----- */
.expanded-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    margin-top: 1rem;
    flex-direction: row;
}
.expanded-sidebar {
    display: none; /* مخفي تمامًا */
}
.expanded-main {
    flex: 1;
    min-width: 0;
    width: 100%;
}

/* ----- صندوق الميزانية داخل الشريط الجانبي (إن وُجد) ----- */
.sidebar-box {
    width: 100%;
    margin: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 1.2rem;
    gap: 1rem;
}
.sidebar-box .budget-input-group {
    width: 100%;
    flex-direction: column;
    gap: 0.8rem;
}
.sidebar-box .budget-input-group input {
    width: 100%;
}
.sidebar-box .budget-hint {
    border-right: none;
    padding-right: 0;
    text-align: center;
}

/* ----- تذييل الصفحة (Footer) ----- */
.footer {
    padding: 1.5rem 2rem;
    background: rgba(0, 0, 0, 0.82);
    margin-top: auto;  /* ← تمت الإضافة لإصلاح ارتفاع الفوتر */
    border-top: 1px solid rgba(212, 175, 55, 0.4);
}
.footer-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}
.footer-social {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    align-items: center;
    justify-content: center;
    min-width: 180px;
}
.social-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    align-items: center;
    justify-content: center;
}
.social-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: rgba(212, 175, 55, 0.08);
    padding: 0.35rem 0.8rem;
    border-radius: 40px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
}
.social-item:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: rgba(212, 175, 55, 0.5);
    transform: translateY(-2px);
}
.social-item i {
    font-size: 0.9rem;
    color: #d4af37;
}
.social-item .social-link {
    color: #d4af37;
    text-decoration: none;
    font-size: 0.8rem;
    transition: 0.2s;
}
.social-item .social-link:hover {
    color: #fff;
    text-decoration: underline;
}
.footer-center {
    text-align: center;
    flex: 1;
}
.footer-center p {
    font-size: 0.85rem;
    color: #e9e2c7;
    margin: 0;
}
.footer-center span {
    color: #d4af37;
}
.footer-sub {
    font-size: 0.7rem !important;
    margin-top: 6px !important;
    color: #c9b574 !important;
}
.footer-sub i {
    color: #d4af37;
    margin-left: 4px;
}
.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    align-items: center;
    justify-content: center;
    min-width: 180px;
}
.links-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    align-items: center;
    justify-content: center;
}
.footer-link-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(212, 175, 55, 0.08);
    padding: 0.35rem 0.8rem;
    border-radius: 40px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
}
.footer-link-item:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: rgba(212, 175, 55, 0.5);
    transform: translateY(-2px);
}
.footer-link-item i {
    font-size: 0.9rem;
    color: #d4af37;
}
.footer-link-item .footer-link {
    color: #d4af37;
    text-decoration: none;
    font-size: 0.8rem;
    transition: 0.2s;
}
.footer-link-item .footer-link:hover {
    color: #fff;
    text-decoration: underline;
}

/* ----- استجابة الجوال (Media Queries) ----- */
@media (max-width: 992px) {
    .navbar {
        gap: 0.8rem;
        padding: 0.5rem 1rem;
        min-height: 70px;
    }
    .navbar-logo img { max-height: 55px; }
    .logo h1 { font-size: 1.8rem; }
    .exchange-rate { font-size: 1.2rem; }
    .exchange-rate span:first-child { font-size: 0.9rem; }
    .nav-links a { font-size: 0.9rem; }
    .hero h2 { font-size: 3rem; letter-spacing: 4px; }
    .hero .sub { font-size: 1rem; }
    .cards-grid { gap: 1.5rem; }
    .expanded-title { font-size: 1.6rem; }
    .footer-social, .footer-links { min-width: 160px; }
    .social-item, .footer-link-item { padding: 0.3rem 0.7rem; }
    .social-item i, .footer-link-item i { font-size: 0.85rem; }
    .social-item .social-link, .footer-link-item .footer-link { font-size: 0.75rem; }
}

@media (max-width: 850px) {
    .expanded-layout {
        flex-direction: column;
    }
    .expanded-sidebar {
        width: 100%;
        order: 1;
    }
    .expanded-main {
        order: 2;
    }
    .footer-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    .footer-social { order: 2; width: 100%; }
    .footer-center { order: 1; width: 100%; }
    .footer-links { order: 3; width: 100%; }
    .social-row, .links-row { justify-content: center; }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.6rem;
        padding: 0.4rem 0.8rem;
        min-height: 60px;
    }
    .navbar-logo img { max-height: 45px; }
    .logo h1 { font-size: 1.4rem; }
    .logo p { font-size: 0.55rem; margin-top: -3px; }
    .exchange-rate { font-size: 1rem; gap: 6px; }
    .exchange-rate span:first-child { font-size: 0.8rem; }
    .currency-select { padding: 4px 22px 4px 12px; font-size: 0.8rem; }
    .nav-links { width: 100%; justify-content: center; gap: 0.8rem; margin-top: 0.3rem; }
    .nav-links a { font-size: 0.8rem; white-space: nowrap; }
    .hero { margin: 4vh 0 3vh; }
    .hero h2 { font-size: 2.2rem; letter-spacing: 3px; }
    .hero .sub { font-size: 0.9rem; letter-spacing: 1px; }
    .cards-section { padding: 1rem 1.5rem; }
    .cards-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
    .expanded-title { font-size: 1.3rem; }
    .expanded-title-wrapper { padding: 0.4rem 0.8rem; }
    .back-btn { padding: 0.4rem 1.2rem; font-size: 0.8rem; }
    .expanded-view { padding: 0 1rem 2rem; }
}

@media (max-width: 480px) {
    .navbar-logo img { max-height: 38px; }
    .logo h1 { font-size: 1.2rem; }
    .exchange-rate { font-size: 0.85rem; }
    .currency-select { font-size: 0.7rem; padding: 3px 18px 3px 10px; }
    .nav-links a { font-size: 0.7rem; }
    .hero h2 { font-size: 1.8rem; letter-spacing: 2px; }
    .hero .sub { font-size: 0.75rem; }
    .cards-grid { grid-template-columns: 1fr; }
    .expanded-title { font-size: 1.1rem; }
    .footer { padding: 1rem; }
    .social-item, .footer-link-item { padding: 0.25rem 0.6rem; }
    .social-item i, .footer-link-item i { font-size: 0.8rem; }
    .social-item .social-link, .footer-link-item .footer-link { font-size: 0.7rem; }
    .footer-center p { font-size: 0.7rem; }
    .footer-sub { font-size: 0.6rem !important; }
}

/* ========= توفير الطاقة (Power saver) =========
   تُضاف الفئتان على عنصر <html> من utils.js:
     • emp-scrolling : أثناء التمرير فقط (تزول بعد ~150ms من توقفه) ← يمنع تنافس الحركات الزخرفية
                       مع التمرير، وهو سبب الرجفة عند تمرير الواجهة الرئيسية.
     • emp-calm      : بعد ~30 ثانية بلا أي تفاعل ← تتوقف الحركات اللانهائية حتى يعود المستخدم.
   الحركات تُستأنف من حيث توقفت (لا قفزات)، ولا يتغير أي تصميم ثابت. */
html.emp-calm .logo h1,
html.emp-calm .exchange-rate,
html.emp-calm .hero h2,
html.emp-calm .expanded-title,
html.emp-calm .navbar-logo::before,
html.emp-calm .hero::before,
html.emp-calm .bg-overlay::after,
html.emp-calm .card::before,
html.emp-calm .card .btn-emp i,
html.emp-calm .btn-add-offer-green::after,
html.emp-calm .btn-profile-gold::after,
html.emp-calm .class-btn::after,
html.emp-calm .btn-detail::after,
html.emp-calm .m-seal::after,
html.emp-calm .m-seal .ms-ring,
html.emp-calm .country-btn .cb-flag::before,
html.emp-calm .featured-card::before,
html.emp-calm .featured-badge::before,
html.emp-calm .reputation-bg-mini,
html.emp-calm .reputation-bg-mini .shimmer-effect-mini,
html.emp-scrolling .logo h1,
html.emp-scrolling .exchange-rate,
html.emp-scrolling .hero h2,
html.emp-scrolling .expanded-title,
html.emp-scrolling .navbar-logo::before,
html.emp-scrolling .hero::before,
html.emp-scrolling .bg-overlay::after,
html.emp-scrolling .card::before,
html.emp-scrolling .card .btn-emp i,
html.emp-scrolling .btn-add-offer-green::after,
html.emp-scrolling .btn-profile-gold::after,
html.emp-scrolling .class-btn::after,
html.emp-scrolling .btn-detail::after,
html.emp-scrolling .m-seal::after,
html.emp-scrolling .m-seal .ms-ring,
html.emp-scrolling .country-btn .cb-flag::before,
html.emp-scrolling .featured-card::before,
html.emp-scrolling .featured-badge::before,
html.emp-scrolling .reputation-bg-mini,
html.emp-scrolling .reputation-bg-mini .shimmer-effect-mini {
    animation-play-state: paused !important;
}
