@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&display=swap');

*{
    box-sizing:border-box;
}

html,body{
    margin:0;
    padding:0;
    font-family:'Tajawal',Tahoma,Arial,sans-serif;
    background:#f7f8fc;
    color:#222;
}

body,
button,
input,
select,
textarea{
    font-family:'Tajawal',Tahoma,Arial,sans-serif;
}

body{
    direction:rtl;
}

a{
    text-decoration:none;
    color:inherit;
}

.container{
    width:min(1100px,calc(100% - 32px));
    margin:0 auto;
}

/* header */
.site-header{
    background:#fff;
    border-bottom:1px solid #e9e9ee;
    position:relative;
    top:auto;
    z-index:100;
    padding:10px 0;
}

.header-wrap{
    min-height:72px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
    position:relative;
}

.mobile-header-row{
    display:none;
}

.logo{
    display:inline-flex;
    align-items:center;
    justify-content:flex-start;
    max-width:100px;
    width:100%;
    font-size:22px;
    font-weight:700;
    color:#1d3557;
    white-space:nowrap;
}

.logo img{
    display:block;
    max-width:250px;
    width:100%;
    height:auto;
}

.site-nav{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:12px;
}

.site-nav a,
.site-nav-link{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:10px 14px;
    border-radius:10px;
    color:#333;
    transition:.2s ease;
    font-weight:500;
}

.site-nav a:hover,
.site-nav-link:hover{
    background:#eef2ff;
    color:#1d3557;
}

.desktop-nav{
    display:block;
}

.mobile-menu-toggle{
    display:none;
    align-items:center;
    justify-content:center;
    width:42px;
    height:42px;
    border:0;
    border-radius:12px;
    background:#fff;
    color:#87cefa;
    font-size:30px !important;
    line-height:1;
    cursor:pointer;
    padding:0;
}

.mobile-menu-dropdown{
    display:none;
}

/* layout */
.site-main{
    min-height:calc(100vh - 140px);
}

.section{
    padding:50px 0;
}

.page-title,
.section-title{
    margin:0 0 12px;
    font-size:28px;
    color:#1d3557;
    text-align:center !important;
}

.page-desc{
    margin:0 0 24px;
    color:#666;
    line-height:1.8;
    text-align:center !important;
}

.section-head{
    margin-bottom:20px;
}

.site-footer{
    background:#fff;
    border-top:1px solid #e9e9ee;
    padding:22px 0;
    text-align:center;
    color:#666;
}

/* buttons */
.btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:30px;
    padding:5px 5px;
    background:#1d3f6e;
    color:#fff;
    font-weight:500;
    transition:.2s ease;
    border:1px solid transparent;
}

.btn:hover{
    transform:translateY(-2px);
}

.btn-light{
    background:#fff;
    color:#1d3f6e;
    border-color:#dce4f2;
}

/* common cards */
.cards-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:18px;
}

.card{
    background:#fff;
    border:1px solid #e7edf7;
    border-radius:22px;
    padding:22px;
    box-shadow:0 8px 24px rgba(0,0,0,.04);
    transition:.2s ease;
}

.card:hover{
    transform:translateY(-4px);
}

/* hero */
.home-hero{
    padding:64px 0;
    background:linear-gradient(135deg,#eef4ff,#f8faff);
}

.home-hero-content-centered{
    text-align:center;
    max-width:820px;
    margin:0 auto;
}

.home-hero-content-centered h1{
    margin:0 0 16px;
    font-size:48px;
    line-height:1.35;
    color:#1d3557;
}

.home-hero-content-centered p{
    margin:0 auto 24px;
    max-width:760px;
    color:#5f6b7a;
    font-size:20px;
    line-height:1.9;
}

.hero-actions{
    display:flex;
    justify-content:center;
    flex-wrap:wrap;
    gap:12px;
}

/* image cards */
.home-image-cards-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:18px;
}

.home-image-card{
    display:block;
    background:#fff;
    border:1px solid #e7edf7;
    border-radius:22px;
    padding:18px;
    box-shadow:0 8px 24px rgba(0,0,0,.04);
    text-align:center;
    transition:.2s ease;
}

.home-image-card:hover{
    transform:translateY(-4px);
}

