/* Client-side specific styles */

/* Rating Stars */
.rating-input {
    font-size: 2rem;
    color: #ddd;
    cursor: pointer;
    display: inline-block;
}

.rating-input i {
    transition: color 0.2s;
    margin: 0 2px;
}

.rating-input i:hover,
.rating-input i.active {
    color: #ffc107;
}

.rating-display {
    color: #ffc107;
    font-size: 1.2rem;
}

.rating-display i {
    margin: 0 1px;
}

/* Reviews Section */
.reviews-header {
    border-top: 2px solid #dee2e6;
    padding-top: 1.5rem;
    margin-top: 1rem;
}

.review-item {
    border-bottom: 1px solid #dee2e6;
    padding: 1.5rem 0;
}

.review-item:first-child {
    padding-top: 0;
}

.review-item:last-child {
    border-bottom: none;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.75rem;
}

.reviewer-info h6 {
    margin: 0;
    font-weight: 600;
}

.reviewer-info small {
    color: #6c757d;
}

.review-rating {
    color: #ffc107;
    font-size: 0.9rem;
}

.review-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.review-text {
    color: #495057;
    line-height: 1.6;
}

.review-meta {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: #6c757d;
}

.review-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.review-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.review-actions .btn {
    font-size: 0.875rem;
}

.review-actions .badge {
    font-size: 0.75rem;
}

.review-reply-section {
    background: #f8f9fa;
    border-radius: 0.375rem;
    padding: 1rem;
}

.review-reply-section textarea {
    resize: vertical;
    min-height: 80px;
}

.review-replies {
    margin-left: 2rem;
    border-left: 3px solid #e9ecef;
    padding-left: 1rem;
}

.verified-badge {
    color: #28a745;
    font-size: 0.875rem;
}

.reviews-summary {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 0.5rem;
    text-align: center;
}

.average-rating {
    font-size: 3rem;
    font-weight: bold;
    color: #212529;
}

.rating-breakdown {
    margin-top: 1rem;
}

.rating-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.rating-bar-label {
    min-width: 60px;
    font-size: 0.875rem;
}

.rating-bar-fill {
    flex: 1;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.rating-bar-fill-inner {
    height: 100%;
    background: #ffc107;
    transition: width 0.3s;
}

.rating-bar-count {
    min-width: 40px;
    text-align: right;
    font-size: 0.875rem;
    color: #6c757d;
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: #d1ecf1;
    color: #0c5460;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.verified-badge i {
    font-size: 0.875rem;
}

/* Properties & Favorites Grid Container - Force Bootstrap Grid Behavior */
#propertiesContainer.row,
#favoritesContainer.row {
    display: flex !important;
    flex-wrap: wrap !important;
    --bs-gutter-x: 1.5rem;
    --bs-gutter-y: 1.5rem;
    margin-top: calc(-1 * var(--bs-gutter-y));
    margin-right: calc(-0.5 * var(--bs-gutter-x));
    margin-left: calc(-0.5 * var(--bs-gutter-x));
}

#propertiesContainer.row > *,
#favoritesContainer.row > * {
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    padding-right: calc(var(--bs-gutter-x) * 0.5);
    padding-left: calc(var(--bs-gutter-x) * 0.5);
    margin-top: var(--bs-gutter-y);
}

/* Column widths matching Bootstrap grid */
#propertiesContainer.row > .col-md-6,
#favoritesContainer.row > .col-md-6 {
    width: 100%;
}

#propertiesContainer.row > .col-lg-4,
#favoritesContainer.row > .col-lg-4 {
    width: 100%;
}

/* Tablet and up - 2 columns */
@media (min-width: 768px) {
    #propertiesContainer.row > .col-md-6,
    #favoritesContainer.row > .col-md-6 {
        flex: 0 0 auto;
        width: 50%;
    }
}

