/* HB Sales Comparison V2 - Clean, Modern Styles */

.hbsc-v2-container {
    max-width: 1200px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
}

.hbsc-v2-header {
    margin-bottom: 40px;
    padding: 20px;
    background: linear-gradient(135deg, #014785 0%, #0066cc 100%);
    color: white;
    border-radius: 10px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    text-align: left;
}

.header-right {
    display: flex;
    align-items: center;
}

.homebench-logo {
    height: 50px;
    width: auto;
    max-width: 150px;
}

.homebench-logo-50 {
    height: 50px;
    width: 50px;
    object-fit: contain;
}

.hbsc-v2-header h2 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 300;
}

.hbsc-v2-header h2.white-title {
    color: white;
}

/* Sections */
.hbsc-v2-section {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hbsc-v2-section h3 {
    margin: 0 0 25px 0;
    font-size: 1.5rem;
    color: #2c3e50;
    border-bottom: 2px solid #014785;
    padding-bottom: 10px;
}

/* Form Elements */
.hbsc-v2-form-group {
    margin-bottom: 25px;
}

.hbsc-v2-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.hbsc-v2-input,
.hbsc-v2-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.hbsc-v2-input:focus,
.hbsc-v2-select:focus {
    outline: none;
    border-color: #014785;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Development Search Group */
.development-search-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.development-search-group input {
    flex: 1;
}

.development-search-group select {
    flex: 2;
}

/* New Layout Structure */
.search-controls-row {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 25px;
}

.choose-developments-section {
    margin-bottom: 25px;
}

.choose-developments-section h4 {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    color: #2c3e50;
}

.choose-developments-section .hbsc-v2-select {
    width: 50%;
}

.map-selected-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.map-section {
    display: flex;
    flex-direction: column;
}

.action-buttons {
    display: flex;
    gap: 15px;
    align-items: center;
}

.dropdown-section {
    display: flex;
    flex-direction: column;
}

.selected-section {
    display: flex;
    flex-direction: column;
}

.selected-section h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1rem;
    border-bottom: 2px solid #014785;
    padding-bottom: 8px;
}

/* Map Container */
.map-container {
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background: white;
    overflow: hidden;
}

/* Custom Map Markers */
.custom-marker {
    background: transparent;
    border: none;
}

.custom-marker div {
    transition: transform 0.2s ease;
}

.custom-marker div:hover {
    transform: scale(1.1);
}

.development-map {
    height: 300px;
    width: 100%;
}

.map-legend {
    padding: 8px 12px;
    background: #f8f9fa;
    border-top: 1px solid #e1e5e9;
    text-align: center;
}

.map-legend small {
    color: #6c757d;
    font-size: 0.85rem;
}

/* Status Filter Radio Buttons */
.status-filter-group {
    display: flex;
    gap: 20px;
    margin-top: 8px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: #2c3e50;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.3s ease;
}

.radio-label:hover {
    background-color: #f8f9fa;
}

.radio-label input[type="radio"] {
    margin-right: 8px;
    accent-color: #014785;
}

.radio-label input[type="radio"]:checked + .radio-text {
    color: #014785;
    font-weight: 600;
}

/* Unified Development Container */
.unified-development-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    min-height: 400px;
}

.development-list-container {
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background: white;
}

.development-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.development-item {
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    background: #f8f9fa;
}

.development-item:hover {
    background: #e3f2fd;
    border-color: #014785;
    transform: translateX(2px);
}

.development-item:last-child {
    margin-bottom: 0;
}

.development-name {
    font-weight: 600;
    color: #2c3e50;
    display: block;
    margin-bottom: 4px;
}

.developer-name {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.loading-message {
    text-align: center;
    color: #7f8c8d;
    padding: 40px 20px;
    font-style: italic;
}

/* Selected Developments Container */
.selected-developments-container {
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background: white;
    padding: 15px;
}

.selected-section {
    margin-bottom: 25px;
}

.selected-section:last-child {
    margin-bottom: 0;
}

.selected-section h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1rem;
    border-bottom: 2px solid #014785;
    padding-bottom: 8px;
}

.selected-primary-container,
.selected-comparators-container {
    min-height: 60px;
    border: 2px dashed #bdc3c7;
    border-radius: 6px;
    padding: 15px;
    background: #f8f9fa;
}

.selected-development-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    border-left: 4px solid #014785;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.selected-development-item:last-child {
    margin-bottom: 0;
}

.selected-development-item .development-info {
    flex: 1;
}

.selected-development-item .development-name {
    margin-bottom: 4px;
}

.selected-development-item .developer-name {
    font-size: 0.85rem;
}

.remove-development {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    line-height: 1;
}

.remove-development:hover {
    background: #c0392b;
}

.empty-selection {
    color: #7f8c8d;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.primary-indicator {
    background: #27ae60;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Comparator List Styling */
.comparator-list {
    min-height: 120px;
    border: 2px dashed #bdc3c7;
    border-radius: 6px;
    padding: 15px;
    background: #f8f9fa;
}

.comparator-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    border-left: 4px solid #014785;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.comparator-item:last-child {
    margin-bottom: 0;
}

.comparator-remove {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 2px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.comparator-remove:hover {
    background: #c0392b;
}

/* Buttons */
.hbsc-v2-btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-right: 10px;
    margin-bottom: 10px;
}

.hbsc-v2-btn-primary {
    background: #014785;
    color: white;
}

.hbsc-v2-btn-primary:hover:not(:disabled) {
    background: #0066cc;
    transform: translateY(-1px);
}

.hbsc-v2-btn-primary:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

.hbsc-v2-btn-secondary {
    background: #95a5a6;
    color: white;
}

.hbsc-v2-btn-secondary:hover {
    background: #7f8c8d;
}

.hbsc-v2-btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

/* Plot Controls */
.plot-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    align-items: center;
    flex-wrap: wrap;
}

.plot-controls select {
    width: auto;
    min-width: 200px;
}

/* Loading States */
.hbsc-v2-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #014785;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.progress-container {
    margin-top: 1rem;
    width: 100%;
    max-width: 400px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #014785, #0066cc);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-text {
    font-size: 0.875rem;
    color: #014785;
    font-weight: 600;
}

/* Loading Progress Steps */
.loading-progress {
    margin-top: 20px;
    text-align: left;
    max-width: 300px;
}

