        :root {
            --primary-color: #3498db;
            --secondary-color: #2c3e50;
            --accent-color: #e74c3c;
            --bl-color: #000000;
            --light-color: #ecf0f1;
            --dark-color: #2c3e50;
            --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            --transition: all 0.3s ease;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        body {
            background-color: #f5f7fa;
            color: var(--dark-color);
            line-height: 1.6;
            overflow-x: hidden;
        }
		
		html, body {
  touch-action: manipulation; 
}
       header {
  background-color: white;
  box-shadow: var(--shadow);
  padding: 0.5rem 2rem 0.5rem 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  /*max-width: 1200px;*/
  width:100%;
  margin: 0 0 0 1em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo span {
  font-size: 1.3rem;
  color: var(--primary-color);
  font-weight: 700;
}
.logo a {
  font-size: 1.1rem;
  color: var(--primary-color);
  font-weight: 700;
  text-decoration: none; /* pour enlever le souligné par défaut */
}

.vam{
vertical-align:middle;
}

#image-input-mobile {
  position: absolute;
  inset: 0; /* remplit le bouton */
  opacity: 0;
  cursor: pointer;
}
#loadimagemobile {
  position: relative;
  overflow: hidden;
}

.logo-icon {
  width: 30px;
  height: 30px;
  background-color: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 1.1rem;
}

.site-title {
  font-size: 0.7rem;
  color: var(--secondary-color);
  font-weight: 600;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

        nav ul {
            display: flex;
            list-style: none;
            gap: 1.5rem;
        }

        nav a {
            text-decoration: none;
            color: var(--dark-color);
            font-weight: 500;
            transition: var(--transition);
        }

        nav a:hover {
            color: var(--primary-color);
        }

       /* .main-container {
            max-width: 1200px;
            margin: 2rem auto;
            padding: 0 1rem;
            display: grid;
            grid-template-columns: 1fr 300px;
            gap: 2rem;
        }*/

        
        /*.tools-panel {
            background-color: white;
            border-radius: 8px;
            box-shadow: var(--shadow);
            padding: 1.5rem;
            display: flex;
            flex-direction: column;
           
            gap: 1rem;
           
            overflow-y: auto;
            height: 80vh;
            
        }*/

        .tool-section {
          /*  border-bottom: 1px solid #eee;
            padding-bottom: 1.5rem;*/
        }
        
       
		#layers_tool button,
		#gif_tool button,
#canvas_size_tool button,
#saved_sketches_tool button {
    flex: 0 0 48%;
    font-size: 0.8em;
    padding: 0.5em 0.2em;
}


        .tool-section:last-child {
            border-bottom: none;
        }

        .tool-section h3 {
            /*margin-bottom: 1rem;*/
             margin-bottom: 0.5rem;
            color: var(--secondary-color);
            font-size: 1rem;
        }

        .tool-options {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 0.5rem;
        }

        .tool-btn {
            background-color: var(--light-color);
            border: none;
            border-radius: 4px;
            padding: 0.5rem;
            cursor: pointer;
            transition: var(--transition);
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 5px;
            font-size: 0.8rem;
        }

        .tool-btn:hover {
            background-color: #e0e0e0;
        }

        .tool-btn.active {
            background-color: var(--primary-color);
            color: white;
            
            
        }
        
        
        
        
        .tool-btn.active img {
           
            filter: invert(1);
        }
         .zoom-btn.active {
            background-color: var(--light-color);
            color: white;
        }
        
        
       
		.s_bt{
		 font-size: 0.8rem;
		}
        
        .color-picker-container {
    display: flex;
    justify-content: center; /* centre horizontalement */
    align-items: center;     /* centre verticalement */
    gap: 10px;
    width: 100%;             /* si tu veux que le conteneur prenne toute la largeur */
}

        .color-preview {
            width: 30px;
            height: 30px;
            border-radius: 4px;
            border: 1px solid #ddd;
        }

        input[type="color"] {
            width: 100%;
            height: 40px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }

        .slider-container {
            display: flex;
            flex-direction: column;
            gap: 5px;
        }

        .slider-container label {
            font-size: 0.9rem;
            color: #666;
        }

        input[type="range"] {
            width: 80%;
        }

        .action-buttons {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }
        
         .action-buttonslayers {
            display: flex;
          
            gap: 0.5rem;
        }


        .btn {
            padding: 0.8rem 1rem;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-weight: 500;
            transition: var(--transition);
            text-align: center;
        }

        .btn-primary {
            background-color: var(--primary-color);
            color: white;
        }

        .btn-primary:hover {
            background-color: #2980b9;
        }

        .btn-secondary {
            background-color: var(--light-color);
            color: var(--dark-color);
        }

        .btn-secondary:hover {
            background-color: #dfe6e9;
        }

        .btn-danger {
            background-color: var(--accent-color);
            color: white;
        }

        .btn-danger:hover {
            background-color: #c0392b;
        }

        .mobile-menu-toggle {
            display: none;
            background: none;
            border: none;
            font-size: 2rem;
            cursor: pointer;
            color: var(--dark-color);
        }

     
        
        
        
        .canvas-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column; /* vertical */
    gap: 5px;
    z-index: 10;
}