/* Desktop and up - 3 columns */
@media (min-width: 992px) {
    #propertiesContainer.row > .col-lg-4,
    #favoritesContainer.row > .col-lg-4 {
        flex: 0 0 auto;
        width: 33.333333%;
    }
}

/* Ensure columns don't have display issues */
#propertiesContainer.row > [class*="col-"],
#favoritesContainer.row > [class*="col-"] {
    display: block !important;
}

/* Property Cards */
.property-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.property-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.property-card .card-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.property-card .card-footer {
    margin-top: auto;
}

.property-image {
    height: 250px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.property-status {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.property-price {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 15px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 700;
}

.property-details {
    padding: 20px;
}

.property-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #2c3e50;
    line-height: 1.3;
}

.property-location {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.property-location i {
    margin-right: 5px;
}

.property-features {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #34495e;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.property-agent {
    border-top: 1px solid #ecf0f1;
    padding-top: 15px;
    font-size: 0.85rem;
    color: #7f8c8d;
}

/* Favorite Button Styles */
.favorite-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.favorite-btn:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.favorite-btn i {
    font-size: 18px;
    transition: color 0.3s ease;
    color: #999;
}

.favorite-btn:hover i {
    color: #dc3545;
}

.favorite-btn.active {
    background: white;
    border-color: #dc3545;
}

.favorite-btn.active i {
    color: #dc3545;
}

.favorite-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.favorite-btn:disabled:hover {
    transform: none;
}

/* Search and Filter Styles */
.search-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 0;
    margin-bottom: 40px;
}

.search-form {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.search-form .form-control,
.search-form .form-select {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 15px;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

.search-form .form-control:focus,
.search-form .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.btn-search {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    padding: 12px 30px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Filter Sidebar */
.filter-sidebar {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
}

.filter-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #2c3e50;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.filter-group {
    margin-bottom: 25px;
}

.filter-group label {
    font-weight: 500;
    color: #34495e;
    margin-bottom: 8px;
}

.price-range-display {
    background: #e9ecef;
    padding: 10px 15px;
    border-radius: 6px;
    font-weight: 500;
    text-align: center;
    margin-top: 10px;
}

/* Property Grid */
.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

/* Pagination */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 40px;
}

.pagination .page-link {
    border: 2px solid #e9ecef;
    color: #667eea;
    padding: 10px 15px;
    margin: 0 2px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.pagination .page-link:hover {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.pagination .page-item.active .page-link {
    background: #667eea;
    border-color: #667eea;
}

/* Property Details Page */
.property-hero {
    position: relative;
    height: 500px;
    background-size: cover;
    background-position: center;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 30px;
}

.property-hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 40px 30px 30px;
    color: white;
}

.property-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.gallery-image {
    height: 150px;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gallery-image:hover {
    transform: scale(1.05);
}

/* Feature Tags */
.feature-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.feature-tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Inquiry Form */
.inquiry-form {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-top: 30px;
}

.inquiry-form .form-control,
.inquiry-form .form-select {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 15px;
}

.inquiry-form .form-control:focus,
.inquiry-form .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Stats Section */
.stats-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 0;
    margin: 60px 0;
}

.stat-card {
    text-align: center;
    padding: 20px;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Loading States */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 120px 0 60px;
    margin-bottom: 0;
}

/* Property Details Carousel */
.carousel-item img {
    height: 400px;
    object-fit: cover;
    border-radius: 10px;
}

/* Agent Info Card */
.agent-info img {
    width: 60px;
    height: 60px;
    object-fit: cover;
}

/* Contact Page Styles */
.contact-item {
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
}

.contact-item:last-child {
    border-bottom: none;
}

.contact-icon {
    width: 50px;
    text-align: center;
}

.map-container {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Similar Properties */
.similar-property {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.3s ease;
}

.similar-property:hover {
    background-color: #f8f9fa;
    color: inherit;
    text-decoration: none;
}

.similar-property:last-child {
    border-bottom: none;
}

.similar-property img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
    margin-right: 10px;
}

.similar-property-info h6 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
}

.similar-property-info small {
    color: #6c757d;
}

/* Property Status Badges */
.status-available {
    background-color: #28a745;
    color: white;
}

.status-sold {
    background-color: #dc3545;
    color: white;
}

.status-rented {
    background-color: #ffc107;
    color: #212529;
}

.status-off_market {
    background-color: #6c757d;
    color: white;
}

/* Enhanced Property Features */
.property-detail-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.feature-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.feature-box:hover {
    border-color: #667eea;
    transform: translateY(-2px);
}

.feature-box i {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 10px;
}

.feature-box h6 {
    margin: 0;
    font-weight: 600;
}

/* Amenities List */
.amenities-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.amenity-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
}

.amenity-item i {
    color: #28a745;
    margin-right: 10px;
    width: 20px;
}

/* Form Enhancements */
.form-floating {
    margin-bottom: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    padding: 12px 30px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-outline-primary {
    border: 2px solid #667eea;
    color: #667eea;
    border-radius: 8px;
    padding: 10px 25px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background: #667eea;
    border-color: #667eea;
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .properties-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .search-form {
        padding: 20px;
    }
    
    .property-hero {
        height: 300px;
    }
    
    .property-hero-overlay {
        padding: 20px;
    }
    
    .filter-sidebar {
        margin-bottom: 20px;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .page-header {
        padding: 100px 0 40px;
    }
    
    .carousel-item img {
        height: 250px;
    }
    
    .property-detail-features {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .amenities-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .property-features {
        flex-direction: column;
        gap: 8px;
    }
    
    .search-section {
        padding: 40px 0;
    }
    
    .stats-section {
        padding: 40px 0;
    }
}

/* List View Styles */
#propertiesContainer.list-view {
    flex-direction: column;
}

#propertiesContainer.list-view > * {
    width: 100% !important;
    max-width: 100% !important;
}

#propertiesContainer.list-view .property-card {
    flex-direction: row;
    height: auto;
}

#propertiesContainer.list-view .property-card .card-img-top {
    width: 300px;
    height: 100%;
    object-fit: cover;
}

