/* assets/css/style.css */

:root {
    --haraj-blue: #0066cc;
    --haraj-bg: #f6f6f6;
}

body {
    font-family: 'Cairo', sans-serif;
    background: var(--haraj-bg);
    margin: 0;
}

/* TOP BAR */
.top-bar {
    background: var(--haraj-blue);
    color: #fff;
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.top-bar a {
    color: #fff;
    text-decoration: none;
    font-size: 20px;
    font-weight: 900;
}

.top-icons {
    display: flex !important; 
    align-items: center;
    gap: 18px; 
}

.top-icons .icon-link {
    font-size: 22px; 
    padding: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, opacity 0.2s;
}

.top-icons .icon-link:active {
    transform: scale(0.9); 
}

/* HEADER & LOGO */
.logo-text {
    font-size: 24px; 
    font-weight: 900;
    color: #fff !important;
    text-decoration: none;
}
@media (min-width: 576px) {
    .logo-text { font-size: 30px; }
}

.search-wrapper {
    background: #f2f2f2;
    border-radius: 10px;
    display: flex;
    align-items: center;
    padding: 0 15px;
}

.search-wrapper input {
    border: none;
    background: transparent;
    padding: 12px;
    width: 100%;
    outline: none;
}

.btn-add-ad {
    background: #ffbc34;
    color: #000 !important;
    font-weight: 700;
    border-radius: 10px;
    padding: 8px 16px;
    text-decoration: none;
    font-size: 14px;
}
@media (min-width: 576px) {
    .btn-add-ad { padding: 10px 25px; font-size: 16px; }
}

.user-avatar-header {
    width: 38px; 
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* DROPDOWN MENU */
.custom-dropdown-menu {
    border-radius: 12px !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15) !important;
    border: 1px solid #e1e8ed !important;
    padding: 8px 0 !important;
    min-width: 180px !important;
}

.custom-dropdown-menu .dropdown-item {
    font-size: 15px !important;       
    font-weight: 700 !important;      
    color: #333333 !important;        
    padding: 10px 16px !important;    
    text-align: right !important;
    display: flex !important;
    align-items: center;
    gap: 10px;                                                                                                                                                                                                                                
    transition: background 0.2s, color 0.2s;
}

.custom-dropdown-menu .dropdown-item:hover {
    background-color: #f0f7ff !important;
    color: var(--haraj-blue) !important;
}

.custom-dropdown-menu .dropdown-item.text-danger-custom {
    color: #e74c3c !important;
}
.custom-dropdown-menu .dropdown-item.text-danger-custom:hover {
    background-color: #fdf2f2 !important;
    color: #c0392b !important;
}
   .btn-follow-cat {
        font-size: 11px;
        padding: 2px 10px;
        border-radius: 12px;
        font-weight: bold;
        transition: all 0.2s ease-in-out;
    }
    .cat-item-wrapper {
        position: relative;
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        margin-bottom: 5px;
    }
    .cat-follow-inline-btn {
        font-size: 9px;
        padding: 1px 6px;
        border-radius: 8px;
        margin-top: 4px;
        cursor: pointer;
        border: 1px solid #0d6efd;
        background: transparent;
        color: #0d6efd;
    }
    .cat-follow-inline-btn.is-following {
        background: #28a745;
        color: #fff;
        border-color: #28a745;
    }
/* CATEGORIES ROW */
.sub-cats-area {
    background: #fff;
    border-bottom: 1px solid #eee;
}

.cats-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 12px 15px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.cats-row::-webkit-scrollbar {
    display: none;
}

.cat-item {
    background: #f0f2f5;
    color: #555;
    padding: 8px 20px;
    border-radius: 25px;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid #ddd;
    transition: 0.2s;
    text-decoration: none; /* تم إضافة هذا السطر لإزالة الخط تماماً */
}

.cat-item:hover {
    background: #e9eef5;
    color: #555; /* يضمن عدم تغير لون النص أو ظهور خط عند تمرير الماوس */
    text-decoration: none; /* يضمن عدم ظهور الخط عند الحوم (Hover) */
}

.cat-item.active {
    background: var(--haraj-blue);
    color: #fff;
    border-color: var(--haraj-blue);
    text-decoration: none; /* يضمن عدم ظهور الخط للقسم النشط */
}

/* ADS LIST & CARDS */
.ad-list-container { 
    background: white; 
    border-radius: 8px; 
    overflow: hidden; 
    box-shadow: 0 1px 2px rgba(0,0,0,0.05); 
}
.ad-row {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    text-decoration: none;
    color: inherit;
    padding: 3px;
    border-bottom: 1px solid #f1f1f1;
}
.ad-row:hover { background: #f9f9f9; }

.ad-img-box {
    width: 100px;
    height: 100px;
    min-width: 100px;
    max-width: 100px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e0e0e0;
    background-color: #f8f9fa;
}
.placeholder-img-box {
    background-color: #eaeaea;
}
.placeholder-img-box i {
    font-size: 24px;
    color: #a0a0a0;
}

/* ستايل لتصغير حجم العملة مقارنة بالسعر */
.ad-currency-style {
    font-size: 11px;
    font-weight: normal;
    opacity: 0.85;
}
@media(min-width: 576px) {
    .ad-list-container { border-radius: 12px; }
    .ad-img-box { width: 120px; height: 120px; min-width: 120px; margin-left: 18px; border-radius: 12px; }
}
.ad-img-box img { width: 100%; height: 100%; object-fit: cover; }

.ad-info-box { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; 
}

.ad-item-title { 
    font-size: 14px; 
    font-weight: 700; 
    color: #0066cc; 
    margin-bottom: 4px; 
    line-height: 1.3; 
    display: -webkit-box; 
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical; 
    overflow: hidden; 
}
@media(min-width: 576px) {
    .ad-item-title { font-size: 18px; margin-bottom: 8px; }
}

.ad-item-meta { 
    display: flex; 
    align-items: center; 
    flex-wrap: wrap; 
    gap: 8px; 
    font-size: 11px; 
    color: #888; 
}
@media(min-width: 576px) {
    .ad-item-meta { gap: 15px; font-size: 13px; }
}
.ad-item-meta i { font-size: 11px; }
@media(min-width: 576px) {
    .ad-item-meta i { font-size: 12px; }
}

.ad-meta-link {
    color: #666;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s;
}
.ad-meta-link:hover {
    color: #0066cc;
    text-decoration: underline;
}

.ad-item-price { 
    font-size: 14px; 
    font-weight: 800; 
    color: #2ecc71; 
    text-align: left; 
    margin-top: 3px; 
}
@media(min-width: 576px) {
    .ad-item-price { font-size: 16px; margin-top: 0; }
}

/* LAYOUT & SIDEBAR */
.main-content-layout { margin: 10px auto; }
@media (min-width: 992px) {
    .main-content-layout { margin: 25px auto; }
}

.sidebar-wrapper {
    position: sticky;
    top: 80px; 
}

.sidebar-card-box {
    background: white;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 15px;
    border: 1px solid #eee;
}

.sidebar-card-title {
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 12px;
    color: #333;
    border-right: 3px solid var(--haraj-blue);
    padding-right: 8px;
}

#loader { padding: 40px; }

@media (max-width: 576px) {
    .container { padding-left: 6px; padding-right: 6px; }
}

/* USER PROFILE PAGE STYLES */
.user-profile-header {
    background: white;
    border-radius: 12px;
    border: 1px solid #eee;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.profile-avatar {
    width: 65px;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* ==========================================
   تنسيقات صفحة تفاصيل الإعلان (مضافة حديثاً)
   ========================================== */

/* تنسيقات عامة ومتجاوبة */
.main-wrapper { margin-top: 15px; padding-bottom: 90px; }
.content-card { background: white; border-radius: 12px; padding: 15px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); margin-bottom: 15px; }

/* العناوين والخطوط */
.ad-title-detail { font-size: 20px; font-weight: 800; color: #333; margin-bottom: 15px; line-height: 1.4; }

/* بيانات المعلن */
.user-row { display: flex; align-items: center; gap: 10px; }
.user-img { width: 45px; height: 45px; border-radius: 50%; object-fit: cover; border: 1px solid #eee; }
.user-name { font-weight: 700; font-size: 15px; flex-grow: 1; }
.btn-follow { color: var(--haraj-blue); font-weight: 700; text-decoration: none; font-size: 13px; border: 1px solid var(--haraj-blue); padding: 3px 12px; border-radius: 20px; }

/* تفاصيل الموقع والوقت أسفل اسم المستخدم */
.meta-row { margin-right: 55px; font-size: 12px; color: #757575; margin-top: -5px; margin-bottom: 15px; }

/* سطر الوصف والسعر */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; border-bottom: 1px solid #f0f0f0; padding-bottom: 8px; }
.section-header .fs-5 { font-size: 16px !important; }
.price-text { color: #2E7D32; font-weight: 800; font-size: 20px; }
.ad-desc { font-size: 15px; color: #444; line-height: 1.7; margin-top: 15px; white-space: pre-wrap; }

/* الصور */
.image-stack img { width: 100%; border-radius: 10px; margin-bottom: 10px; border: 1px solid #f0f0f0; }

/* العمود الجانبي */
.sidebar-card { background: white; border-radius: 12px; padding: 15px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); position: sticky; top: 150px; }
.sidebar-title { font-weight: 800; font-size: 15px; margin-bottom: 15px; display: block; border-right: 4px solid var(--haraj-blue); padding-right: 8px; }

.btn-call { background: var(--haraj-blue); color: white !important; border-radius: 10px; padding: 10px; font-weight: 700; text-align: center; text-decoration: none; display: block; margin-bottom: 10px; width: 100%; font-size: 15px; }
.btn-wa { background: white; color: #25D366 !important; border: 2px solid #25D366; border-radius: 10px; padding: 9px; font-weight: 700; text-align: center; text-decoration: none; display: block; width: 100%; font-size: 15px; }

/* التعليقات الشجرية والردود الفرعية */
.comment-container { margin-bottom: 15px; }
.comment-box { border-bottom: 1px solid #f5f5f5; padding: 12px 0; display: flex; gap: 10px; }
.comment-avatar { width: 35px; height: 35px; border-radius: 50%; background: #eee; object-fit: cover; }
.reply-box { margin-right: 45px; border-right: 2px solid #ddd; padding-right: 15px; background: #fafafa; border-radius: 0 8px 8px 0; }

.btn-reply-link { background: none; border: none; color: #757575; font-size: 12px; font-weight: bold; padding: 0; margin-top: 5px; cursor: pointer; }
.btn-reply-link:hover { color: var(--haraj-blue); text-decoration: underline; }

/* الشاشات الكبيرة المتجاوبة */
@media (min-width: 768px) {
    .content-card, .sidebar-card { padding: 25px; }
    .ad-title-detail { font-size: 24px; }
    .price-text { font-size: 24px; }
    .section-header .fs-5 { font-size: 1.25rem !important; }
    .user-img { width: 55px; height: 55px; }
    .meta-row { margin-right: 67px; font-size: 13px; }
}

/* شريط الجوال السفلي تبعا لتجاوب الشاشة */
@media (max-width: 991px) {
    .sidebar-col { display: none; }
    .bottom-nav-mobile { position: fixed; bottom: 0; left: 0; right: 0; background: white; padding: 10px; display: flex; gap: 10px; box-shadow: 0 -4px 15px rgba(0,0,0,0.08); z-index: 1001; }
    .bottom-nav-mobile .btn-call, .bottom-nav-mobile .btn-wa { flex: 1; margin: 0; padding: 12px 5px; font-size: 14px; }
}
@media (min-width: 992px) {
    .bottom-nav-mobile { display: none; }
}