/* ======================================== */
/* FEATURED ROW CARDS - Match Homepage      */
/* ======================================== */

.ad-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ad-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: #d1d5db;
}

.ad-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
    background-color: #f3f4f6;
}

.ad-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 10;
}

.featured-badge {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #78350f;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.featured-badge i {
    color: #78350f;
    font-size: 10px;
}

.new-badge {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.new-badge i {
    color: white;
    font-size: 10px;
}

.ad-details {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ad-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
    line-height: 1.4;
}

.ad-price {
    font-size: 16px;
    font-weight: 700;
    color: #2563eb;
    margin-bottom: 8px;
}

.ad-specs {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 6px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.ad-specs span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ad-specs i {
    width: 14px;
    color: #9ca3af;
}

.ad-time {
    font-size: 11px;
    color: #9ca3af;
    margin-bottom: 8px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.ad-time span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ======================================== */
/* LIST VIEW CARDS - Clean Vertical Layout  */
/* ======================================== */

.list-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.list-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: #d1d5db;
}

.list-image {
    height: 180px;
    background-size: cover;
    background-position: center;
    background-color: #f3f4f6;
}

.list-content {
    padding: 16px;
}

.list-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.list-price {
    font-size: 18px;
    font-weight: 700;
    color: #2563eb;
    margin-bottom: 8px;
}

.list-meta {
    font-size: 13px;
    color: #6b7280;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.list-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.list-meta i {
    width: 14px;
    color: #9ca3af;
}

.list-time {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 12px;
}

.list-time div {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: flex-end;
    margin-bottom: 2px;
}

/* ======================================== */
/* COMPACT LIST CARD - FOR NORMAL ADS       */
/* ======================================== */

.compact-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: all 0.2s ease;
    
}

.compact-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: #d1d5db;
}

.compact-image {
    height: 200px;
    width: 100%;
    background-size: cover;
    background-position: center;
    background-color: #f8f9fa;
}

.compact-content {
    padding: 20px;
}

.compact-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
    line-height: 1.4;
}

.compact-price {
    font-size: 22px;
    font-weight: 700;
    color: #2563eb;
    margin-bottom: 12px;
}

.compact-details {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.compact-details span {
    font-size: 14px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.compact-details i {
    width: 16px;
    color: #94a3b8;
}

.compact-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e9ecef;
    padding-top: 15px;
}

.compact-time {
    display: flex;
    gap: 20px;
}

.compact-time span {
    font-size: 13px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
}

.compact-time i {
    width: 14px;
}

/* ======================================== */
/* NORMAL ADS CARD - 140x140 IMAGES         */
/* ======================================== */

.normal-ad-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.normal-ad-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: #d1d5db;
}

.normal-ad-image {
    height: 140px;
    width: 100%;
    background-size: cover;
    background-position: center;
    background-color: #f8f9fa;
}

.normal-ad-content {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.normal-ad-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
    line-height: 1.4;
}

.normal-ad-price {
    font-size: 16px;
    font-weight: 700;
    color: #2563eb;
    margin-bottom: 8px;
}

.normal-ad-details {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 8px;
}

.normal-ad-details span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.normal-ad-details i {
    width: 14px;
    color: #94a3b8;
}

.normal-ad-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.normal-ad-time {
    font-size: 11px;
    color: #94a3b8;
    display: flex;
    justify-content: space-between;
}

.normal-ad-time span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ======================================== */
/* UNIVERSAL VIEW DETAILS BUTTON - FIXED    */
/* ======================================== */

.view-details,
.view-details-sm,
.view-details-md {
    display: inline-flex;
    align-items: center;
    justify-content: center;  /* This centers the text */
    gap: 6px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    width: fit-content;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.2);

    /* Text centering fixes */
    line-height: 0.5;
    vertical-align: middle;
    text-align: center;
    white-space: nowrap;
    padding:8px;
   
}

.view-details:hover,
.view-details-sm:hover,
.view-details-md:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
    color: white;
    text-decoration: none;
}

.view-details:active,
.view-details-sm:active,
.view-details-md:active {
    background: #1e3a8a;
    transform: translateY(0);
}

.view-details i,
.view-details-sm i,
.view-details-md i {
    font-size: 10px;
    transition: transform 0.2s ease;
    display: inline-block;
    line-height: 1;
}

.view-details:hover i,
.view-details-sm:hover i,
.view-details-md:hover i {
    transform: translateX(3px);
}

/* Small button - for cards */
.view-details-sm {
    padding: 8px 16px;
    font-size: 12px;
    min-width: 100px;
    
}

.view-details-sm i {
    font-size: 10px;
}

