/* قسم البحث */
.search-section {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.search-form .input-group {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 1rem;
    overflow: hidden;
}

.search-form .form-control {
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
}

.search-form .btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* العناوين */
.section-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 2rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* الإعلانات المميزة */
.featured-ads-section {
    background: #fff;
}

.featured-ads-section .ad-image img.img-fluid {
    max-height: 250px !important;
    height: 250px !important;
    width: 100% !important;
    object-fit: contain !important;
}

.featured-ads-section .ad-image {
    max-height: 250px !important;
    height: 250px !important;
    display: flex;
    justify-content: center;
    align-items: center;
}

#featuredAdsCarousel {
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

#featuredAdsCarousel .carousel-item {
    background: #fff;
}

#featuredAdsCarousel .carousel-control-prev,
#featuredAdsCarousel .carousel-control-next {
    width: 5%;
    border-radius: 0;
}

#featuredAdsCarousel .carousel-control-prev {
    border-radius: 0 1rem 1rem 0;
}

#featuredAdsCarousel .carousel-control-next {
    border-radius: 1rem 0 0 1rem;
}

/* بطاقات الإعلانات */
.ad-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
    height: 100%;
}

.ad-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.ad-card.featured {
    border: 2px solid #ffc107;
}

.ad-image {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.ad-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    z-index: 1;
}

.ad-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ad-image .price-badge {
    position: absolute;
    bottom: 15px;
    right: 10px;
    background: rgba(31, 240, 3, 0.825);
    color: #131313;
    padding: 8px 15px;
    border-radius: 6px;
    font-weight: bold;
    z-index: 2;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ad-image .views-badge {
    position: absolute;
    bottom: 15px;
    left: 10px;
    background: rgb(4, 130, 241);
    color: #fdfdfd;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 0.9em;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ad-image .featured-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 193, 7, 0.9);
    color: #000;
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: bold;
    z-index: 2;
}

.ad-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.7));
    padding: 10px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ad-content {
    padding: 15px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ad-title {
    font-size: 1.2rem;
    margin-bottom: 10px;
    font-weight: bold;
}

.ad-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.ad-title a:hover {
    color: #007bff;
}

.ad-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    color: #666;
    font-size: 0.9em;
}

.ad-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 15px;
}

.ad-meta i {
    margin-left: 5px;
}

.ad-description {
    color: #666;
    font-size: 0.9em;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.ad-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: flex-start;
}

/* أزرار الاتصال والتواصل */
.contact-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
}

.contact-buttons .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 15px;
    font-size: 0.9rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-align: center;
    width: 100%;
}

.contact-buttons .btn i {
    margin-left: 8px;
    font-size: 1.2rem;
    display: inline-block;
    vertical-align: middle;
    line-height: 1;
}

.contact-buttons .btn-whatsapp i {
    color: white !important;
    font-size: 1.2rem !important;
    margin-left: 8px;
    display: inline-block;
    vertical-align: middle;
    background-color: transparent !important;
}

.btn-whatsapp i::before {
    content: '\f232';  /* Unicode للواتساب */
    font-family: 'Font Awesome 6 Brands';
    display: inline-block;
}

.contact-buttons .btn-call {
    background-color: #007bff;
    color: white;
    grid-column: 1;
}

.contact-buttons .btn-whatsapp {
    background-color: #25d366;
    color: white;
    grid-column: 2;
}

.contact-buttons .btn-view-ad {
    background-color: #28a745;
    color: white;
    grid-column: 1 / span 2;
}

.contact-buttons .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* تجاوب مع الشاشات الصغيرة */
@media (max-width: 576px) {
    .contact-buttons {
        grid-template-columns: 1fr;
    }
    
    .contact-buttons .btn-call,
    .contact-buttons .btn-whatsapp,
    .contact-buttons .btn-view-ad {
        grid-column: 1;
    }
}

/* تنسيق البانرات */
.banner-section {
    margin-bottom: 20px;
}

.banner-section .container {
    max-width: 950px;
    margin: 0 auto;
}

.banner-section .row {
    flex-direction: column;
    align-items: center;
}

.banner-section .banner-item {
    margin-bottom: 15px;
    width: 100%;
    max-width: 950px;
}

.banner-section .banner-item:last-child {
    margin-bottom: 0;
}

.banner-section img {
    width: 100%;
    height: auto;
    max-width: 950px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.banners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.banner-item img {
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.banner-item img:hover {
    transform: scale(1.02);
}

/* أزرار الاتصال للموبايل */
.mobile-contact-buttons {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-contact-buttons .btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.mobile-contact-buttons .btn-call {
    background-color: #28a745;
}

.mobile-contact-buttons .btn-whatsapp {
    background-color: #25d366;
}

/* إخفاء الأزرار على الشاشات الكبيرة */
@media (min-width: 768px) {
    .mobile-contact-buttons {
        display: none;
    }
}

/* التصميم المتجاوب */
@media (max-width: 992px) {
    .ad-image {
        min-height: 200px;
    }
    
    .ad-title {
        font-size: 1.1rem;
    }
    
    .contact-buttons {
        flex-direction: column;
    }
    
    #featuredAdsCarousel .carousel-control-prev,
    #featuredAdsCarousel .carousel-control-next {
        width: 10%;
    }
}

@media (max-width: 768px) {
    .search-form .input-group {
        flex-direction: column;
    }
    
    .search-form .btn {
        border-radius: 0 0 1rem 1rem;
    }
    
    .search-form .form-control {
        border-radius: 1rem 1rem 0 0;
    }
    
    .ad-card .row {
        flex-direction: column;
    }
    
    .ad-image {
        min-height: 200px;
    }
    
    .ad-content {
        padding: 1rem;
    }
}
