/**
 * Price Chart Styles
 * Styles for the property price chart component
 */

/* Chart Section */
.price-chart-section {
    padding-bottom: 80px;
}

.price-chart-section .section-title {
    text-align: center;
    margin-bottom: 40px;
    color: var(--beige-main);
    font-weight: 600;
    font-size: 2.5rem;
    line-height: 1.2;
}

/* Chart Container */
.chart-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-top: 30px;
    position: relative;
    overflow: hidden;
}

.chart-container-header .section-subtitle {
    margin-bottom: 20px;
    line-height: 1.3;
    color: var(--beige-main);
}

.chart-container .section-title::before {
    content: '';
    position: absolute;
    bottom: -15px;
    left: -500px;
    right: -500px;
    height: 1px;
    background: var(--stroke-gray);
    pointer-events: none;
}

/* Chart Canvas */
.chart-canvas-wrapper {
    position: relative;
    height: 400px;
    width: 100%;
}

#priceChart {
    width: 100% !important;
    height: 100% !important;
}


/* Loading State */
.chart-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 400px;
    color: #666666;
    font-size: 1.1rem;
}

.chart-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-top: 2px solid #4285f4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* Error State */
.chart-error {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 400px;
    color: #ea4335;
    font-size: 1.1rem;
    text-align: center;
}


/* Responsive Design */
@media (max-width: 1200px) {

    .price-chart-section {
        padding-bottom: 60px;
    }
    
    .chart-container {
        padding: 20px;
    }
}

@media (max-width: 992px) {
    .chart-container {
        padding: 20px 15px;
    }
}

@media (max-width: 768px) {
    .price-chart-section {
        padding-bottom: 40px;
    }
   
    
    .chart-container {
        margin-top: 20px;
        border-radius: 8px;
        padding: 15px 10px;
        overflow: hidden; /* Hide container overflow */
    }

    .chart-container-header .section-title {
        margin-bottom: 20px;
        line-height: 1.3;
        color: var(--beige-main);
    }
    
    .chart-canvas-wrapper {
        height: 300px;
        overflow-x: auto; /* Enable horizontal scroll */
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        padding-bottom: 10px; /* Space for scrollbar */
    }
    
    /* Fixed width for canvas on mobile */
    #priceChart {
        min-width: 600px !important; /* Minimum width for comfortable viewing */
        width: 600px !important;
        height: 280px !important;
    }
    
    /* Scrollbar styling */
    .chart-canvas-wrapper::-webkit-scrollbar {
        height: 6px;
    }
    
    .chart-canvas-wrapper::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 3px;
    }
    
    .chart-canvas-wrapper::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 3px;
    }
    
    .chart-canvas-wrapper::-webkit-scrollbar-thumb:hover {
        background: #a8a8a8;
    }
}

@media (max-width: 480px) {
    .chart-container {
        padding: 10px 5px;
    }
 
    .chart-canvas-wrapper {
        height: 280px;
    }
    
    /* For very small screens increase minimum width */
    #priceChart {
        min-width: 700px !important;
        width: 700px !important;
        height: 260px !important;
    }
}

/* Scroll indicator for users */
@media (max-width: 768px) {
    .chart-container::after {
        content: "← Swipe to see more →";
        display: block;
        text-align: center;
        font-size: 12px;
        color: #999;
        margin-top: 5px;
        font-style: italic;
    }
}

/* Animation */
.chart-container {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Print Styles */
@media print {
    .price-chart-section {
        background-color: white !important;
        padding-bottom: 20px !important;
    }
    
    .chart-container {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}