#custom-alert {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none; /* désactivé par défaut */
}

.custom-alert-overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
}

.custom-alert-box {
  position: relative;
  background: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  z-index: 1;
  min-width: 200px;
  max-width: 300px;
  text-align: center;
}

.custom-alert-box button {
  margin-top: 1rem;
  padding: 0.4rem 1rem;
  border: none;
  background: #3498db;
  color: white;
  border-radius: 4px;
  cursor: pointer;
}
.zoom-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: white;
    box-shadow: var(--shadow);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
}

.zoom-btn:hover {
    background-color: var(--light-color);
}
.canvas-controls .zoom-btn.active{

/**/
 background-color: var(--primary-color);
            color: white;
}

  .zoom-btn.active img {
           
            filter: invert(1);
        }

        .saved-sketches {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 10px;
            margin-top: 1rem;
        }

        .sketch-thumb {
            width: 100%;
            aspect-ratio: 1;
            border-radius: 4px;
            border: 1px solid #ddd;
            cursor: pointer;
            background-size: cover;
            background-position: center;
            transition: var(--transition);
        }

        .sketch-thumb:hover {
            transform: scale(1.05);
        }

        .layers-panel {
            margin-top: 0rem;
            max-height: 200px;
            overflow-y: auto;
            border: 1px solid #eee;
            border-radius: 4px;
            padding: 0rem;
        }

        .layer-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.5rem;
            border-bottom: 1px solid #eee;
            cursor: pointer;
        }

        .layer-item:last-child {
            border-bottom: none;
        }

        .layer-item.active {
            background-color: #e3f2fd;
        }

        .layer-visibility {
            cursor: pointer;
            width:20px;
            height:20px;
        }

        .layer-name {
            flex: 1;
            font-size: 0.8rem;
        }

        .layer-actions {
            display: flex;
            gap: 5px;
        }

        .layer-action-btn {
            background: none;
            border: none;
            cursor: pointer;
            font-size: 0.8rem;
            color: #666;
        }

        .layer-action-btn:hover {
            color: var(--primary-color);
        }

        .text-tooltip {
            position: absolute;
            background: rgba(0, 0, 0, 0.8);
            color: white;
            padding: 5px 10px;
            border-radius: 4px;
            font-size: 0.8rem;
            pointer-events: none;
            z-index: 1000;
            display: none;
        }

        .tool-indicator {
            position: absolute;
            top: 10px;
            left: 10px;
            background: rgba(0, 0, 0, 0.7);
            color: white;
            padding: 5px 10px;
            border-radius: 4px;
            font-size: 0.8rem;
            z-index: 1000;
        }

        .how-to-section {
            margin-top: 3rem;
            padding: 2rem;
            background-color: white;
            border-radius: 8px;
            box-shadow: var(--shadow);
        }

        .how-to-section h2 {
            margin-bottom: 1.5rem;
            color: var(--secondary-color);
            text-align: center;
            font-size:1.3em;
        }

        .how-to-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 2rem;
        }

        .how-to-card {
            padding: 1.5rem;
            background-color: var(--light-color);
            border-radius: 8px;
        }

        .how-to-card h3 {
        	font-size:1.1em;
            margin-bottom: 1rem;
            color: var(--primary-color);
        }
		.how-to-card p {
        	font-size:0.9em;
        	color:#000000;
        }
        footer {
            background-color: var(--secondary-color);
            color: white;
            padding: 2rem 1rem;
            margin-top: 3rem;
        }

        .footer-content {
            max-width: 1200px;
            margin: 0 auto;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 1.5rem;
        }

        .footer-links {
            display: flex;
            gap: 2rem;
            flex-wrap: wrap;
            justify-content: center;
        }

        .footer-links a {
            color: white;
            text-decoration: none;
            transition: var(--transition);
        }

        .footer-links a:hover {
            color: var(--primary-color);
        }

        .copyright {
            text-align: center;
            font-size: 0.9rem;
            opacity: 0.8;
        }