.home-image-card-thumb{
    width:100%;
    height:190px;
    margin:0 0 16px;
    border-radius:18px;
    overflow:hidden;
    background:#eef3fb;
    display:block;
}

.home-image-card-thumb img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
}

.home-image-card h3{
    margin:0;
    color:#1d3557;
    font-size:20px;
}

/* latest sections */
.home-latest-group{
    margin-bottom:30px;
}

.home-latest-group:last-child{
    margin-bottom:0;
}

.home-cards-grid,
.home-features-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:18px;
}

/* latest profile cards */
.home-latest-cards-grid{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:18px;
    align-items:stretch;
}

.home-latest-card{
    background:#fff;
    border:1px solid #e7edf7;
    border-radius:22px;
    padding:18px;
    box-shadow:0 8px 24px rgba(0,0,0,.04);
    display:flex;
    flex-direction:column;
    height:100%;
}

.home-latest-card-top{
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:14px;
    flex:1;
}

.home-latest-card-image{
    width:92px;
    height:92px;
    border-radius:18px;
    overflow:hidden;
    background:#eef3fb;
    border:1px solid #e7edf7;
    display:flex;
    align-items:center;
    justify-content:center;
}

.home-latest-card-image img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
}

.home-latest-card-placeholder{
    font-size:34px;
}

.home-latest-card-body{
    min-width:0;
    text-align:center;
    display:flex;
    flex-direction:column;
    flex:1;
}

.home-latest-card-body h3{
    margin:0 0 10px;
    color:#1d3557;
    font-size:16px;
    line-height:1.5;
}

.home-latest-card-body p{
    margin:0 0 12px;
    color:#667085;
    line-height:1.8;
}

.home-latest-card-meta{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    justify-content:center;
}

.home-latest-card-meta span{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:7px 12px;
    border-radius:999px;
    background:#f3f6fb;
    color:#667085;
    font-size:13px;
}

.home-latest-card-actions{
    margin-top:auto;
    display:flex;
    justify-content:center;
    padding-top:14px;
}

.home-latest-card-actions .btn{
    min-width:120px;
}

.home-empty-card{
    text-align:center;
}

.home-empty-card p{
    margin:0;
    color:#667085;
    line-height:1.8;
}

/* category & feature cards */
.home-category-card,
.feature-card{
    text-align:right;
}

.home-category-icon{
    width:54px;
    height:54px;
    border-radius:16px;
    background:#eef3fb;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:26px;
    margin:0 auto 14px;
}

.home-category-card h3,
.feature-card h3{
    margin:0 0 10px;
    color:#1d3557;
    font-size:22px;
}

.home-category-card p,
.feature-card p{
    margin:0;
    color:#667085;
    line-height:1.8;
}

.home-card-link{
    display:inline-block;
    margin-top:14px;
    color:#1d3f6e;
    font-weight:700;
}

.home-features-grid .feature-card{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    text-align:center;
}

/* CTA */
.home-cta-box{
    background:#1d3557;
    color:#fff;
    border-radius:24px;
    padding:32px 24px;
    text-align:center;
}

.home-cta-box h2{
    margin:0 0 12px;
    font-size:34px;
}

.home-cta-box p{
    margin:0 0 20px;
    color:rgba(255,255,255,.85);
    line-height:1.9;
}

.home-cta-box .btn{
    background:#fff;
    color:#1d3557;
}

.home-cta-box .btn-light{
    background:transparent;
    color:#fff;
    border:1px solid rgba(255,255,255,.25);
}

/* unified listing grid */
.listing-cards-grid{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:18px;
    align-items:stretch;
}

/* ===== featured listing final ===== */
.featured-listing-section{
    background:#e9f0ff;
    padding:60px 30px;
    margin:40px 0;
    border-radius:30px;
    overflow:hidden;
}

.featured-listing-section::after{
    content:"← اسحب لعرض المزيد";
    display:block;
    text-align:center;
    font-size:13px;
    color:#6b7a90;
    margin-top:14px;
}

.featured-listing-wrap{
    display:flex;
    gap:18px;
    overflow-x:auto;
    overflow-y:hidden;
    padding:6px 4px 12px;
    margin-top:20px;
    scroll-snap-type:x mandatory;
    -webkit-overflow-scrolling:touch;
    scroll-behavior:smooth;
    direction:ltr;
}

