/* Déclaration des variables de couleur */
:root {
    --waiting-primary: #F1556C;
    --waiting-secondary: #FBDFD3;

    --preshape-primary: #9c4825;
    --preshape-secondary: #F8C87D;

    --shape-primary: #996d20;
    --shape-secondary: #FAE092;

    --artwork-primary: #6767BF;
    --artwork-secondary: #C7C7FF;

    --lamination-primary: #56742d;
    --lamination-secondary: #CAE6A3;

    --sanding-primary: #245348;
    --sanding-secondary: #85B8AC;

    --polish-primary: #5297A7;
    --polish-secondary: #BCE3EC;
}

/* Style général */
* {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #323b44;
    color: #ffffff;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* =================== HEADER =================== */
header {
    width: 100%;
    height: 80px;
    background-color: white;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
}

.user-info {
    margin-left: 171px;
    display: flex;
    flex-direction: row;
    gap: 15px;
    align-items: center;
}

header img {
    height: 130px;
    margin: 0;
    position: absolute;
    top: -1px;
    left: -1px;
}

header img.avatar {
    height: 50px;
    width: 50px;
	min-height: 50px;
    min-width: 50px;
    border-radius: 100%;
    object-fit: cover;
    position: static;
}

header h2 {
    color: #323b44;
    font-family: "aktiv-grotesk", sans-serif;
    font-weight: 800;
    font-style: normal;
}

header .link-header {
    display: flex;
    flex-direction: row;
}

header a.logout, header a.search, header a.back {
    font-size: 18px;
    text-decoration: none;
    display: block;
    height: 80px;
    width: 80px;
    text-align: center;
    align-content: center;
    color: #323b44;
}

header a.logout:hover, header a.search:hover, header a.back:hover {}

/* =================== LOGIN PAGE =================== */
.login-container {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 100%;
    text-align: left;
    color: #323b44;
    margin: 100px auto; /* Centrer le container */
}

.login-container h2 {
    text-align: center;
    margin-bottom: 20px;
}

.login-container label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
}

.login-container input[type="text"],
.login-container input[type="password"] {
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
}

.login-container button {
    width: 100%;
    padding: 15px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
}

.login-container button:hover {
    background-color: #45a049;
}

.login-container form {
	margin: 30px 0px;
}

/* Messages de feedback */
.success-message {
    color: #4CAF50;
    background-color: #DFF2BF;
    padding: 15px;
    border-radius: 5px;
    margin-top: 20px;
    text-align: center;
}

.error-message {
    color: #D8000C;
    background-color: #FFBABA;
    padding: 15px;
    border-radius: 5px;
    margin-top: 20px;
    text-align: center;
}

/* Page changement de mot de passe */