.slider-container p {
  display: flex;
  align-items: center;
  gap: 8px;
}

#brush-size {
  flex: 1;
}

#brush-size-value {
  display: inline-block;
  min-width: 24px;
  text-align: center;
  position: relative;
  top: 2px; /* ajuste finement le centrage vertical */
  font-size:0.8em;
}


.ads_responsive{width:100%;height:150px;margin:0 auto;display:block}
  
  .tool-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  background: #f8f9fa;
  padding: 4px;
  border-radius: 8px;
}

/* Boutons outils */
.tool-options .tool-btn,
.tool-options .btn.btn-secondary {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  width: 32px;
  height: 32px;

  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.tool-options .tool-btn:hover,
.tool-options .btn.btn-secondary:hover {
  background: #e9ecef;
}

.tool-options .tool-btn.active {
  background: #007bff;
  color: white;
  border-color: #007bff;
}

/* === COLOR PICKER === */
.color-picker-container {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  width: 32px;
  height: 32px;
  padding: 0;
}

.color-picker-container input[type="color"] {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  width: 100%;
  height: 100%;
  padding: 0;
  background: none;
  cursor: pointer;
  border-radius: 4px;
}

/* Supprime la bordure par défaut du picker sur Chrome */
.color-picker-container input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 4px;
}
.color-picker-container input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

/* === BRUSH SIZE (inline à droite) === */

.brush-size-wrapper {
  display: flex;
  align-items: center;
  justify-content: flex-start; /* alignement à gauche */
  gap: 6px;
  background: #fff;
 /* border: 1px solid #ccc;
  border-radius: 6px;*/
  padding: 3px 6px;
  height: 32px;
  width: 100%; /* optionnel pour que ça prenne toute la largeur disponible */
}

.brush-slider {
  display: flex;
  align-items: center;
  gap: 4px;
  width:120px;
}

#brush-size {
  width: 100%; /* le slider prend tout l'espace restant */
}

#brush-size-value {
  font-size: 12px;
  color: #555;
  min-width: 28px;
  text-align: right;
}








/* === BARRE OUTILS MOBILE SIMPLIFIEE === */
.mobile-tools {
margin-top:0.2em;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    align-items: center;
    gap: 5px;
    padding: 0px;
    width: 100%;
    box-sizing: border-box;
    background-color: white;
    position: relative;
    justify-content: flex-start;
}

/* Assure que tous les éléments soient alignés au début */
.mobile-tools > * {
    flex-shrink: 0;
}


.mobile-tools .tool-btn {
    width: 24px; /* ← Taille originale */
    height: 24px; /* ← Taille originale */
    background: #f8f9fa;
    border: 1px solid #ccc;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

/* Container couleur - taille réduite */
#mobile-color {
    padding: 0;
    overflow: hidden;
    flex-shrink: 0;

}

#mobile-color input[type="color"] {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}




/* Scrollbar */
.mobile-tools::-webkit-scrollbar {
    height: 4px;
}

.mobile-tools::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.2);
    border-radius: 2px;
}

/* État actif */
.mobile-tools .tool-btn.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.mobile-tools .tool-btn.active img {
    filter: invert(1);
}

/* === COLOR PICKER & SLIDER === */
#mobile-color input[type="color"]{
  width: 24px;
  height: 24px;
  border: none;
  cursor: pointer;
  border-radius: 4px;
  padding: 0;
  background: none;
}







/* === BOUTONS SPECIAUX === */
#mobile-save,
#delete-selected-mobile {
  background: #fff;
  border: 1px solid #ccc;
}

#mobile-save:hover,
#delete-selected-mobile:hover {
  background: #e9ecef;
}

   .mobile-tools {
        display: none; /* caché par défaut */

    }

.brush-style-menu button {
  all: unset;
  padding: 2px 4px;
  margin-right: 4px;
  cursor: pointer;
  font-size: 12px;
  border-radius: 4px;
  background: none;
  color: inherit;
}

