/* General container for the answers page */
.renet-container {
    width: 89%;
    margin: 0px auto;
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    direction: rtl;
}

/* Title for the page */
.rental-title {
     font-size: 13px;
    color: #667085;
    white-space: nowrap;
}

/* Search and Filter Section */
/* Search and Filter Section */


.search-box-main {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    width: 100%;
    border: 1px solid #E9EEF3; /* Light border */
    border-radius: 12px; /* Rounded corners */
    padding: 8px; /* Padding around input and button */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); /* Subtle shadow */
}

.search-input-main {
    flex: 1;
    height: 40px; /* Slightly smaller height */
    border: none; /* Remove border, it's on the container */
    border-radius: 8px; /* Match container radius */
    padding: 0 12px; /* Adjusted padding */
    font-size: 15px; /* Adjusted font size */
    color: #2B2F33;
    direction: rtl;
    outline: none;
    background-color: #F8F9FA; /* Light background */
}

.search-input-main::placeholder {
    color: var(--ink-400);
}

.search-button-main {
    background-color: var(--ferzyab-red);
    color: white;
    border: none;
    padding: 10px 20px; /* Adjusted padding */
    font-size: 14px;
    border-radius: 8px;
    cursor: pointer;
    min-width: 90px; /* Adjusted min-width */
    transition: background-color 0.3s ease;
}

.search-button-main:hover {
    filter: brightness(.96);
}

.filter-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-start;
    background-color: white; /* Light background for filter row */
    border-radius: 12px;
    padding: 10px;
}

.filter-item {
    position: relative;
    flex-grow: 1;
    min-width: 120px; /* Adjusted min-width for dropdowns */
}

.filter-select {
    background-color: white;
    border: 1px solid #ddd;
    padding: 10px 12px; /* Adjusted padding */
    font-size: 13px; /* Adjusted font size */
    border-radius: 8px;
    color: #666;
    width: 100%;
    appearance: none;
    cursor: pointer;
    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="%23666" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>');
    background-repeat: no-repeat;
    background-position: left 8px center; /* Adjusted position */
    padding-left: 28px; /* Space for arrow */
}

.filter-item.checkbox-item {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-grow: 0;
    min-width: unset;
}

.filter-item.checkbox-item input[type="checkbox"] {
    width: 16px; /* Slightly smaller checkbox */
    height: 16px;
    accent-color: var(--ferzyab-red);
}

.filter-item.checkbox-item label {
    font-size: 13px;
    color: #333;
    cursor: pointer;
}

.filter-search-btn {
    background-color: var(--ferzyab-red); /* Changed to red as per image */
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 8px;
    cursor: pointer;
    min-width: 90px;
    transition: background-color 0.3s ease;
}

.filter-search-btn:hover {
    filter: brightness(.96);
}

/* Total answers banner */
.total-answers-banner {
    background-color: #001D81;
    color: white;
    padding: 10px 15px; /* Adjusted padding */
    border-radius: 12px; /* Adjusted border-radius */
    margin-top: 15px; /* Adjusted margin */
    text-align: center;
    font-size: 20px; /* Adjusted font size */
    max-width: 250px; /* Adjusted max-width */
    margin-right: auto;
    margin-left: auto;
    margin-bottom: 15px;
}

/* Answer cards wrapper */
.answer-cards-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr)); /* Responsive 2-column layout */
    gap: 20px;
    margin: 30px auto;
    max-width: 1352px; /* Match search-filter-section width */
}

/* Individual answer card */
.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 */
}

.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-title::before {
    content: 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>'); /* Generic title icon */
    display: inline-block;
    width: 16px;
    height: 16px;
}

.answer-card-meta {
    display: flex
;
    /* gap: 8px 15px; */
    margin-top: 5px;
    height: 100%;
    gap: 0px;
    flex-direction: column;
    justify-content: space-evenly;
}

.answer-card-meta .meta-item span {
     font-size: 14px;
    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>');
}

/* Special badge styling */
.special-badge {
    position: absolute;
    top: 15px; /* Adjusted position */
    right: 15px; /* Adjusted position */
    background-color: #FFD700; /* Gold color */
    color: #333; /* Darker text for contrast */
    padding: 4px 10px;
    border-radius: 20px; /* More rounded */
    font-weight: 600;
    font-size: 12px;
    z-index: 10;
}

