/*----------
Regroupe les styles globaux 
utilisées dans l'application
*-------------/


/*--------Mise en page globale---------*/

 html, body {
    font-family: Arial, Helvetica, sans-serif;
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    cursor: auto;
}

body {
  background-color: #eee !important;
}

body > main {
  flex: 1;
  padding: 1%;
}

/*-----Responsive ----*/

@media all and (max-width: 991px) {
  body > main {
    padding: 5%; 
  }
}

.wrap-container {
  display: flex;
  flex: 1;
  justify-content: center;
  margin-top: 5%;
}

.overlay {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: 99;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
}

/*-------- Header -------- */

header{
        background-color: var(--color-primary);
        position: sticky;
        top : 0;
        display: block;
        width: auto;
        height: 100px;
        color: whitesmoke;
        z-index: 2;
    }

img{
    height: 90%;
    margin: 4px;
    object-fit: contain;
}

/*--------Menu de navigation ---------*/

nav{
    font-size: 1.2rem;
    margin: 2px auto;
    background-color: var(--color-primary);
    width: 100%;
    padding: 0 2%;
}


nav .nav-list{
    list-style: none;
    display: flex;
    justify-content: start; 
    width: 100%;     
}



.link-nav{ 
    text-decoration: none;       
    color: whitesmoke;
    margin-left: 1%;
    margin-right: 1%;
}

.link-deconnect {
  margin-left: auto;
}

.separator {
  display: block;
}


.active, .link-nav:hover {
    color: rgb(197, 197, 197);
}

.label-nav, #toogle {
  display: none;
}

/*-------------Menu de navigation reponsive ------- */

@media all and (max-width: 1091px) {

  header{
    height: 80px;
  }

  .separator {
  display: none;
  }

  nav .nav-list svg {
    opacity: 0;
  }

  img {
    height: 60%;
    margin: 2px;
  }

  nav ul{
    display: none;
  }

  nav{
    margin: 0;
    padding: 0;
  }

  nav .nav-list {
    display: none;
    flex-direction: column;
    background-color: var(--color-primary);
    height: 200px;
    overflow-y: scroll;
    overflow-x: hidden;
    scrollbar-color: var(--color-primary);
  }

  nav .nav-list a {
    width: 100%;
    padding-bottom: 2%;
  }

  nav .nav-list a:hover {
    background-color: var(--color-secondary);
  }

  .link-nav {
    margin-left: auto;
  }

  .label-nav {
    width: 30%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 40px;
    cursor: pointer;
    color: #fff;
    margin: 0 auto
  }

  #toogle:checked + .nav-list {
    display: flex;
  }

}


/*-------- Footer -------- */

footer {
    background-color: black;
    display: block;
    width: 100%;
    margin-top: 2%;
}

.version {
    color: whitesmoke;
    text-align: center;
    font-style: italic;
}

.sources {
  color: whitesmoke;
  text-align: center;
  font-style: italic;
}


/*-------- Notifications ---------*/

.alert-box{
  position: fixed;
  right: 1rem;
  top: -5rem;
  z-index: 3;
  width: 300px;
  text-align: center;
}

.alert {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  position: relative;
  animation: translate 0.5s forwards;
}

.custom-close {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  width: 24px;
  height: 24px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.8;
}

.custom-close .danger {
  color: #c94d50;
}

.custom-close .danger:hover {
  color: #c94d4fd5;
}

.custom-close .info {
  color: #012F6b;
}

.custom-close .info {
  color: #022758;
}

.custom-close .success {
  color: #7dc67d;
}

.custom-close .success:hover {
  color: #6cbf6c;
}

@keyframes translate {
  from {
    top: -5rem;
  }
  to {
    top: 5rem;
  }
}

@keyframes fadeOutUp {
  from {
    top: 5rem
  }
  to {
    top: -5rem;
  }
}

.alert.fade-out {
  animation: fadeOutUp 0.5s ease forwards;
}

/*--------- Tableau de données ---------*/

.custom-table{
  table-layout: fixed;
  width: 100%;
  margin: auto;
  margin-top: 2px;
  border-collapse: collapse;
  box-shadow: 8px 4px 15px #000000;
}

.custom-table thead th {
  position: sticky;
  top: 0;
  background-color: var(--color-primary);
  color: white;
  z-index: 1;
}

tr:nth-child(even){
  background-color: #e7e7e7;
}

tr {
  text-align: center;
  padding: 1px;
  height: 40px;
}

.custom-table td,
.custom-table th {
  padding: 0.5rem;
  text-align: center;
}

