/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0e2431 0%, #0e2431 100%);
    min-height: 100vh;
    color: #f9b248;
    direction: rtl;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    color: #f9b248;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Search section */
.search-section {
    background: rgba(12, 66, 93, 0.53);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.search-box {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

#search-input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #f9b248;
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

#search-input:focus {
    outline: none;
    border-color: #f9b248;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-btn {
    background: linear-gradient(135deg, #f9b248 0%, #f9b248 100%);
    color: #000000;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.search-btn:active {
    transform: translateY(0);
}

/* Filters */
.filters {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.filters select {
    padding: 10px 15px;
    border: 2px solid #f9b248;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #f9b248;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.filters select:focus {
    outline: none;
    border-color: #667eea;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error message */
.error-message {
    background: #fee;
    color: #c33;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #fcc;
    text-align: center;
}

/* Results count */
.results-count {
    background: rgb(85, 174, 2);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
    color: #f9b248;
}

/* Results grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.product-card {
    background: #414848;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #f5f5f5;
}

.product-info {
    padding: 20px;
}

.product-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #f9b248;
    line-height: 1.4;
}

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: #e1ff00;
    margin-bottom: 8px;
}

.product-location {
    font-size: 14px;
    color: #ffffff;
    margin-bottom: 8px;
}

.product-description {
    font-size: 13px;
    color: #ffffff;
    margin-bottom: 12px;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #fdfcfc;
}

.product-condition {
    background: #e8f5e8;
    color: #000000;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.chat-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #ffffff;
    font-size: 12px;
}

/* Load more */
.load-more {
    text-align: center;
    margin-top: 30px;
}

.load-more-btn {
    background: #f9b248;
    color: #000000;
    border: 2px solid #ffffff;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    background: #eaba66;
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 2rem;
    }

    .search-box {
        flex-direction: column;
    }

    .search-btn {
        justify-content: center;
    }

    .filters {
        flex-direction: column;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .search-section {
        padding: 20px;
    }

    .product-card {
        margin: 0 10px;
    }
}