/* Pagination */
.pagination {
    display: flex;
    flex-wrap: wrap; /* Allow items to wrap to the next line */
    justify-content: center;
    align-items: center; /* Center vertically */
    margin-top: 40px; /* Adjusted margin */
    margin-bottom: 60px; /* Adjusted margin */
    background-color: white;
    border-radius: 12px; /* More rounded */
    padding: 12px 15px; /* Adjusted padding */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); /* Updated shadow */
    max-width: 100%; /* Ensure it doesn't exceed parent width */
    width: auto; /* Allow width to adjust based on content and flex-wrap */
    margin-left: auto;
    margin-right: auto;
    gap: 5px; /* Gap between pagination items */
}

.pagination span,
.pagination a {
    display: flex; /* Use flex for centering content */
    align-items: center;
    justify-content: center;
    min-width: 36px; /* Fixed width for circles */
    height: 36px; /* Fixed height for circles */
    padding: 0; /* Remove padding */
    margin: 0; /* Remove margin */
    border: none; /* Remove border */
    background-color: transparent; /* Transparent background */
    color: #666;
    text-decoration: none;
    border-radius: 50%; /* Circular shape */
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.pagination a:hover {
    background-color: #f0f0f0;
    color: #E60000;
}

.pagination .pagination-current {
    background-color: #E60000;
    color: white;
    font-weight: bold;
}

.pagination .pagination-btn {
    background-color: transparent;
    color: #666;
    border: none;
}

.pagination .pagination-btn:hover {
    background-color: #f0f0f0;
    color: #E60000;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .renet-container {
        width: 95%;
    }
    .answer-cards-wrapper {
        grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); /* Adjust for tablets */
    }
    .answer-card {
        height: 160px; /* Slightly smaller height */
    }
    .answer-card-image {
        width: 140px; /* Slightly smaller image width */
    }
    .answer-card-title {
        font-size: 16px;
    }
    .answer-card-date, .answer-card-meta .meta-item span {
        font-size: 12px;
    }
    .meta-item img {
        width: 14px;
        height: 14px;
    }
    .total-answers-banner {
        max-width: 280px;
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    .renet-container {
        width: 92%;
    }
    .search-filter-section {
        padding: 12px;
        gap: 12px;
    }
    .search-input-main {
        height: 45px;
        font-size: 14px;
    }
    .search-button-main, .filter-search-btn {
        padding: 10px 20px;
        font-size: 13px;
        min-width: 80px;
    }
    .filter-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .filter-item {
        min-width: unset;
        width: 100%;
    }
    .filter-select {
        padding: 10px 15px;
        font-size: 13px;
    }
    .filter-item.checkbox-item label {
        font-size: 13px;
    }
    .answer-cards-wrapper {
        grid-template-columns: 1fr; /* Single column on mobile */
        gap: 15px;
    }
    .answer-card {
        height: 140px; /* Further reduced height */
    }
    .answer-card-image {
        width: 120px; /* Further reduced image width */
    }
    .answer-card-details {
        padding: 10px 15px;
        gap: 5px;
    }
    .answer-card-title {
        font-size: 15px;
    }
    .answer-card-meta {
        grid-template-columns: 1fr; /* Stack meta items vertically */
        gap: 5px;
    }
    .answer-card-date, .answer-card-meta .meta-item span {
        font-size: 11px;
    }
    .meta-item img {
        width: 12px;
        height: 12px;
        margin-left: 6px;
    }
    .special-badge {
        top: 10px;
        right: 10px;
        padding: 3px 8px;
        font-size: 11px;
    }
    .pagination {
        padding: 10px;
        gap: 3px;
    }
    .pagination span, .pagination a {
        min-width: 30px;
        height: 30px;
        font-size: 13px;
    }
    .total-answers-banner {
        max-width: 100%;
        font-size: 18px;
        padding: 10px 15px;
    }
}

@media (max-width: 480px) {
    .renet-container {
        width: 90%;
    }
    .answer-card {
        height: 120px;
    }
    .answer-card-image {
        width: 100px;
    }
    .answer-card-details {
        padding: 8px 12px;
    }
    .answer-card-title {
        font-size: 14px;
    }
    .answer-card-date, .answer-card-meta .meta-item span {
        font-size: 10px;
    }
    .meta-item img {
        width: 10px;
        height: 10px;
        margin-left: 5px;
    }
    .special-badge {
        top: 8px;
        right: 8px;
        padding: 2px 6px;
        font-size: 10px;
    }
    .pagination {
        padding: 8px;
    }
    .pagination span, .pagination a {
        min-width: 28px;
        height: 28px;
        font-size: 12px;
    }
}

/* 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;
}