.featured-listing-wrap::-webkit-scrollbar{
    height:6px;
}

.featured-listing-wrap::-webkit-scrollbar-thumb{
    background:#cfd8f6;
    border-radius:999px;
}

.featured-listing-card{
    min-width:300px;
    max-width:300px;
    height:430px;
    flex:0 0 auto;
    scroll-snap-align:start;
    border:1px solid #cfe0ff;
    box-shadow:0 12px 28px rgba(29,63,110,.08);
    position:relative;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
    border-radius:22px;
    transition:.3s;
    direction:rtl;
}

.featured-listing-card:hover{
    transform:translateY(-6px) scale(1.02);
}

.featured-listing-card::before{
    content:"مميز";
    position:absolute;
    top:10px;
    left:10px;
    background:#1d3f6e;
    color:#fff;
    font-size:12px;
    padding:4px 10px;
    border-radius:999px;
    z-index:2;
}

.featured-listing-card .home-latest-card-top{
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:14px;
    flex:1;
}

.featured-listing-card .home-latest-card-body{
    display:flex;
    flex-direction:column;
    flex:1;
    text-align:center;
    width:100%;
}

.featured-listing-card .home-latest-card-body h3{
    min-height:58px;
    margin:0 0 10px;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    overflow:hidden;
}

.featured-listing-card .home-latest-card-body p{
    min-height:72px;
    margin:0 0 12px;
    display:-webkit-box;
    -webkit-line-clamp:3;
    -webkit-box-orient:vertical;
    overflow:hidden;
    line-height:1.8;
}

.featured-listing-card .home-latest-card-meta{
    min-height:64px;
    display:flex;
    flex-wrap:wrap;
    justify-content:center;
    gap:8px;
    align-content:flex-start;
}

.featured-listing-card .home-latest-card-actions{
    margin-top:auto;
    padding-top:14px;
    display:flex;
    justify-content:center;
}

/* tablet */
@media (max-width: 992px){
    .container{
        width:min(100%,calc(100% - 24px));
    }

    .section{
        padding:40px 0;
    }

    .page-title,
    .section-title{
        font-size:24px;
        text-align:center !important;
    }

    .cards-grid,
    .home-cards-grid,
    .home-features-grid{
        grid-template-columns:1fr;
    }

    .home-latest-cards-grid{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }

    .listing-cards-grid{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }

    .home-hero-content-centered h1{
        font-size:38px;
    }

    .home-hero-content-centered p{
        font-size:18px;
    }

    .featured-listing-section{
        padding:44px 22px;
    }

    .featured-listing-card{
        min-width:280px;
        max-width:280px;
        height:420px;
    }
}

