body {
    direction: rtl;
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    margin: 0;
    padding: 0;
}

header {
    background-color: #d8cfc4;
    color: #4d2a1d;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #4d2a1d;
}

header .logout-button {
    background-color: #4d2a1d;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

header .logout-button:hover {
    background-color: #d8cfc4;
    color: #4d2a1d;
}
button {
    padding: 10px 15px;
    background-color: #4d2a1d; /* Dark brown background */
    color: #fff; /* White text */
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #d8cfc4; /* Light brown background on hover */
    color: #4d2a1d; /* Dark brown text color on hover */
}

.username-container {
    font-size: 18px;
    font-weight: bold;
}

.search-container {
    display: flex;
    justify-content: center;
    margin: 20px;
}

.search-container input {
    padding: 10px;
    border: 2px solid #d8cfc4;
    border-radius: 8px;
    font-size: 16px;
    margin-right: 10px;
    width: 300px;
    transition: border-color 0.3s;
}

.search-container input:focus {
    border-color: #4d2a1d;
    outline: none;
}

.search-container button {
    padding: 10px 15px;
    background-color: #4d2a1d;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.search-container button:hover {
    background-color: #d8cfc4;
    color: #4d2a1d;
}

#result-container {
    display: flex;
    justify-content: center;
    margin: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px auto;
    max-width: 800px;
}

th, td {
    padding: 12px;
    text-align: right;
    border-bottom: 1px solid #ddd;
}

tr:nth-child(even) {
    background-color: #e6dcd0;
}

tr:nth-child(odd) {
    background-color: #f5f5f5;
}

th {
    background-color: #d8cfc4;
    color: #4d2a1d;
    text-align: center;
}

p, h2, h4 {
    margin: 10px 0;
    color: #4d2a1d;
}

strong {
    color: #4d2a1d;
}

.callout {
    background-color: #e6dcd0;
    border-color: #4d2a1d;;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border: 3px solid #4d2a1d;
}

.transfert-container {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

.popup {
    z-index: 10;
    display: none; /* Hidden by default */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 1001; /* Ensure it sits on top of the overlay */
    background-color: #e6dcd0;
    border-color: #4d2a1d;;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border: 3px solid #4d2a1d;
}

.popup-overlay {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent black */
    z-index: 1000; /* Ensure it sits below the popup */
}

.popup-content {
    position: relative;
}


.popup-content h2 {
    margin-top: 2;
}
.form-group {
    display: flex;
    align-items: center; /* Centre verticalement les éléments */
    gap: 10px; /* Espacement entre le champ de saisie et le label */
    margin-bottom: 15px; /* Espacement entre les lignes de formulaire */
}

label {
    font-size: 16px;
    margin: 0; /* Retire la marge par défaut du label */
    white-space: nowrap; /* Évite le retour à la ligne du label */
}
.form-actions {
    text-align: right;
}
button#confirm-button, button#exit-button {
    padding: 10px 15px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button#confirm-button {
    background-color: #4d2a1d;
    color: #fff;
    margin-right: 10px;
}

button#confirm-button:hover {
    background-color: #d8cfc4;
    color: #4d2a1d;
}

button#exit-button {
    background-color: #ddd;
    color: #333;
}

button#exit-button:hover {
    background-color: #ccc;
}
.my-section{
    display: none;
}
#loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.8); /* Slightly transparent background */
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);


}

.spinner {
    border: 8px solid #f3f3f3; /* Light gray */
    border-top: 8px solid #4d2a1d; /* Dark brown */
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    display: flex;
    
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loading-spinner p {
    margin-top: 10px;
    font-size: 16px;
    color: #4d2a1d; /* Dark brown */
}

input[type="number"] {
    padding: 10px;
    border: 2px solid #d8cfc4;
    border-radius: 8px;
    font-size: 16px;
    width: 100%;
    max-width: 200px; /* Réduit la largeur maximale */
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="number"]:focus {
    border-color: #4d2a1d;
    outline: none;
    box-shadow: 0 0 5px rgba(77, 42, 29, 0.3);
}
.username-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info span {
    margin: 0 10px;
    font-weight: bold;
}

.balance {
    margin-left: auto;
}

.overlay {
    display: none; /* Initially hidden */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
    z-index: 5; /* Lower z-index than spinner */
}

.invoice {
    font-family: Arial, sans-serif;
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
    border: 1px solid #ccc;
}
.invoice h1 {
    font-size: 24px;
    margin-bottom: 20px;
}
.invoice p {
    font-size: 18px;
    margin: 10px 0;
}


/* Mobile styles for screens 600px wide or smaller */
@media only screen and (max-width: 600px) {
    body {
        font-size: 16px; /* Adjust font size for better readability on mobile */
        margin: 0; 
        padding: 10px;
    }

    h1 {
        font-size: 24px; /* Resize titles */
        text-align: center;
    }

    input, button {
        width: 100%; /* Make inputs and buttons full-width */
        font-size: 18px;
        padding: 12px;
        margin: 10px 0;
        box-sizing: border-box; /* Ensures padding doesn't affect width */
    }

    table {
        width: 100%; /* Ensure table fits the screen */
        border-collapse: collapse;
    }

    th, td {
        font-size: 14px; /* Smaller font for table */
        padding: 8px; /* Add padding to cells */
        text-align: left;
    }

    /* Make sure the spinner and popups fit well */
    .spinner {
        width: 50px;
        height: 50px;
        margin: auto;
    }

    .popup {
        width: 90%;
        margin: auto;
        padding: 20px;
    }

    /* Responsive container adjustments */
    #result-container, #popup {
        width: 100%;
        padding: 10px;
        box-sizing: border-box;
    }

    /* Hide unnecessary elements on mobile, if needed */
    .desktop-only {
        display: none;
    }
}