.change-password-container form {
	padding: 50px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.change-password-container form input{
	padding: 20px;
}

.password-container input {
	width:100%;
}

/* =================== DASHBOARD PAGE =================== */
main {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    margin-top: 120px; /* Ajouter une marge pour compenser le header fixe */
}

h2 {
    text-align: center;
}

.stats-section {
    display: flex;
    justify-content: center;
    width: 100%;
}

span.titre-stats {
    font-family: aktiv-grotesk, sans-serif;
    font-weight: 200;
    font-style: normal;
    min-width: 60px;
    display: inline-block;
    text-align: right;
}

.stats-column {
    color: #ffffff;
    padding: 15px;
    flex: 1;
    font-family: aktiv-grotesk, sans-serif;
    font-weight: 900;
    font-style: italic;
    font-size: 12px;
    max-width: 400px;
    text-align: center;
}

.stats-collectif p, .stats-individuel p {
    text-align: center;
    font-size: 14px;
}

.stats-column h3 {
    margin-top: 0;
    text-align: center;
    text-transform: uppercase;
    font-family: aktiv-grotesk, sans-serif;
    font-weight: 900;
    font-style: normal;
    font-size: 20px;
}

.commande {
    text-align: right;
}

/* =================== STATS =================== */

.positive {
    color: green;
}

.negative {
    color: red;
}

.admin-link {
	text-align: center;
}

.more-stats {
	color: black;
    text-decoration: none;
    background: white;
    padding: 10px 15px;
    font-size: 25px;
    text-decoration: none;
    border-radius: 4px;
    display: inline-block;
    margin: 5px;
    text-transform: uppercase;
    font-family: aktiv-grotesk, sans-serif;
    font-weight: 900;
    font-style: normal;
}

/* =================== FILTERS =================== */
.filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.filters a {
    padding: 10px 15px;
    background-color: #5d6f81;
    font-size: 25px;
    color: #ffffff;
    text-decoration: none;
    border-radius: 4px;
    display: inline-block;
    margin: 5px;
    text-transform: uppercase;
    font-family: aktiv-grotesk, sans-serif;
    font-weight: 900;
    font-style: normal;
}

.filters a:hover {
    background-color: #4a596a;
}

/* Couleurs spécifiques des filtres */
.filters a#filter-standby { background-color: black; }
.filters a#filter-waiting { background-color: var(--waiting-secondary); }
.filters a#filter-shape { background-color: var(--shape-secondary); }
.filters a#filter-preshape { background-color: var(--preshape-secondary); }
.filters a#filter-artwork { background-color: var(--artwork-secondary); }
.filters a#filter-lamination { background-color: var(--lamination-secondary); }
.filters a#filter-sanding { background-color: var(--sanding-secondary); }
.filters a#filter-polish { background-color: var(--polish-secondary); }
.filters a#filter-my-boards { background-color: black; }

/* =================== TABLE =================== */
.table-container {
    width: 90%;
    margin: 20px auto;
    color: #323b44;
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

table th, table td {
    padding: 10px;
    text-align: left;
    font-family: aktiv-grotesk, sans-serif;
    font-weight: 700;
    font-style: normal;
	max-width: 150px;
}

table thead tr {
    background-color: #20272e !important;
}

table tr {
    background-color: #20272e;
    color: white;
    font-family: aktiv-grotesk, sans-serif;
    font-weight: 700;
    font-style: normal;
    font-size: 10px;
}

tr:nth-child(even) {
    background-color: #485460;
}

tr:nth-child(odd) {
    background-color: #343f48;
}

table th {
    padding: 30px 10px;
}

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

.actions a {
    color: #4CAF50;
    text-decoration: none;
    font-size: 16px;
}

.actions a:hover {
    text-decoration: underline;
}

table td.checkbox-case {
    text-align: center;
}

input[type="checkbox"]:checked {
    text-align: center;
    background: aqua!important;
    background-color: aqua!important;  
}

/* =================== ROW COLORS =================== */
.standby { background-color: black; }
.waiting { background-color: var(--waiting-primary); }
.shape { background-color: var(--shape-primary); }
.preshape { background-color: var(--preshape-primary); }
.artwork { background-color: var(--artwork-primary); }
.lamination { background-color: var(--lamination-primary); }
.sanding { background-color: var(--sanding-primary); }
.polish { background-color: var(--polish-primary); }

.etat-box.waiting {
    background-color: var(--waiting-secondary); /* 80% blanc, 20% waiting primaire */
    border: 2px solid var(--waiting-primary);
    color: var(--waiting-primary);
}

.etat-box.preshape {
    background-color: var(--preshape-secondary); /* 80% blanc, 20% preshape primaire */
    border: 2px solid var(--preshape-primary);
    color: var(--preshape-primary);
}

.etat-box.shape {
    background-color: var(--shape-secondary); /* 80% blanc, 20% shape primaire */
    border: 2px solid var(--shape-primary);
    color: var(--shape-primary);
}

.etat-box.artwork {
    background-color: var(--artwork-secondary); /* 80% blanc, 20% artwork primaire */
    border: 2px solid var(--artwork-primary);
    color: var(--artwork-primary);
}

.etat-box.lamination {
    background-color: var(--lamination-secondary); /* 80% blanc, 20% lamination primaire */
    border: 2px solid var(--lamination-primary);
    color: var(--lamination-primary);
}

.etat-box.sanding {
    background-color: var(--sanding-secondary); /* 80% blanc, 20% sanding primaire */
    border: 2px solid var(--sanding-primary);
    color: var(--sanding-primary);
}

.etat-box.polish {
    background-color: var(--polish-secondary); /* 80% blanc, 20% polish primaire */
    border: 2px solid var(--polish-primary);
    color: var(--polish-primary);
}

.etat-box {
    padding: 10px 20px;
    border-radius: 100px;
    font-family: aktiv-grotesk, sans-serif;
    font-weight: 700;
    font-style: italic;
    text-transform: uppercase;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    min-width: 135px;
}

.etat-box .point {
    height: 15px;
    width: 15px;
    border-radius: 100px;
}

.etat-box.waiting .point {
    background-color: var(--waiting-primary);
}

.etat-box.preshape .point {
    background-color: var(--preshape-primary);
}

.etat-box.shape .point {
    background-color: var(--shape-primary);
}

.etat-box.artwork .point {
    background-color: var(--artwork-primary);
}

.etat-box.lamination .point {
    background-color: var(--lamination-primary);
}

.etat-box.sanding .point {
    background-color: var(--sanding-primary);
}

.etat-box.polish .point {
    background-color: var(--polish-primary);
}

.details-button {
    display: block;
    width: 100%;
    height: 100%;
    text-align: left;
    padding: 10px;
    border: none;
    background: none;
    cursor: pointer;
}

.details-button:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.checkbox {
    transform: scale(2);
}

.clickable-row {
    cursor: pointer;
}

.clickable-row td:not(.checkbox-cell) {
    position: relative;
}

.clickable-row td:not(.checkbox-cell):before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.checkbox-cell {
    position: relative;
    z-index: 2;
}

a.detail {
    padding: 15px;
    background-color: white;
    border-radius: 100px;
    height: 50px;
    display: block;
    width: 50px;
    text-align: center;
    align-content: center;
}

a.detail i {
    color: #323b44;
}

#boardinfo {
    width: 100%;
    border: 3px solid rgba(239, 83, 80, 0.3);
    border-radius: 5px;
}

#boardinfo button {
    background: none;
    color: #ef5350;
    font-size: 20px;
}