/* mobile */
@media (max-width: 768px){
    .container{
        width:min(100%,calc(100% - 20px));
    }

    .site-header{
        position:relative !important;
    }

    .header-wrap{
        min-height:68px;
        display:flex !important;
        align-items:center !important;
        justify-content:space-between !important;
        flex-direction:row !important;
        gap:12px;
        padding:0 0;
    }

    .desktop-nav{
        display:none !important;
    }

    .logo{
        order:2;
        display:inline-flex;
        align-items:center;
        justify-content:flex-start;
        width:auto;
        max-width:180px;
        flex:0 0 auto;
    }

    .logo img{
        display:block;
        max-width:100px;
        width:auto;
        height:auto;
    }

    .mobile-header-row{
        order:1;
        display:flex !important;
        align-items:center !important;
        justify-content:flex-end !important;
        width:auto;
        flex:0 0 auto;
    }

    .mobile-menu-toggle{
        display:inline-flex;
        flex:0 0 42px;
    }

    .mobile-menu-dropdown{
        display:none;
        position:absolute;
        top:calc(100% + 10px);
        right:0;
        left:0;
        background:#fff;
        border:1px solid #87cefa;
        border-radius:18px;
        box-shadow:0 12px 30px rgba(0,0,0,.08);
        padding:10px;
        z-index:300;
    }

    .site-header.mobile-menu-open .mobile-menu-dropdown{
        display:block;
    }

    .mobile-menu-dropdown .site-nav{
        display:flex;
        flex-direction:column;
        align-items:stretch;
        gap:6px;
        width:100%;
    }

    .mobile-menu-dropdown .site-nav a,
    .mobile-menu-dropdown .site-nav-link{
        display:block;
        width:100%;
        text-align:right;
        padding:12px 14px;
        border-radius:12px;
    }

    .mobile-menu-dropdown .site-nav a:hover,
    .mobile-menu-dropdown .site-nav-link:hover{
        background:#f5f7fc;
        color:#1d3557;
    }

    .site-main{
        min-height:auto;
    }

    .section{
        padding:32px 0;
    }

    .page-title,
    .section-title{
        font-size:22px;
        line-height:1.5;
    }

    .page-desc{
        font-size:15px;
        margin-bottom:20px;
        text-align:center !important;
    }

    .site-footer{
        padding:18px 0;
        font-size:14px;
    }

    .btn{
        min-height:44px;
        padding:10px 16px;
        border-radius:12px;
        font-size:14px;
    }

    .card{
        padding:18px;
        border-radius:18px;
    }

    .home-hero{
        padding:42px 0;
    }

    .home-hero-content-centered h1{
        font-size:30px;
    }

    .home-hero-content-centered p{
        font-size:16px;
    }

    .home-image-cards-grid{
        grid-template-columns:1fr;
    }

    .home-image-card{
        padding:20px 16px;
    }

    .home-image-card-thumb{
        height:170px;
        border-radius:18px;
    }

    .home-image-card h3{
        font-size:20px;
    }

    .home-category-icon{
        width:48px;
        height:48px;
        font-size:22px;
        border-radius:14px;
    }

    .home-category-card h3,
    .feature-card h3{
        font-size:20px;
    }

    .home-latest-cards-grid{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }

    .home-latest-card{
        padding:16px;
        border-radius:18px;
    }

    .home-latest-card-top{
        gap:12px;
    }

    .home-latest-card-image{
        width:78px;
        height:78px;
        border-radius:16px;
    }

    .home-latest-card-placeholder{
        font-size:28px;
    }

    .home-latest-card-body h3{
        font-size:18px;
    }

    .home-latest-card-body p{
        font-size:14px;
    }

    .home-latest-card-meta span{
        font-size:12px;
        padding:6px 10px;
    }

    .home-latest-card-actions .btn{
        min-width:110px;
    }

    .home-cta-box{
        padding:24px 18px;
    }

    .home-cta-box h2{
        font-size:28px;
    }

    .featured-listing-section{
        padding:32px 16px;
        margin:28px 0;
        border-radius:22px;
    }

    .featured-listing-card{
        min-width:240px;
        max-width:240px;
        height:390px;
    }

    .featured-listing-card .home-latest-card-body h3{
        min-height:52px;
        font-size:17px;
    }

    .featured-listing-card .home-latest-card-body p{
        min-height:64px;
        font-size:14px;
    }

    .listing-cards-grid{
        grid-template-columns:repeat(2,minmax(0,1fr));
        gap:14px;
    }
}

@media (max-width: 560px){
    .listing-cards-grid{
        grid-template-columns:1fr;
    }
}

/* ===== admin layout ===== */
.admin-body{
    background:#f7f8fc;
    margin:0;
}

.admin-header{
    background:#fff;
    border-bottom:1px solid #e9e9ee;
    padding:14px 0;
    position:sticky;
    top:0;
    z-index:200;
}

.admin-header-wrap{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
}

.admin-logo{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:90px;
}

.admin-logo img{
    width:100%;
    height:auto;
    display:block;
}

.admin-nav{
    display:flex;
    align-items:center;
    flex-wrap:wrap;
    gap:12px;
}

.admin-nav a{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:10px 14px;
    border-radius:10px;
    color:#333;
    font-weight:600;
    transition:.2s ease;
}

.admin-nav a:hover{
    background:#eef2ff;
    color:#1d3557;
}

.admin-main{
    min-height:calc(100vh - 140px);
}

.admin-footer{
    background:#fff;
    border-top:1px solid #e9e9ee;
    padding:18px 0;
    text-align:center;
    color:#666;
}

.admin-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:18px;
    margin-top:24px;
}

