/* نظام الإعلانات المبوبة - Custom CSS */

/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700&display=swap');

* {
    font-family: 'Cairo', sans-serif;
}

body {
    background-color: #f8f9fa;
}

/* Cards */
.ad-card {
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    border-radius: 10px;
    overflow: hidden;
}

.ad-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.ad-card img {
    height: 200px;
    object-fit: cover;
}

.ad-card .card-body {
    padding: 1.25rem;
}

.ad-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #28a745;
}

.ad-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.ad-location {
    color: #6c757d;
    font-size: 0.9rem;
}

.ad-date {
    color: #999;
    font-size: 0.85rem;
}

/* Category Cards */
.category-card {
    text-align: center;
    padding: 2rem 1rem;
    border-radius: 10px;
    transition: all 0.3s;
    border: 2px solid #e9ecef;
}

.category-card:hover {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
    transform: scale(1.05);
}

.category-card i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.category-card h5 {
    margin-bottom: 0.5rem;
}

.category-card .ad-count {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Badge Styling */
.badge-featured {
    background-color: #ffc107;
    color: #000;
}

.badge-negotiable {
    background-color: #17a2b8;
}

/* Image Upload Preview */
.image-preview {
    position: relative;
    display: inline-block;
    margin: 5px;
}

.image-preview img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 5px;
}

.image-preview .remove-image {
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 3px;
    padding: 5px 10px;
    cursor: pointer;
}

/* Search Bar */
.search-container {
    background-color: #f8f9fa;
    padding: 6rem 0;
    margin-bottom: 3rem;
    color: #2c3e50;
    text-shadow: none;
    border-bottom: 1px solid #e9ecef;
}

.search-container h1 {
    margin-bottom: 1.5rem;
    font-weight: 800;
    font-size: 3rem;
    color: #2c3e50;
    letter-spacing: -1px;
}

.search-box {
    max-width: 800px;
    margin: 0 auto;
    padding: 5px;
}

.search-box .form-control {
    border-radius: 50px !important;
    /* Fully rounded */
    border: 1px solid #e9ecef;
    padding: 1rem 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
    background: #ffffff;
    height: auto;
    color: #333;
    margin-bottom: 10px;
    /* Mobile spacing */
}

/* Desktop spacing adjustments handled by Bootstrap grid usually, 
   but since g-0 is on the row, we might need a margin if they are side-by-side. 
   However, let's just make them look like distinct pills first. */

.search-box .btn {
    border-radius: 50px !important;
    /* Fully rounded */
    padding: 1rem 2rem;
    border: none;
    color: #000;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    margin-right: 15px;
    /* Add spacing between button and input in RTL */
}

@media (min-width: 768px) {
    .search-box .form-control {
        margin-bottom: 0;
    }
}

/* Pagination */
.pagination {
    direction: rtl;
}

/* Profile Picture */
.profile-picture {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #007bff;
}

.profile-picture-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* Chat/Message Styles */
.chat-list {
    max-height: 500px;
    overflow-y: auto;
}

.chat-item {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: background-color 0.2s;
}

.chat-item:hover {
    background-color: #f8f9fa;
}

.chat-item.unread {
    background-color: #e3f2fd;
    font-weight: bold;
}

.message-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 1rem;
    background-color: #fff;
}

.message {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 10px;
}

.message.sent {
    background-color: #007bff;
    color: white;
    margin-right: 20%;
    text-align: left;
}

.message.received {
    background-color: #e9ecef;
    margin-left: 20%;
    text-align: right;
}

/* Favorite Button */
.btn-favorite {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-favorite.active {
    color: #dc3545;
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner-overlay.active {
    display: flex;
}

/* Responsive */
@media (max-width: 768px) {
    .ad-card img {
        height: 150px;
    }

    .category-card i {
        font-size: 2rem;
    }

    .search-container {
        padding: 2rem 0;
    }

    .search-box .form-control,
    .search-box .btn {
        border-radius: 5px;
        margin-bottom: 0.5rem;
    }
}

/* Admin Dashboard */
.dashboard-card {
    border-radius: 10px;
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.dashboard-card .card-body {
    padding: 1.5rem;
}

.dashboard-icon {
    font-size: 2.5rem;
    opacity: 0.3;
}

.dashboard-number {
    font-size: 2rem;
    font-weight: bold;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

/* Utility Classes */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cursor-pointer {
    cursor: pointer;
}

/* Status Badges */
.status-active {
    background-color: #28a745;
}

.status-pending {
    background-color: #ffc107;
    color: #000;
}

.status-expired {
    background-color: #6c757d;
}

.status-sold {
    background-color: #17a2b8;
}

