/*
 * ========================================
 * Vehicle Cards Design System - AlRaebi Auto Car
 * ========================================
 * نظام موحد لجميع بطاقات المركبات في الموقع
 * يشمل: السيارات، الشاحنات، محطات الشحن
 */

/* ========================================
   1. BASE CARD STRUCTURE (البنية الأساسية)
   ======================================== */

.vehicle-card {
    position: relative;
    background: var(--color-card-bg);
    border-radius: 24px; /* زوايا مستديرة موحدة */
    overflow: hidden;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.15); /* ظل قوي موحد */
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1), var(--theme-transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* شريط علوي تم إزالته بناءً على طلب المستخدم */

.vehicle-card:hover {
    transform: translateY(-12px); /* حركة أقوى */
    box-shadow: 0 25px 60px var(--btn-primary-hover-shadow); /* ظل أقوى عند hover */
}

/* ========================================
   2. VEHICLE IMAGE SECTION (قسم الصورة)
   ======================================== */

.vehicle-image {
    position: relative;
    width: 100%;
    height: 200px; /* ارتفاع أكبر للفخامة */
    background: linear-gradient(135deg, var(--color-bg-section) 0%, var(--color-bg-muted) 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* تعتيم خفيف موحد فوق الصورة */
.vehicle-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.15); /* تعتيم موحد 15% */
    z-index: 1;
    pointer-events: none;
}

.vehicle-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.vehicle-card:hover .vehicle-image img {
    transform: scale(1.1); /* تكبير أقوى */
}

/* ========================================
   3. VEHICLE OVERLAY (الطبقة العلوية)
   ======================================== */

.vehicle-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 165, 223, 0.92) 0%, rgba(0, 126, 198, 0.92) 100%); /* تعتيم موحد 92% */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1.5rem;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 10;
}

.vehicle-card:hover .vehicle-overlay {
    opacity: 1;
}

/* زر بارز موحد - أبيض مع ظل */
.vehicle-overlay .btn {
    background: var(--btn-white-bg);
    color: var(--color-primary);
    border: none;
    font-weight: 700;
    font-size: 1.1rem;
    padding: 14px 32px; /* مسافات واسعة */
    border-radius: 50px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25); /* ظل قوي */
    transition: all 0.3s ease, var(--theme-transition);
}

.vehicle-overlay .btn:hover {
    background: var(--btn-white-hover-bg);
    color: var(--btn-white-hover-text);
    transform: scale(1.08);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

/* ========================================
   4. VEHICLE BADGE (شارة المركبة)
   ======================================== */

.vehicle-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: var(--btn-primary-text);
    padding: 5px 14px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px var(--btn-primary-shadow);
    z-index: 20;
    animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Badge Variants */
.vehicle-badge.hot {
    background: linear-gradient(135deg, var(--btn-danger-bg) 0%, var(--btn-danger-bg-end) 100%);
}

.vehicle-badge.new {
    background: linear-gradient(135deg, var(--btn-success-bg) 0%, var(--btn-success-bg-end) 100%);
}

.vehicle-badge.featured {
    background: linear-gradient(135deg, var(--btn-warning-bg) 0%, var(--btn-warning-bg-end) 100%);
    color: var(--btn-warning-text);
}

.vehicle-badge.commercial {
    background: linear-gradient(135deg, var(--btn-secondary-bg) 0%, var(--btn-secondary-hover) 100%);
}

/* ========================================
   5. VEHICLE INFO SECTION (معلومات المركبة)
   ======================================== */

.vehicle-info {
    padding: 20px 20px; /* مسافات واسعة موحدة */
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.vehicle-name {
    font-size: 1.25rem; /* خط أكبر */
    font-weight: 800; /* خط سميك جداً */
    color: var(--color-text);
    margin: 0;
    line-height: 1.3;
    letter-spacing: -0.5px;
    transition: color 0.3s ease, var(--theme-transition);
}

.vehicle-card:hover .vehicle-name {
    color: var(--color-primary);
}

.vehicle-type {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin: 0;
    font-weight: 600; /* أسمك */
    transition: var(--theme-transition);
}

/* ========================================
   6. VEHICLE SPECS (المواصفات)
   ======================================== */

.vehicle-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px; /* مسافة أكبر */
    margin-top: 0.5rem;
}

.spec-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--color-primary);
    padding: 8px 16px; /* مسافات واسعة موحدة */
    border-radius: 50px; /* دائري موحد */
    font-size: 0.8rem;
    color: var(--btn-primary-text);
    font-weight: 700; /* خط سميك موحد */
    box-shadow: 0 4px 12px var(--btn-primary-shadow); /* ظل خفيف موحد */
    transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease, var(--theme-transition);
}