#preshape-info {
    width: 100%;
    border: 3px solid rgba(255, 170, 0, 0.15);
    border-radius: 5px;
}

#preshape-info button {
    background: none;
    color: #ffaa00;
    font-size: 20px;
}

#artwork-info {
    width: 100%;
    border: 3px solid rgba(61, 220, 247, 0.15);
    border-radius: 5px;
}

#artwork-info button {
    background: none;
    color: #3ddcf7;
    font-size: 20px;
}

.accordion {
    cursor: pointer;
    padding: 18px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 15px;
    transition: 0.4s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.accordion i {
    transition: transform 0.4s;
}

.active i {
    transform: rotate(180deg);
}

.table-wrapper {
    max-height: 700px;
    overflow-y: auto;
}

div.action-div {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.form-actions {
    padding: 10px 0px;
    color: white;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

select {
    padding: 20px 30px;
    font-size: 18px;
    border-radius: 100px;
    border: none;
    background-color: #485460;
    color: #ffffff;
    box-sizing: border-box;
    font-family: aktiv-grotesk, sans-serif;
    font-weight: 800;
    font-style: italic;
    width: 100%;
}

button[type="submit"], button[formaction="assign_user.php"], button#assignButton {
    width: 100%;
    font-size: 20px;
    border-radius: 8px;
    border: none;
    color: black;
    cursor: pointer;
    background-image: linear-gradient(to top right, #00ffe9, #00ffb9);
    font-family: aktiv-grotesk, sans-serif;
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
	border-radius: 100px;
    padding: 20px 50px;
}

button[type="submit"]:hover, button[formaction="assign_user.php"]:hover {
    background-color: #45a049;
}

button[type="submit"]:active, button[formaction="assign_user.php"]:active {
    transform: scale(0.98);
    transition: transform 0.1s;
}

select:focus, button[type="submit"]:focus, button[formaction="assign_user.php"]:focus {
    outline: 3px solid #0056b3;
}

select, button[type="submit"], button[formaction="assign_user.php"] {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.form-actions button {
    width: auto;
    flex: 1;
    max-width: 48%;
}

@media (max-width: 768px) {
    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .form-actions button {
        width: 100%;
        max-width: 100%;
        margin-bottom: 10px;
    }

    .form-actions select {
        width: 100%;
        margin-bottom: 10px;
    }
}

#finishedButton {
    width: 100%;
    height: 75px;
    color: white;
    border: none;
    border-radius: 100px;
    text-transform: uppercase;
    font-size: 20px;
    background-image: linear-gradient(to top right, #ff0042, #ff00a7);
    font-family: aktiv-grotesk, sans-serif;
    font-weight: 900;
    font-style: italic;
    cursor: pointer;
	margin: 10px 0px;
}

/* =================== PAGE DETAIL =================== */

main {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    margin-top: 120px; /* Ajouter une marge pour compenser le header fixe */
}

h2.model-info {
    font-family: aktiv-grotesk, sans-serif;
    font-weight: 900;
    font-style: normal;
    text-align: center;
}

.date {
    text-align: center;
}

.accordion-container {
    display: flex;
    flex-direction: column;
}

.accordion-item-fullwidth {
    width: 100%;
}

.accordion-button {
    cursor: pointer;
    padding: 35px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 15px;
    transition: 0.4s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: none;
    color: #333;
    font-family: aktiv-grotesk, sans-serif;
    font-weight: 900;
    font-style: normal;
    text-transform: uppercase;
    font-size: 20px;
}

.accordion-button i {
    transition: transform 0.4s;
}

.accordion-button.active i {
    transform: rotate(180deg);
}

.accordion-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out;
    padding: 0 35px;
}

.accordion-panel h3 {
    font-family: aktiv-grotesk, sans-serif;
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    font-size: 18px;
}

.accordion-panel p {
    text-align: left;
    font-family: aktiv-grotesk, sans-serif;
    font-weight: 300;
    font-style: normal;
}

.accordion-panel p strong{
    text-align: left;
    font-family: aktiv-grotesk, sans-serif;
    font-weight: 900;
    font-style: italic;
}

.accordion-item {
    color: black;
}

.accordion-item#infoboard {
    background-color: var(--waiting-secondary);
    border-left: 5px solid var(--waiting-primary);
}

.accordion-item#infoboard .accordion-button {
    color: var(--waiting-primary);
}

.accordion-item#infoboard .accordion-panel p strong {
    color: var(--waiting-primary);
}

