/* Filter Form Container */
.adclassified-filter-form {
   display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    max-width: 1000px !important;
    margin: 0 auto 30px;
    padding: 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
}



.adclassified-filter-form input[type="text"] {
    flex: 1 1 300px;
    min-width: 200px;
    border: 2px solid #e0e3e7;
    border-radius: 8px !important;
    font-size: 15px;
    color: #2d3748;
    transition: all 0.3s ease;
    background: #f8fafc !important;
}

.adclassified-filter-form input[type="text"]:focus {
    outline: none;
    border-color: #e19b2c;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
    background: #ffffff;
}

.adclassified-filter-form input[type="text"]::placeholder {
    color: #94a3b8;
}

/* Category Select Dropdown */
.adclassified-filter-form select {
    flex: 0 1 220px;
    min-width: 180px;
    border: 2px solid #abb8c3;
    border-radius: 8px !important;
    font-size: 15px;
    color: #2d3748;
    background: #f8fafc !important;
    background-size: 16px;
    appearance: none;
    transition: all 0.3s ease;
}

.adclassified-filter-form select:focus {
    outline: none;
    border-color: #e19b2c;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/* Submit Button */
.adclassified-filter-form button[type="submit"] {
    flex: 0 0 auto;
    padding: 12px 24px;
    background: linear-gradient(135deg, #e19b2c, #ec9b2c);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(52, 152, 219, 0.3);
}

.adclassified-filter-form button[type="submit"]:hover {
    background: linear-gradient(135deg, #ec9b2c, #e19b2c);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}


/* Listing Grid */
.adclassified-listings {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.ad-item {
    position: relative;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.ad-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.ad-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid #eee;
    align-self: center;
    
}

.ad-item-content {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.ad-item h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1.2rem;
    color: #e19b2c;
    font-weight: 600;
    line-height: 1.4;
    width:100%;
    text-align:center;
}

.ad-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: #7f8c8d;
    width:90%;
    margin:2px 10px;
}

.ad-price {
    font-weight: 700;
    color: #e19b2c;
    font-size: 0.85rem;
}

.ad-price small {
    font-size: 0.8rem;
    color: #e19b2c;
}

.ad-summary {
    margin: 0.5rem 0 1rem 0;
    color: #34495e;
    font-size: 0.95rem;
    line-height: 1.5;
    flex-grow: 1;
}

.view-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #f8fafc;
    color: var(--primary-color);
    text-align: center;
    
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-top: auto;
    align-self: flex-start;
    width:100%;
    text-align:center;
    font-size: 0.9rem;
}

.view-link:hover {
    background: #ec9b2c;
    color: white;
}

/* Featured Badge */
.featured-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #e74c3c;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 1;
}

.featured .view-link {
    background: #e19b2c;
    color: white;
}

/* Loading State */
#ad-listing-results p {
    text-align: center;
    padding: 2rem;
    color: #7f8c8d;
}

/* No Results */
#ad-listing-results > p:not(:only-child) {
    grid-column: 1 / -1;
}

/* Color Variables */
:root {
    --primary-color: #e19b2c;
}

/* RTL Support */
body.rtl .adclassified-filter-form {
    direction: rtl;
}

body.rtl .filter-group button {
    direction: rtl;
}
/* RTL Support */
body.rtl .adclassified-filter-form select {
    background-position: left 12px center;
    padding-right: 18px;
    padding-left: 36px;
}

body.rtl .ad-meta-row {
    flex-direction: row-reverse;
}

body.rtl .featured-badge {
    left: auto;
    right: 10px;
}

body.rtl .ad-item h3,
body.rtl .ad-summary,
body.rtl .ad-city {
    text-align: right;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .adclassified-filter-form {
        flex-direction: column;
        gap: 15px;
    }
    
    .filter-group {
        width: 100%;
    }

    .adclassified-filter-form input[type="text"] {
        flex:auto;
    }
    .adclassified-filter-form select { 
        flex:auto;
    }
    .adclassified-filter-form button[type="submit"]{
        width:100%;
    }
    .adclassified-listings {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (max-width: 480px) {
    .adclassified-listings {
        grid-template-columns: 1fr;
    }
    
    .ad-item img {
        height: 180px;
    }
}

/* Animation for AJAX Loading */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.ad-item {
    animation: fadeIn 0.3s ease forwards;
}
/* Nested Category Options Styling */


option[value=""] {
    color: #94a3b8;
    font-style: italic;
}