/* Car Image Lazy Loading Placeholder */
.car-image-placeholder {
    position: relative;
    width: 100%;
    height: 242px; /* Desktop height */
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;
}

@media (max-width: 640px) {
    .car-image-placeholder {
        height: 121px; /* Mobile height */
    }
}

.car-image-placeholder .placeholder-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 0, 42, 0.1);
    border-top-color: #ff002a;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 8px;
    transition: opacity 0.3s ease;
}

/* Count Loading Styles */
.count-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 16px;
}

.count-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #ff002a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.count-loading span {
    opacity: 0.7;
    animation: text-pulse 2s ease-in-out infinite;
}

.vehicle-list {
    position: relative;
    min-height: 400px;
}

/* Modern Loading Spinner */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
}

.modern-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ff002a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1.5rem;
}

.loading-dots {
    display: flex;
    gap: 8px;
    margin-bottom: 1rem;
}

.loading-dot {
    width: 12px;
    height: 12px;
    background: #ff002a;
    border-radius: 50%;
    animation: loading-pulse 1.4s ease-in-out infinite both;
}

.loading-dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dot:nth-child(2) { animation-delay: -0.16s; }
.loading-dot:nth-child(3) { animation-delay: 0s; }

.loading-text {
    color: #666;
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.loading-subtext {
    color: #999;
    font-size: 0.9rem;
}

/* Skeleton Loading Cards */
.skeleton-container {
    display: block; /* Grid yerine block kullan */
    padding: 20px 0;
}

.skeleton-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px; /* Grid yerine margin kullan */
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    animation: skeleton-pulse 1.5s ease-in-out infinite alternate;
}

.skeleton-image {
    height: 200px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 8px;
    margin-bottom: 15px;
}

.skeleton-title {
    height: 20px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 10px;
    width: 80%;
}

.skeleton-description {
    height: 15px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 8px;
    width: 90%;
}

.skeleton-description:last-child {
    width: 60%;
}

/* Mevcut card yapısında skeleton için özel stiller */
.list-car-details .skeleton-image {
    width: 100%;
    height: 250px; /* Car card image yüksekliği */
}

.second-slider-card-description .skeleton-title {
    margin-bottom: 15px;
}

.second-slider-card-description .skeleton-description {
    margin-bottom: 10px;
}

/* Apply button özel loading durumu */
.apply-filters-btn.filter-loading {
    background-color: #6c757d !important;
    cursor: not-allowed;
    position: relative;
}

.apply-filters-btn.filter-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 25px;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    transform: translateY(-50%);
    z-index: 1;
}

/* Filter Loading States */
.filter-loading {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}

.filter-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 15px;
    width: 14px;
    height: 14px;
    border: 2px solid transparent;
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    transform: translateY(-50%);
    z-index: 1;
}

/* Car List Info Styling */
.car-list-info {
    text-align: right;
}

.car-list-info h2 {
    text-align: right;
    font-weight: 600;
    color: #333;
    margin-bottom: 0;
}

#listing-type-title {
    font-size: 1.1rem;
    color: #666;
    font-weight: 500;
    text-align: -webkit-right;
}

#listing-title {
    font-size: 1.1rem;
    color: #666;
    font-weight: 500;
    text-align: -webkit-left;
}

/* Error States */
.error-container {
    text-align: center;
    padding: 3rem;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    margin: 20px 0;
}

.error-icon {
    font-size: 3rem;
    color: #dc3545;
    margin-bottom: 1rem;
}

.error-message {
    color: #dc3545;
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.error-subtext {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.retry-button {
    min-width: 204px;
    width: auto;
    height: 52px;
    color: #fff;
    font-size: 14px;
    font-style: normal;
    font-weight: 600;
    line-height: 160%;
    border: 1px solid #fff;
    background: #ff002a;
    border-radius: 96px;
    margin-left: 20px;
    margin-right: 20px;
    text-decoration: none;
}

.retry-button:hover {
    background: #000000;
    color: #ffffff;
    border: 1px solid #ffffff;
}

/* No Results State */
.no-results {
    text-align: center;
    padding: 3rem;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    margin: 20px 0;
    width: 100%; /* Full width on desktop */
    flex: 1 1 100%; /* Override flex behavior */
}

.no-results-icon {
    font-size: 3rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.no-results-title {
    color: #495057;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.no-results-text {
    color: #6c757d;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.clear-filters-button {
    background: #ff002a;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.3s ease;
}

.clear-filters-button:hover {
    background: #000000;
}

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

@keyframes loading-pulse {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes skeleton-pulse {
    0% { opacity: 1; }
    100% { opacity: 0.6; }
}

@keyframes skeleton-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes text-pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.car-card-animate {
    animation: fadeIn 0.5s ease-out;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .skeleton-container {
        grid-template-columns: 1fr;
        padding: 15px;
    }

    .loading-container {
        padding: 2rem 1rem;
    }

    .modern-spinner {
        width: 45px;
        height: 45px;
        border-width: 3px;
    }

    .loading-text {
        font-size: 1rem;
    }
}
