/* Locanalyst Specific Styles */

/* Property Cards */
.property-card {
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    height: 100%;
}

.property-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.property-badge {
    position: absolute;
    top: 10px;
    right: 10px;
}

.property-address {
    font-size: 0.9rem;
    color: #666;
}

.property-size,
.property-price {
    font-size: 0.95rem;
    font-weight: 500;
}

/* Map Styles */
.radius-circle {
    stroke: #007bff;
    stroke-width: 2;
    stroke-opacity: 0.8;
    fill: #007bff;
    fill-opacity: 0.1;
}

.map-marker-popup {
    max-width: 250px;
}

/* Competitor Markers */
.competitor-marker {
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Delete button styling */
.delete-competitor-btn {
    transition: all 0.2s ease;
}

.delete-competitor-btn:hover {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: white !important;
    transform: scale(1.05);
}

/* Competitor card animations */
.competitor-card {
    transition: all 0.3s ease;
}

.competitor-card.deleting {
    opacity: 0.5;
    transform: scale(0.95);
    pointer-events: none;
}

/* Success alert positioning */
.alert.position-fixed {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.competitor-marker .marker-content {
    color: white;
    font-weight: bold;
    font-size: 12px;
    text-align: center;
    line-height: 1;
}

/* Favicon-specific styling */
.competitor-marker.favicon-marker {
    border-width: 3px;
    background-color: transparent;
    padding: 2px;
}

.competitor-marker.favicon-marker img {
    width: 100% !important;
    height: 100% !important;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    max-width: none;
    max-height: none;
    background-color: white;
}

/* Ensure favicon markers have proper dimensions */
.competitor-marker.favicon-marker {
    width: 32px !important;
    height: 32px !important;
    box-sizing: border-box;
}

/* Threat level border colors for favicon markers */
.competitor-marker.favicon-marker.competitor-high {
    border-color: #dc3545;
    background-color: transparent;
}

.competitor-marker.favicon-marker.competitor-medium {
    border-color: #ffc107;
    background-color: transparent;
}

.competitor-marker.favicon-marker.competitor-low {
    border-color: #28a745;
    background-color: transparent;
}

/* Original icon-based markers (fallback) */
.competitor-high:not(.favicon-marker) {
    background-color: #dc3545;
}

.competitor-medium:not(.favicon-marker) {
    background-color: #ffc107;
}

.competitor-low:not(.favicon-marker) {
    background-color: #28a745;
}

.property-marker {
    background-color: #007bff;
}

/* Competitor Results */
.competitor-card {
    border-left: 5px solid #ccc;
    transition: transform 0.2s;
}

.competitor-card:hover {
    transform: translateX(5px);
}

.competitor-card.threat-high {
    border-left-color: #dc3545;
}

.competitor-card.threat-medium {
    border-left-color: #ffc107;
}

.competitor-card.threat-low {
    border-left-color: #28a745;
}

/* Highlight animation for selected property */
@keyframes highlight-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(0, 123, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
    }
}

.highlight-form {
    animation: highlight-pulse 1.5s ease-out;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Sticky filters on scroll */
@media (min-width: 768px) {
    .sticky-top {
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }
}

/* SWOT Analysis styling */
.swot-section {
    margin-bottom: 15px;
}

.swot-strengths {
    color: #28a745;
}

.swot-weaknesses {
    color: #dc3545;
}

.swot-opportunities {
    color: #007bff;
}

.swot-threats {
    color: #ffc107;
}

/* Market Analysis */
.demographic-card {
    background-color: #f8f9fa;
    border-left: 4px solid #6610f2;
}

.market-insight-card {
    background-color: #f8f9fa;
    border-left: 4px solid #20c997;
}

/* Toggle button for filters on mobile */
@media (max-width: 767.98px) {
    #search-filters {
        max-height: 400px;
        overflow-y: auto;
    }
}

/* Census Tract Info Box Styles */
.info {
    padding: 6px 8px;
    font: 14px/16px Arial, Helvetica, sans-serif;
    background: white;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    border-radius: 5px;
}

.info h4 {
    margin: 0 0 5px;
    color: #777;
}

/* Demographics Display Styles */
.demographics-section {
    margin-top: 2rem;
}

.demographics-section h5 {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.accordion-item {
    border: 1px solid #e9ecef;
    margin-bottom: 0.5rem;
    border-radius: 0.375rem !important;
    overflow: hidden;
}

.accordion-button {
    background-color: #f8f9fa;
    border: none;
    padding: 1rem 1.25rem;
    font-weight: 600;
    color: #495057;
}

.accordion-button:not(.collapsed) {
    background-color: #e7f3ff;
    color: #0056b3;
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.accordion-body {
    padding: 1.5rem;
    background-color: #fff;
}

.demographics-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f3f4;
}

.demographics-item:last-child {
    border-bottom: none;
}

.demographics-label {
    font-weight: 500;
    color: #495057;
    flex: 1;
}

.demographics-value {
    font-weight: 600;
    color: #2c3e50;
    text-align: right;
    min-width: 100px;
}

/* Highlight important values */
.demographics-value.highlight {
    color: #0056b3;
    background-color: #e7f3ff;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .demographics-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .demographics-value {
        text-align: left;
        margin-top: 0.25rem;
        min-width: auto;
    }
}

/* Animation for accordion */
.accordion-collapse {
    transition: all 0.3s ease-in-out;
}

/* Custom styling for different data types */
.demographics-value.currency {
    color: #28a745;
}

.demographics-value.percentage {
    color: #6f42c1;
}

.demographics-value.population {
    color: #fd7e14;
}

/* Enhanced Pricing Display Styles */
.pricing-patterns-container {
    margin-bottom: 1.5rem;
}

.pricing-patterns-container .card {
    transition: all 0.2s ease-in-out;
}

.pricing-patterns-container .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.price-display h6 {
    font-weight: 600;
    font-size: 1.1rem;
}

.price-confidence i {
    font-size: 1.2rem;
    cursor: help;
}

.context-preview {
    max-height: 3rem;
    overflow: hidden;
    line-height: 1.4;
}

/* Structured Products Styles */
.structured-products-container .product-card {
    transition: all 0.2s ease-in-out;
    border: 1px solid #e9ecef;
}

.structured-products-container .product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    border-color: #007bff;
}

