.page-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    width: 89%;
    margin: 20px auto;
}

/* فیلترهای بالای صفحه */
.search-top-filters {
    padding: 10px;
    border-radius: 16px;
    background: white;
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
    width: 100%;
}

.search-filter-dropdown {
   background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    min-width: 19%;
    justify-content: space-between;
}

.search-active-filter {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    background: #E60000;
    color: white;
    border-color: #E60000;
    min-width: 9%;
    justify-content: center;
}

.search-filter-arrow {
    font-size: 12px;
}

.search-all-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.main-content {
    flex: 3;
    min-width: 300px;
}

.sidebar {
    flex: 1;
    min-width: 250px;
}

.search-category-section {
    width: 100%;
    margin-bottom: 30px;
}

.search-category-header {
    border-radius: 13px;
    padding: 10px;
    background: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.search-category-title {
    font-size: 16px;
    color: #E60000;
    font-weight: 600;
}

.search-category-btn {
    border-radius: 8px;
    padding: 11px 33px;
    min-width: 9%;
    background: #E60000;
    color: white;
    border: none;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.search-results-header {
    background: white;
    border-radius: 16px;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.search-results-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
}

.search-results-count-btn {
    background: #E60000;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 25px;
    font-size: 1rem;
    cursor: pointer;
}



.page-container-question {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

@media (min-width: 769px) {
    .page-container-question {
        grid-template-columns: 1fr 350px;
        gap: 30px;
    }
}

.loading,
.no-answers {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

.error-message,
.success-message {
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
}

.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.success-message {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

/* New styles for answer cards to match the image */
.answer-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    margin-bottom: 15px;
}

.answer-card {
    background-color: white;
    border-radius: 16px; /* More rounded corners */
    border: 1px solid #E9EEF3;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05); /* Updated shadow */
    overflow: hidden;
    display: flex;
    flex-direction: row;
    align-items: center; /* Vertically center content */
    height: 208px; /* Adjusted fixed height for the card */
    position: relative; /* For special badge positioning */
    transition: box-shadow 0.3s ease;
}

.answer-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.answer-card-image {
    padding: 12px;
    width: 160px; /* Adjusted fixed width for images */
    height: 100%; /* Take full height of the card */
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 16px; /* Rounded only on the right side */
}

.answer-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.answer-card-details {
    padding: 15px 20px;
    display: flex;
    flex-direction: row-reverse;
    justify-content: space-between;
    flex-grow: 1;
    gap: 8px;
    height: 100%;
}

.answer-card-top-info {
    justify-content: space-between;
    align-items: center;
    width: 12%;
    margin-top: 12px;
    margin-bottom: 5px;
}

.answer-card-date {
    font-size: 13px;
    color: #667085;
    white-space: nowrap;
}

.answer-card-meta-group {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
}

.answer-card-meta {
    display: flex;
    margin-top: 5px;
    height: 100%;
    gap: 0px;
    flex-direction: column;
    justify-content: space-evenly;
}

.answer-card-meta .meta-item span {
    font-size: 13px;
    color: #3F3F3F;
    font-weight: 600;
}

.meta-item {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #3F3F3F;
}

.meta-item img {
    width: 16px;
    height: 16px;
    margin-left: 8px;
    flex-shrink: 0;
}

.meta-item::before {
    content: ''; /* Reset content for all meta-items */
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    flex-shrink: 0;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.meta-item:nth-child(1)::before { /* عنوان جواب */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%233F3F3F" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"></path><path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"></path></svg>');
}

.meta-item:nth-child(2)::before { /* بازدید */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%233F3F3F" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path><circle cx="12" cy="12" r="3"></circle></svg>');
}

.meta-item:nth-child(3)::before { /* فرز */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%233F3F3F" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="1" x2="12" y2="23"></line><path d="M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"></path></svg>');
}

.meta-item:nth-child(4)::before { /* مکان */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%233F3F3F" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"></path><circle cx="12" cy="10" r="3"></circle></svg>');
}

.meta-item:nth-child(5)::before { /* دسته بندی */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%233F3F3F" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 3H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-6l-2-3z"></path></svg>');
}

.meta-item:nth-child(6)::before { /* شخص درج کننده */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%233F3F3F" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle></svg>');
}

.meta-item:nth-child(7)::before { /* محبوبیت */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%233F3F3F" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"></polygon></svg>');
}

.stat-icon {
    width: 16px;
    height: 16px;
    margin-left: 8px;
}

/* Variables from rent-pages.php */
:root {
    --ferzyab-red: #E60000;
    --ink-800: #5F6A75;
    --ink-700: #7E8893;
    --ink-500: #98A2AD;
    --ink-400: #AEB6BF;
    --panel: #FFFFFF;
    --divider: #EEF1F4;
    --card-border: #F2F2F2;
    --radius: 12px;
}

.answer-form-container {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.search-category-header {
    margin-bottom: 15px;
}

.search-category-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #E60000;
}

.answer-form-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.answer-form-card textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 1rem;
    resize: vertical;
}

.submit-answer-btn {
    background: #E60000;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-size: 1rem;
    cursor: pointer;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 992px) {
    .page-container {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .search-results-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
        text-align: center;
    }

    .search-results-title {
        font-size: 1.3rem;
    }
}
