.price-chart-container {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    max-width: 100%;
    margin: 0 auto;
}

.title-cart-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.chart-title {
    font-size: 24px;
    color: #333;
    margin-top: 0;
    margin-bottom: 0;
    font-weight: 600;
}

.chart-description {
    font-size: 14px;
    color: #555;
    line-height: 1.5;
    margin-bottom: 20px;
}

.price-display {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    flex-direction: column;
}

.current-price {
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
}

.price-label {
    font-size: 14px;
    color: #555;
    margin-bottom: 2px;
    font-weight: 400;
}

.price-value {
    font-size: 28px;
    font-weight: 700;
    color: #222;
    line-height: 1.1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.price-diff {
    font-size: 14px;
    margin-left: 8px;
    margin-top: 5px;
    background: #f8f8f8;
    padding: 6px 10px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    max-width: 100%;
    line-height: 1.4;
    flex-wrap: wrap;
}

.price-diff .diff-icon {
    margin-right: 6px;
    font-weight: bold;
    font-size: 16px;
}

/* For bullion products, inverted color scheme: 
   - positive (green) when cheaper than comparison (better value)
   - negative (red) when more expensive (worse value) */
.price-diff.positive-change {
    background-color: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.2);
    color: #2E7D32; /* Darker green for better contrast and readability */
}

.price-diff.negative-change {
    background-color: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.2);
    color: #C62828; /* Darker red for better contrast and readability */
}

.price-change {
    display: flex;
    align-items: center;
    text-align: left;
}

.change-value {
    font-size: 16px;
    font-weight: 500;
    display: inline-block;
    line-height: 1.1;
    margin-right: 5px;
}

.change-period {
    font-size: 12px;
    color: #666;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
    font-weight: 500;
    line-height: 1.2;
}

.positive-change {
    color: #4CAF50;
}

.negative-change {
    color: #F44336;
}

.chart-controls {
    margin-bottom: 20px;
    display: flex;
    justify-content: flex-end;
}

.view-selector {
    display: inline-block;
    background-color: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23555555' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-selector:hover {
    background-color: #f0f0f0;
    border-color: #ccc;
}

.view-selector:focus {
    outline: none;
    border-color: #aaa;
    box-shadow: 0 0 3px rgba(0,0,0,0.1);
}

canvas[id^="priceChart_"] {
    width: 100% !important;
    height: 300px !important;
    max-height: 300px !important;
}

/* Add a fixed height to the chart container */
.price-chart-container {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    max-width: 100%;
    margin: 0 auto;
}

/* Add specific height constraint for the chart area */
.chart-area {
    position: relative;
    height: 300px;
    width: 100%;
    margin-top: 10px;
}

.chart-area canvas {
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Product Actions Container */
.product-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

/* Similar Products Dropdown Styling */
.similar-products-container {
    margin-bottom: 5px;
}

.similar-products-selector {
    display: inline-block;
    background-color: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 5px 30px 5px 10px;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    width: 100%;
    max-width: 230px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23555555' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Mobile-specific styling for the comparison selector */
@media (max-width: 768px) {
    .similar-products-selector {
        padding: 8px 30px 8px 12px;
        font-size: 14px;
        background-size: 14px;
        background-position: right 10px center;
    }
    
    .similar-products-selector option {
        font-size: 14px;
        padding: 8px;
    }
    
    /* Make the comparison message stand out more on mobile */
    .comparison-active .price-value {
        margin-bottom: 12px;
    }
    
    /* Highlight for active comparison on mobile */
    .similar-products-selector.active {
        box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.3);
    }
}

.similar-products-selector.no-similar-products {
    background-color: #f0f0f0;
    color: #999;
    border-color: #ddd;
    cursor: not-allowed;
    opacity: 0.75;
    background-image: none;
    padding: 5px 10px;
    font-style: italic;
}

.similar-products-selector:not(.no-similar-products):hover {
    background-color: #f0f0f0;
    border-color: #ccc;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.similar-products-selector:not(.no-similar-products):focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 2px rgba(0,102,204,0.15);
}

/* Styling for selected dropdown */
.similar-products-selector:not(.no-similar-products).active {
    background-color: #eef5ff;
    border-color: #0066cc;
}

/* When in comparison mode, highlight the container */
.price-chart-container.comparison-active {
    background-color: #fafcff;
    border-left: 3px solid #0066cc;
    transition: background-color 0.3s ease, border-left 0.3s ease;
}

/* Selected option in dropdown */
.similar-products-selector option:checked {
    background-color: #0066cc;
    color: white;
}

/* Active dropdown indicates comparison mode */
.similar-products-selector.active {
    background-color: #eef5ff;
    border-color: #0066cc;
    box-shadow: 0 0 0 1px rgba(0, 102, 204, 0.2);
}

/* Legend enhancements */
.price-chart-container canvas {
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .price-chart-container {
        padding: 15px;
    }
    
    .title-cart-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .chart-title {
        font-size: 20px;
        margin-bottom: 10px;
    }
    
    .price-value {
        font-size: 22px;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .price-diff {
        margin-left: 0;
        margin-top: 8px;
        font-size: 12px;
        padding: 5px 8px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .price-diff .diff-icon {
        font-size: 14px;
        margin-right: 4px;
    }
    
    .change-value {
        font-size: 14px;
    }
    
    canvas[id^="priceChart_"] {
        height: 250px !important;
        max-height: 250px !important;
    }
    
    .chart-area {
        height: 250px;
    }
    
    .chart-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .view-selector {
        width: 100%;
        text-align: center;
    }
    
    .product-actions {
        width: 100%;
        align-items: stretch;
        margin-bottom: 15px;
    }
    
    .similar-products-container {
        width: 100%;
    }
    
    .similar-products-selector {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }
    
    .add-to-cart-container {
        margin-left: 0;
        margin-bottom: 0;
        width: 100%;
        text-align: center;
    }
    
    .add-to-cart-button {
        width: 100%;
        text-align: center;
    }
    
    /* Improved comparison indicators for mobile */
    .price-chart-container.comparison-active {
        border-left-width: 5px;
        padding-left: 12px;
    }
    
    /* Better tooltip touch area for mobile */
    .chart-area canvas {
        touch-action: pan-y;
    }
}

/* Add to Cart Button Styling */
.add-to-cart-container {
    text-align: right;
}

.add-to-cart-button {
    display: inline-block;
    background-color: #0066cc;
    color: #ffffff;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.add-to-cart-button:hover {
    background-color: #0052a3;
    text-decoration: none;
    color: #ffffff;
} 