:root {
  --header-outline: 3px;
  --background-colour: white;
  --accent-colour: #36cbdb;
}

* {
  margin: 0;
  padding: 0;
}

body {
  height: 100vh;
  width: 100vw;
  background-image: radial-gradient(#FFFFFF,#A9C810,#5EB030);
  background-repeat: no-repeat;
}

/* HEADER */

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 90%;
  /*background-color: white;*/
  z-index: 1000; /* Valeur élevée pour être au-dessus de tout */
  /*box-shadow: 0 2px 4px rgba(0,0,0,0.1); Optionnel: ajoute une ombre légère */
}

.logo-row {
  position: relative;
  z-index: 1001; /* Encore plus élevé que le header */
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#clear-btn,
#download-btn {
  /*background-color: var(--background-colour);*/
  display: grid;
  place-items: center;
  cursor: pointer;
  
}

#clear-btn {
  /*margin: var(--header-outline);*/
  text-align-last: right;
  padding-inline: 5px;
}

#download-btn {
  padding-inline: 5px;
  /*margin: var(--header-outline) var(--header-outline) var(--header-outline) 0;*/
}

#clear-btn:active,
#download-btn:active {
  background-color: var(--accent-colour);
}

#clear-btn i,
#download-btn i{
  color: white;
}

i {
  color: #535353;
  pointer-events: none
}

#title {
  display: grid;
  place-items: center;
  background-color: var(--background-colour);
  margin: var(--header-outline) 0;
}

h1 {
  text-align: center;
  color: var(--accent-colour);
  font-size: calc(1rem + 1vw);
  font-family: monospace;
}

#draw-style-choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
}

.draw-style-btn {
  background-color: var(--background-colour);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.draw-style-btn:nth-child(1),
.draw-style-btn:nth-child(2) {
  margin: var(--header-outline) 0 0 var(--header-outline);
}

.draw-style-btn:nth-child(3) {
  margin: var(--header-outline) var(--header-outline) 0 var(--header-outline);
}

.draw-style-btn:nth-child(4),
.draw-style-btn:nth-child(5) {
  margin: var(--header-outline) 0 var(--header-outline) var(--header-outline);
}

.draw-style-btn:nth-child(6) {
  margin: var(--header-outline);
}

/* CANVAS */

#container {
  display: flex;
  justify-content: center;
  align-items: center;
  /*margin-top: 20vh;   Ajustez cette valeur selon votre header */
  width: 95vw;
  position: relative;
  z-index: 1;
  /*margin-top: 100px;  Ajustez cette valeur selon la hauteur de votre header */
}

#canvas {
  position: relative;
  height: 75vh;
  width: 85vw;
  touch-action: none; /* Empêche le scroll sur mobile lors du dessin */
}

/* MODAL */

#modal {
  display: none;
  place-items: center;
  position: fixed;
  top: 0;
  left: 0%;
  width: 100%;
  z-index: 998;
  background-color: white;
}

#modal-content {
  padding: 5%;
}

#canvas-image {
  width: 100%;
}

#modal-close-btn {
  display: none;
  position: fixed;
  font-size: calc(2rem + 1vw);
  cursor: pointer;
  top: 0%;
  left: 4%;
  z-index: 999;
}

#download-link {
  display: none;
}

/* FOOTER */

  /*footer {
    position: fixed;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    width: 100%;
    height: 10vh;
    bottom: 0;
    cursor: pointer;
  }*/
  .colour-box {
    width: 45px;
    height: 45px;
  }
  .colour-box:nth-child(1) {
    background-color: #094074;
  }

  .colour-box:nth-child(2) {
    background-color: #12664F;
  }

  .colour-box:nth-child(3) {
    background-color: #F3B700;
  }

  .colour-box:nth-child(4) {
    background-color: #C81D25;
  }

  .colour-box:nth-child(5) {
    background-color: #F1A9A7;
  }

  .default-selection,
  .user-selection-btn-clicked {
    border: 3px solid var(--accent-colour);
  }

  .rcorners {
    border-radius: 60px 60px;
    background: white;
    padding: 19px;
    margin: 2vw;
  }
/* Styles de base pour le footer */
footer {
  position: fixed;
  bottom: 0px;
  width: 95%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  /*background: rgba(255, 255, 255, 0.5);*/
  padding: 2px;
  border-radius: 20px;
  /*gap: 10px;*/
  z-index: 1000;
  max-width: 95%;
  backdrop-filter: blur(3px);
}

/* Par défaut, cacher les couleurs supplémentaires */
.tablet-colors,
.desktop-colors {
  display: none;
}

/* Media query pour tablettes */
@media screen and (min-width: 768px) {
  .tablet-colors {
    display: block;
  }

  .colour-box {
    width: 40px;
    height: 40px;
  }

  footer {
    padding: 5px;
    bottom: 0px;
  }
}