.accordion-item#preshapeinfo {
    background-color: var(--preshape-secondary);
    border-left: 5px solid var(--preshape-primary);
}

.accordion-item#preshapeinfo .accordion-button {
    color: var(--preshape-primary);
}

.accordion-item#preshapeinfo .accordion-panel p strong {
    color: var(--preshape-primary);
}

.accordion-item#shapeinfo {
    background-color: var(--shape-secondary);
    border-left: 5px solid var(--shape-primary);
}

.accordion-item#shapeinfo .accordion-button {
    color: var(--shape-primary);
}

.accordion-item#shapeinfo .accordion-panel p strong {
    color: var(--shape-primary);
}

.accordion-item#artworkinfo {
    background-color: var(--artwork-secondary);
    border-left: 5px solid var(--artwork-primary);
}

.accordion-item#artworkinfo .accordion-button {
    color: var(--artwork-primary);
}

.accordion-item#artworkinfo .accordion-panel p strong {
    color: var(--artwork-primary);
}

.accordion-item#laminationinfo {
    background-color: var(--lamination-secondary);
    border-left: 5px solid var(--lamination-primary);
}

.accordion-item#laminationinfo .accordion-button {
    color: var(--lamination-primary);
}

.accordion-item#laminationinfo .accordion-panel p strong {
    color: var(--lamination-primary);
}

.accordion-item#sandinginfo {
    background-color: var(--sanding-secondary);
    border-left: 5px solid var(--sanding-primary);
}

.accordion-item#sandinginfo  .accordion-button {
    color: var(--sanding-primary);
}

.accordion-item#sandinginfo .accordion-panel p strong {
    color: var(--sanding-primary);
}

.return {
    width: 100%;
    text-align: center;
    margin-top: 50px;
}

.return a {
    color: black;
    text-decoration: none;
    font-family: aktiv-grotesk, sans-serif;
    font-weight: 900;
    font-style: italic;
    background-color: white;
    padding: 10px 50px;
    margin-top: 50px;
}