.admin-stat{
    background:#fff;
    border:1px solid #e7edf7;
    border-radius:22px;
    padding:24px;
    box-shadow:0 8px 24px rgba(0,0,0,.04);
    text-align:center;
}

.admin-stat h3{
    margin:0 0 12px;
    color:#1d3557;
    font-size:20px;
}

.admin-stat p{
    margin:0;
    font-size:34px;
    font-weight:800;
    color:#1d3f6e;
}

@media (max-width: 992px){
    .admin-grid{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
}

@media (max-width: 768px){
    .admin-header-wrap{
        flex-direction:column;
        justify-content:center;
    }

    .admin-nav{
        justify-content:center;
    }

    .admin-nav a{
        padding:10px 12px;
        font-size:14px;
    }

    .admin-grid{
        grid-template-columns:1fr;
    }
}



body.admin-body {
    margin: 0;
    background: #f5f7fb;
    font-family: "Tajawal", Tahoma, Arial, sans-serif;
    color: #1f2d3d;
}

.admin-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

.admin-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.admin-page-title {
    margin: 0;
    font-size: 34px;
    font-weight: 800;
    color: #183153;
}

.admin-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.admin-toolbar-left,
.admin-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-search-form input[type="text"] {
    min-width: 260px;
    height: 42px;
    padding: 0 14px;
    border: 1px solid #d8e1ef;
    border-radius: 12px;
    background: #fff;
    font-size: 14px;
    outline: none;
}

.admin-search-form input[type="text"]:focus {
    border-color: #73a8e8;
    box-shadow: 0 0 0 3px rgba(115, 168, 232, 0.16);
}

.admin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    padding: 0 16px;
    border: 0;
    border-radius: 12px;
    background: #1d3f6e;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}

.admin-btn:hover {
    transform: translateY(-1px);
    background: #16345b;
}

.admin-btn-outline {
    background: #eef4fb;
    color: #1d3f6e;
}

.admin-btn-outline:hover {
    background: #dfeaf8;
}

.admin-card {
    background: #fff;
    border: 1px solid #e4ebf5;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(16, 42, 67, 0.06);
    overflow: hidden;
}

.admin-card-body {
    padding: 0;
}

.admin-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1100px;
}

.admin-table thead th {
    background: #f7f9fc;
    color: #183153;
    font-size: 14px;
    font-weight: 800;
    padding: 16px 14px;
    text-align: right;
    border-bottom: 1px solid #e8eef6;
    white-space: nowrap;
}

.admin-table tbody td {
    padding: 14px;
    font-size: 14px;
    color: #334155;
    border-bottom: 1px solid #eef2f7;
    vertical-align: middle;
    white-space: nowrap;
}

.admin-table tbody tr:nth-child(even) {
    background: #fcfdff;
}

.admin-table tbody tr:hover {
    background: #f5f9ff;
}

.admin-status {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: #e8f7ee;
    color: #177245;
}

.admin-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    height: 34px;
    padding: 0 12px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    transition: 0.2s ease;
}

.admin-action-edit {
    background: #e8f1fd;
    color: #1d4f91;
}

.admin-action-edit:hover {
    background: #d9e8fc;
}

.admin-action-delete {
    background: #fdecec;
    color: #b42318;
}

.admin-action-delete:hover {
    background: #fbdada;
}

.admin-id {
    color: #64748b;
    font-weight: 700;
}

@media (max-width: 768px) {
    .admin-page {
        padding: 16px;
    }

    .admin-page-title {
        font-size: 28px;
    }

    .admin-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-toolbar-left,
    .admin-toolbar-right,
    .admin-search-form {
        width: 100%;
    }

    .admin-search-form input[type="text"] {
        min-width: 0;
        width: 100%;
    }

    .admin-btn {
        width: 100%;
    }
}
html[dir="ltr"] body {
  direction: ltr;
}

html[dir="ltr"] .site-nav,
html[dir="ltr"] .header-wrap,
html[dir="ltr"] .home-latest-card-meta,
html[dir="ltr"] .listing-filter-actions,
html[dir="ltr"] .profile-card__actions,
html[dir="ltr"] .profile-top-menu {
  direction: ltr;
}

.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lang-link {
  min-width: 42px;
  text-align: center;
}

.lang-link.is-active {
  font-weight: 700;
  text-decoration: underline;
}
