/* Polices */
@font-face {
    font-display: swap;
    font-family: 'Roboto Flex';
    font-style: normal;
    font-weight: 400;
    src: url('./font/roboto-flex-v26-latin-regular.woff2') format('woff2');
}

html {
    font-size: 1rem;
    color: var(--text-color);
}

body {
    font-family: 'Roboto Flex', Arial, sans-serif;
    margin: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* Style global des boutons */
button {
    border: var(--button-border);
    transition: all 0.2s ease;
}

button:hover {
    border: var(--button-border-hover);
}

/* Header */
.header {
    background-color: var(--header-background-color);
    color: var(--header-menu-primaire-color);
    padding: 1rem;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 60rem;
    margin: 0 auto;
    flex-wrap: wrap;
}

.header-title {
    font-size: 1.5rem;
    text-align: center;
    flex: 1 1 auto;
    margin: 0 2rem;
    text-transform: uppercase;
    color: var(--header-menu-primaire-color);
}

.menu-container {
    position: relative;
}

/* Boutons du menu principal (dans le header) */
.menu-toggle-left, .menu-toggle-right {
    background: none;
    border: none;
    color: var(--header-menu-primaire-color);
    font-size: 1.125rem;
    cursor: pointer;
    display: flex;
    align-items: center;
}

/* Menus déroulants */
.menu-left, .menu-right {
    position: absolute;
    top: 3.5rem;
    background-color: var(--background-secondary);
    padding: 1rem;
    border-radius: 0.5rem;
    min-width: 12rem;
    box-shadow: 0 0.25rem 0.5rem var(--shadow-color);
    z-index: 1000;
}

.menu-left {
    left: 0;
}

.menu-right {
    right: 0;
}

.menu-left ul, .menu-right ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.menu-left li, .menu-right li {
    width: 100%;
    display: flex;
    justify-content: center;
}

/* Style des liens et boutons dans les menus déroulants */
.menu-left li a, .menu-right li a,
.menu-left li button, .menu-right li button,
.profile-link a {
    display: block;
    width: 100%;
    text-decoration: none;
    color: var(--text-color);
    background: var(--background-secondary);
    padding: 0.75rem 1rem;
    border: var(--button-border);
    border-radius: 0.313rem;
    text-align: center;
    cursor: pointer;
    margin-bottom: 0.4rem;
    transition: all 0.2s ease;
    min-width: 10rem;
    max-width: 12rem;
}

#profil_a {
  width:min-content;
}

/* Hover des liens et boutons dans les menus déroulants */
.menu-left li a:hover, .menu-right li a:hover,
.menu-left li button:hover, .menu-right li button:hover,
.profile-link a:hover {
    background: var(--primary-color);
    color: var(--header-menu-primaire-color);
    border: var(--button-border-hover);
}

/* Style spécial pour le bouton de déconnexion */
.logout-btn {
    color: var(--danger-color) !important;
    font-weight: bold;
}

.logout-btn:hover {
    background: var(--danger-color) !important;
    color: var(--header-menu-primaire-color) !important;
}

/* Style pour les sélecteurs de langue et thème */
#languageSelector,
#themesSelector {
    width: 100%;
    max-width: 12rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.4rem;
    border: var(--button-border);
    border-radius: 0.313rem;
    background-color: var(--background-secondary);
    color: var(--text-color);
    cursor: pointer;
    text-align: center;
}

#languageSelector:hover,
#themesSelector:hover {
    border-color: var(--primary-color);
}

/* Style pour les boutons d'action */
.action-button {
    background: var(--primary-color);
    color: var(--header-menu-primaire-color);
    padding: 0.5rem 1rem;
    border: var(--button-border);
    border-radius: 0.313rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-button:hover {
    background: var(--primary-hover-color);
    border: var(--button-border-hover);
}

/* Style pour les boutons de danger */
.danger-button {
    background: var(--danger-color);
    color: var(--header-menu-primaire-color);
    border: var(--button-border);
}

.danger-button:hover {
    background: var(--danger-hover-color);
    border: var(--button-border-hover);
}

/* Loader */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--overlay-background);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

#loader::before {
    content: "";
    width: 3rem;
    height: 3rem;
    border: 0.313rem solid var(--background-secondary);
    border-top: 0.313rem solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Global Main Content */
main {
    padding: 1rem;
}

/* styles pour les toasts */
.toast-container {
    position: fixed;
    top: 30%; /* Positionne à 1rem depuis le haut */
    left: 50%; /* Centre horizontalement par rapport à la largeur de la page */
    transform: translateX(-50%); /* Décale de 50% vers la gauche pour le centrer parfaitement */
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center; /* Aligne les toasts au centre horizontal */
}

.toast {
    min-width: 250px;
    max-width: 350px;
    padding: 1rem;
    border-radius: 0.313rem; /* 5px */
    color: var(--text-color);
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    font-size: 1.5rem;
    background-color: var(--background-secondary);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    background-color: var(--success-color);
}

.toast-error {
    background-color: var(--danger-color);
}

.toast-warming {
    background-color: var(--warning-color);
}

.toast-info {
    background-color: var(--info-color);
}

/* Styles pour le modal */
.modal {
    position: absolute;
    top: 2rem;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-background);
    display: block;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    overflow: auto; /* Ajout de la scrollbar automatique */
}

.modal-content {
    background: var(--background-secondary);
    padding: 2rem;
    border-radius: 0.5rem;
    position: relative;
    /*width: 90%;*/
    max-width: 400px;
}

.close-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

.legal-section {
    max-width: 800px;
    margin: 2rem auto;
    padding: 1rem;
    background: var(--background-secondary);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 0.313rem;
}

.block-article {
    margin-bottom: 1.5rem;
}

.block-article h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.block-article p {
    margin: 0.2rem 0;
}

/* Style pour le conteneur du tableau */
.table-container {
    width: 100%;
    overflow-x: auto;
    margin: 1rem 0;
}

/* Style pour le tableau des achats */
.purchase-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    background: var(--background-secondary);
    color: var(--text-color);
}

.purchase-table th,
.purchase-table td {
    padding: 0.5rem;
    text-align: left;
    border: 1px solid var(--border-color);
}

.purchase-table th {
    background: var(--primary-color);
    color: var(--header-menu-primaire-color);
}

/* Pour les petits écrans */
@media screen and (max-width: 768px) {
    .table-container {
        margin: 0.5rem 0;
    }
    
    .purchase-table {
        font-size: 0.9rem;
    }
    
    .purchase-table th,
    .purchase-table td {
        padding: 0.3rem;
    }
}

/* Styles pour les tableaux responsifs */
.profil-section .table-container,
.profil-section #invoiceListUser {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 1em;
    -webkit-overflow-scrolling: touch;
}

.profil-section table,
.profil-section .purchase-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.profil-section table th,
.profil-section table td {
    padding: 0.75rem;
    text-align: left;
    border: 1px solid var(--border-color);
}

.profil-section table th {
    background-color: var(--secondary-color);
    color: var(--text-color);
}

/* Pour les petits écrans */
@media screen and (max-width: 768px) {
    .profil-section table th,
    .profil-section table td {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
}

#addReviewForm{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--background-secondary);
  color: var(--text-color);
  border: 1px solid var(--border-color);
}