/**
 * DriveTrust ID - CSS Professionnel pour la gestion des véhicules
 * Inclut : Modal d'édition/création + Cartes d'offres tarifaires
 */

/* ===== MODAL VÉHICULE ===== */

.vehicle-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.vehicle-modal-content {
    background: #ffffff;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.vehicle-modal-header {
    background: #f8fafc;
    padding: 24px 30px;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0;
}

.vehicle-modal-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #1a202c;
}

.vehicle-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #94a3b8;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.vehicle-modal-close:hover {
    background: #f1f5f9;
    color: #475569;
}

.vehicle-modal-body {
    padding: 30px;
}

/* ===== SECTIONS DU FORMULAIRE ===== */

.vehicle-form-section {
    margin-bottom: 32px;
}

.vehicle-form-section:last-child {
    margin-bottom: 0;
}

.vehicle-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
}

/* ===== CHAMPS DE FORMULAIRE ===== */

.vehicle-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.vehicle-form-field {
    display: flex;
    flex-direction: column;
}

.vehicle-form-label {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
}

.vehicle-form-label .required {
    color: #dc2626;
    margin-left: 2px;
}

.vehicle-form-input,
.vehicle-form-select {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    color: #1e293b;
    background: #ffffff;
    transition: all 0.2s;
}

.vehicle-form-input:focus,
.vehicle-form-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.vehicle-form-input::placeholder {
    color: #94a3b8;
}

/* ===== SECTION OFFRES TARIFAIRES ===== */

.offers-section {
    background: #f8fafc;
    padding: 24px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
}

.offers-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.offers-count {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

.offers-add-btn {
    padding: 10px 20px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.offers-add-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.offers-add-btn:active {
    transform: translateY(0);
}

/* ===== CARTES D'OFFRES ===== */

.offers-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.offer-card {
    background: #ffffff;
    border: 2px solid #cbd5e1;
    border-radius: 10px;
    padding: 16px 20px;
    transition: all 0.2s;
}

.offer-card.active {
    border-color: #3b82f6;
    background: linear-gradient(to right, #ffffff, #f0f9ff);
}

.offer-card.inactive {
    opacity: 0.6;
    border-color: #e2e8f0;
}

.offer-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.offer-card-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.offer-card-info {
    flex: 1;
    min-width: 0;
}

.offer-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.offer-card-name {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.offer-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.offer-badge.active {
    background: #10b981;
    color: white;
}

.offer-badge.inactive {
    background: #6b7280;
    color: white;
}

.offer-card-details {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.offer-detail-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.offer-detail-label {
    color: #64748b;
    font-weight: 500;
}

.offer-detail-value {
    color: #0f172a;
    font-weight: 700;
}

.offer-detail-value.price {
    color: #2563eb;
    font-size: 15px;
}

.offer-detail-value.deposit {
    color: #ea580c;
}

/* ===== ACTIONS DES OFFRES ===== */

.offer-card-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.offer-action-btn {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.offer-action-btn.edit {
    background: #f59e0b;
    color: white;
}

.offer-action-btn.edit:hover {
    background: #d97706;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.offer-action-btn.toggle {
    background: #10b981;
    color: white;
}

.offer-action-btn.toggle.inactive {
    background: #6b7280;
}

.offer-action-btn.toggle:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.offer-action-btn.delete {
    background: #ef4444;
    color: white;
}

.offer-action-btn.delete:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* ===== ÉTAT VIDE ===== */

.offers-empty {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 10px;
    border: 2px dashed #cbd5e1;
}

.offers-empty-text {
    color: #64748b;
    font-size: 15px;
    margin-bottom: 16px;
}

.offers-empty-btn {
    padding: 12px 24px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.offers-empty-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* ===== BOUTONS DU FORMULAIRE ===== */

.vehicle-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid #e2e8f0;
}

.vehicle-btn {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.vehicle-btn-cancel {
    background: #f1f5f9;
    color: #475569;
}

.vehicle-btn-cancel:hover {
    background: #e2e8f0;
}

.vehicle-btn-save {
    background: #10b981;
    color: white;
}

.vehicle-btn-save:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.vehicle-btn-save:active {
    transform: translateY(0);
}

/* ===== LISTE DES VÉHICULES (PAGE LOUEUR) ===== */

.vehicle-list-card {
    background: white;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.2s;
}

.vehicle-list-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

.vehicle-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 16px;
}

.vehicle-card-title {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
}

.vehicle-card-subtitle {
    font-size: 14px;
    color: #64748b;
}

.vehicle-card-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.vehicle-card-badge.available {
    background: #d1fae5;
    color: #065f46;
}

.vehicle-card-badge.unavailable {
    background: #fee2e2;
    color: #991b1b;
}

.vehicle-card-offers {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px solid #f1f5f9;
}

.vehicle-card-offers-title {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 12px;
}

.vehicle-card-offers-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.vehicle-offer-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 20px;
    font-size: 13px;
}

.vehicle-offer-pill-name {
    color: #0c4a6e;
    font-weight: 600;
}

.vehicle-offer-pill-price {
    color: #2563eb;
    font-weight: 700;
}

.vehicle-offer-pill.inactive {
    background: #f1f5f9;
    border-color: #e2e8f0;
    opacity: 0.6;
}

/* ===== SECTION PHOTOS ===== */

.vehicle-photos-container {
    margin-bottom: 20px;
}

.vehicle-photos-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

.vehicle-photos-hint {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 10px;
}

.vehicle-photos-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.photo-item {
    position: relative;
    width: 120px;
    height: 120px;
    cursor: move;
    transition: all 0.2s;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
}

.photo-item.main-photo img {
    border-color: #3b82f6;
}

.photo-item:hover {
    transform: scale(1.05);
}

.photo-main-badge {
    position: absolute;
    bottom: 5px;
    left: 5px;
    background: #3b82f6;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.photo-remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.photo-remove-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.photo-add-btn {
    width: 120px;
    height: 120px;
    border: 2px dashed #3b82f6;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: rgba(59, 130, 246, 0.05);
    transition: all 0.2s;
}

.photo-add-btn:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: #2563eb;
}

.photo-add-icon {
    font-size: 48px;
    color: #3b82f6;
    line-height: 1;
}

.photo-add-text {
    font-size: 12px;
    color: #3b82f6;
    margin-top: 5px;
    font-weight: 500;
}

.offers-loading-container {
    text-align: center;
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
    min-height: 50px;
}

.offers-loading-text {
    color: #64748b;
    font-size: 14px;
}

/* ===== MODAL FOOTER ===== */

.vehicle-modal-footer {
    padding: 20px 30px;
    background: #f8fafc;
    border-top: 2px solid #e2e8f0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    border-radius: 0 0 12px 12px;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
    .vehicle-modal-content {
        max-width: 95%;
        margin: 10px;
    }

    .vehicle-form-grid {
        grid-template-columns: 1fr;
    }

    .offer-card-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .offer-card-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .vehicle-form-actions {
        flex-direction: column;
    }

    .vehicle-btn {
        width: 100%;
    }

    .offer-card-details {
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .vehicle-modal-body {
        padding: 20px;
    }

    .offers-section {
        padding: 16px;
    }

    .offer-card {
        padding: 12px 16px;
    }

    .offer-card-actions {
        flex-direction: column;
        width: 100%;
    }

    .offer-action-btn {
        width: 100%;
    }
}
