/**
 * DriveTrust ID - Styles pour le système d'offres tarifaires
 */

/* ===== MODAL D'OFFRE ===== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(44, 62, 80, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(3px);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===== SECTION DES OFFRES ===== */

.pricing-offers-management {
    margin-top: 20px;
    padding: 0;
    background: transparent;
}

.pricing-offers-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    margin-bottom: 20px;
}

.pricing-offers-section h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.pricing-offers-section p {
    margin: 0;
    color: #7f8c8d;
    font-size: 13px;
}

/* ===== CARTES D'OFFRES ===== */

.offer-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px 15px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.offer-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-color: #3498db;
}

.offer-card.active {
    border-color: #3498db;
    background: #f8fbff;
}

.offer-card.inactive {
    opacity: 0.5;
    border-color: #ddd;
}

/* Badge de statut */
.offer-status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.offer-status-badge.active {
    background: #27ae60;
    color: white;
}

.offer-status-badge.inactive {
    background: #95a5a6;
    color: white;
}

/* ===== GRILLE D'INFORMATIONS ===== */

.offer-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.offer-info-item {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.offer-info-label {
    color: #7f8c8d;
    font-size: 13px;
    margin-bottom: 5px;
    font-weight: 500;
}

.offer-info-value {
    color: #2c3e50;
    font-weight: 600;
    font-size: 16px;
}

.offer-info-value.price {
    color: #3498db;
    font-weight: 700;
    font-size: 18px;
}

.offer-info-value.deposit {
    color: #e67e22;
    font-weight: 600;
}

/* ===== BOUTONS D'ACTION ===== */

.offer-actions {
    display: flex;
    gap: 8px;
    margin-left: 20px;
}

.offer-action-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    background: #95a5a6;
    color: white;
}

.offer-action-btn:hover {
    transform: scale(1.1);
}

.offer-action-btn.edit {
    background: #f39c12;
}

.offer-action-btn.toggle {
    background: #27ae60;
}

.offer-action-btn.toggle.inactive {
    background: #95a5a6;
}

.offer-action-btn.delete {
    background: #e74c3c;
}

/* ===== BOUTON AJOUTER UNE OFFRE ===== */

.add-offer-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.add-offer-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.add-offer-btn:active {
    transform: translateY(0);
}

/* ===== FORMULAIRE D'OFFRE ===== */

.offer-form-group {
    margin-bottom: 20px;
}

.offer-form-label {
    display: block;
    margin-bottom: 8px;
    color: #34495e;
    font-weight: 600;
    font-size: 14px;
}

.offer-form-label .required {
    color: #e74c3c;
    margin-left: 2px;
}

.offer-form-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s ease;
}

.offer-form-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.offer-form-hint {
    color: #7f8c8d;
    font-size: 13px;
    margin-top: 5px;
    display: block;
}

/* ===== TYPE DE DURÉE (RADIO BUTTONS) ===== */

.duration-type-options {
    display: flex;
    gap: 15px;
}

.duration-type-option {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.duration-type-option:hover {
    border-color: #3498db;
    background: #f8f9fa;
}

.duration-type-option input[type="radio"] {
    margin-right: 10px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.duration-type-option input[type="radio"]:checked + div {
    color: #3498db;
}

.duration-type-option:has(input[type="radio"]:checked) {
    border-color: #3498db;
    background: rgba(52, 152, 219, 0.05);
}

/* ===== ÉTAT VIDE ===== */

.offers-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #95a5a6;
}

.offers-empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.offers-empty-state h3 {
    margin: 0 0 10px 0;
    color: #7f8c8d;
    font-size: 18px;
}

.offers-empty-state p {
    margin: 0;
    font-size: 14px;
}

/* ===== SECTION CLIENT - SÉLECTION D'OFFRE ===== */

.client-offers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.client-offer-card {
    background: white;
    border: 3px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.client-offer-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: #3498db;
}

.client-offer-card.selected {
    border-color: #27ae60;
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.05) 0%, rgba(39, 174, 96, 0.1) 100%);
    box-shadow: 0 0 0 4px rgba(39, 174, 96, 0.1);
}

.client-offer-card.selected::before {
    content: "✓";
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    background: #27ae60;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
}

.client-offer-name {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 15px;
}

.client-offer-price {
    font-size: 32px;
    font-weight: 800;
    color: #3498db;
    margin-bottom: 15px;
}

.client-offer-price span {
    font-size: 16px;
    font-weight: 400;
    color: #7f8c8d;
}

.client-offer-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.client-offer-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #34495e;
    font-size: 14px;
}

.client-offer-detail svg {
    width: 18px;
    height: 18px;
    color: #3498db;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 10px;
    }

    .duration-type-options {
        flex-direction: column;
    }

    .offer-info-grid {
        grid-template-columns: 1fr;
    }

    .client-offers-grid {
        grid-template-columns: 1fr;
    }

    .offer-card {
        padding: 15px;
    }

    .offer-actions {
        margin-left: 0;
        margin-top: 15px;
        justify-content: flex-end;
    }
}

/* ===== ANIMATIONS ===== */

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.offer-card.new {
    animation: pulse 0.6s ease;
}

/* ===== ACCESSIBILITÉ ===== */

.offer-action-btn:focus,
.add-offer-btn:focus,
.offer-form-input:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Mode sombre (si nécessaire) */
@media (prefers-color-scheme: dark) {
    .modal-content {
        background: #2c3e50;
        color: #ecf0f1;
    }

    .offer-form-input {
        background: #34495e;
        border-color: #4a5f7f;
        color: #ecf0f1;
    }

    .offer-card {
        background: #34495e;
        border-color: #4a5f7f;
    }

    .pricing-offers-management {
        background: #2c3e50;
        border-color: #4a5f7f;
    }
}
