/* ==================== صفحات خودرو ==================== */

/* ==================== Page Header ==================== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.page-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* ==================== Statistics Cards ==================== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.stat-icon {
    width: 60px;
    height: 60px;
    flex: 0 0 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white-color);
    font-size: 28px;
    line-height: 1;
}

/* واریانت‌های رنگی ویجت‌های آمار (آیکن Bootstrap داخل دایره) */
.stat-card.stat-blue  .stat-icon { background: linear-gradient(135deg, #5b7dff, #3b5bdb); }
.stat-card.stat-green .stat-icon { background: linear-gradient(135deg, #22c55e, #15803d); }
.stat-card.stat-amber .stat-icon { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-card.stat-green .stat-info h3 { color: #15803d; }
.stat-card.stat-amber .stat-info h3 { color: #d97706; }

/* ردیف پلاک واقع‌نما در کارت خودرو */
.car-plate-row {
    display: flex;
    justify-content: center;
    margin: 14px 0 16px;
}

.stat-info h3 {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 5px 0;
    color: var(--primary-color);
}

.stat-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
}

/* ==================== Cars Grid ==================== */
.cars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

.car-card {
    background: var(--white-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    cursor: pointer;
}

.car-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.default-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--success-color);
    color: var(--white-color);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    z-index: 10;
}

.car-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.car-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.car-info {
    padding: 20px;
}

.car-info h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 10px 0;
}

.car-year {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 15px;
}

/* ==================== Plate Number ==================== */
.plate-number {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin: 15px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: var(--border-radius);
}

.plate-section {
    background: var(--white-color);
    border: 2px solid #000;
    border-radius: 4px;
    padding: 8px 12px;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 16px;
    min-width: 50px;
    text-align: center;
}

.plate-char {
    font-family: 'IRANSans', sans-serif;
    font-size: 18px;
    background: #0066cc;
    color: var(--white-color);
    border-color: #0066cc;
}

.plate-iran {
    background: #0066cc;
    color: var(--white-color);
    border-color: #0066cc;
    font-size: 12px;
    line-height: 1.2;
    padding: 4px 8px;
}

/* ==================== Car Details ==================== */
.car-details {
    margin: 15px 0;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--text-secondary);
    font-size: 14px;
}

.detail-value {
    font-weight: 500;
    font-size: 14px;
}

/* ==================== Service Dates ==================== */
.service-dates {
    background: #f8f9fa;
    border-radius: var(--border-radius);
    padding: 15px;
    margin: 15px 0;
}

.service-date-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 13px;
}

.service-date-item.next {
    color: var(--success-color);
    font-weight: 500;
}

/* ==================== Car Actions ==================== */
.car-actions {
    display: flex;
    gap: 8px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.car-actions .btn {
    flex: 1;
    min-width: 100px;
}

/* ==================== Empty State ==================== */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: var(--white-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.empty-state i {
    font-size: 80px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 22px;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 25px;
}

/* ==================== Car Form ==================== */
.car-form-container {
    padding: 30px 0;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin: 25px 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.required {
    color: var(--danger-color);
}

/* Plate Input Group */
.plate-input-group {
    display: flex;
    gap: 10px;
    align-items: end;
    flex-wrap: wrap;
}

.plate-input-section {
    flex: 1;
    min-width: 80px;
}

.plate-input-section label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    color: var(--text-secondary);
}

.plate-number {
    text-align: center;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 18px;
}

/* ==================== Car Detail Page ==================== */
.car-detail-container {
    padding: 30px 0;
}

.car-info-card {
    position: sticky;
    top: 90px;
}

.car-image-large {
    width: 100%;
    height: 250px;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.car-image-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* کامپوننت مشترک تصویر خودرو داخل قاب بزرگ صفحه‌ی جزئیات */
.car-image-large .v-car {
    width: 100%;
    height: 100%;
    background: transparent;
}

/* پلاک واقع‌نما در صفحه‌ی جزئیات، وسط‌چین */
.plate-display {
    justify-content: center;
}

.plate-display {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 20px 0;
}

.car-specs {
    margin: 20px 0;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.spec-item:last-child {
    border-bottom: none;
}

.spec-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.spec-value {
    font-weight: 600;
}

.vin-number {
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.car-description {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: var(--border-radius);
}

.car-description h5 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.car-actions-detail {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

/* ==================== Service Items ==================== */
.card-header {
    background: var(--light-color);
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}

.card-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.upcoming-service-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    border-right: 4px solid var(--info-color);
}

.upcoming-service-item.priority-high {
    border-right-color: var(--danger-color);
    background: rgba(220, 53, 69, 0.05);
}

.upcoming-service-item.priority-medium {
    border-right-color: var(--warning-color);
}

.service-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--light-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--primary-color);
}

.service-info {
    flex: 1;
}

.service-info h5 {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
}

.service-info p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

/* History Items */
.history-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: box-shadow 0.3s;
}

.history-item:hover {
    box-shadow: var(--shadow);
}

.history-date {
    flex-shrink: 0;
}

.date-badge {
    background: var(--primary-color);
    color: var(--white-color);
    padding: 10px 15px;
    border-radius: var(--border-radius);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

.history-content {
    flex: 1;
}

.history-content h5 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
}

.garage-name {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0 0 10px 0;
}

.history-details {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.detail-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: var(--light-color);
    border-radius: 4px;
    font-size: 13px;
}

.detail-badge.cost {
    color: var(--success-color);
    font-weight: 600;
}

.history-action {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    .cars-grid {
        grid-template-columns: 1fr;
    }

    .stats-row {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .plate-input-group {
        justify-content: center;
    }

    .plate-input-section {
        min-width: 60px;
    }

    .car-actions {
        flex-direction: column;
    }

    .car-actions .btn {
        width: 100%;
    }

    .car-info-card {
        position: static;
        margin-bottom: 20px;
    }

    .history-item {
        flex-direction: column;
    }

    .history-action {
        width: 100%;
    }

    .history-action .btn {
        width: 100%;
    }
}

/* ==================== فرم خودرو — بازطراحی (پیش‌نمایش/برند/رنگ/پلاک) ==================== */
.car-preview { display:flex; align-items:center; gap:16px; background:linear-gradient(135deg,#f5f7ff,#eef2ff); border:1px solid var(--border-color); border-radius:var(--border-radius); padding:16px 18px; margin-bottom:20px; }
.car-preview-stage { width:180px; max-width:48%; }
.car-svg { width:100%; height:auto; display:block; filter: drop-shadow(0 6px 10px rgba(15,23,42,.12)); }
.car-body { transition: fill .25s ease; }
.car-preview-cap { font-weight:700; color:var(--text-primary); font-size:16px; }

.brand-chips { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.brand-chip { border:1px solid var(--border-color); background:var(--bg-white); color:var(--text-secondary); border-radius:50px; padding:5px 12px; font-size:13px; font-weight:500; cursor:pointer; transition:var(--transition-fast); font-family:inherit; }
.brand-chip:hover { border-color:var(--primary-light); color:var(--primary-color); }
.brand-chip.active { background:var(--primary-gradient); color:#fff; border-color:transparent; }

.color-swatches { display:flex; flex-wrap:wrap; gap:8px; }
.color-swatch { display:inline-flex; align-items:center; gap:7px; border:1px solid var(--border-color); background:var(--bg-white); border-radius:50px; padding:5px 12px 5px 8px; cursor:pointer; font-size:13px; font-family:inherit; color:var(--text-secondary); transition:var(--transition-fast); }
.color-swatch .cs-dot { width:18px; height:18px; border-radius:50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); flex:0 0 18px; }
.color-swatch.light .cs-dot { box-shadow: inset 0 0 0 1px rgba(0,0,0,.28); }
.color-swatch:hover { border-color:var(--primary-light); }
.color-swatch.active { border-color:var(--primary-color); background:rgba(91,125,255,.08); color:var(--text-primary); font-weight:600; }

/* پلاک واقع‌نما */
.plate { direction:ltr; display:inline-flex; align-items:stretch; background:#fff; border:2px solid #111827; border-radius:10px; overflow:hidden; box-shadow: var(--shadow-sm); max-width:100%; }
.plate-main { display:flex; align-items:center; gap:6px; padding:8px 10px; }
.plate-cell { border:none; outline:none; text-align:center; font-weight:800; font-size:26px; color:#111827; background:transparent; padding:2px 0; font-family:'Vazirmatn','IRANSans',sans-serif; }
.plate-2 { width:52px; } .plate-3 { width:74px; } .plate-letter { width:46px; }
.plate-cell:focus { background:rgba(91,125,255,.10); border-radius:6px; }
.plate-region { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; background:#0b3d91; color:#fff; padding:5px 9px; min-width:58px; }
.plate-flag { display:flex; flex-direction:column; width:22px; height:14px; border-radius:2px; overflow:hidden; }
.plate-flag i { flex:1; display:block; }
.plate-flag i:nth-child(1){ background:#16a34a; } .plate-flag i:nth-child(2){ background:#fff; } .plate-flag i:nth-child(3){ background:#dc2626; }
.plate-region-num { width:46px; border:none; outline:none; text-align:center; font-weight:800; font-size:20px; background:#fff; color:#111827; border-radius:4px; padding:1px 0; font-family:inherit; }
.plate-ir { font-size:12px; font-weight:700; }
@media (max-width:480px){ .plate-cell{ font-size:22px; } .plate-2{ width:44px; } .plate-3{ width:62px; } .plate-letter{ width:42px; } .car-preview-stage{ width:130px; } }