.spec-item i {
    color: var(--btn-primary-text);
    font-size: 0.9rem;
}

.vehicle-card:hover .spec-item {
    background: var(--color-primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 6px 18px var(--btn-primary-hover-shadow); /* ظل أقوى عند hover */
}

/* ========================================
   7. VEHICLE ACTIONS (أزرار الإجراءات)
   ======================================== */

.vehicle-actions {
    padding: 0 20px 20px; /* مسافات واسعة موحدة */
    display: flex;
    gap: 12px;
}

/* زر الإجراء الرئيسي - بارز وموحد */
.vehicle-actions .btn {
    flex: 1;
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border: none;
    padding: 14px 24px; /* مسافات واسعة */
    font-size: 1.05rem;
    font-weight: 800; /* خط سميك جداً */
    border-radius: 50px; /* دائري موحد */
    box-shadow: 0 6px 18px var(--btn-primary-shadow); /* ظل قوي موحد */
    transition: all 0.3s ease, var(--theme-transition);
    letter-spacing: 0.3px;
}

.vehicle-actions .btn:hover {
    background: var(--btn-primary-hover);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 25px var(--btn-primary-hover-shadow); /* ظل أقوى */
}

/* ========================================
   8. VEHICLE PRICE (السعر)
   ======================================== */

.vehicle-price {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--color-bg-section) 0%, var(--color-bg-muted) 100%);
    transition: var(--theme-transition);
}

.price-label {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    font-weight: 500;
    transition: var(--theme-transition);
}

.price-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    transition: var(--theme-transition);
}

.price-currency {
    font-size: 1rem;
    color: var(--color-text-secondary);
    margin-right: 5px;
    transition: var(--theme-transition);
}

/* ========================================
   9. VEHICLE FEATURES (الميزات)
   ======================================== */

.vehicle-features {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 20px 15px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    transition: var(--theme-transition);
}

.feature-item i {
    color: var(--btn-success-bg);
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

/* ========================================
   10. VEHICLE STATUS (الحالة)
   ======================================== */

.vehicle-status {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: var(--color-card-bg);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 20;
    transition: var(--theme-transition);
}

.vehicle-status.available {
    color: var(--btn-success-bg);
}

.vehicle-status.available::before,
.vehicle-status.pre-order::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.vehicle-status.available::before {
    background: var(--btn-success-bg);
    animation: status-pulse 2s ease-in-out infinite;
}

.vehicle-status.pre-order {
    color: var(--btn-warning-bg);
}

.vehicle-status.pre-order::before {
    background: var(--btn-warning-bg);
}

.vehicle-status.sold-out {
    color: var(--btn-danger-bg);
}

@keyframes status-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* ========================================
   11. VEHICLE RATING (التقييم)
   ======================================== */

.vehicle-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px 10px;
}

.rating-stars {
    display: flex;
    gap: 4px;
}

.rating-stars i {
    color: var(--btn-warning-bg);
    font-size: 1rem;
}

.rating-count {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    transition: var(--theme-transition);
}

/* ========================================
   12. VEHICLE COMPARISON (المقارنة)
   ======================================== */

.vehicle-compare {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    background: var(--color-card-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease, var(--theme-transition);
    z-index: 20;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.vehicle-compare:hover {
    background: var(--color-primary);
    color: var(--btn-primary-text);
    transform: scale(1.1);
}

.vehicle-compare i {
    font-size: 1.1rem;
}

/* ========================================
   13. VEHICLE TAGS (الوسوم)
   ======================================== */

.vehicle-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 20px 15px;
}

.vehicle-tag {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--color-bg-muted);
    color: var(--color-text-secondary);
    transition: var(--theme-transition);
}

.vehicle-tag.electric {
    background: var(--color-bg-section);
    color: var(--btn-success-bg);
}

.vehicle-tag.hybrid {
    background: var(--color-bg-section);
    color: var(--color-primary);
}

.vehicle-tag.commercial {
    background: var(--color-bg-muted);
    color: var(--color-text-secondary);
}

/* ========================================
   14. GRID LAYOUTS (تخطيطات الشبكة)
   ======================================== */

.vehicles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

/* 2 Columns Layout */
.vehicles-grid-2 {
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
}