/* Medium button - for list view */
.view-details-md {
    padding: 10px 20px;
    font-size: 13px;
    min-width: 120px;
}

.view-details-md i {
    font-size: 11px;
}

/* Large button - for CTAs */
.view-details-lg {
    padding: 12px 24px;
    font-size: 14px;
    border-radius: 6px;
    min-width: 140px;
}

/* Button container - left aligned */
.card-footer,
.ad-card .card-body,
.compact-card .compact-content,
.list-card .list-content {
    text-align: left;
}

.view-details,
.view-details-sm,
.view-details-md {
    margin-left: 0;
    margin-right: auto;
}

/* ======================================== */
/* CATEGORIES SIDEBAR                       */
/* ======================================== */

.categories-sidebar {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    position: sticky;
    top: 100px;
}

.categories-sidebar h4 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.categories-sidebar .list-group-item {
    border: none;
    padding: 10px 15px;
    margin-bottom: 2px;
    border-radius: 8px !important;
    font-size: 14px;
    transition: all 0.2s ease;
}

.categories-sidebar .list-group-item:hover {
    background-color: #e2e8f0;
    transform: translateX(5px);
}

.categories-sidebar .list-group-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.categories-sidebar .badge {
    font-size: 11px;
    font-weight: 500;
    padding: 4px 8px;
}

/* ======================================== */
/* PRICE FILTER FORM                        */
/* ======================================== */

.form-control-sm, .form-select-sm {
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    width: 100%;
}

.form-control-sm:focus, .form-select-sm:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
    color: white;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* ======================================== */
/* RESPONSIVE DESIGN                        */
/* ======================================== */

@media (max-width: 992px) {
    .categories-sidebar {
        position: static;
        margin-bottom: 30px;
    }
}

@media (max-width: 768px) {
    .list-meta,
    .compact-details {
        flex-direction: column;
        gap: 8px;
    }

    .list-time {
        text-align: left;
    }

    .list-time div {
        justify-content: flex-start;
    }

    .compact-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .compact-image {
        height: 150px;
    }

    .compact-time {
        flex-wrap: wrap;
    }

    .ad-specs,
    .ad-time {
        flex-direction: column;
        gap: 4px;
    }
}

@media (max-width: 576px) {
    .ad-image,
    .compact-image {
        height: 180px;
    }

    .categories-sidebar {
        padding: 15px;
    }

    .view-details-sm {
        padding: 7px 14px;
        font-size: 11px;
        min-width: 90px;
    }

    .view-details-md {
        padding: 8px 16px;
        font-size: 12px;
        min-width: 100px;
    }
}

@media (max-width: 480px) {
    .view-details-sm,
    .view-details-md {
        white-space: normal;
        padding: 8px 12px;
        min-width: 80px;
    }
}

/* ======================================== */
/* SEARCH PAGE SPECIFIC STYLES              */
/* ======================================== */

.search-image {
    height: 140px;
    width: 140px;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    margin: 12px;
    border: 1px solid #e9ecef;
    position: relative;
}

/* List featured badge */
.list-featured-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #78350f;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Optional: subtle gold border for featured items */
.featured-border {
    border-left: 3px solid #fbbf24 !important;
}

@media (max-width: 768px) {
    .search-image {
        width: 100%;
        height: 180px;
        margin: 0;
        border-radius: 8px 8px 0 0;
    }
}

/* ======================================== */
/* MEGA MENU STYLES - For Categories Dropdown */
/* ======================================== */

.mega-menu {
    width: 600px;
    padding: 1.5rem;
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-radius: 12px;
    margin-top: 10px;
}

.mega-menu .row {
    margin: 0;
}

.mega-menu .dropdown-header {
    color: #1e293b;
    font-weight: 700;
    font-size: 15px;
    padding: 0.5rem 1rem;
    background: transparent;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 0.75rem;
}

.mega-menu .dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 13px;
    color: #4b5563;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.mega-menu .dropdown-item:hover {
    background: #f3f4f6;
    color: #2563eb;
    transform: translateX(5px);
}

.mega-menu .dropdown-item.text-primary {
    font-weight: 500;
    margin-top: 0.5rem;
}

.mega-menu .dropdown-item.text-primary:hover {
    background: #eef2ff;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .mega-menu {
        width: 100%;
        padding: 1rem;
    }
    
    .mega-menu .col-md-4 {
        margin-bottom: 1rem;
    }
}

/* ======================================== */
/* COLLAPSIBLE CATEGORY TREE STYLES         */
/* ======================================== */
/* Category Tree Styles */
.category-tree {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 5px;
}

.category-tree::-webkit-scrollbar {
    width: 4px;
}