.progress-step {
    padding: 8px 12px;
    margin: 4px 0;
    border-radius: 6px;
    background: #f8f9fa;
    color: #666;
    font-size: 0.9rem;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.progress-step.active {
    background: #e3f2fd;
    color: #014785;
    opacity: 1;
    font-weight: 600;
}

.progress-step.completed {
    background: #e8f5e8;
    color: #2e7d32;
    opacity: 1;
}

.progress-step.completed::after {
    content: " ✓";
    color: #4caf50;
    font-weight: bold;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tables */
.hbsc-v2-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hbsc-v2-table th,
.hbsc-v2-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e1e5e9;
}

.hbsc-v2-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #e1e5e9;
}

.hbsc-v2-table tr:hover {
    background: #f8f9fa;
}

.hbsc-v2-table tr:last-child td {
    border-bottom: none;
}

/* Status Colors */
.status-available {
    color: #27ae60;
    font-weight: 600;
}

.status-sold {
    color: #e74c3c;
    font-weight: 600;
}

.status-reserved {
    color: #f39c12;
    font-weight: 600;
}

/* Report Cards */
.report-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 4px solid #014785;
}

.report-card h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
}

.report-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 600;
    color: #014785;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-top: 5px;
}

/* Debug Panel */
.hbsc-v2-debug {
    background: #2c3e50;
    color: #ecf0f1;
    border-radius: 8px;
    padding: 20px;
    margin-top: 30px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.hbsc-v2-debug h4 {
    margin: 0 0 15px 0;
    color: #ecf0f1;
}

.debug-entry {
    background: rgba(255,255,255,0.1);
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
    border-left: 3px solid #014785;
}

.debug-timestamp {
    color: #95a5a6;
    font-size: 12px;
}

.debug-error {
    border-left-color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.debug-success {
    border-left-color: #27ae60;
    background: rgba(39, 174, 96, 0.1);
}

/* Statistics Section */
.stats-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.stats-info h4 {
    margin: 0 0 5px 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.stats-info small {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stats-card {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.stats-card h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-card-icon {
    font-size: 1.3rem;
}

.stats-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.stats-metrics.single-column {
    grid-template-columns: 1fr;
}

.stats-metrics.three-column {
    grid-template-columns: repeat(3, 1fr);
}

.metric-item {
    text-align: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #014785;
}

.metric-value {
    display: block;
    font-size: 1.4rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 2px;
}

.metric-label {
    display: block;
    font-size: 0.85rem;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-change {
    font-size: 0.8rem;
    margin-top: 3px;
}

.metric-change.positive {
    color: #27ae60;
}

.metric-change.negative {
    color: #e74c3c;
}

/* Chart Container */
.chart-container {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.chart-placeholder {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: 2px dashed #bdc3c7;
    border-radius: 6px;
    color: #7f8c8d;
    font-style: italic;
}

/* Price Distribution */
.price-distribution {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.price-range-bar {
    flex: 1;
    min-width: 80px;
    text-align: center;
    background: #e3f2fd;
    border-radius: 4px;
    padding: 8px 4px;
    border-bottom: 3px solid #014785;
    font-size: 0.85rem;
}

.price-range-bar .range-label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 2px;
}

.price-range-bar .range-count {
    color: #014785;
    font-weight: 600;
}

/* Availability Breakdown */
.availability-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.availability-item {
    text-align: center;
    padding: 15px 10px;
    border-radius: 6px;
    background: #f8f9fa;
}

.availability-item.available {
    background: rgba(39, 174, 96, 0.1);
    border: 2px solid #27ae60;
    color: #27ae60;
}

.availability-item.sold {
    background: rgba(231, 76, 60, 0.1);
    border: 2px solid #e74c3c;
    color: #e74c3c;
}

.availability-item.reserved {
    background: rgba(243, 156, 18, 0.1);
    border: 2px solid #f39c12;
    color: #f39c12;
}

.availability-item.other {
    background: rgba(149, 165, 166, 0.1);
    border: 2px solid #95a5a6;
    color: #95a5a6;
}

.availability-count {
    display: block;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.availability-label {
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.availability-percentage {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-top: 3px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hbsc-v2-container {
        margin: 10px;
        padding: 0 10px;
    }
    
    .map-selected-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .action-buttons button {
        width: 100%;
    }
    
    .development-map {
        height: 250px;
    }
    
    .search-controls {
        gap: 15px;
    }
    
    .status-filter-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .plot-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .plot-controls select,
    .plot-controls button {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .report-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .development-cards-carousel {
        margin: 20px 0;
    }
    
    .carousel-navigation {
        flex-direction: column;
        gap: 15px;
        margin-bottom: 15px;
    }
    
    .carousel-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .carousel-indicators {
        order: -1;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .card-image img {
        height: 150px;
    }
}

/* Enhanced Development Cards */
.report-summary {
    text-align: center;
    margin-bottom: 30px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    color: #666;
}

/* PDF Generation Section */
.pdf-generation-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

.pdf-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #014785;
}

.pdf-info p {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-weight: 500;
}

.pdf-info ul {
    margin: 0;
    padding-left: 20px;
    color: #666;
}

.pdf-info li {
    margin-bottom: 8px;
}

.pdf-actions {
    text-align: center;
}

#generate-pdf-btn {
    width: 100%;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
}

.pdf-btn-spinner {
    display: none;
}

.pdf-result {
    background: rgba(39, 174, 96, 0.1);
    border: 2px solid #27ae60;
    border-radius: 8px;
    padding: 20px;
    margin-top: 15px;
}

.pdf-success p {
    color: #27ae60;
    font-weight: 600;
    margin: 0 0 15px 0;
}

.pdf-error {
    background: rgba(231, 76, 60, 0.1);
    border: 2px solid #e74c3c;
    border-radius: 8px;
    padding: 20px;
    margin-top: 15px;
}

.pdf-error p {
    color: #e74c3c;
    font-weight: 600;
    margin: 0;
}

#download-pdf-link {
    width: 100%;
    padding: 12px 20px;
    text-decoration: none;
    display: inline-block;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .pdf-generation-controls {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Report Footer */
.hbsc-v2-footer {
    margin-top: 60px;
    padding: 30px 0;
    border-top: 2px solid #e9ecef;
    background: #f8f9fa;
}

.report-metadata {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
}

.report-metadata p {
    margin: 0;
    padding: 10px 0;
}

.report-metadata strong {
    color: #014785;
    font-weight: 600;
}

/* Development Cards Grid - Compact 3-Wide Layout */
.development-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0;
    padding: 20px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .development-cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Compact Development Cards */
.compact-dev-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    border: 1px solid #e1e5e9;
}

.compact-dev-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.compact-dev-card.primary-card {
    border: 2px solid #27ae60;
}

.compact-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #27ae60;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 2;
}

.compact-image {
    height: 120px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.compact-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.compact-no-image {
    color: #6c757d;
    font-size: 0.8rem;
}

.compact-content {
    padding: 16px;
}

.compact-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
    line-height: 1.2;
}

.compact-subtitle {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-bottom: 12px;
    line-height: 1.2;
}

.compact-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.compact-stat {
    text-align: center;
    padding: 8px 4px;
    background: #f8f9fa;
    border-radius: 4px;
}

.compact-stat .stat-number {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.1;
}

.compact-stat .stat-text {
    display: block;
    font-size: 0.7rem;
    color: #7f8c8d;
    line-height: 1;
}

.compact-price-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 8px;
}

.compact-price, .compact-sqft {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px;
    background: #f8f9fa;
    border-radius: 4px;
}

.compact-price .price-label, .compact-sqft .sqft-label {
    font-size: 0.75rem;
    color: #7f8c8d;
    margin-bottom: 2px;
}

.compact-price .price-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #27ae60;
}

.compact-sqft .sqft-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #3498db;
}

.compact-range {
    margin-bottom: 8px;
}

.compact-range .range-text {
    font-size: 0.8rem;
    color: #7f8c8d;
}

.compact-launch {
    font-size: 0.75rem;
    color: #95a5a6;
    border-top: 1px solid #ecf0f1;
    padding-top: 8px;
}

/* Statistics Charts */
.stats-card.full-width {
    grid-column: 1 / -1;
}

.chart-container {
    padding: 20px;
    text-align: center;
}

.chart-container canvas {
    max-width: 100%;
    height: auto;
}

/* Override for specific chart types to prevent conflicts */
.chart-container:not(.donut-chart) canvas {
    max-width: 100%;
    height: auto;
}

/* Donut Charts - Responsive Container with high specificity */
.stats-card .chart-container.donut-chart {
    position: relative;
    height: 300px;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ultra-specific selector to override all conflicts */
.hbsc-v2-container .stats-card .chart-container.donut-chart canvas,
#availableUnitsByDeveloperChart,
#propertyTypesChart {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    min-width: 0 !important;
    min-height: 0 !important;
}

/* Area Comparison Chart Container - Fixed Height */
#area-comparison-chart .chart-container {
    height: 400px !important;
    overflow: hidden;
}

#areaComparisonCanvas {
    max-height: 360px !important;
}

/* Clean Card Variables */
:root {
    --card-width: 320px;
    --card-height: 480px;
}

@keyframes fadeInCarousel {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.carousel-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* Clean Carousel Track */
.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    padding: 20px 0;
    gap: 30px;
    align-items: flex-start;
}

/* Clean Card Structure */
.carousel-slide {
    flex-shrink: 0;
    width: var(--card-width);
    transition: transform 0.3s ease;
}

.carousel-slide:hover {
    transform: translateY(-5px);
}

.dev-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    height: var(--card-height);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.3s ease;
}

.dev-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.primary-card {
    border: 2px solid #27ae60;
}

.primary-card .card-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #27ae60;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
}

.card-image {
    height: 200px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-image {
    color: #6c757d;
    font-size: 0.9rem;
}

.card-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.dev-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 5px 0;
    line-height: 1.3;
}

.dev-subtitle {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin: 0 0 15px 0;
}

.compact-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 18px 0;
}

