/* Custom Styles */
html, body {
    height: 100%;
}

body {
    font-family: 'Tajawal', sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Use viewport height to ensure full coverage */

}

.main-content {
    flex: 1; /* This makes the content expand to fill available space */
}


.hero {
    padding: 120px 0; /* Increased height by 10% */
    background-color: rgba(0, 0, 0, 0.5); /* Overlay for better text visibility */
    background-blend-mode: overlay;
}

.hero h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 30px; /* Added spacing below the slogan */
}

.hero form {
    background-color: rgba(255, 255, 255, 0.9); /* Semi-transparent white background */
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px; /* Added spacing below the form */
}

.hero form select,
.hero form button {
    height: 50px; /* Larger height for input elements */
    font-size: 1rem; /* Larger font size for better readability */
}

.hero form select {
    width: 100%; /* Full width for select elements */
}

.hero form button {
    width: 100%; /* Full width for the button */
    background-color: #007bff; /* Blue button */
    border: none;
}

.hero .stats {
    font-size: 0.9rem;
    color: #ddd;
}

.section {
    padding: 60px 0;
}

.section:nth-child(odd) {
    background-color: #f8f9fa; /* Light gray background for odd sections */
}

.section:nth-child(even) {
    background-color: #ffffff; /* White background for even sections */
}

.section h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 30px;
    color: #333; /* Dark text for headings */
    text-align: center; /* Center section titles */
}

.section .city-list {
    column-count: 3; /* Split the list into 3 columns */
    column-gap: 20px;
}

.section .city-list a {
    display: block;
    margin-bottom: 10px;
    color: #007bff; /* Blue text for links */
    text-decoration: none;
}

.section .city-list a:hover {
    text-decoration: underline;
}

.latest-ads {
    padding: 60px 0;
    background-color: #ffffff; /* White background for the latest ads section */
}

.latest-ads h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 30px;
    color: #333; /* Dark text for headings */
    text-align: center; /* Center section titles */
}