.category-tree::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.category-tree::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.category-item {
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 8px;
}

.active-category {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 6px;
}

.active-category a,
.active-category .badge {
    color: white !important;
    background-color: rgba(255,255,255,0.2) !important;
}

.active-subcategory {
    background-color: #eef2ff;
    border-radius: 4px;
}

.active-subcategory a {
    color: #2563eb !important;
}

.toggle-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.toggle-btn:hover {
    transform: scale(1.1);
}

.subcategories {
    transition: all 0.3s ease;
    border-left: 2px dashed #e2e8f0;
    margin-left: 12px;
}

/* Badge styles */
.badge.bg-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.badge.bg-secondary {
    background-color: #e9ecef !important;
    color: #495057 !important;
}

.badge.bg-light {
    background-color: #f1f5f9 !important;
    color: #334155 !important;
}

/* ======================================== */
/* LIST VIEW CARDS - Like Search Page       */
/* ======================================== */

.list-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.list-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: #d1d5db;
}

.list-image {
    height: 140px;
    width: 100%;
    background-size: cover;
    background-position: center;
    background-color: #f3f4f6;
}

.list-content {
    padding: 16px;
}

.list-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.list-price {
    font-size: 18px;
    font-weight: 700;
    color: #2563eb;
}

.list-meta {
    font-size: 13px;
    color: #6b7280;
    display: flex;
    gap: 16px;
    margin: 8px 0;
}

.list-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.list-meta i {
    width: 14px;
    color: #9ca3af;
}

.list-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.list-time {
    font-size: 12px;
    color: #9ca3af;
    display: flex;
    gap: 16px;
}

.list-time span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.list-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background-color: #2563eb;
    color: white;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.list-btn:hover {
    background-color: #1d4ed8;
    color: white;
    text-decoration: none;
}

/* Responsive */
@media (max-width: 768px) {
    .list-image {
        height: 180px;
    }
    
    .list-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* ======================================== */
/* ALL ADS LIST - Professional List View    */
/* ======================================== */

.all-ad-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.all-ad-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: #d1d5db;
}

.all-ad-image {
    height: 140px;
    width: 140px;
    background-size: cover;
    background-position: center;
    background-color: #f3f4f6;
    margin: 12px;
    border-radius: 8px;
}

.all-ad-content {
    padding: 16px;
}

.all-ad-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.all-ad-price {
    font-size: 18px;
    font-weight: 700;
    color: #2563eb;
}

.all-ad-meta {
    font-size: 13px;
    color: #6b7280;
    display: flex;
    gap: 16px;
    margin: 8px 0;
}

.all-ad-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.all-ad-meta i {
    width: 14px;
    color: #9ca3af;
}

.all-ad-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.all-ad-time {
    font-size: 12px;
    color: #9ca3af;
    display: flex;
    gap: 16px;
}

.all-ad-time span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.all-ad-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background-color: #2563eb;
    color: white;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.all-ad-btn:hover {
    background-color: #1d4ed8;
    color: white;
    text-decoration: none;
}

/* Responsive */
@media (max-width: 768px) {
    .all-ad-image {
        width: 100%;
        height: 180px;
        margin: 0;
        border-radius: 8px 8px 0 0;
    }
    
    .all-ad-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/*==========================*/
/* Featured item in list */
/*==============================*/


.featured-in-list {
    border-left: 4px solid #fbbf24 !important;
}

.list-featured-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #78350f;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.all-ad-image {
    position: relative;
}

/* ======================================== */
/* NEW COMPACT CARD STYLES - Clean Design   */
/* ======================================== */

/* Key Details Grid */
.key-details {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
    background: #f8fafc;
    padding: 8px;
    border-radius: 6px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #475569;
}

.detail-item i {
    width: 14px;
    color: #94a3b8;
    font-size: 11px;
}

.detail-item.location {
    width: 100%;
    margin-top: 2px;
    padding-top: 2px;
    border-top: 1px dashed #e2e8f0;
}

/* Ad Title min-height for consistency */
.ad-title {
    min-height: 40px;
}

/* Ad Meta in cards */
.ad-meta {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #94a3b8;
    margin-bottom: 10px;
}

.ad-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Update existing ad-card for compact design */
.ad-card .ad-details {
    padding: 12px;
}

.ad-card .ad-title {
    font-size: 14px;
    min-height: 40px;
}

.ad-card .ad-price {
    font-size: 16px;
    margin-bottom: 10px;
}

/* Responsive adjustments for compact cards */
@media (max-width: 768px) {
    .key-details {
        gap: 8px;
    }
    
    .detail-item {
        font-size: 10px;
    }
}