thead {
  font-weight: bold;
  font-size: medium;
  text-align: center;
  vertical-align: center;
}

tbody tr:hover{
  background-color: #d0e0f0;
  transition: background-color 0.3s ease;
}

/*---------Tableau de données résponsive------------- */

@media (max-width: 992px) {
  .custom-table thead {
    display: none;
  }

  .custom-table, .custom-table tbody, .custom-table tr, .custom-table td {
    display: block;
    width: 100%;
    box-sizing: border-box;
    box-shadow: none;
  }

  .custom-table tr {
    margin-bottom: 1rem;
    padding: 0.5rem;
    background-color: #f9f9f9;
    border-radius: 10px;
  }

  .custom-table td {
    text-align: left;
    padding: 0.5rem 1rem;
    border: none;
    position: relative;
  }

  .custom-table td:last-child {
    border-bottom: none;
  }

  .custom-table td::before {
    content: attr(data-label);
    float: left;
    font-weight: bold;
  }

   .custom-table td::before {
    content: attr(data-label);
    display: block;
    font-weight: bold;
    margin-bottom: 0.3rem;
    margin-right: 0.3rem;
    color: var(--color-primary);
  }
  .custom-table td {
    transition: all 0.3s ease;
  }


}

/*--------- Styles globaux pour les forumlaires -------- */

.form-wrapper {
  position: absolute;
  display: none;
  top: 10%;
  left: 20%;
  width: 60%;
  height: auto;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  z-index: 100;
}

.form-header {
  color: white;
  background-color: var(--color-primary);
  display: flex;
  border-bottom: 1px solid #fff;
  border-top-right-radius: 10px;
  border-top-left-radius: 10px;
  justify-content: center;
  vertical-align: center;
  align-items: center;
}

.close-form {
  border: none;
  background-color: var(--color-primary);
  border-top-right-radius: 12px;
  font-weight: 100;
  font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
  color: #fff;
  font-size: 1.5rem;
}

.fields-required {
  font-style: italic;
}

.custom-form{
  background: #fff;
  width: 100%;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 8px 20px black;
}


.close-form:hover {
  color: rgb(224, 222, 222);
}

.custom-btn , .custom-btn-2 {
  width: 100px;
  border: none;
  background-color: var(--color-primary);
  margin-bottom: 10px;
  border-radius: 3%;
  color: #fffefe;
  box-shadow: 0 4px 10px black;
  font-size: 1.5rem;
  padding: 4px;
}


.require-fields{
  font-style: italic;
}

.custom-btn:hover, .custom-btn-2:hover{
  background-color: var(--color-secondary);

}

.form-footer{
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 2%;
}

.form-footer-2{
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 5px;
}

/*-------- Infobulles -------- */

.tooltip-wrapper{
  position: relative;
  display: inline-block;
}

.tooltip-text {
  visibility: hidden;
  font-weight: bolder;
  opacity: 0;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--color-primary);
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  z-index: 200;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.warning-text {
  visibility: hidden;
  font-weight: bolder;
  width: 150px;
  opacity: 0;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgb(255, 171, 0);
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  z-index: 200;
  transition: opacity 0.2s ease, visibility 0.2s ease;

}

.tooltip-wrapper:hover .tooltip-text {
  visibility: visible;
  opacity: 0.75;
}

td[data-value="0"] .tooltip-wrapper:hover .warning-text{
  visibility: visible;
  opacity: 0.85;
}


/********Pagination**************/

.pagination-container{
  display: none;
  justify-content: center;
  margin-top : 10px;
}

.btn-pagination {
  background-color: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 2%;
  box-shadow: 0 4px 10px black;
  margin-left: 2px;
  margin-right: 2px;
}

.btn-pagination:hover {
  background-color: var(--color-secondary);
}

.btn-pagination:disabled {
  background-color: #ccc;
  opacity: 0.7;
  cursor: not-allowed;
}


.form-header h2 {
  font-size: 1.8rem;
  margin: auto;
}


/*---------------Responsive Design-----------------------------------------------------*/

@media (width < 767px) {
  .form-wrapper {
    width: 90%;
    top: 10%;
    left: 5%;
    right: 5%;
  }
}

@media (width > 767px) and (width < 991px) {
  .form-wrapper {
    width: 80%;
    top: 10%;
    left: 10%;
    right: 10%;
  }
}


@media (width > 991px) and  (width < 1500px) {
  .custom-table thead {
    font-size: smaller;
    font-weight: normal;
  }
}
