/* Feuille de style CSS principale */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f5f5f5;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

/* En-têtes améliorés */
h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2.2em;
}

h2, h3 {
    color: #1a237e;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

h1 {
    font-size: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Boutons améliorés */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #2ecc71;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background-color: #27ae60;
}

/* Formulaire amélioré */
form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

/* Style uniforme pour tous les champs */
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    background-color: white;
    font-size: 14px;
    font-family: inherit;
}

/* Style au focus */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

/* Style spécifique pour textarea */
.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

/* Style spécifique pour les select pour assurer la cohérence visuelle */
.form-group select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 30px;
}

/* Suppression de la flèche native des select sur IE */
.form-group select::-ms-expand {
    display: none;
}

button {
    background-color: #3498db;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
    margin: 5px;
}

button:hover {
    background-color: #2980b9;
}

.actions {
    text-align: center;
    margin-bottom: 30px;
}

.autocomplete-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.3s ease;
}

.autocomplete-input:focus {
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

/* Style pour les suggestions */
input::-webkit-calendar-picker-indicator {
    display: none !important;
}

/* Style pour la liste des clients */
#listeClients {
    margin-top: 40px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
}

.client-card {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.client-card:hover {
    transform: translateY(-5px);
}

.client-card h3 {
    color: #2c3e50;
    margin-top: 0;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.client-card p {
    margin: 8px 0;
    color: #666;
}

/* Boutons d'action améliorés */
.card-actions {
    margin-top: 1.5rem;
    gap: 1rem;
    display: flex;
}

/* Boutons d'action pour PDF, EDITER et SUPPRIMER */
.btn-action {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    flex: 1;       /* Pour forcer l'égalité de largeur */
    text-align: center;
}

.btn-pdf {
    background-color: #3498db;
    color: white;
}

.btn-edit {
    background-color: #f39c12;
    color: white;
}

.btn-delete {
    background-color: #e74c3c;
    color: white;
}

/* Message pas de données amélioré */
.no-data {
    padding: 3rem;
    text-align: center;
    color: #6c757d;
    font-size: 1.2rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 2rem 0;
}

/* Animation de chargement */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

select {
    appearance: none;
    background-color: white;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    padding-right: 2.5em;
}

select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Animation pour le changement de liste */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

#marque option {
    padding: 8px;
}

/* Styles pour la liste des clients */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.search-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-container input,
.search-container select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    flex: 1;
}

.btn-refresh {
    display: flex;
    align-items: center;
    gap: 5px;
}

.refresh-icon {
    display: inline-block;
}

.rotating {
    animation: rotate 1s linear;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 5px;
    color: white;
    z-index: 1000;
    animation: slideIn 0.5s ease;
}

.notification.success {
    background-color: #2ecc71;
}

.notification.error {
    background-color: #e74c3c;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.client-card {
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.date {
    color: #666;
    font-size: 0.9em;
}

.card-content {
    margin-bottom: 15px;
}

.probleme {
    margin-top: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

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

/* Boutons primaires, groupes de boutons, et autres éléments */
.btn-primary {
    background-color: #007bff;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.btn-primary:active {
    transform: translateY(0);
}

.icon {
    font-size: 1.2em;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 5px;
    color: white;
    z-index: 1000;
    animation: slideIn 0.5s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.notification.success {
    background-color: #2ecc71;
}

.notification.error {
    background-color: #e74c3c;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.devis-section {
    margin: 15px 0;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.radio-group {
    display: flex;
    gap: 20px;
    margin: 10px 0;
}

.radio-group input[type="radio"] {
    margin-right: 5px;
}

.radio-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

#factureContainer {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
}

#factureContainer input {
    width: 100%;
    max-width: 200px;
}

.code-schema-container {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.code-input {
    flex: 1;
}

.schema-container {
    flex: 1;
}

.pattern-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

#patternLock {
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #fff;
}

.btn-clear {
    padding: 5px 10px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
}

.btn-clear:hover {
    background-color: #e0e0e0;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.button-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
    margin-bottom: 20px;
}

.button-group button,
.button-group .btn {
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    text-align: center;
    min-width: 200px;
}

.btn {
    background-color: #007bff;
    color: white;
    border: none;
}

.btn:hover {
    background-color: #0056b3;
}