.brush-style-menu button.active {
 border: 1px solid #cccccc;
}


.tool-btn, .btn-secondary {
    display: flex;
    align-items: center;   /* centre verticalement */
    justify-content: center; /* centre horizontalement */
}

.btn-img-center {
    display: block;
    max-width: 100%;
    max-height: 100%;
}


/*MODAL*/
.custom-modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.custom-modal-content {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.custom-modal-content p{
  font-size:1em;
  font-weight:bold;
}

.format-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 15px 0;
}
.format-buttons button {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  background: #ecf0f1;
  color: #000000;
  cursor: pointer;
  font-weight: 600;
}
.format-buttons button:hover {
  background: #bcc0c0;
}

#close-save-modal {

   padding: 8px 16px;
  border: none;
  border-radius: 6px;
  background: #3498db;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}

/*END MODAL*/

 .tools-panel {
            background-color: white;
            border-radius: 8px;
            box-shadow: var(--shadow);
            padding: 0.5rem 1rem 1.5rem 1rem;
            display: flex;
            flex-direction: column;
           /* gap: 1.5rem;*/
            gap: 1rem;
           /* max-height: 70vh;*/
            overflow-y: auto;
            height: 78vh;
           /* min-height:600px;*/
        }
        

.tool-section {
   /* width: 200px;
    max-width: 200px;*/
    width: 95%;
    max-width:95%;
}

.tool-section h3 {
    font-size: 1rem;
    color: var(--primary-color);
    margin-bottom: 6px;
}

/* Inputs style */
.tool-section input[type="range"] {
    width: 100%;
    margin-top: 2px;
}



.tool-section input[type="color"] {
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Group inline controls */
.inline-group {
    display: flex;
    align-items: center;
  /*  gap: 6px;*/
    flex-wrap: wrap;
}

.inline-group label {
    font-size: 0.85rem;
    color: var(--dark-color);
    min-width: 60px;
}

        
     
      
      
      
      
.tools-tabs {
    display: flex;
    gap: 0rem;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 0.5rem;
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    color: var(--dark-color);
    flex: 1;
    display: flex;         
    justify-content: center; 
    align-items: center;     
    text-align: center;
}

.tab-btn img {
    display: block; 
    margin: 0 auto;
}

.tab-btn:hover {
    background-color: #f5f5f5;
}

.tab-btn.active {
    background-color: var(--primary-color);
    color: white;
    
}
.tab-btn.active img {
    filter: invert(1);
}
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}



  .tool-section.info-message {
    background-color: #fff3cd; 
    padding: 0.5rem 0.5rem;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #856404; 
    display: flex;
    align-items: center;
    font-size:0.7em;
    
}

.tool-section.info-message img.vam {
    flex-shrink: 0;
}    

    select#library-category {
    padding: 3px 6px;
    font-size: 0.9rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: #fff;
    color: #333;
    transition: all 0.2s ease;
    min-width: 140px;
    width:100%;
    cursor: pointer;
}

.inline-group label {
    font-size: 0.85rem;
    color: #333;
    margin-right: 0.5rem;
    min-width: 50px;
    display: inline-block;
}

.inline-group select#textFontFamily {
    padding: 3px 6px;
    font-size: 0.9rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: #fff;
    color: #333;
    transition: all 0.2s ease;
    min-width: 140px;
    width:100%;
    cursor: pointer;
}

.inline-group select#textFontFamily:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 3px rgba(0, 123, 255, 0.5);
    outline: none;
}

.color-row {
    display: flex;
    justify-content: flex-start; 
    align-items: flex-start;      
    gap: 6px;                     
    max-width: 200px;
    width: 100%;
    margin-bottom:0.5em;
}

.color-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;     
    flex: 1;
}

.color-item label {
    margin-bottom: 3px;
    opacity: 0.7;
    white-space: nowrap;
    font-size: 0.7em;
}

.color-item input[type="color"] {
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: none;
}




#text_filter_tool button,
		#image_filter_tool button,
#global_tool button{
    flex: 0 0 48%;
    font-size: 0.8em;
    padding: 0.5em 0.2em;
}



.tools-panel, 
.tool-section, 
.tool-section * {
  box-sizing: border-box;
  max-width: 100%;
}

 
 
 
 
 
 
     /*NEW*/    
      .new_page {
           background-color: var(--primary-color);
            color: white;
        }