a img {
    width: 100%;
    height: auto;
}

.update-section, .assign-section {
	padding: 20px;
}

.update-section form, .assign-section form {
	gap: 20px;
    display: flex;
    flex-direction: column;
}

/* Photo section */

.photo-section {
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
}

.photo-section img {
    display: block;
    margin: 20px auto;
    max-width: 100%;
    border: 2px solid #000;
    border-radius: 8px;
}

#open-camera, #upload-button {
    padding: 15px 50px;
    margin: 10px 0;
    font-family: 'aktiv-grotesk', sans-serif;
    font-weight: 900;
    font-style: italic;
    color: #000000;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    background-color: #fff;
    border-radius: 8px;
}

.camera-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 1000; /* Assurez-vous que la popup est au-dessus de tout */
}

.camera-popup video {
    max-width: 90%;
    max-height: 70%;
    border-radius: 8px;
}

.capture-button {
    background-color: red;
    border: none;
    color: white;
    font-size: 24px;
    border-radius: 50%;
    padding: 20px;
    margin-top: 20px;
    cursor: pointer;
}

.close-button {
    position: absolute;
    top: 20px; /* Ajuster pour une meilleure visibilité */
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 48px; /* Taille de la croix */
    font-weight: bold;
    cursor: pointer;
    line-height: 1; /* Ajuste la hauteur de ligne pour centrer le symbole */
}

/* Styles pour le canvas */
#camera-popup {
    position: relative;
}
#video, #overlay {
    width: 100%;
    height: auto;
}
#overlay {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none; /* Permet de cliquer à travers le canvas */
}

/* =================== SEARCH PAGE =================== */

.search-container {
    padding: 20px;
    text-align: center;
}

.search-container h2 {
    margin-bottom: 20px;
    font-family: 'aktiv-grotesk';
    text-transform: uppercase;
    font-style: italic;
    font-weight: 900;
}

.search-container form {
    padding: 20px;
}

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

.form-group select,
.form-group input {
    width: 100%;
    border: none;
    border-radius: 5px;
    background-color: #3E4C59;
    color: #fff;
    font-size: 1em;
    margin: 0px;
    margin-bottom: 40px;
    border-radius: 100px;
    padding: 25px 40px;
    font-family: 'aktiv-grotesk';
    font-weight: 900;
    text-transform: uppercase;
}

.search-container button {
    width: 100%;
    border-radius: 100px;
    background-image: linear-gradient(to right, #02AAB0 0%, #00CDAC 51%, #02AAB0 100%);
    padding: 15px 45px;
    text-align: center;
    text-transform: uppercase;
    transition: 0.5s;
    background-size: 200% auto;
    color: white;            
    box-shadow: 0 0 5px #eee;
    display: block;
    font-family: 'aktiv-grotesk';
    font-weight: 900;
    text-transform: uppercase;
}

.search-container input::placeholder {
    color: white;
}

.search-container button:hover {
    background-position: right center; /* change the direction of the change here */
    color: #fff;
    text-decoration: none;
}

/* Page de résultat */

.results-container {
	text-align: center;
}

/* Styles pour les menus déroulants */
.select-container {
    position: relative;
    width: 100%;
}

.select-container select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: #3E4C59 url('data:image/svg+xml;utf8,<svg fill="%23fff" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>') no-repeat right 10px center;
    padding-right: 40px; /* Espace pour la flèche */
}

/* =================== STATS DETAILS PAGE =================== */

.employee-stats {
	padding: 20px;
}

.employee-chart-container {
	max-height: 300px;
}

.back-button {
	margin-top: 50px;
	text-align: center;
}

canvas {
	max-height: 500px;
}

/* =================== Compte rendu mensuel PAGE =================== */

.bar-container {
    width: 100%;
    background-color: #e0e0e0;
    height: 30px;
    display: flex;
    border-radius: 5px;
    overflow: hidden;
    margin: 20px 0;
}

.bar {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.bar-current {
    background-color: #4caf50; /* Vert pour les commandes du mois actuel */
}

.bar-previous {
    background-color: #f44336; /* Rouge pour les commandes du mois dernier */
}