/* AutoTrader Stock Sync - Frontend Styles */

/* Vehicle Grid */
.atss-vehicles-grid {
    display: grid;
    gap: 30px;
    margin: 30px 0;
}

.atss-columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.atss-columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.atss-columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
    .atss-vehicles-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Vehicle Card */
.atss-vehicle-card,
.atss-card {
    background: #fff;
    border: none;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.atss-vehicle-image,
.atss-card-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/3;
}

.atss-card-price-badge {
    position: absolute;
    line-height: 1 !important;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 16px !important;
    border-radius: 4px;
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #10b981;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

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

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

.atss-card-content {
    padding: 20px;
}

.atss-vehicle-content {
    padding: 20px 0px;
}

.atss-vehicle-title,
.atss-card-title {
    margin: 0 0 10px 0 !important;
    font-size: 16px !important;
    line-height: 1.3 !important;
    font-weight: 600 !important;
}

.atss-vehicle-title a,
.atss-card-title a {
    text-decoration: none !important;
    color: #333 !important;
    font-size: 16px !important;
}

.atss-vehicle-title a:hover,
.atss-card-title a:hover {
    color: #0073aa !important;
}

.atss-vehicle-price,
.atss-card-price {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #0073aa !important;
    margin-bottom: 15px !important;
}

.atss-vehicle-meta,
.atss-card-specs {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    margin-bottom: 15px !important;
    font-size: 13px !important;
    color: #666 !important;
}

.atss-meta-item,
.atss-spec {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    font-size: 13px !important;
}

.atss-meta-item:not(:last-child)::after {
    content: "•";
    margin-left: 10px;
}

.atss-spec .fas,
.atss-spec .far,
.atss-meta-item .fas,
.atss-meta-item .far {
    width: auto !important;
    min-width: 14px !important;
    font-size: 13px !important;
    color: #10b981 !important;
}

.atss-view-details {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #10b981;
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.3s ease;
}

.atss-view-details .fas {
    transition: transform 0.3s ease;
}

.atss-view-details:hover {
    opacity: 0.8;
    color: #10b981;
}

.atss-view-details:hover .fas {
    transform: translateX(3px);
}

.atss-card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #10b981;
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.3s ease;
}

.atss-card-link:hover {
    opacity: 0.8;
    color: #10b981;
}

.atss-card-link .fas {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.atss-card-link:hover .fas {
    transform: translateX(3px);
}

/* Single Vehicle */
.atss-single-vehicle {
    background: #fff;
    border-radius: 8px;
}

.atss-vehicle-image-large {
    margin-bottom: 30px;
}

.atss-vehicle-image-large img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.atss-vehicle-price-large {
    font-size: 36px;
    font-weight: 700;
    color: #0073aa;
    margin: 20px 0;
}

.atss-vehicle-specs {
    margin: 30px 0;
}

.atss-vehicle-specs h3 {
    margin-bottom: 15px;
}

.atss-vehicle-specs table {
    width: 100%;
    border-collapse: collapse;
}

.atss-vehicle-specs th,
.atss-vehicle-specs td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e1e1e1;
}

.atss-vehicle-specs th {
    font-weight: 600;
    width: 40%;
    color: #666;
}

.atss-vehicle-specs td {
    font-weight: 400;
}

.atss-vehicle-description {
    margin-top: 30px;
    line-height: 1.6;
}

.atss-vehicle-description h3 {
    margin-top: 30px;
    margin-bottom: 15px;
}

.atss-vehicle-description ul {
    list-style: disc;
    margin-left: 20px;
}

/* Search Form */
.atss-search-form {
    background: #f7f7f7;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.atss-search-form form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: end;
}

.atss-search-form select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.atss-search-form button {
    padding: 10px 20px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.atss-search-form button:hover {
    background: #005177;
}

/* No Results */
.atss-no-vehicles {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: #666;
}

/* Vehicles Wrapper */
.atss-vehicles-wrapper {
    margin: 20px 0;
}

/* Loading Indicator */
.atss-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.atss-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(16, 185, 129, 0.3);
    border-top-color: #10b981;
    border-radius: 50%;
    animation: atss-spin 0.8s linear infinite;
}

@keyframes atss-spin {
    to { transform: rotate(360deg); }
}

.atss-scroll-sentinel {
    height: 1px;
    visibility: hidden;
}

/* Search Form Styles */
.atss-search-wrapper {
    margin-bottom: 40px;
}

.atss-search-form {
    display: flex;
    flex-direction: column;
}

.atss-search-form .atss-search-field {
    width: 100%;
}

.atss-search-form .atss-search-field select {
    width: 100%;
    box-sizing: border-box;
}

.atss-search-form .atss-search-submit {
    width: 100%;
}

.atss-search-form .atss-search-submit button {
    width: 100%;
    box-sizing: border-box;
}

.atss-search-form select:focus,
.atss-search-form input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.atss-search-form button:hover {
    opacity: 0.9;
}

.atss-search-results-header {
    margin-bottom: 20px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
}

.atss-search-results-header p {
    margin: 0;
    font-weight: 600;
    color: #374151;
}

.atss-no-results {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: #666;
}

@media (max-width: 768px) {
    .atss-search-form .atss-search-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}