/* Media query pour desktop */
@media screen and (min-width: 1024px) {
  .desktop-colors {
    display: block;
  }

  .colour-box {
    width: 45px;
    height: 45px;
  }

  footer {
    /*max-width: %;*/
    padding: 5px;
  }
}
    /* Responsive Design */
  @media (max-width: 768px) {
    body {
      background-image: radial-gradient(#FFFFFF, #A9C810, #5EB030);
      background-size: cover;
    }
  
    header {
      grid-template-columns: 20% 20% 30% 30%;
      height: 12vh;
    }
  
    h1 {
      font-size: calc(1rem + 2vw);
    }
  
    #draw-style-choices {
      grid-template-columns: repeat(3, 1fr);
      grid-template-rows: repeat(2, 1fr);
    }
  
    #canvas {
      height: 75vh;
      width: 85vw;
    }
  
    
  
    
  }
  
  @media (max-width: 480px) {
    footer {
      position: fixed;
      display: grid;
      grid-template-columns: repeat(6, 1fr);
      width: 100%;
      height: 10vh;
      bottom: 0;
      cursor: pointer;
    }
    header {
      grid-template-columns: 1fr;
      height: 15vh;
    }
  
    h1 {
      font-size: calc(1rem + 3vw);
    }
  
    #draw-style-choices {
      grid-template-columns: repeat(6, 1fr);
      grid-template-rows: repeat(1, 1fr);
    }
  
    #canvas {
      height: 75vh;
      width: 85vw;
    }
  
    
  }
    /* Responsive Design for very small screens */
  @media (max-width: 360px) {
    footer {
      position: fixed;
      display: grid;
      grid-template-columns: repeat(6, 1fr);
      width: 95%;
      height: 10vh;
      bottom: 0;
      cursor: pointer;
    }
    body {
      background-image: radial-gradient(#FFFFFF, #A9C810, #5EB030);
      background-size: cover;
    }
  
    header {
      grid-template-columns: 1fr;
      height: 18vh;
    }
  
    h1 {
      font-size: calc(1rem + 4vw);
    }
  
    #draw-style-choices {
     
        grid-template-columns: repeat(6, 1fr);
        grid-template-rows: repeat(1, 1fr);
      
    }
  
    #canvas {
      height: 75vh;
      width: 85vw;
    }
  
    
  
    
  
    .rcorners {
      padding: 10px;
      margin: 5px;
      border-radius: 30px;
    }
  }

  .color {
	  width: 80%;
	  height: 80%;
    }
	
	.container {
	  justify-content: center;
	  align-items: center;
	  text-align: center;
    }
	
	.color-button {
      display: inline-block;
      width: 30px;
      height: 30px;
      margin: 2px;
      cursor: pointer;
	  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }
	
	.button {
      display: inline-block;
      width: 20px;
      height: 20px;
	  padding-inline: 1px;
      margin-right: 10px;
      cursor: pointer;
	  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }

    /* Style pour les boutons de couleur par défaut */
    .color-button {
        display: inline-block;
        width: 30px;
        height: 30px;
        margin: 2px;
        cursor: pointer;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        border: 2px solid transparent; /* Bordure transparente par défaut */
        border-radius: 50%;
        transition: all 0.3s ease; /* Animation fluide */
    }

    /* Style pour le bouton de couleur sélectionné */
    .color-button.selected-color {
        border: 5px solid #333; /* Bordure grise foncée */
        transform: scale(2); /* Légère augmentation de taille */
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.3); /* Ombre plus prononcée */
    }

    /* Effet hover sur les boutons de couleur */
    .color-button:hover {
        transform: scale(1.4);
        box-shadow: 0 0 6px rgba(0, 0, 0, 0.25);
    }

    /* Style pour le conteneur des crayons */
    .pencils-container {
        position: fixed;
        bottom: 0px;
        left: 50%;
        transform: translateX(-50%);
        width: 95%;
        max-width: 1200px;
        background: rgba(255, 255, 255, 0.8);
        padding: 15px;
        z-index: 1000;
        border-radius: 20px;
    }

    .pencils-wrapper {
        display: flex;
        overflow-x: auto;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        padding: 10px;
        gap: 8px;
        justify-content: center;
    }

    /* Masquer la barre de défilement tout en gardant la fonctionnalité */
    .pencils-wrapper::-webkit-scrollbar {
        height: 6px;
    }

    .pencils-wrapper::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.1);
        border-radius: 3px;
    }

    .pencils-wrapper::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.2);
        border-radius: 3px;
    }

    /* Responsive design */
    @media screen and (max-width: 768px) {
        .color-button {
            min-width: 30px;
            height: 30px;
        }
        
        .pencils-container {
            width: 95%;
            padding: 10px;
        }
    }

    @media screen and (min-width: 769px) and (max-width: 1024px) {
        .color-button {
            min-width: 35px;
            height: 35px;
        }
        
        .pencils-container {
            width: 95%;
            padding: 12px;
        }
    }

    @media screen and (min-width: 1025px) {
        .color-button {
            min-width: 40px;
            height: 40px;
        }
        
        .pencils-container {
            width: 90%;
            padding: 15px;
            max-width: 95%;
            margin: 0 auto;
            border-radius: 20px;
        }
    }