/* Car Price Tracker - Public Styles */

/* Main wrapper */
.car_prices-car-wrapper {
    padding: 30px 50px;
    max-width: 1200px;
    margin: auto;
}

/* Tags */
.car_prices-car-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.car_prices-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    background: #f0f0f0;
    color: #555;
}

.car_prices-tag-active {
    background: #e6f9f5;
    color: #13c1ac;
}

.car_prices-tag-inactive {
    background: #fef2e5;
    color: #e67e22;
}

/* Proxy Selector */
.car_prices-proxy-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.car_prices-proxy-selector-label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

.car_prices-proxy-selector-select {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    min-width: 140px;
}

/* Price Cards */
.car_prices-price-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.car_prices-price-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: box-shadow 0.2s ease;
}

.car_prices-price-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.car_prices-price-card-wallapop {
    border-top: 3px solid #13c1ac;
}

.car_prices-price-card-coches {
    border-top: 3px solid #ff6b35;
}

.car_prices-price-card-autocasion {
    border-top: 3px solid #2e86de;
}

.car_prices-price-card-milanuncios {
    border-top: 3px solid #8e44ad;
}

.car_prices-price-card-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: #333;
}

.car_prices-price-card-avg {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 12px;
}

.car_prices-price-card-range {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #777;
    margin-bottom: 8px;
    padding: 0 10px;
}

.car_prices-price-card-count {
    font-size: 13px;
    color: #999;
}

.car_prices-price-card[data-source] {
    cursor: pointer;
}

.car_prices-price-card-empty {
    font-size: 18px;
    color: #ccc;
    padding: 20px 0;
}

/* Per-card crawl button */
.car_prices-price-card-crawl {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.car_prices-btn-crawl-source {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #f9f9f9;
    color: #555;
    cursor: pointer;
    transition: all 0.2s ease;
}

.car_prices-btn-crawl-source:hover {
    background: #eee;
    border-color: #ccc;
}

.car_prices-btn-crawl-source:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.car_prices-btn-crawl-success {
    background: #e6f9f5 !important;
    border-color: #13c1ac !important;
    color: #13c1ac !important;
}

.car_prices-btn-crawl-error {
    background: #fef2e5 !important;
    border-color: #e67e22 !important;
    color: #e67e22 !important;
}

.car_prices-price-card-reset {
    margin-top: 6px;
    text-align: center;
}

.car_prices-btn-reset-source {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    background: transparent;
    color: #999;
    cursor: pointer;
    transition: all 0.2s ease;
}

.car_prices-btn-reset-source:hover {
    background: #fef2e5;
    border-color: #e67e22;
    color: #e67e22;
}

.car_prices-btn-reset-source:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.car_prices-price-card-status {
    display: inline-block;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 4px;
}

.car_prices-price-card-status-disabled {
    background: #fef2e5;
    color: #e67e22;
}

.car_prices-price-card-status-unconfigured {
    background: #f0f0f0;
    color: #999;
}

/* Spin animation for crawl loading */
@keyframes car_prices-spin {
    from { transform: rotate(360deg); }
    to { transform: rotate(0deg); }
}

.car_prices-spin {
    animation: car_prices-spin 1s linear infinite;
}

.car_prices-mr-5 {
    margin-right: 5px;
}

/* Source popup body */
#car_prices-source-popup .car_prices-popup-content {
    padding: 30px;
}

/* Chart */
.car_prices-chart-section h2 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.car_prices-chart-wrapper {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 20px;
    height: 350px;
    position: relative;
}

.car_prices-chart-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Actions */
.car_prices-actions {
    text-align: center;
}

/* Filters */
.car_prices-filters {
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 20px;
}

.car_prices-filter-form {
    margin: 0;
}

.car_prices-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.car_prices-filter-field {
    flex: 1;
    min-width: 150px;
}

.car_prices-filter-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #555;
}

.car_prices-filter-field select,
.car_prices-filter-field input[type="text"],
.car_prices-filter-field input[type="number"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
}

.car_prices-filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 0 0 auto;
    min-width: auto;
    padding-bottom: 2px;
}

/* Table */
.car_prices-table-wrapper {
    overflow-x: auto;
}

.car_prices-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    overflow: hidden;
}

.car_prices-table thead th {
    background: #f5f5f5;
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #e5e5e5;
}

.car_prices-table tbody td {
    padding: 12px 16px;
    font-size: 14px;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
}

.car_prices-table tbody tr:hover {
    background: #fafafa;
}

.car_prices-table tbody tr:last-child td {
    border-bottom: none;
}

.car_prices-car-link {
    font-weight: 600;
    text-decoration: none;
}

.car_prices-car-link:hover {
    text-decoration: underline;
}

.car_prices-table-empty {
    text-align: center;
    color: #999;
    padding: 40px 16px !important;
}

/* Button variants */
.car_prices-btn-secondary {
    background: #e5e5e5 !important;
    color: #555 !important;
}

.car_prices-btn-secondary:hover {
    background: #d5d5d5 !important;
}

/* Distribution stats */
.car_prices-distribution-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.car_prices-distribution-stat {
    flex: 1;
    min-width: 120px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.car_prices-distribution-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
}

.car_prices-distribution-stat-label {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

/* Source popup stats row */
.car_prices-source-popup-stats-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.car_prices-source-popup-stat {
    flex: 1;
    min-width: 80px;
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 12px 8px;
    text-align: center;
}

.car_prices-source-popup-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
}

.car_prices-source-popup-stat-label {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

/* Popup listings table */
.car_prices-source-popup-listings {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 16px;
    border: 1px solid #eee;
    border-radius: 8px;
}

.car_prices-source-popup-listings table {
    width: 100%;
    border-collapse: collapse;
}

.car_prices-source-popup-listings th {
    background: #f5f5f5;
    padding: 10px 14px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #777;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
}

.car_prices-source-popup-listings td {
    padding: 8px 14px;
    font-size: 13px;
    color: #333;
    border-bottom: 1px solid #f5f5f5;
}

.car_prices-source-popup-listings tr:hover {
    background: #f9f9f9;
}

.car_prices-source-popup-listings tr:last-child td {
    border-bottom: none;
}

.car_prices-source-popup-listings a {
    color: #2e86de;
    text-decoration: none;
}

.car_prices-source-popup-listings a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .car_prices-car-wrapper {
        padding: 20px;
    }

    .car_prices-price-cards {
        grid-template-columns: 1fr;
    }

    .car_prices-filter-row {
        flex-direction: column;
    }

    .car_prices-filter-field {
        min-width: 100%;
    }

    .car_prices-chart-wrapper {
        height: 250px;
    }

    .car_prices-table thead th,
    .car_prices-table tbody td {
        padding: 8px 10px;
        font-size: 13px;
    }

    .car_prices-distribution-stats {
        flex-direction: column;
    }

    .car_prices-source-popup-stats-row {
        flex-direction: column;
    }
}