/* 4 Columns Layout */
.vehicles-grid-4 {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* ========================================
   15. COMPACT CARD VARIANT (بطاقة مدمجة)
   ======================================== */

.vehicle-card.compact .vehicle-image {
    height: 160px;
}

.vehicle-card.compact .vehicle-info {
    padding: 12px 12px;
}

.vehicle-card.compact .vehicle-name {
    font-size: 1.05rem;
}

/* ========================================
   16. FEATURED CARD VARIANT (بطاقة مميزة)
   ======================================== */

.vehicle-card.featured {
    box-shadow: 0 15px 40px var(--btn-primary-shadow);
}

/* ========================================
   17. HORIZONTAL CARD VARIANT (بطاقة أفقية)
   ======================================== */

.vehicle-card.horizontal {
    flex-direction: row;
}

.vehicle-card.horizontal .vehicle-image {
    width: 40%;
    height: auto;
    min-height: 300px;
}

.vehicle-card.horizontal .vehicle-info {
    width: 60%;
}

/* ========================================
   18. LOADING STATE (حالة التحميل)
   ======================================== */

.vehicle-card.loading {
    pointer-events: none;
}

.vehicle-card.loading .vehicle-image {
    position: relative;
    overflow: hidden;
}

.vehicle-card.loading .vehicle-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.6) 50%, transparent 100%);
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ========================================
   19. RESPONSIVE DESIGN (التصميم المتجاوب)
   ======================================== */

/* Fallback for browsers without grid support */
@supports not (display: grid) {
    .vehicles-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 30px;
    }
    
    .vehicles-grid > * {
        flex: 1 1 calc(33.333% - 20px);
        min-width: 280px;
    }
}

@media (max-width: 1200px) {
    .vehicles-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 25px;
    }
}

@media (max-width: 992px) {
    .vehicle-image {
        height: 170px;
    }
    
    .vehicle-name {
        font-size: 1.1rem;
    }
    
    .vehicle-card.horizontal {
        flex-direction: column;
    }
    
    .vehicle-card.horizontal .vehicle-image {
        width: 100%;
        height: 170px;
    }
    
    .vehicle-card.horizontal .vehicle-info {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .vehicles-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .vehicle-image {
        height: 160px;
    }
    
    .vehicle-info {
        padding: 15px 12px;
    }
    
    .vehicle-name {
        font-size: 1.05rem;
    }
    
    .vehicle-badge {
        top: 10px;
        right: 10px;
        padding: 4px 12px;
        font-size: 0.65rem;
    }
}

@media (max-width: 576px) {
    .vehicles-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .vehicle-image {
        height: 150px;
    }
    
    .vehicle-specs {
        gap: 5px;
    }
    
    .spec-item {
        padding: 4px 8px;
        font-size: 0.7rem;
    }
}

/* ========================================
   20. RTL/LTR SUPPORT (دعم العربية والإنجليزية)
   ======================================== */

/* RTL (Arabic) - Badge on LEFT side */
[dir="rtl"] .vehicle-badge,
[dir="ltr"] .vehicle-compare,
[dir="ltr"] .vehicle-status {
    left: auto;
}

[dir="rtl"] .vehicle-badge {
    left: 12px;
}

[dir="rtl"] .vehicle-compare,
[dir="rtl"] .vehicle-status {
    right: 20px;
}

[dir="rtl"] .price-currency {
    margin-right: 0;
    margin-left: 5px;
}

/* LTR (English) - Badge on RIGHT side */
[dir="ltr"] .vehicle-badge,
[dir="rtl"] .vehicle-compare,
[dir="rtl"] .vehicle-status {
    right: auto;
}

[dir="ltr"] .vehicle-badge {
    right: 12px;
}

[dir="ltr"] .vehicle-compare,
[dir="ltr"] .vehicle-status {
    left: 20px;
}

[dir="ltr"] .price-currency {
    margin-left: 0;
    margin-right: 5px;
}

/* ========================================
   21. PRINT STYLES (أنماط الطباعة)
   ======================================== */

@media print {
    .vehicle-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--color-border);
    }
    
    .vehicle-overlay,
    .vehicle-compare,
    .vehicle-actions {
        display: none;
    }
}

/* ========================================
   22. ACCESSIBILITY (إمكانية الوصول)
   ======================================== */

.vehicle-card:focus-within {
    outline: 3px solid var(--focus-shadow-color);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }
}

/* ========================================
   23. DARK MODE SUPPORT (دعم الوضع الداكن)
   ======================================== */

/* البطاقات داكنة دائماً - تم تطبيق الألوان الداكنة في الأعلى */