/*.canvas-container {
            background-color: white;
            border-radius: 8px;
           
            overflow: hidden;
            position: relative;
            height: 70vh;
            
       
          
        }*/
        
.canvas-container {
    background-color: white;
    border-radius: 8px;
    overflow: auto; /* scroll si canvas dépasse */
    position: relative;
    height: 80vh; /* ou height: 80vh si tu veux plus */
      /* border: 2px solid #ccc;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);*/
     background-image:
        linear-gradient(to right, rgba(0,0,0,0.1) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0,0,0,0.1) 1px, transparent 1px);
    background-size: 10px 10px; /* carrés plus petits */
}        
        

        #drawing-canvas {
            width: 100%;
            height: 100%;
            cursor: crosshair;
            
        }




.recent-colors-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
    margin-top: 10px;
}

.recent-color {
    width: 25px;
    height: 25px;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    transition: transform 0.2s;
}

.recent-color:hover {
    transform: scale(1.1);
    border-color: #999;
}
.rename-layer-btn{
border:none;
background:none;
}

.page-item {
    padding: 8px;
    margin-bottom: 6px;
    background: #f2f2f2;
    border-radius: 5px;
    cursor: pointer;
    user-select: none;
    border: 2px solid transparent;
}

.page-item.active {
    border-color: #007bff;
    background: #e8f1ff;
}

  .main-container 
  {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 1rem;
    margin:1em 0 3em 0;
    border:0px solid #000000;
  }

/*
.main-tools {
    overflow-x: hidden;
}
*/
  .main-tools {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: #fff;
    padding: 8px;
    border-radius: 10px;
    box-shadow: var(--shadow);
   
    /* height: fit-content;max-height: 90vh;*/
    /*overflow-y: auto;*/
    
     overflow-y: visible;
    position: sticky;
    top: 63px;
  }

  .main-tools .tool-btn,
  .main-tools .btn.btn-secondary,
  .main-tools .color-picker-container {
    width: 40px;
    height: 40px;
    padding: 4px;
    border-radius: 8px;
  }

  .main-tools .brush-size-wrapper {
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
    background: transparent;
  }



  .main-tools .brush-style-menu {
    display: flex;
    gap: 4px;
    justify-content: center;
  }
/*END NEW*/



/*28-11-25*/


/* === MENU DES FORMES EN VERTICAL === */

/* Menu des formes caché par défaut */
#shapes_details {
    display: none;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

/* Quand le menu est ouvert */
#shapes_details.show {
    display: flex !important;
    animation: appear 0.2s ease;
}

/* Les boutons de forme */
#shapes_details .tool-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

/* Bouton principal actif */
#shape_ic.active {
    background-color: var(--primary-color);
}

#shape_ic.active img {
    filter: invert(1);
}