.card {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card-img-top {
    height: 200px;
    object-fit: cover;
}

.card-title {
    font-weight: 700;
    font-size: 1.2rem;
}

.card-text {
    font-size: 1.1rem;
    color: #007bff; /* Blue text for price */
}

footer {
    background-color: #333;
    padding: 20px 0;
    margin-top: auto; /* This ensures footer stays at bottom */
}

footer nav {
    display: flex;
    justify-content: center;
    gap: 20px; /* Added spacing between footer links */
    flex-wrap: wrap; /* Allow links to wrap on smaller screens */
}

footer nav a {
    color: #fff;
    text-decoration: none;
}

/* Visual Separator */
.border-top {
    border-top: 1px solid #dee2e6 !important;
}

/* Results Count */
.results-count {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Sticky Filters Section */
.filters-section {
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.95);
}

/* Make filters section non-sticky on mobile devices */
@media (max-width: 767.98px) {
    .filters-section {
        position: static !important; /* Override sticky behavior */
        top: auto !important; /* Reset top positioning */
    }
}

/* Dropdown Styles */
.dropdown-menu {
    text-align: right; /* Ensure RTL alignment */
}

.dropdown-item {
    text-align: right;
}

/* Results Section */
.results-section {
    background-color: #f8f9fa; /* Light gray background */
}

.results-section .result-item {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.results-section .result-item img {
    height: 200px;
    object-fit: cover;
}

.results-section .result-item h5 {
    font-weight: 700;
    color: #333;
}

.results-section .result-item p {
    margin: 0;
}

/* Pagination */
.pagination .page-item .page-link {
    color: #007bff;
    border: 1px solid #dee2e6;
    margin: 0 2px;
}

.pagination .page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
    color: #fff;
}

/* Fix rounded edges for RTL pagination */
.pagination .page-item:first-child .page-link {
    border-top-right-radius: 0.25rem;
    border-bottom-right-radius: 0.25rem;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.pagination .page-item:last-child .page-link {
    border-top-left-radius: 0.25rem;
    border-bottom-left-radius: 0.25rem;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* Footer */
footer {
    margin-top: auto; /* Ensure footer sticks to the bottom */
}

/* Ensure all input fields have RTL text alignment */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
textarea {
    text-align: right;
    direction: rtl;
}

/* Custom Styles from ad.html */
body {
    background-color: #f8f9fa; /* Light gray background */
}

.card, .sticky-bottom {
    background-color: #fff; /* White boxes for sections */
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sticky-bottom {
    border-top: 1px solid #dee2e6; /* Border at the top */
    position: sticky;
    bottom: 0;
    z-index: 1000;
}

.price-analysis {
    background: linear-gradient(to right, green, yellow, red); /* Gradient for price analysis */
    height: 10px;
    border-radius: 5px;
    position: relative;
}

.price-analysis::after {
    content: 'X';
    position: absolute;
    top: -5px;
    left: 60%; /* Adjust this value to position the marker */
    color: #000;
    font-weight: bold;
}

.ad-box {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
}

.main-image {
    width: 100%;
    height: 400px; /* Set fixed height for main property image */
    object-fit: cover;
    cursor: pointer;
}

/* Add this to ensure consistent image containers in search results */
.result-item .row {
    min-height: 200px; /* Match image height */
}

/* Ensure image container in search results has fixed height */
.result-item .col-md-4 {
    height: 200px;
    overflow: hidden;
}

/* Responsive Map */
.map-container {
    position: relative;
    overflow: hidden;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
}

.map-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Responsive Sticky Contact Section */
@media (max-width: 768px) {
    .sticky-bottom .col-md-4 {
        text-align: center !important;
        margin-bottom: 10px;
    }
    .sticky-bottom .btn {
        width: 100%;
        margin-bottom: 5px;
    }
    .sticky-bottom .d-flex {
        justify-content: center !important;
    }
}

/* Gallery Modal Styles */
.gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.gallery-modal.active {
    display: flex;
}

.gallery-modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    max-width: 80%;
    max-height: 80%;
    overflow: auto;
    text-align: center;
}

.gallery-modal-content img {
    max-width: 100%;
    max-height: 500px;
    margin-bottom: 10px;
}

.gallery-thumbnails {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}

.gallery-thumbnail {
    width: 80px;
    height: 60px;
    cursor: pointer;
    border: 2px solid transparent;
    object-fit: cover;
}

.gallery-thumbnail.active {
    border-color: #007bff;
}

.ad-thumbnail {
    width: 80px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f8f9fa;
    border: 2px dashed #007bff;
    cursor: pointer;
}

.ad-thumbnail i {
    font-size: 24px;
    color: #007bff;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.8);
    border: none;
    padding: 15px;
    cursor: pointer;
    z-index: 10001;
    font-size: 24px;
}

.gallery-nav.prev {
    left: 10px;
}

.gallery-nav.next {
    right: 10px;
}

.gallery-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

/* Share Popup Styles */
.share-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.share-popup.active {
    display: flex;
}

.share-popup-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    width: 300px;
    position: relative; /* Ensure the close button is positioned relative to the popup */
}

.share-popup-content p {
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.share-icons {
    display: flex;
    justify-content: space-around;
}

.share-icons a {
    color: #007bff;
    font-size: 2rem;
    text-decoration: none;
}

.share-icons a:hover {
    color: #0056b3;
}

.close-popup {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #000;
}

@media print {
    /* Hide unnecessary elements when printing */
    header, footer, .sticky-bottom, .share-popup {
        display: none;
    }

    /* Adjust layout for printing */
    body {
        font-size: 12pt;
        color: #000;
    }
}

/* Custom Styles */
.manage-ads .card {
    transition: transform 0.3s ease;
}

.manage-ads .card:hover {
    transform: translateY(-5px);
}

.badge {
    font-size: 0.75rem;
}

/* Inbox Page Styles */
.list-group-item.unread {
    background-color: #f8f9fa;
    border-left: 4px solid #007bff;
}

.list-group-item {
    padding: 15px;
    border: 1px solid #dee2e6;
    margin-bottom: 10px;
}

.list-group-item img {
    max-width: 100%;
    height: auto;
}

/* Chat Page Styles */
.chat-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    background-color: #f8f9fa;
}

.chat-messages .message {
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 8px;
    max-width: 70%;
}

.chat-messages .message.received {
    background-color: #ffffff;
    margin-right: auto;
}

.chat-messages .message.sent {
    background-color: #007bff;
    color: #fff;
    margin-left: auto;
}

.chat-messages .message small {
    display: block;
    margin-top: 5px;
    font-size: 0.8rem;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .list-group-item img {
        width: 50px;
        height: 50px;
    }

    .chat-container {
        max-height: 300px;
    }
}

/* Login and Register Page Styles */
.card {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.btn-success {
    background-color: #28a745;
    border-color: #28a745;
}

.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-danger i {
    margin-left: 5px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .card {
        padding: 20px;
    }

    .btn {
        width: 100%;
    }
}

/* User Info Card Styles */
.user-info .card {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.user-info .card-body {
    padding: 20px;
}

.user-info img {
    border: 2px solid #007bff;
}

.user-info .text-muted {
    font-size: 0.9rem;
}

.user-info i {
    margin-left: 5px;
    color: #007bff;
}

/* Ads List Styles */
.user-ads .card {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.user-ads .card-img-top {
    height: 200px;
    object-fit: cover;
}

.user-ads .card-title {
    font-size: 1.2rem;
    font-weight: 700;
}

.user-ads .card-text {
    font-size: 1.1rem;
    color: #007bff;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .user-info img {
        width: 80px;
        height: 80px;
    }

    .user-ads .card {
        margin-bottom: 20px;
    }
}

/* User Icon Styles */
.user-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.user-icon i {
    font-size: 5rem; /* Large icon size */
    color: #007bff; /* Blue color */
}


/* Profile Settings Styles */
.profile-settings .card {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.profile-settings .card-body {
    padding: 20px;
}

.profile-settings .form-control {
    margin-bottom: 15px;
}

.profile-settings .text-muted {
    font-size: 0.9rem;
}

.profile-settings .btn {
    margin-top: 10px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .profile-settings .card-body {
        padding: 15px;
    }
}

/* Alert Message Styles */
.alert {
    margin-bottom: 20px;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Password Forgotten Styles */
.password-forgotten .card {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.password-forgotten .card-body {
    padding: 20px;
}

.password-forgotten .alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    text-align: center;
    padding: 10px;
    margin-bottom: 20px;
}

.password-forgotten .btn {
    margin-top: 10px;
}

.password-forgotten a {
    color: #007bff;
    text-decoration: none;
}

.password-forgotten a:hover {
    text-decoration: underline;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .password-forgotten .card-body {
        padding: 15px;
    }
}

/* Reset Password Styles */
.reset-password .card {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.reset-password .card-body {
    padding: 20px;
}

.reset-password .alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    text-align: center;
    padding: 10px;
    margin-bottom: 20px;
}

.reset-password .alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    text-align: center;
    padding: 10px;
    margin-bottom: 20px;
}

.reset-password .btn {
    margin-top: 10px;
}

.reset-password a {
    color: #007bff;
    text-decoration: none;
}

.reset-password a:hover {
    text-decoration: underline;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .reset-password .card-body {
        padding: 15px;
    }
}

/* Create Ad Styles */
.create-ad .card {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.create-ad .card-body {
    padding: 20px;
}

.create-ad .form-control {
    margin-bottom: 15px;
}

.create-ad .btn {
    margin-top: 10px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .create-ad .card-body {
        padding: 15px;
    }
}

/* Price dropdown styles */
#priceDropdown {
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
}

#priceDropdown .filter-label {
    white-space: nowrap;
    margin-left: 5px;
}

#priceDropdown .filter-value {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    direction: ltr; /* Keep numbers LTR even in RTL layout */
    text-align: left;
    max-width: 80px;
}

/* Ensure dropdown arrow stays in place */
#priceDropdown::after {
    margin-right: auto;
    margin-left: 0.5em;
}

/* Fix for close button in alerts - RTL specific */
.alert-dismissible .btn-close {
    position: absolute;
    left: 0;
    right: auto; /* Override RTL positioning */
    padding: 0.75rem 1rem; /* Adjust padding for better touch target */
}

/* Adjust alert padding to accommodate the close button */
.alert-dismissible {
    padding-right: 1rem;
    padding-left: 3rem; /* Make space for the close button */
}

/* Ensure the close button icon is properly centered */
.btn-close {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1; /* Make sure it's fully visible */
}

/* Optional: Style the close button on hover */
.btn-close:hover {
    opacity: 0.75;
}

/* Conversation Container Styles */
.conversation-container {
    max-height: 600px; /* Adjust this value as needed */
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 10px;
    background-color: #fff;
}

/* Custom Scrollbar */
.conversation-container::-webkit-scrollbar {
    width: 8px;
}

.conversation-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.conversation-container::-webkit-scrollbar-thumb {
    background: #007bff;
    border-radius: 4px;
}

.conversation-container::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