.product-thumbnail {
    border: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

.product-info .card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
}

.price-section {
    border-bottom: 1px solid #f1f3f4;
    padding-bottom: 0.5rem;
}

.product-description {
    border-bottom: 1px solid #f8f9fa;
    padding-bottom: 0.5rem;
}

.product-metadata .badge {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Accordion Enhancements */
.accordion-button {
    font-weight: 600;
    padding: 0.75rem 1rem;
}

.accordion-button:not(.collapsed) {
    background-color: rgba(13, 110, 253, 0.1);
    border-color: rgba(13, 110, 253, 0.25);
}

.accordion-body {
    padding: 1rem;
    background-color: #fafbfc;
}

/* Badge Enhancements */
.badge.bg-opacity-75 {
    --bs-bg-opacity: 0.75;
}

/* Responsive Improvements */
@media (max-width: 768px) {
    .pricing-patterns-container .col-md-3 {
        margin-bottom: 0.5rem;
    }

    .structured-products-container .col-lg-4 {
        margin-bottom: 1rem;
    }

    .product-card .card-body {
        padding: 1rem !important;
    }
}

/* Animation for loading states */
.pricing-loading {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

/* Special styling for price confidence indicators */
.price-confidence .bi-check-circle-fill {
    color: #28a745 !important;
}

.price-confidence .bi-check-circle {
    color: #17a2b8 !important;
}

.price-confidence .bi-question-circle {
    color: #ffc107 !important;
}

/* Enhanced summary cards */
.pricing-patterns-container .card.border-success,
.pricing-patterns-container .card.border-primary,
.pricing-patterns-container .card.border-danger,
.pricing-patterns-container .card.border-info {
    border-width: 2px;
}

.structured-products-container .card.border-primary,
.structured-products-container .card.border-success,
.structured-products-container .card.border-info {
    border-width: 2px;
}

/* Pricing Display Improvements */
.pricing-simple-container .card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pricing-simple-container .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.pricing-simple-container .price-info h5 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.pricing-simple-container .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Products Display Improvements */
.products-simple-container .card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.products-simple-container .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.products-simple-container .card-title {
    font-size: 1rem;
    line-height: 1.3;
}

.products-simple-container .price-section h5 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.products-simple-container .product-tags .badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
}

/* Text truncation improvements */
.text-truncate-custom {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-truncate-multiline {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

/* Better spacing for pricing cards */
.pricing-simple-container .row.g-3>* {
    margin-bottom: 1rem;
}

.products-simple-container .row.g-3>* {
    margin-bottom: 1rem;
}

/* Improved badge styling */
.badge.bg-light {
    color: #495057 !important;
    border: 1px solid #dee2e6;
}

/* Better availability badges */
.badge.bg-success {
    background-color: #198754 !important;
}

.badge.bg-danger {
    background-color: #dc3545 !important;
}

.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
}

/* Tract Analysis Map Visualization Styles */
.tract-info-marker {
    background: transparent !important;
    border: none !important;
    font-size: 16px;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

.tract-analysis-popup .leaflet-popup-content-wrapper {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.tract-analysis-popup .leaflet-popup-content {
    margin: 12px 16px;
    line-height: 1.4;
}

.tract-popup {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.tract-popup h6 {
    color: #2c3e50;
    margin-bottom: 8px;
    font-weight: 600;
}

.tract-popup .row {
    margin: 0;
}

.tract-popup .col-6 {
    padding: 0 4px;
}

.tract-popup hr {
    margin: 8px 0;
    border-color: #e9ecef;
}

.tract-popup small {
    font-size: 0.75rem;
    color: #6c757d;
}

.tract-popup .badge {
    font-size: 0.7rem;
    padding: 0.25em 0.5em;
}

/* Subtle radius circle animations */
@keyframes tractCirclePulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 0.3;
    }

    100% {
        opacity: 0.6;
    }
}

.leaflet-interactive[stroke="#007bff"] {
    animation: tractCirclePulse 3s ease-in-out infinite;
}

.leaflet-interactive[stroke="#28a745"] {
    animation: tractCirclePulse 4s ease-in-out infinite;
}