/* Animation */
@keyframes appear {
    from { 
        opacity: 0;
        transform: translateY(-5px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.tools-panel {
    /* ... autres styles ... */
    /* REMPLACER */
    /* height: 78vh; */
    /* PAR */
    max-height:520px;
    height: auto;
}


/*.main-container {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin: 1em 2em 3em 2em;
    max-height: 630px;
}*/

.tools-panel {
    background-color: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 0.5rem 1rem 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    max-height: 550px;
    height: 550px; /* Hauteur fixe */
    width: 270px; /* Largeur fixe */
}

.canvas-container {
    background-color: white;
    border-radius: 8px;
    overflow: auto;
    position: relative;
    max-height: 550px;
    height: 550px; /* Même hauteur que tools-panel */
    flex: 1; /* Prend tout l'espace restant en largeur */
}

.canvas-wrapper {
    height: 100%;
    overflow: auto;
}

#drawing-canvas {
    max-width: 100%;
    max-height: 100%;
    cursor: crosshair;
}

.main-container {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin: 1em 2em 3em 2em;
    /* Pas de max-height pour plus de flexibilité */
}

.tools-panel {
    background-color: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 0.5rem 1rem 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    max-height: 550px;
    height: 550px;
    width: 270px;
    flex-shrink: 0; /* Empêche de rétrécir */
}

.canvas-container {
    background-color: white;
    border-radius: 8px;
    overflow: hidden; /* Changé de auto à hidden */
    position: relative;
    max-height: 550px;
    height: 550px;
    flex: 1;
}

.canvas-wrapper {
    height: 100%;
    width: 100%;
    overflow: auto; /* Scroll ici si nécessaire */
}

#drawing-canvas {
    width: 100%;
    height: 100%;
    cursor: crosshair;
}


/*MODAL DEMO*/

.custom-modal-video {
    position: fixed;
    top: 0; 
    left: 0;
    width: 100%; 
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-modal-video.active {
    opacity: 1;
}

.custom-modal-content-video {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    
    /* 🔥 MODAL À 80% DE L'ÉCRAN */
    width: 80vw;
    height: 80vh;
    max-width: 1200px;
    max-height: 800px;
    
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.custom-modal-video.active .custom-modal-content-video {
    transform: scale(1);
}

.custom-modal-content-video p {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 20px;
    color: #333;
}

.close-modal-video {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    z-index: 10000;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal-video:hover {
    background: #f0f0f0;
    color: #000;
}

.video-container-video {
    position: relative;
    width: 100%;
    height: 100%;
    flex: 1;
    border-radius: 8px;
    overflow: hidden;
}

.video-container-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.trigger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: bold;
    transition: all 0.2s;
    margin: 0 5px;
    background-color: #ecf0f1;
    color: #2c3e50;
    height: 36px;
    min-width: 80px;
    line-height: 1;
    text-decoration: none;
    font-family: inherit;
}

.trigger-btn:hover {
    background-color: #dfe6e9;
    transform: translateY(-1px);
}
/*END MODAL DEMO*/


/* Adaptation écrans moyens */
@media (max-width: 1200px) and (min-width: 993px) {
    .main-container {
        margin: 1em 1em 3em 1em;
    }
    .tools-panel {
        width: 250px;
    }
}

/* Grands écrans */
@media (min-width: 1400px) {
    .tools-panel,
    .canvas-container {
        height: 600px;
        max-height: 600px;
    }
}


/*28-11-25*/ 
 
 
 
 
 
 
 


 @media (max-width: 1100px) {
.brush-slider {
  width:110px;
}
}
 @media (max-width: 992px) 
       {
       #mobile_ads{
       margin:1em 0 0 0;
       
       }
       .ads_responsive{width:100%;margin:0 auto;display:block;
       
       width: 100%;
    height: 50px; 
    max-height: 50px;
       }
       
        #canvas_control_desktop{
display:none;
}
          header {

  padding: 0.3rem 2rem 0.3rem 1rem;

}
       .logo-icon {
  width: 25px;
  height: 25px;

}
    /* Main container passe en une seule colonne */
    .main-container {
        grid-template-columns: 1fr;
        
          margin: 1rem auto 0 auto;
         
    }
  

   
    .tools-panel {
        display: none;
    }

  
 
 
 .custom-modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.custom-modal-content {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.format-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 15px 0;
}
.format-buttons button {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  background: #0078ff;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}
.format-buttons button:hover {
  background: #005fd1;
}

 
 
 
  /*MOBILE MENU*/  
    
    
    .mobile-tools {
    display: flex;
    flex-wrap: nowrap; 
    overflow-x: auto;
    overflow-y: hidden;
    align-items: center;
    gap: 5px;
    padding: 5px 0; 
    width: 100%;
    box-sizing: border-box;
    background-color: white;
    position: relative; 
    top: auto;
    left: auto;
    right: auto;
    z-index: 1000;
   
}



/* Styles pour les boutons dans la barre mobile */
.mobile-tools .tool-btn {
    flex: 0 0 auto; /* Empêche les boutons de rétrécir */
    width: 30px; /* Taille fixe pour tous les boutons */
    height: 30px;
    background: #f8f9fa;
    border: 1px solid #ccc;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

/*.mobile-tools::before {
    content: '';
    flex-shrink: 0;
    width: 0;
}
 .mobile-tools > *:first-child {
        margin-left: 0.3em;
    }

  
  
    .mobile-tools > *:last-child {
        margin-right: 1em;
    }
*/    
    
    .mobile-tools {
    	 padding-top: 5px !important;
        padding-bottom: 10px !important; 
    }

/* Container couleur mobile */
#mobile-color {
    padding: 0;
    overflow: hidden;
}

#mobile-color input[type="color"] {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
}

/* Select de taille de brosse */
#mobile-brush-size {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 0 8px;
    height: 30px;
}



/* Scrollbar stylisée */
.mobile-tools::-webkit-scrollbar {
    height: 4px;
}

.mobile-tools::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.2);
    border-radius: 2px;
}

