/**
 * Vehicle Inventory Widget Styles
 *
 * @package CorvetteMike_Advanced
 * @since 1.0.0
 */

/* Main Widget Container */
.corvettemike-vehicle-inventory {
    max-width: 100%;
    margin: 0 auto;
}

/* Filter Section */
.vehicle-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

@media (min-width: 768px) {
    .category-filters {
        margin-bottom: 0;
    }
}

.filter-tab {
    border: 2px solid #e0e0e0;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.filter-tab:hover {
    border-color: #007cba;
    transform: translateY(-2px);
    font-weight: 700;
}

.filter-tab.active {
    border-color: #007cba;
    box-shadow: 0 4px 15px rgba(0, 124, 186, 0.3);
}

.filter-tab .count {
    font-size: 12px;
    opacity: 0.8;
}

/* Search Container */
.search-container {
    position: relative;
    flex-shrink: 0;
    min-width: 250px;
}

.vehicle-search {
    width: 100%;
    padding: 12px 45px 12px 42px !important;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #ffffff;
    color: #E0E0E0 !important;
}

.vehicle-search:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
    color: #000000 !important;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #999;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    z-index: 1;
}

.search-clear {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #999;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.search-clear:hover {
    color: #333;
}

/* Vehicle Content Area */
.vehicle-content {
    position: relative;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 8px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Vehicle Grid */
.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.vehicle-grid.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Vehicle Cards */
.vehicle-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    opacity: 1;
    transform: translateY(0);
    text-decoration: none;
    color: inherit;
}

/* Frontend: Hide cards initially for fade-in animation */
body:not(.elementor-editor-active) .vehicle-card:not(.fade-in) {
    opacity: 0;
    transform: translateY(20px);
}

.vehicle-card.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.vehicle-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

/* Vehicle Image */
.vehicle-image {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
}

.vehicle-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.vehicle-card:hover .vehicle-image img {
    transform: scale(1.05);
}

/* Image Overlay */
.vehicle-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.vehicle-card:hover .vehicle-image-overlay {
    opacity: 1;
}

.vehicle-image-overlay-text {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    padding: 10px 20px;
    border: 2px solid #ffffff;
    border-radius: 4px;
}

/* Category Badges Container */
.vehicle-category-badges {
    position: absolute;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    z-index: 3;
    max-width: calc(100% - 30px);
}

.vehicle-category-badges.badge-position-top-left {
    top: 15px;
    left: 15px;
}

.vehicle-category-badges.badge-position-top-right {
    top: 15px;
    right: 15px;
    justify-content: flex-end;
}

.vehicle-category-badges.badge-position-bottom-left {
    bottom: 15px;
    left: 15px;
}

.vehicle-category-badges.badge-position-bottom-right {
    bottom: 15px;
    right: 15px;
    justify-content: flex-end;
}

/* Individual Category Badge */
.vehicle-category-badge {
    background-color: #007cba;
    color: #ffffff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Vehicle Details */
.vehicle-details {
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.vehicle-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    order: 1;
}

.vehicle-year {
    font-weight: 600;
}

.vehicle-colors {
    font-style: italic;
}

.vehicle-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    order: 2;
}

.vehicle-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    flex: 1;
    margin-right: 10px;
}

.vehicle-engine {
    font-size: 13px;
    color: #666;
    font-weight: 500;
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
}


/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    padding: 20px 0;
}

.pagination-dots {
    display: flex;
    gap: 10px;
    align-items: center;
}

.pagination-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-dots .dot:hover {
    background: #007cba;
    transform: scale(1.2);
}

.pagination-dots .dot.active {
    background: #007cba;
    width: 30px;
    border-radius: 6px;
}

/* Error and No Results States */
.no-vehicles,
.error-message {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 16px;
    grid-column: 1 / -1;
}

.error-message {
    color: #d32f2f;
    background: #ffebee;
    border-radius: 8px;
    border: 1px solid #ffcdd2;
}

/* Responsive Design */
@media (max-width: 767px) {
    .vehicle-filters {
        flex-direction: column;
        gap: 15px;
    }

    .category-filters {
        justify-content: flex-start;
        width: 100%;
    }

    .search-container {
        width: 100%;
        min-width: auto;
    }

    .vehicle-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .vehicle-info {
        flex-direction: row-reverse;
        align-items: flex-start;
        gap: 8px;
    }

    .vehicle-title {
        margin-right: 0;
        font-size: 16px;
        order: 2;
    }

    .vehicle-engine {
        order: 1;
    }

    .filter-tab {
        padding: 8px 16px;
        font-size: 13px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .vehicle-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .vehicle-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Accessibility */
.filter-tab:focus,
.vehicle-search:focus,
.pagination-dots .dot:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .vehicle-filters,
    .pagination-container {
        display: none;
    }

    .vehicle-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}