/* Custom CSS for Canadian Realty Pro */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Navigation styles */
.nav-link {
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: #DC2626;
    bottom: -5px;
    left: 0;
}

/* Property card styles */
.property-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.property-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.property-image {
    width: 100%;
    height: 240px;
    object-fit: cover;
    position: relative;
}

.property-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #DC2626;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.property-content {
    padding: 20px;
}

.property-price {
    font-size: 24px;
    font-weight: 700;
    color: #DC2626;
    margin-bottom: 8px;
}

.property-address {
    color: #6B7280;
    margin-bottom: 12px;
    font-size: 14px;
}

.property-features {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #4B5563;
}

.property-feature {
    display: flex;
    align-items: center;
    gap: 4px;
}

.property-actions {
    display: flex;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid #F3F4F6;
}

.property-actions button {
    flex: 1;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #DC2626;
    color: white;
    border: none;
}

.btn-primary:hover {
    background: #B91C1C;
}

.btn-secondary {
    background: transparent;
    color: #DC2626;
    border: 1px solid #DC2626;
}

.btn-secondary:hover {
    background: #DC2626;
    color: white;
}

/* Map styles */
.map-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
}

.mapboxgl-popup-content {
    border-radius: 8px;
    padding: 16px;
}

.map-property-popup {
    max-width: 300px;
}

.map-property-popup img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 12px;
}

.map-property-popup .price {
    font-size: 18px;
    font-weight: 700;
    color: #DC2626;
    margin-bottom: 4px;
}

.map-property-popup .address {
    color: #6B7280;
    font-size: 14px;
    margin-bottom: 8px;
}

.map-property-popup .features {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #4B5563;
    margin-bottom: 12px;
}

/* Neighborhood card styles */
.neighborhood-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

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

.neighborhood-header {
    background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
    color: white;
    padding: 24px;
}

.neighborhood-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 20px;
}

.stat-item {
    text-align: center;
    padding: 16px;
    background: #F9FAFB;
    border-radius: 8px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #DC2626;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: #6B7280;
    text-transform: uppercase;
    font-weight: 500;
}

/* Blog card styles */
.blog-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

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

.blog-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.blog-content {
    padding: 20px;
}

.blog-category {
    display: inline-block;
    background: #FEE2E2;
    color: #DC2626;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

.blog-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}

.blog-excerpt {
    color: #6B7280;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.blog-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #9CA3AF;
    padding-top: 16px;
    border-top: 1px solid #F3F4F6;
}

/* Chat widget styles */
.chat-message {
    margin-bottom: 16px;
}

.chat-message.user {
    text-align: right;
}

.chat-message.user .message-bubble {
    background: #DC2626;
    color: white;
    display: inline-block;
    padding: 8px 12px;
    border-radius: 18px 18px 4px 18px;
    max-width: 80%;
}

.chat-message.agent .message-bubble {
    background: #F3F4F6;
    color: #374151;
    display: inline-block;
    padding: 8px 12px;
    border-radius: 18px 18px 18px 4px;
    max-width: 80%;
}

/* Animation classes */
.fade-in {
    opacity: 0;
    animation: fadeIn 0.5s ease-in-out forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.slide-up {
    transform: translateY(20px);
    opacity: 0;
    animation: slideUp 0.5s ease-out forwards;
}

@keyframes slideUp {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Loading states */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #DC2626;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    .property-features {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .property-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .neighborhood-stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stat-item {
        padding: 12px;
    }
    
    .stat-value {
        font-size: 20px;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #F3F4F6;
}

::-webkit-scrollbar-thumb {
    background: #DC2626;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #B91C1C;
}

/* Focus styles for accessibility */
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #DC2626;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .property-card {
        border: 2px solid #000;
    }
    
    .btn-secondary {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}