.mobile-tools::-webkit-scrollbar-track {
    background: transparent;
}

/* États actifs */
.mobile-tools .tool-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.mobile-tools .tool-btn.active img {
    filter: invert(1);
}

/* Hover states */
.mobile-tools .tool-btn:hover {
    background: #e9ecef;
}

.mobile-tools .tool-btn.active {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
}
.mobile-tools .tool-btn.active:hover {
    background-color: var(--primary-color);
}
.mobile-tools .tool-btn:focus {
    outline: none;
  /*  background-color: var(--primary-color);*/
}

   /*END MOBILE MENU*/ 
    
    
    

    /* Masquer les tool-options spécifiques si besoin */
    .tool-options {
        display: none !important;
    }

    /* Ajustements logo et titre */
    .logo span {
        font-size: 1rem;
    }
    .logo a {
  font-size: 1rem;
}

    .site-title {
        font-size: 0.6rem;
        margin: 0.3em 0 0 0;
    }

    /* Ajustement titres section "How-to" */
    .how-to-section h2 {
        font-size: 1em;
    }
    
    
    
    
     /*  .main-tools {
       padding-left:40px;
       padding-right:40px;
    }*/
}

@media (max-width:650px){
/*
.ads_responsive{width:300px;height:250px;margin:0 auto}
*/

}
        @media (max-width: 576px) {



.logo span{font-size:0.8em}
.logo a {
  font-size: 0.8rem;
}

            nav ul {
                gap: 1rem;
            }

            .canvas-container {
                height: 60vh;
            }

            .mobile-tools .tool-options {
                grid-template-columns: repeat(4, 1fr);
            }

            .how-to-grid {
                grid-template-columns: 1fr;
            }
        }
        
  
@media (max-width:360px){.ads_responsive{width:250px;height:250px;margin:0 auto}}
@media (max-width:300px){.ads_responsive{width:90%;height:250px;margin:0 auto}}  
      


@media (max-width: 992px) {
#title_i{display:none;}
 @supports (-webkit-touch-callout: none) {
        .how-to-card.less-important {
            display: none !important;
        }
        
        .how-to-grid {
            grid-template-columns: 1fr !important;
            gap: 1rem !important;
        }
    }
       footer {
            
            margin-top: 10rem !important;
        }
    .main-tools, #zoom-in, #zoom-out, .tools-panel {
        display: none !important;
    }

    .canvas-container {
        margin: 0 auto 10px auto !important;
        padding: 0 15px; 
        background: white;
        border-radius: 8px;
        overflow: hidden;
        box-sizing: border-box; 
        
        
          background-image:
        linear-gradient(to right, rgba(0,0,0,0.1) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0,0,0,0.1) 1px, transparent 1px);
    background-size: 10px 10px;
    }

/*    .mobile-tools {
        display: flex !important;
        position: relative !important;
        margin: 0 auto 20px auto !important;
        background: white;
        border-radius: 8px;
        padding: 8px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        width: auto !important;
        max-width: 95vw;
    }
    */
    
    
    
.mobile-tools {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
    grid-auto-rows: 34px;
    gap: 6px;
    padding: 8px 10px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    width: 95vw;
    margin: 10px auto 20px auto !important;
    box-sizing: border-box;
}



.mobile-tools .tool-btn {
    width: 100%;
    height: 100%;
    background: #f1f3f5;
    border: 1px solid #d0d5d8;
    border-radius: 6px;  /* un peu plus compact */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.mobile-tools .tool-btn img {
    width: 18px;   /* réduit pour que l’icône respire mieux */
    height: 18px;
}

.mobile-tools .tool-btn:hover {
    background: #e5e8eb;
}

.mobile-tools .tool-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.mobile-tools .tool-btn.active img {
    filter: invert(1);
}

/* Color picker */
#mobile-color {
    padding: 0;
}
#mobile-color input[type="color"] {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 6px;
}



    
#mobile-brush-size {
    flex: 0 0 auto;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    height: auto !important;
}



#mobile-brush-select {
    font-size: 0.7em;
    padding: 4px 4px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    height: 32px;           /* aligne parfaitement avec les boutons */
    box-sizing: border-box;
}

}