.stat-compact {
    text-align: center;
    padding: 10px 8px;
    background: #f8f9fa;
    border-radius: 6px;
    min-height: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: #014785;
    line-height: 1;
}

.stat-label {
    display: block;
    font-size: 0.7rem;
    color: #6c757d;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dev-status {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #e3f2fd;
    color: #1976d2;
    align-self: flex-start;
}

.launch-date, .sold-out-date {
    font-size: 0.8rem;
    color: #6c757d;
}

.price-details {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.price-row .label {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
}

.price-row .value {
    font-size: 0.85rem;
    color: #2c3e50;
    font-weight: 600;
}

/* Navigation Controls */
.carousel-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.carousel-nav-btn {
    background: #014785;
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(1, 71, 133, 0.3);
}

.carousel-nav-btn:hover:not(:disabled) {
    background: #0066cc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(1, 71, 133, 0.4);
}

.carousel-nav-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    box-shadow: none;
}

/* Dots Navigation */
.dots-container {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.dot {
    width: 8px;
    height: 8px;
    background-color: #014785;
    border-radius: 50%;
    opacity: 0.3;
    transition: transform 0.3s ease, opacity 0.3s ease;
    cursor: pointer;
}

.dot.active {
    opacity: 1;
    transform: scale(1.3);
}

.dot:hover {
    opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 768px) {
    :root {
        --card-width: 300px;
        --card-height: 450px;
    }
    
    .development-cards-carousel {
        padding: 20px 0;
    }
    
    .carousel-track {
        gap: 20px;
        padding: 20px 0;
    }
    
    .card-content {
        padding: 20px;
    }
    
    .content-text {
        font-size: 1.6rem;
    }
    
    .carousel-nav-btn {
        width: 40px;
        height: 40px;
    }
}

/* 3D Carousel Positions */
.carousel-slide.hideLeft {
    left: 0%;
    opacity: 0;
    transform: translateY(50%) translateX(-50%);
    z-index: 1;
}

.carousel-slide.hideLeft .dev-card {
    width: 200px;
}

.carousel-slide.hideRight {
    left: 100%;
    opacity: 0;
    transform: translateY(50%) translateX(-50%);
    z-index: 1;
}

.carousel-slide.hideRight .dev-card {
    width: 200px;
}

.carousel-slide.prevLeftSecond {
    z-index: 4;
    left: 15%;
    transform: translateY(50%) translateX(-50%);
    opacity: 0.7;
}

.carousel-slide.prevLeftSecond .dev-card {
    width: 200px;
}

.carousel-slide.prev {
    z-index: 5;
    left: 30%;
    transform: translateY(50px) translateX(-50%);
}

.carousel-slide.prev .dev-card {
    width: 300px;
}

.carousel-slide.selected {
    z-index: 10;
    left: 50%;
    transform: translateY(0px) translateX(-50%);
}

.carousel-slide.selected .dev-card {
    width: 400px;
}

.carousel-slide.next {
    z-index: 5;
    left: 70%;
    transform: translateY(50px) translateX(-50%);
}

.carousel-slide.next .dev-card {
    width: 300px;
}

.carousel-slide.nextRightSecond {
    z-index: 4;
    left: 85%;
    transform: translateY(50%) translateX(-50%);
    opacity: 0.7;
}

.carousel-slide.nextRightSecond .dev-card {
    width: 200px;
}

/* Hover effects for better interactivity */
.carousel-slide:hover .dev-card {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
}

.carousel-slide.selected:hover .dev-card {
    transform: translateY(-10px);
}

/* Navigation buttons positioned at bottom */
.carousel-navigation-bottom {
    position: absolute;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 20;
}

@media (min-width: 769px) {
    .carousel-nav-btn {
        opacity: 0.7;
        transition: opacity 0.3s ease, background 0.3s ease, transform 0.3s ease;
    }
}

/* Focus states for accessibility */
.carousel-nav-btn:focus,
.carousel-indicator:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

/* Loading state */
.carousel-slide.loading {
    opacity: 0.5;
}

.carousel-slide.loading .dev-card {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.dev-card {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dev-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(0,0,0,0.15);
}

.primary-card {
    border-left: 4px solid #27ae60;
}

.card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #27ae60;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 2;
}

.card-image {
    height: 200px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-image {
    color: #999;
    font-style: italic;
}

.card-content {
    padding: 20px;
}

.dev-title {
    color: #2c5aa0;
    margin: 0 0 5px 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.dev-subtitle {
    color: #666;
    margin: 0 0 15px 0;
    font-size: 1rem;
}

.dev-dates {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.date-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.date-item:last-child {
    margin-bottom: 0;
}

.date-label {
    color: #2c5aa0;
    font-weight: 600;
    font-size: 0.9rem;
}

.date-value {
    color: #666;
    font-size: 0.9rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.stats-section {
    background: #fafbfc;
    border: 1px solid #e8eaed;
    border-radius: 8px;
    padding: 15px;
}

.stats-section h4 {
    color: #2c5aa0;
    margin: 0 0 12px 0;
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 10px;
}

.stat-row:last-child {
    margin-bottom: 0;
}

.stat-large {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.2;
}

.stat-label {
    color: #666;
    font-size: 0.85rem;
    margin-top: 2px;
}

.price-range {
    text-align: center;
}

.price-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 8px;
}

.price-large {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.2;
}

.price-large.positive {
    color: #27ae60;
}

.price-large.negative {
    color: #e74c3c;
}

.price-label {
    color: #666;
    font-size: 0.8rem;
    margin-top: 2px;
}

/* Compact Stats Layout */
.compact-stats {
    display: flex;
    gap: 15px;
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
}

.stat-compact {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 70px;
}

.stat-compact .stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #014785;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-compact .stat-label {
    font-size: 0.75rem;
    color: #666;
    text-align: center;
}

.dev-status {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 15px 0;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.active {
    background: #27ae60;
    color: white;
}

.launch-date, .sold-out-date {
    font-size: 0.9rem;
    color: #666;
}

.price-details {
    margin-top: 10px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.price-row .label {
    color: #666;
    font-weight: 500;
}

.price-row .value {
    color: #014785;
    font-weight: 600;
}

.price-range-text {
    color: #666;
    font-size: 0.85rem;
    line-height: 1.3;
}

.incentive-stats {
    text-align: center;
}

.percentage-text {
    color: #666;
    font-size: 0.85rem;
    margin-top: 5px;
}

.percentage-text.positive {
    color: #27ae60;
}

.percentage-text.negative {
    color: #e74c3c;
}

/* Section 5: Comparison Analysis */
.comparison-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid #e1e5e9;
}

.comparison-tab {
    background: none;
    border: none;
    padding: 12px 20px;
    font-size: 1rem;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.comparison-tab:hover {
    color: #014785;
    background-color: #f8f9fa;
}

.comparison-tab.active {
    color: white;
    background-color: #014785;
    border-bottom-color: #014785;
    font-weight: 600;
    border-radius: 5px 5px 0 0;
}

/* Individual Rankings */
.ranking-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
}

.ranking-chart {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ranking-chart h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.1rem;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #014785;
}

.ranking-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 6px;
    background: #fafbfc;
    transition: all 0.2s ease;
}

.ranking-item:hover {
    background: #f0f7ff;
}

.ranking-item.primary-bar {
    background: #e8f5e8;
    border-left: 4px solid #27ae60;
}

.ranking-position {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2c3e50;
    min-width: 25px;
    text-align: center;
    background: #014785;
    color: white;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.ranking-item.primary-bar .ranking-position {
    background: #27ae60;
}

.ranking-content {
    flex: 1;
}

.ranking-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 0.95rem;
}

.ranking-bar-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ranking-bar {
    height: 20px;
    background: linear-gradient(90deg, #014785, #0066cc);
    border-radius: 10px;
    min-width: 20px;
    transition: width 0.5s ease;
}

.ranking-item.primary-bar .ranking-bar {
    background: linear-gradient(90deg, #27ae60, #229954);
}

.ranking-value {
    font-weight: 600;
    color: #2c3e50;
    min-width: 80px;
    text-align: right;
    font-size: 0.9rem;
}

/* Aggregate Comparison */
.aggregate-comparison {
    margin-bottom: 30px;
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.comparison-metric {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.metric-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #ecf0f1;
}

.metric-comparison {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.primary-value,
.comparator-value {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
}

.primary-value {
    background: #e8f5e8;
}

.primary-value .label {
    color: #27ae60;
    font-weight: 600;
}

.comparator-value .label {
    color: #666;
    font-weight: 600;
}

.value {
    font-weight: 700;
    color: #2c3e50;
}

.difference {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    border-radius: 6px;
    font-weight: 700;
    margin-top: 5px;
}

.difference.positive {
    background: #d5edf5;
    color: #1e7e92;
}

.difference.negative {
    background: #f8e6e6;
    color: #c0392b;
}

/* Individual Comparators Table */
.individual-comparators {
    margin-top: 30px;
}

.individual-comparators h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
}

.comparator-table {
    overflow-x: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.comparator-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.comparator-table th,
.comparator-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #e1e5e9;
}

.comparator-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    position: sticky;
    top: 0;
}

.comparator-table .primary-row {
    background: #e8f5e8;
}

.comparator-table .primary-row td {
    color: #27ae60;
}

.comparator-table tr:hover:not(.primary-row) {
    background: #f0f7ff;
}

/* Responsive Design for Comparison Analysis */
@media (max-width: 768px) {
    .ranking-charts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .comparison-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .ranking-chart {
        padding: 15px;
    }
    
    .comparison-metric {
        padding: 15px;
    }
    
    .comparison-tabs {
        flex-direction: column;
        gap: 5px;
    }
    
    .comparison-tab {
        text-align: center;
    }
    
    .comparator-table {
        font-size: 0.8rem;
    }
    
    .comparator-table th,
    .comparator-table td {
        padding: 8px 6px;
    }
}

/* Market Statistics Section 6 */
.market-info-bar {
    background: linear-gradient(135deg, #014785 0%, #0066cc 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.market-area-info h4 {
    margin: 0 0 10px 0;
    font-size: 1.4rem;
    font-weight: 600;
}

.market-area-info p {
    margin: 5px 0;
    opacity: 0.95;
}

/* Market Summary Cards */
.market-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.market-summary-card {
    background: white;
    border: 1px solid #e8ecf4;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.market-summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-color: #014785;
}

.summary-card-icon {
    font-size: 2.5rem;
    margin-right: 15px;
    opacity: 0.8;
}

.summary-card-content {
    flex: 1;
}

.summary-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
}

.summary-label {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin: 5px 0;
    font-weight: 500;
}

.summary-change {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 15px;
    display: inline-block;
}

.summary-change.positive {
    background: rgba(39, 174, 96, 0.1);
    color: #27ae60;
}

.summary-change.negative {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.summary-comparison {
    font-size: 0.8rem;
    color: #95a5a6;
    margin-top: 5px;
}

/* Market Chart Tabs */
.market-chart-tabs {
    display: flex;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.market-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.market-tab:hover {
    color: #495057;
    background: rgba(1, 71, 133, 0.1);
}

.market-tab.active {
    background: #014785;
    color: white;
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.3);
}

/* Market Chart Container */
.market-chart-container {
    background: white;
    border: 1px solid #e8ecf4;
    border-radius: 12px;
    padding: 25px;
    min-height: 400px;
}

.chart-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f1f3f4;
}

.chart-header h5 {
    margin: 0;
    font-size: 1.2rem;
    color: #2c3e50;
    font-weight: 600;
}

/* Monthly Trends Chart */
.dual-axis-chart {
    display: flex;
    align-items: stretch;
    height: 300px;
    margin: 20px 0;
}

.chart-y-axis {
    width: 80px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
}

.chart-y-axis.left-axis {
    align-items: flex-end;
    padding-right: 10px;
}

.chart-y-axis.right-axis {
    align-items: flex-start;
    padding-left: 10px;
}

.axis-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #7f8c8d;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

.axis-scale {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    font-size: 0.75rem;
    color: #95a5a6;
}

.chart-content {
    flex: 1;
    position: relative;
    border-left: 2px solid #ecf0f1;
    border-right: 2px solid #ecf0f1;
    border-bottom: 2px solid #ecf0f1;
}

.chart-bars {
    display: flex;
    height: 100%;
    align-items: flex-end;
    justify-content: space-around;
    padding: 0 10px;
}

.chart-month-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    position: relative;
    width: 40px;
}

.chart-bar {
    width: 15px;
    margin: 0 2px;
    border-radius: 4px 4px 0 0;
    position: absolute;
    bottom: 20px;
}

.chart-bar.sales-bar {
    background: #014785;
}

.chart-bar.price-line {
    background: #e74c3c;
}

.chart-label {
    position: absolute;
    bottom: 0;
    font-size: 0.7rem;
    color: #7f8c8d;
    transform: rotate(-45deg);
    transform-origin: bottom;
    width: 60px;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.legend-color {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 3px;
    margin-right: 8px;
}

.legend-color.sales {
    background: #014785;
}

.legend-color.price {
    background: #e74c3c;
}

/* Property Types Chart */
.property-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.property-type-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    transition: all 0.3s ease;
}

.property-type-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.property-type-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.property-type-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 10px;
}

.property-type-icon.type-color-1 { background: #014785; }
.property-type-icon.type-color-2 { background: #2ecc71; }
.property-type-icon.type-color-3 { background: #e74c3c; }
.property-type-icon.type-color-4 { background: #f39c12; }
.property-type-icon.type-color-5 { background: #9b59b6; }

.property-type-header h6 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
}

.property-type-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: #2c3e50;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-top: 2px;
}

.property-type-bar {
    background: #ecf0f1;
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.6s ease;
}

.bar-fill.type-color-1 { background: #014785; }
.bar-fill.type-color-2 { background: #2ecc71; }
.bar-fill.type-color-3 { background: #e74c3c; }
.bar-fill.type-color-4 { background: #f39c12; }
.bar-fill.type-color-5 { background: #9b59b6; }

/* Price Bands Chart */
.price-bands-chart {
    max-width: 600px;
    margin: 0 auto;
}

.price-band-item {
    display: grid;
    grid-template-columns: 120px 1fr 60px;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f3f4;
}

.price-band-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #2c3e50;
}

.price-band-bar {
    position: relative;
    background: #ecf0f1;
    border-radius: 6px;
    height: 24px;
    overflow: hidden;
}

.price-band-bar .bar-fill {
    background: #014785;
    height: 100%;
    border-radius: 6px;
    transition: width 0.6s ease;
}

.bar-count {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: white;
    font-weight: 600;
}

.price-band-percent {
    font-size: 0.85rem;
    font-weight: 600;
    color: #7f8c8d;
    text-align: right;
}

/* Area Comparison Chart */
.comparison-chart {
    max-width: 700px;
    margin: 0 auto;
}

.comparison-metric {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.metric-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
    text-align: center;
}

.comparison-bars {
    display: grid;
    gap: 15px;
}

.comparison-bar {
    display: grid;
    grid-template-columns: 100px 1fr;
    align-items: center;
    gap: 15px;
}

.bar-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #7f8c8d;
}

.bar-container {
    position: relative;
    background: #ecf0f1;
    border-radius: 8px;
    height: 32px;
    overflow: hidden;
}

.bar-fill.local-bar {
    background: linear-gradient(90deg, #27ae60, #2ecc71);
}

.bar-fill.council-bar {
    background: linear-gradient(90deg, #e74c3c, #f39c12);
}

.bar-value {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    color: white;
    font-weight: 600;
}

/* Responsive Design for Market Statistics */
@media (max-width: 768px) {
    .market-summary-cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .market-chart-tabs {
        flex-direction: column;
        gap: 5px;
    }
    
    .market-tab {
        text-align: center;
    }
    
    .dual-axis-chart {
        height: 250px;
    }
    
    .chart-y-axis {
        width: 60px;
    }
    
    .chart-month-group {
        width: 30px;
    }
    
    .chart-bar {
        width: 12px;
    }
    
    .property-type-grid {
        grid-template-columns: 1fr;
    }
    
    .property-type-stats {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .comparison-bar {
        grid-template-columns: 80px 1fr;
        gap: 10px;
    }
    
    .price-band-item {
        grid-template-columns: 100px 1fr 50px;
        gap: 10px;
    }
}

/* New Chart Styles for Section 6 Updates */

/* Line Chart Styles */
.line-chart {
    position: relative;
    height: 300px;
    display: flex;
    align-items: stretch;
}

.line-chart .chart-content {
    flex: 1;
    position: relative;
    margin: 0 20px;
}

.chart-lines {
    position: relative;
    height: 100%;
    width: 100%;
}

.council-avg-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: #e74c3c;
    z-index: 2;
}

.line-label {
    position: absolute;
    right: 10px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    transform: translateY(-50%);
    z-index: 3;
}

.council-label {
    background: rgba(231, 76, 60, 0.9);
}

.price-line {
    position: relative;
    height: 100%;
    width: 100%;
}

.price-point {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #014785;
    border-radius: 50%;
    transform: translate(-50%, 50%);
    cursor: pointer;
    z-index: 4;
}

.price-point:hover {
    background: #0066cc;
    transform: translate(-50%, 50%) scale(1.3);
}

.chart-x-axis {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding: 0 20px;
}

.month-label {
    font-size: 11px;
    color: #666;
    text-align: center;
    transform: rotate(-45deg);
    white-space: nowrap;
}

/* Horizontal Price Distribution Chart */
.horizontal-price-chart {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.price-band-row {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 20px;
    align-items: center;
}

.price-range-label {
    font-weight: 600;
    text-align: right;
    padding-right: 10px;
    color: #2c3e50;
}

.distribution-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.distribution-section {
    display: grid;
    grid-template-columns: 100px 1fr 60px;
    gap: 10px;
    align-items: center;
}

.distribution-label {
    font-size: 12px;
    color: #666;
    text-align: right;
}

.horizontal-bar {
    height: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.pcd-bar {
    background: linear-gradient(90deg, #014785, #0066cc);
}

.council-bar {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
}

.percentage-label {
    font-size: 12px;
    font-weight: 600;
    color: #2c3e50;
    text-align: center;
}

/* Updated Legend Styles */
.legend-color.pcd-line {
    background: #014785;
}

.legend-color.council-line {
    background: #e74c3c;
}

.legend-color.pcd-distribution {
    background: linear-gradient(90deg, #014785, #0066cc);
}

.legend-color.council-distribution {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
}

/* Bar Chart Updates */
.bar-chart {
    position: relative;
    height: 300px;
    display: flex;
    align-items: stretch;
}

.bar-chart .chart-content {
    flex: 1;
    position: relative;
    margin-left: 20px;
}

.chart-bars {
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: 5px;
}

.chart-month-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
}

.sales-bar {
    background: linear-gradient(0deg, #27ae60, #2ecc71);
    min-height: 2px;
    width: 100%;
    border-radius: 4px 4px 0 0;
    transition: all 0.3s ease;
}

.sales-bar:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

/* Responsive Updates */
@media (max-width: 768px) {
    .price-band-row {
        grid-template-columns: 120px 1fr;
        gap: 15px;
    }
    
    .distribution-section {
        grid-template-columns: 80px 1fr 50px;
        gap: 8px;
    }
    
    .line-chart .chart-content {
        margin: 0 10px;
    }
    
    .month-label {
        font-size: 10px;
    }
    
    .price-range-label {
        font-size: 12px;
    }
}

/* Price Distribution Chart (New £50k Brackets) */
.price-distribution-chart {
    padding: 20px;
}

.distribution-chart-container {
    display: flex;
    align-items: stretch;
    height: 400px;
}

.y-axis {
    display: flex;
    flex-direction: column;
    width: 80px;
    margin-right: 20px;
}

.y-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    text-align: center;
    font-weight: 600;
    color: #2c3e50;
    align-self: center;
    margin-bottom: 20px;
}

.y-scale {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    font-size: 12px;
    color: #666;
    text-align: right;
}

.chart-bars-container {
    flex: 1;
    position: relative;
}

.distribution-bars-grid {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 100%;
    gap: 2px;
    padding: 0 10px;
}

.bracket-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.bracket-bars {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 100%;
    gap: 2px;
    width: 100%;
}

.distribution-bar {
    width: 12px;
    min-height: 2px;
    border-radius: 2px 2px 0 0;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.distribution-bar:hover {
    opacity: 0.8;
}

.distribution-bar.pcd-bar {
    background: linear-gradient(0deg, #014785, #0066cc);
}

.distribution-bar.council-bar {
    background: linear-gradient(0deg, #e74c3c, #c0392b);
}

.bracket-label {
    margin-top: 10px;
    font-size: 10px;
    color: #666;
    text-align: center;
    transform: rotate(-45deg);
    white-space: nowrap;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Line Chart Updates for Connected Lines */
.price-line-segment {
    position: absolute;
    z-index: 1;
}

.line-chart-svg {
    pointer-events: none;
    z-index: 1;
}

.line-chart-svg path {
    fill: none;
    stroke-width: 3;
}

.line-chart-svg line {
    stroke-width: 2;
}

.pcd-point {
    background: #014785;
    border: 2px solid #0066cc;
}

.council-point {
    background: #e74c3c;
    border: 2px solid #c0392b;
}

/* Area Comparison Chart Updates for Development Bar */
.development-bar {
    background: linear-gradient(90deg, #27ae60, #2ecc71);
}

.primary-bar {
    background: linear-gradient(90deg, #e67e22, #f39c12);
}

.comparator-bar {
    background: linear-gradient(90deg, #9b59b6, #8e44ad);
}

.comparison-bar.development .bar-label {
    color: #27ae60;
    font-weight: 600;
}

.comparison-bar.primary-development .bar-label {
    color: #e67e22;
    font-weight: 700;
}

.comparison-bar.comparator-development .bar-label {
    color: #9b59b6;
    font-weight: 600;
}

/* Chart.js Canvas Styles */
.market-chart-container {
    position: relative;
    height: 400px;
    width: 100%;
    padding: 20px;
}

.market-chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

#salesVolumeCanvas,
#averagePricesCanvas,
#priceDistributionCanvas {
    max-height: 360px;
}

/* Ensure charts are responsive */
@media (max-width: 768px) {
    .market-chart-container {
        height: 300px;
        padding: 10px;
    }
    
    #salesVolumeCanvas,
    #averagePricesCanvas,
    #priceDistributionCanvas {
        max-height: 280px;
    }
    
    .stats-card .chart-container.donut-chart {
        height: 250px;
        max-width: 300px;
    }
    
    .hbsc-v2-container .stats-card .chart-container.donut-chart canvas,
    #availableUnitsByDeveloperChart,
    #propertyTypesChart {
        width: 100% !important;
        height: 100% !important;
    }
}

/* Chart.js container styles */
.market-chart-container {
    position: relative;
    height: 400px;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
}

.market-chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Keep existing responsive styles */
@media (max-width: 768px) {
    .distribution-bars-grid {
        gap: 1px;
    }
    
    .distribution-bar {
        width: 8px;
    }
    
    .bracket-label {
        font-size: 9px;
        height: 25px;
    }
    
    .y-axis {
        width: 60px;
        margin-right: 15px;
    }
    
    .distribution-chart-container {
        height: 300px;
    }
    
    .market-chart-container {
        height: 300px;
        padding: 10px;
    }
}

/* Available Plots Comparison */
.plots-comparison-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.comparison-info {
    color: #666;
    font-size: 0.9rem;
}

.plots-comparison-grid {
    margin-top: 20px;
}

.comparison-summary {
    margin-bottom: 30px;
}

.summary-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

@media (min-width: 1200px) {
    .summary-cards-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

.summary-card {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.summary-card.primary {
    border-left: 4px solid #27ae60;
    background: linear-gradient(135deg, #f8fff9, #ffffff);
}

.summary-card h5 {
    margin: 0 0 15px 0;
    color: #014785;
    font-weight: 600;
}

.summary-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.summary-metric .metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: #014785;
    line-height: 1;
    margin-bottom: 5px;
}

.summary-metric .metric-label {
    color: #666;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Compact Summary Card Styles */
.summary-card.compact {
    padding: 12px;
    text-align: left;
}

.card-header-compact {
    margin-bottom: 10px;
}

.development-name-compact {
    margin: 0 0 4px 0;
    color: #014785;
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1.2;
}

.developer-name-compact {
    color: #7f8c8d;
    font-size: 0.75rem;
    line-height: 1.1;
}

.summary-metrics-compact {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

.summary-metric-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    background: #f8f9fa;
    border-radius: 4px;
}

.metric-value-compact {
    font-size: 0.8rem;
    font-weight: 600;
    color: #2c3e50;
}

.metric-label-compact {
    font-size: 0.7rem;
    color: #7f8c8d;
}

/* Scatter Chart Styles */
.scatter-chart-container {
    margin: 30px 0;
    padding: 20px;
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
}

.scatter-chart-container h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
}

.chart-note {
    display: block;
    color: #7f8c8d;
    font-style: italic;
    margin-top: 10px;
    text-align: center;
}

.plots-comparison-table-container {
    margin-top: 30px;
}

.plots-comparison-table {
    width: 100%;
    font-size: 0.85rem;
}

.plots-comparison-table th {
    background: #014785;
    color: white;
    font-weight: 600;
    padding: 12px 8px;
}

.plots-comparison-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #e1e5e9;
}

.plots-comparison-table tr:nth-child(even) {
    background: #f8f9fa;
}

.plots-comparison-table tr:hover {
    background: #e3f2fd;
}

@media (max-width: 768px) {
    .plots-comparison-controls {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .summary-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .plots-comparison-table {
        font-size: 0.75rem;
    }
    
    .plots-comparison-table th,
    .plots-comparison-table td {
        padding: 8px 4px;
    }
}

/* Area Comparison Chart Updates */
.developments-comparison-chart {
    margin: 20px 0;
}

.comparison-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.comparison-label {
    min-width: 200px;
    font-weight: 600;
    color: #2c3e50;
    flex-shrink: 0;
}

.comparison-bar-container {
    flex: 1;
    position: relative;
    height: 30px;
    background: #e9ecef;
    border-radius: 4px;
    margin: 0 15px;
    overflow: hidden;
}

.comparison-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
    position: relative;
}

.comparison-bar-fill.local-bar {
    background: linear-gradient(90deg, #6c757d, #495057);
}

.comparison-bar-fill.council-bar {
    background: linear-gradient(90deg, #6f42c1, #5a28a3);
}

.comparison-bar-fill.primary-bar {
    background: linear-gradient(90deg, #27ae60, #219a52);
}

.comparison-bar-fill.comparator-bar {
    background: linear-gradient(90deg, #014785, #0066cc);
}

.comparison-value {
    font-weight: 600;
    color: #2c3e50;
    min-width: 100px;
    text-align: right;
    flex-shrink: 0;
}

.chart-note {
    margin-top: 15px;
    padding: 10px;
    background: #e3f2fd;
    border-left: 4px solid #014785;
    font-size: 0.85rem;
    color: #666;
    border-radius: 4px;
}

@media (max-width: 768px) {
    .comparison-item {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .comparison-label {
        min-width: auto;
        text-align: center;
    }
    
    .comparison-bar-container {
        margin: 0;
    }
    
    .comparison-value {
        text-align: center;
    }
}

/* Market Statistics Section Spacing */
#market-statistics {
    margin-bottom: 50px;
    padding-bottom: 40px;
}

/* Section 7: 2nd Hand Sales Map */
#sales-map-section {
    margin-bottom: 50px;
}

.market-info-bar {
    background: linear-gradient(135deg, #014785 0%, #0066cc 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

#sales-map-area-info h4 {
    margin: 0 0 10px 0;
    font-size: 1.4rem;
    font-weight: 600;
}

#sales-map-area-info p {
    margin: 5px 0;
    opacity: 0.95;
}

.sales-map-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    margin-bottom: 30px;
    height: 500px;
}

.sales-map {
    height: 100%;
    width: 100%;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
}

/* Grayscale filter for Section 7 map tiles */
.sales-map .leaflet-tile-pane .grayscale-tiles {
    filter: grayscale(100%) contrast(1.1) brightness(0.9);
    -webkit-filter: grayscale(100%) contrast(1.1) brightness(0.9);
}

/* Alternative approach - apply grayscale to all tiles in sales map */
.sales-map .leaflet-tile-pane {
    filter: grayscale(100%) contrast(1.1) brightness(0.9);
    -webkit-filter: grayscale(100%) contrast(1.1) brightness(0.9);
}

/* Fix for Section 6 market chart canvas distortion - Ultra specific selectors */
div#market-statistics .market-chart-container canvas {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    transform: none !important;
}

div#market-statistics canvas#propertyTypesChart {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    transform: none !important;
}

/* Ensure proper sizing for donut charts in Section 6 - Maximum specificity */
div.hbsc-v2-container div#market-statistics .chart-container.donut-chart {
    width: 100% !important;
    height: 300px !important;
    position: relative !important;
    overflow: hidden !important;
}

div.hbsc-v2-container div#market-statistics .chart-container.donut-chart canvas {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    transform: none !important;
    aspect-ratio: 1 !important;
}

/* Additional ultra-specific selectors for donut charts */
div.hbsc-v2-container div#market-statistics div#property-types-tab div#property-types-chart canvas,
div.hbsc-v2-container div#plot-statistics div.chart-container.donut-chart canvas {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    transform: none !important;
    aspect-ratio: 1/1 !important;
    object-fit: contain !important;
}

/* Additional canvas fixes for all property types charts */
div#market-statistics div#property-types-tab canvas,
div#market-statistics canvas[id*="propertyTypes"] {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    aspect-ratio: 1/1 !important;
    transform: none !important;
}

/* Ensure Section 7 title matches other sections */
#sales-map-section h3 {
    margin: 0 0 25px 0;
    font-size: 1.5rem;
    color: #2c3e50;
    border-bottom: 2px solid #014785;
    padding-bottom: 10px;
}

.map-legend-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.sales-map-legend {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sales-map-legend h4 {
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    color: #2c3e50;
    text-align: center;
}

.legend-scale {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Price-based color coding */
.legend-color.highest-price {
    background: #d32f2f; /* Dark red for highest prices */
}

.legend-color.high-price {
    background: #f44336; /* Red for high prices */
}

.legend-color.medium-price {
    background: #ff9800; /* Orange for medium prices */
}

.legend-color.low-price {
    background: #2196f3; /* Blue for low prices */
}

.legend-color.lowest-price {
    background: #1565c0; /* Dark blue for lowest prices */
}

/* Sales Summary Cards */
.sales-summary-section {
    margin-top: 30px;
}

.sales-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.sales-summary-card {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.sales-summary-card h5 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sales-summary-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #014785;
    margin-bottom: 5px;
}

.sales-summary-label {
    font-size: 0.85rem;
    color: #7f8c8d;
}

/* Sales Map Markers - Custom styles for Leaflet */
.sales-marker {
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    opacity: 0.8;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.sales-marker:hover {
    opacity: 1;
    transform: scale(1.2);
}

/* Custom Marker Cluster Styles */
.marker-cluster {
    background-clip: padding-box;
    border-radius: 20px;
    text-align: center;
    color: white;
    font-weight: bold;
}

.marker-cluster div {
    width: 30px;
    height: 30px;
    margin-left: 5px;
    margin-top: 5px;
    border-radius: 15px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.marker-cluster-small {
    background-color: rgba(1, 71, 133, 0.6); /* Blue theme matching the title bar */
    border: 2px solid rgba(1, 71, 133, 0.8);
}

.marker-cluster-small div {
    background-color: rgba(1, 71, 133, 0.8);
}

.marker-cluster-medium {
    background-color: rgba(1, 71, 133, 0.7);
    border: 2px solid rgba(1, 71, 133, 0.9);
}

.marker-cluster-medium div {
    background-color: rgba(1, 71, 133, 0.9);
    width: 35px;
    height: 35px;
    margin-left: 2px;
    margin-top: 2px;
    border-radius: 17px;
    font-size: 13px;
}

.marker-cluster-large {
    background-color: rgba(1, 71, 133, 0.8);
    border: 2px solid #014785;
}

.marker-cluster-large div {
    background-color: #014785;
    width: 38px;
    height: 38px;
    margin-left: 1px;
    margin-top: 1px;
    border-radius: 19px;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sales-map-container {
        grid-template-columns: 1fr;
        height: auto;
        gap: 15px;
    }
    
    .sales-map {
        height: 400px;
    }
    
    .map-legend-container {
        order: -1;
    }
    
    .sales-map-legend {
        padding: 15px;
    }
    
    .legend-scale {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .legend-item {
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }
    
    .legend-item span {
        font-size: 0.8rem;
    }
}

/* Data Disclaimer Styling */
.market-data-disclaimer {
    margin-top: 30px;
    padding: 12px 16px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.8rem;
    line-height: 1.4;
    color: #9ca3af;
}

.market-data-disclaimer p {
    margin: 0;
}

.market-data-disclaimer strong {
    color: #6b7280;
    font-weight: 600;
}

/* Price Trends Section */
.price-trends-section {
    margin-top: 40px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 25px;
}

.trends-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.trend-chart-container {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.trend-chart-container h4 {
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    color: #2c3e50;
    text-align: center;
}

.trend-chart-container canvas {
    width: 100% !important;
    height: 300px !important;
}

/* Responsive design for trend charts */
@media (max-width: 768px) {
    .trends-charts-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .trend-chart-container canvas {
        height: 250px !important;
    }
}