#propertiesContainer.list-view .property-card .position-relative {
    width: 300px;
    flex-shrink: 0;
}

#propertiesContainer.list-view .card-body {
    flex: 1;
}

#propertiesContainer.list-view .card-footer {
    width: auto;
    min-width: 200px;
}

/* Pagination Container */
nav[aria-label="Properties pagination"] {
    display: block !important;
    visibility: visible !important;
}

/* Pagination Styles */
.pagination {
    margin-top: 3rem !important;
    margin-bottom: 2rem;
    display: flex !important;
    justify-content: center !important;
}

.pagination .page-link {
    border-radius: 8px;
    margin: 0 5px;
    padding: 10px 16px;
    border: 1px solid #dee2e6;
    color: #667eea;
    transition: all 0.3s ease;
}

.pagination .page-link:hover {
    background-color: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination .page-item.active .page-link {
    background-color: #667eea;
    border-color: #667eea;
}

.pagination .page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===================================
   Newsletter Form Styles
   =================================== */
.newsletter-form .form-control {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 0.6rem 1rem;
    border-radius: 0.375rem 0 0 0.375rem;
}

.newsletter-form .form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.newsletter-form .form-control:focus {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: var(--bs-primary);
    color: #fff;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.newsletter-form .btn {
    padding: 0.6rem 1.2rem;
    border-radius: 0 0.375rem 0.375rem 0;
}

.newsletter-form .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

/* Footer Links Hover */
.hover-link {
    transition: all 0.3s ease;
}

.hover-link:hover {
    color: #fff !important;
    padding-left: 5px;
}

/* Social Links */
.social-links a {
    transition: all 0.3s ease;
    display: inline-block;
}

.social-links a:hover {
    color: var(--bs-primary) !important;
    transform: translateY(-3px);
}
