/* Variables CSS */
:root {
    --primary-color: #2A4052;
    --secondary-color: #70C7D3;
    --danger-color: #d32f2f;
    --danger-hover-color: #b71c1c;
    --background-color: white;
    --border-radius: 5px;
    --box-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

/* Styles généraux */
body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #69B5C0, #96bac0);
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    height: 100vh;
    margin: 0;
    padding: 30px;
    box-sizing: border-box;
    position: relative;
}

body.show-overlay #overlay {
    display: block;
}

#app {
    background: var(--background-color);
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    max-width: 80%;
    width: 100%;
    margin: 0 auto;
}

h1, h2 {
    text-align: center;
    color: var(--primary-color);
}

input, textarea, select, button {
    width: 100%;
    margin: 10px 0;
    padding: 10px;
    border-radius: var(--border-radius);
    border: 1px solid #ccc;
    box-sizing: border-box;
}

canvas {
    display: block;
    margin: 0;
    padding: 0;
    border: 1px solid #ccc;
    border-radius: var(--border-radius);
    width: 100%;
    height: auto;
    max-width: 100%;
    height: 200px; /* ou la hauteur fixe souhaitée */
}


#logo {
    display: block;
    margin: 0 auto 20px;
    max-width: 150px;
    width: 100%;
    height: auto;
}

#user-email {
    font-size: 0.7em;
    color: rgb(90, 89, 89);
}

/* Styles pour l'overlay */
#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none; /* Masqué par défaut */
    z-index: 998; /* Doit être derrière le menu */
}

/* Header styles */
header {
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0px 20px;
    box-shadow: var(--box-shadow);
    position: fixed;
    top: 0;
    z-index: 999;
}

header h1, header img {
    color: var(--background-color);
    font-size: 1.5rem;
    margin: 5px;
}

header nav {
    padding: 20px;
    display: none;
    flex-direction: column;
}

header nav.show {
    display: flex;
    flex-direction: column;
    position: absolute;
    background-color: var(--primary-color);
    top: 50px; /* Ajustez selon la hauteur du header */
    right: 20px;
    width: 200px; /* Ajustez selon vos besoins */
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
}

header nav ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

header nav ul li {
    display: block;
    margin: 10px;
}

header nav ul li a {
    padding: 10px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
}

header nav ul li a:hover {
    background-color: var(--secondary-color);
}

.burger {
    display: block;
    cursor: pointer;
    margin-right: 10px;
}

.burger div {
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 5px;
    transition: all 0.3s;
}

#header-logo {
    margin: 5px;
    max-width: 50px;
    height: auto;
}

/* Boutons */
button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    padding: 10px 20px;
    border-radius: var(--border-radius);
}

button:hover {
    background-color: var(--secondary-color);
}

.delete-btn {
    background-color: var(--danger-color);
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: var(--border-radius);
    margin-top: 10px;
}

.delete-btn:hover {
    background-color: var(--danger-hover-color);
}

/* Conteneur des documents */
#documents-container {
    display: flex;
    flex-direction: row;
    gap: 20px;
}

#devis-column, #factures-column {
    flex: 1;
    background: var(--background-color);
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    max-width: 48%;
}

/* Liste des documents */
#documents-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    margin-top: 20px;
}

.document-item {
    flex: 1 1 calc(50% - 10px);
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: var(--border-radius);
    box-sizing: border-box;
    margin-bottom: 10px;
}

.document-item button {
    margin-top: 5px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: var(--border-radius);
}

.document-item button:hover {
    background-color: var(--secondary-color);
}

/* Modales */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--background-color);
    margin: auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    position: relative;
}

.close-btn {
    color: #aaa;
    position: absolute;
    right: 10px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
}

.close-btn:hover,
.close-btn:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* Modale générale */
#modal-warning {
    color: var(--danger-color);
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
}

#modal-message {
    margin-bottom: 20px;
    text-align: center;
}

#modal-buttons {
    display: flex;
    justify-content: flex-end;
}

#modal-ok-btn {
    margin-left: 10px;
    background-color: grey;
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: var(--border-radius);
}

#modal-ok-btn.warning {
    background-color: var(--danger-color);
}

#modal-ok-btn:hover {
    background-color: darkred;
}

#modal-cancel-btn {
    margin-left: 10px;
    background-color: #ccc;
    color: black;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: var(--border-radius);
}

#modal-cancel-btn:hover {
    background-color: #bbb;
}

/* Modale de profil */
#profile-modal .modal-content h2 {
    text-align: center;
    color: var(--primary-color);
}

#profile-modal .modal-content form div {
    margin-bottom: 10px;
}

#profile-modal .modal-content form label {
    display: block;
    margin-bottom: 5px;
}

#profile-modal .modal-content form input {
    width: 100%;
    padding: 10px;
    border-radius: var(--border-radius);
    border: 1px solid #ccc;
    box-sizing: border-box;
}

/* Modale de prévisualisation */
#preview-message {
    margin-bottom: 20px;
    text-align: center;
}

#preview-buttons {
    display: flex;
    justify-content: space-between;
}

#download-btn, #preview-btn, #cancel-preview-btn {
    background-color: grey;
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: var(--border-radius);
    margin: 0 10px;
}

#download-btn:hover, #preview-btn:hover, #cancel-preview-btn:hover {
    background-color: darkgrey;
}

/* Modale de ré-authentification */
#reauth-modal .modal-content {
   
    background-color: var(--background-color);
    margin: auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    position: relative;
}

#reauth-modal{
    display: none ;
}

#reauth-password {
    width: 100%;
    margin: 10px 0;
    padding: 10px;
    border-radius: var(--border-radius);
    border: 1px solid #ccc;
    box-sizing: border-box;
}

/* Items de produit */
.product-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.form-group {
    width: 100%;
}

.product-item input, .product-item select, .product-item button {
    width: 100%;
    padding: 10px;
    border-radius: var(--border-radius);
    border: 1px solid #ccc;
    box-sizing: border-box;
}

.remove-product-btn {
    background-color: var(--danger-color);
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    border-radius: var(--border-radius);
}

.remove-product-btn:hover {
    background-color: var(--danger-hover-color);
}

/* Liste des prestataires */
#providers-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    margin-top: 20px;
}

.provider-item {
    flex: 1 1 calc(50% - 10px);
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: var(--border-radius);
    box-sizing: border-box;
    margin-bottom: 10px;
}

.provider-item button {
    margin-top: 5px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: var(--border-radius);
}

.provider-item button:hover {
    background-color: var(--secondary-color);
}

.provider-item.selected {
    border: 2px solid var(--primary-color);
}



#signup-link {
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: underline;
}

#signup-link:hover {
    color: var(--secondary-color);
}

/* Règles mot de passe */
.rule {
    color: red; /* Par défaut, rouge pour indiquer l'invalidité */
}

.rule.valid {
    color: green; /* Vert pour indiquer la validité */
}

/* Ajout des media queries */
@media (min-width: 768px) {
    #documents-container {
        flex-direction: row;
    }

    #devis-column, #factures-column {
        max-width: 48%;
    }
}

@media (max-width: 767px) {
    #documents-container {
        flex-direction: column;
    }
    
    #devis-column, #factures-column {
        max-width: 100%;
    }
}

header nav {
    display: none;
}

header nav.show {
    display: flex;
    flex-direction: column;
    position: absolute;
    background-color: var(--primary-color);
    top: 50px; /* Adjust based on header height */
    right: 20px;
    width: 200px; /* Adjust as needed */
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
}

header nav ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

header nav ul li a {
    padding: 10px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
}

header nav ul li a:hover {
    background-color: var(--secondary-color);
}
