/* Shared styles for the /pricing analytics pages (index, make, model, year). */

.analytics-container { background-color: #f5f7fb; padding-bottom: 50px; }

.analytics-header {
    background: linear-gradient(135deg, #1e5799 0%, #7db9e8 100%);
    color: #fff;
    padding: 60px 0 30px;
    margin-bottom: 30px;
}
.analytics-header h1 { font-weight: 700; margin-bottom: 10px; color: #fff; }
.analytics-header p.lead { color: #fff; }
.analytics-content { margin-top: -50px; }

.breadcrumb-item a { text-decoration: none; }
.breadcrumb-item a:hover { text-decoration: underline; }

/* Stat cards */
.stats-summary { margin-bottom: 30px; }
.stat-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    padding: 25px;
    display: flex;
    align-items: center;
    height: 100%;
}
.stat-icon {
    width: 60px;
    height: 60px;
    flex: none;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    color: #fff;
}
.stat-icon i { font-size: 26px; }
.stat-content h3 { font-size: 24px; font-weight: 700; margin-bottom: 5px; color: #333; }
.stat-content p { margin: 0; color: #777; font-size: 14px; }

/* Chart cards */
.chart-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.chart-header { padding: 20px 25px; border-bottom: 1px solid #f0f0f0; }
.chart-header h4 { margin: 0; font-weight: 600; color: #333; font-size: 18px; }
.chart-header p { margin: 5px 0 0; color: #888; font-size: 13px; }
.chart-body { padding: 25px; flex: 1; }

/* Chart.js sizes the canvas to its parent, so the parent must be dedicated to the
   canvas and have a height that doesn't come from its content. Without this the
   canvas and its container grow each other forever on phones. */
.chart-wrap { position: relative; height: 300px; }
.chart-empty { padding: 40px 0; text-align: center; color: #888; }

/* Tables and lists */
.pricing-table { margin: 0; }
.pricing-table th { border-top: none; font-weight: 600; color: #555; }
.clickable-row { cursor: pointer; }
.clickable-row:hover { background-color: #f8f9fa; }

.popular-models { max-height: 350px; overflow-y: auto; }
.sibling-models { max-height: 400px; overflow-y: auto; }
.sibling-models a { text-decoration: none; color: #333; }
.sibling-models a:hover { color: #0d6efd; }

.makes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 15px; }
.make-card {
    display: block;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.make-card:hover { border-color: #0d6efd; box-shadow: 0 4px 12px rgba(13,110,253,0.15); color: #333; }
.make-name { font-weight: 600; font-size: 16px; margin-bottom: 8px; }
.make-stats { display: flex; justify-content: space-between; font-size: 12px; color: #666; }
.make-price { color: #198754; font-weight: 500; }

/* Year page */
.other-years { max-height: 300px; overflow-y: auto; }
.year-badges { display: flex; flex-wrap: wrap; gap: 10px; }
.year-badge { padding: 8px 16px; font-size: 14px; text-decoration: none; }
.year-badge.active { font-weight: bold; }

.listing-card { border: 1px solid #eee; border-radius: 8px; overflow: hidden; transition: box-shadow 0.2s; }
.listing-card:hover { box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.listing-card a { text-decoration: none; color: inherit; }
.listing-image { height: 120px; background: #f5f5f5; overflow: hidden; }
.listing-image img { width: 100%; height: 100%; object-fit: cover; }
.listing-image .no-image { display: flex; align-items: center; justify-content: center; height: 100%; color: #999; font-size: 12px; }
.listing-info { padding: 12px; }
.listing-info h6 { margin: 0 0 5px; font-size: 13px; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.listing-info .price { margin: 0; font-weight: 600; color: #198754; }

@media (max-width: 991px) {
    .analytics-header { padding-top: 80px; }
    .stat-content h3 { font-size: 20px; }
    .chart-body { padding: 15px; }
    .makes-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
    .listing-image { height: 100px; }
}

@media (max-width: 768px) {
    .analytics-header { padding: 80px 15px 20px; }
    .analytics-header h1 { font-size: 22px; }
    .analytics-header p.lead { font-size: 14px; }
    .breadcrumb { font-size: 12px; flex-wrap: wrap; }

    .stat-card { margin-bottom: 15px; padding: 15px; }
    .stat-icon { width: 45px; height: 45px; margin-right: 12px; }
    .stat-icon i { font-size: 20px; }
    .stat-content h3 { font-size: 18px; }
    .stat-content p { font-size: 12px; }

    .chart-card { margin-bottom: 15px; }
    .chart-header { padding: 15px; }
    .chart-header h4 { font-size: 16px; }
    .chart-header p { font-size: 12px; }
    .chart-body { padding: 10px; }
    .chart-wrap { height: 260px; }

    .pricing-table { font-size: 13px; }
    .pricing-table th, .pricing-table td { padding: 10px 8px; white-space: nowrap; }
    .pricing-table .btn-sm { padding: 4px 8px; font-size: 12px; }

    .popular-models, .sibling-models { max-height: 280px; }
    .popular-models .table { font-size: 13px; }
    .popular-models .table th, .popular-models .table td { padding: 8px 6px; }
    .sibling-models .list-group-item { padding: 10px 12px; font-size: 14px; }

    .makes-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .make-card { padding: 12px 10px; }
    .make-name { font-size: 14px; margin-bottom: 5px; }
    .make-stats { font-size: 11px; flex-direction: column; gap: 2px; }

    .year-badges { gap: 8px; }
    .year-badge { padding: 6px 12px; font-size: 13px; }
    .listing-image { height: 90px; }
    .listing-info { padding: 10px; }
    .listing-info h6 { font-size: 12px; }
    .listing-info .price { font-size: 14px; }

    .btn-lg { font-size: 14px; padding: 10px 20px; }
}

@media (max-width: 480px) {
    .analytics-header h1 { font-size: 18px; }
    .stat-card { padding: 12px; }
    .stat-icon { width: 40px; height: 40px; margin-right: 10px; }
    .stat-content h3 { font-size: 16px; }
    .pricing-table { font-size: 12px; }
    .pricing-table th, .pricing-table td { padding: 8px 5px; }
    .make-card { padding: 10px 8px; }
    .make-name { font-size: 13px; }
    .year-badge { padding: 5px 10px; font-size: 12px; }
    .listing-image { height: 80px; }
}
