@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@600&family=Lato&display=swap');

body {
	margin: 0;
	font-family: 'Lato', sans-serif;
	display: flex;
	flex-direction: column;
	height: 100vh;
	background-color: #f5f7fa;
	color: #3D3D3D;
}

h1, h2, h3, h4, h5, h6 {
	font-family: 'Montserrat', sans-serif;
	color: #60B339 !important;
}

.progress-bar {
	width: 100%;
	background: #dee2e6;
	height: 8px;
	margin-bottom: 10px;
}

.progress {
	height: 9px;
	background: #60B339;
	width: 0%;
	transition: width 0.3s ease;
}

.main-container {
	display: flex;
	flex: 1;
	overflow: hidden;
	width: 100%;
	margin: auto;
}

.left-panel {
	width: 22%;
	min-width: 280px;
	background: #ffffff;
	display: flex;
	flex-direction: column;
	border-right: 1px solid #dee2e6;
}

.file-list {
	min-height: 200px;
	max-height: 300px;
	overflow-y: auto;
	border-bottom: 1px solid #dee2e6;
	background: #f8f9fa;
}

.file-list ul {
	list-style: none;
	margin: 0;
	padding: 10px;
}

.file-list li {
	padding: 4px;
	border-bottom: 1px solid #dee2e6;
	cursor: pointer;
}

.file-list li:hover {
	background: #e2e6ea;
}

/* Viewer STL principal */
.viewer {
  flex: 1;
  border: 1px solid #ced4da;
  border-radius: 8px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  font-weight: bold;
  font-size: 1.2em;
  color: #495057;
  position: relative;
  transition: height 0.3s ease;
  height: auto;          /* ✅ plus de hauteur fixe */
  min-height: 420px;     /* ✅ garde une bonne taille mini */
  overflow: hidden;
}

/* Barre d’en-tête du viewer */
.viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: #E5E5E5;
  border-bottom: 1px solid #adb5bd;
}


.viewer-header h3{
  margin: 0;
  font-size: 1.2em;
  font-family: 'Montserrat', sans-serif;
  color: #2C2C2C !important;
}


/* le style de la dropzone */
#dropzone-overlay {
    display: none;
    position: fixed;
    top: 100px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85); /* fond gris foncé semi-opaque */
    color: white;
    z-index: 9999;
    pointer-events: auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

#globalDropzone.custom-dropzone {
    display: flex;
    width: 80%;
    max-width: 600px;
    height: 200px;
    border: 2px dashed white;
    border-radius: 15px;
    background: transparent;
    color: white;
    font-size: 18px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
    cursor: pointer;
}

/* gestion des 3 images des methodes */

#images {
	display: flex;
	justify-content: center;       /* centre horizontalement */
	align-items: center;           /* centre verticalement */
	gap: 40px;                     /* espace identique entre les images */
	width: 100%;
	max-width: 100%;
	margin: auto;
	flex-wrap: wrap;
	padding: 20px 0;               /* un peu d’air autour des images */
}

#images img {
	width: clamp(120px, 18vw, 160px); /* taille fluide selon la largeur d’écran */
	height: auto;                     /* conserve le ratio original */
	object-fit: contain;              /* évite tout rognage */
	border-radius: 10px;
	cursor: pointer;
	transition: transform 0.2s ease;
}

#images img:hover {
	transform: scale(1.05);
}

@media (max-width: 600px) {
  #images {
    gap: 40px;
    padding: 10px 0;
  }
  #images img {
    width: clamp(100px, 35vw, 140px);
  }
}


/* Contenu STL inséré dynamiquement */
#viewer-content {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* liens vers les fichiers */

.uploaded-files-list a {
	color: #60B339 !important;
	text-decoration: underline !important;
	font-weight: bold;
}

.uploaded-files-list a:hover {
	color: #3D3D3D !important;
	text-decoration: none !important;
}

/* -- */
.central-panel {
	flex: 1;
	padding: 20px;
	overflow-y: auto;
	background: #ffffff;
}

.menu {
	margin-bottom: 10px;
	padding: 10px;
	border: 1px solid #adb5bd;
	border-radius: 8px;
	background: #E5E5E5;
	overflow: hidden;
	/* max-height: 50px;*/
	max-width: 900px;
	transition: all 0.3s ease;
	cursor: pointer;
	position: relative;
}

.model-info {
	background-color: #000000;
	color: #E5E5E5;
	cursor: default; /* Pas de clic */
}

.menu.active {
	max-height: 1500px;
	cursor: default;
	background: #ffffff;
	border-color: #adb5bd;
}

.menu h3 {
	margin: 0;
	font-size: 1.2em;
	color: #2C2C2C;
}

.menu.model-info h3 {
	color: #FFFFFF;
}

.menu-content {
	margin-top: 10px;
	display: none;
}

.menu.active .menu-content {
	display: block;
	padding-bottom: 12px;
}

.menu img:not(.opt-img) {
  width: 200px;
  height: 200px;
  margin: 5px;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 8px;
  transition: 0.2s;
}



.menu img.selected {
	border-color: #198754;
}

@media (max-width: 600px){
  /* checkbox un peu plus compacte sur mobile */
  .options-list input[type="checkbox"]{
    transform: scale(1.05);
    margin-right: 8px;
  }

  /* évite le texte “écrasé / débordé” */
  .opt-title, .opt-comment{
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}


/* La liste peut scroller si elle est trop longue */
#options-container.options-list{
  max-height: 55vh;                 /* desktop/tablette */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 6px;              /* évite que la scrollbar bouffe le texte */
}

/* Mobile : on réserve plus de place au bouton */
@media (max-width: 600px){
  #options-container.options-list{
    max-height: 45vh;
  }
}


select, input[type=range], input[type=number], textarea {
	width: 100%;
	margin-top: 10px;
	padding: 8px;
	border: 1px solid #ced4da;
	border-radius: 5px;
	background: #ffffff;
}

button {
	background-color: #60B339;
	color: white;
	border: none;
	padding: 10px;
	font-weight: bold;
	border-radius: 5px;
	cursor: pointer;
	margin-top: 10px;
}


/* ideal pour griser les boutons dans les box en cours de chargement */
button.loading {
	opacity: 0.6;
	pointer-events: none;
	cursor: not-allowed;
}

button:hover {
	background-color: white;
	color: #60B339;
	border: 1px solid #60B339;
}

.stl-btn {
  color: #FFFFFF !important;
  border: none;
  padding: 10px 16px;
  font-weight: bold;
  border-radius: 5px;
  cursor: pointer;
  text-decoration: none;
  margin-top: 5px;
}

.stl-btn:hover {
	background-color: #FFFFFF !important;
	color: #60B339 !important;
	border: 1px solid #60B339;
}

table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 10px;
}

table, th, td {
	border: 1px solid #ced4da;
}

th, td {
	padding: 8px;
	text-align: center;
}

.quantity-controls {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin-top: 10px;
}

.quantity-controls button {
	width: 40px;
	height: 40px;
	font-size: 20px;
	text-decoration: none !important;
}

.quantity-controls input {
	width: 60px;
	text-align: center;
}

@media (max-width: 768px) {
  .main-container { flex-direction: column; }

  .left-panel{
    width: 100%;
    min-width: 0;
    height: 30vh;
    border-right: none;
    border-bottom: 1px solid #dee2e6;
  }

  .central-panel{
    order: 2;
    height: auto;
  }

  .viewer-panel{
    order: 3;
    width: 100%;
    min-width: 0;
    border-left: none;
    border-top: 1px solid #dee2e6;
    height: 45vh;
  }

  .viewer{
    min-height: 280px;
  }
}


/* champ contraintes info*/
.constraint-info {
	margin-top: 10px;
	margin-bottom: 5px;
	padding: 10px;
	background-color: #f8f9fa;
	border: 1px solid #ccc;
	border-radius: 5px;
	font-size: 14px;
	color: #333;
	min-height: 40px;
}

/* champ text a coté de la liste des materiaux */
.material-info {
	margin-top: 10px;
	margin-bottom: 5px;
	padding: 10px;
	background-color: #f8f9fa;
	border: 1px solid #ccc;
	border-radius: 5px;
	font-size: 14px;
	color: #333;
	min-height: 40px;
}

.color-info {
	margin-top: 10px;
	margin-bottom: 5px;
	padding: 10px;
	background-color: #f8f9fa;
	border: 1px solid #ccc;
	border-radius: 5px;
	font-size: 14px;
	color: #333;
	min-height: 40px;
}

/* champ text dans le recap */
.recap-info {
	margin-top: 10px;
	padding: 10px;
	background-color: #f1f3f5;
	border: 1px solid #ccc;
	border-radius: 5px;
	font-size: 14px;
	color: #333;
	min-height: 40px;
	margin-bottom: 20px;
}

.quantite-info {
	margin-top: 10px;
	padding: 10px;
	background-color: #f1f3f5;
	border: 1px solid #ccc;
	border-radius: 5px;
	font-size: 14px;
	color: #333;
	min-height: 40px;
	margin-bottom: 20px;
}

/*-- gestion du champ de selection multiple --*/
select[multiple] {
	height: auto;
	min-height: 100px;
	background-color: #f9f9f9;
	border-radius: 8px;
	padding: 10px;
	font-size: 14px;
	border: 1px solid #ccc;
	box-sizing: border-box;
	overflow-y: auto;
}

select[multiple] option {
	padding-left: 25px;
	position: relative;
}

/* style des sliders */
.slider-container {
	margin-top: 5px;
	text-align: left;
}

.slider-label {
	font-weight: bold;
	display: block;
	margin-bottom: 2px;
}

.slider-value {
	font-weight: bold;
	text-align: center;
	margin-top: 2px;
}

/* affichage propre du tableau des tarifs*/
.price-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 20px;
	font-size: 14px;
}

.price-table th, .price-table td {
	border: 1px solid #dee2e6;
	padding: 8px;
	text-align: center;
}

.price-table th {
	background-color: #f1f3f5;
	font-weight: bold;
}

.price-table tbody tr:nth-child(even) {
	background-color: #f8f9fa;
}

/* affichage des boutons + et - pour ajouter et retirer des contraintes */
.contrainte-row {
	display: flex;
	align-items: center;
	margin-bottom: 10px;
}

.contrainte-row select {
	flex: 1;
}

.contrainte-row button {
	margin-left: 10px;
	padding: 5px 10px;
	font-size: 18px;
	font-weight: bold;
	background-color: #4682B4;
	color: white !important;
	border: none;
	border-radius: 5px;
	cursor: pointer;
	background-color: #60B339;
	color:#FFFFFF;
	text-decoration: none;
}

.contrainte-row button:hover {
	background-color: #3b6f99;
}

/* les listes d'options */
.options-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 10px;
}

.options-list label.opt-item{
  align-items: flex-start;
}

.opt-text{
  min-width: 0;
}


.options-list label {
	display: flex;
	align-items: center;
	padding: 10px;
	border: 1px solid #ccc;
	border-radius: 6px;
	background-color: #f9f9f9;
	cursor: pointer;
	user-select: none;
}

.options-list input[type="checkbox"] {
	margin-right: 10px;
	transform: scale(1.2);
}


.viewer-panel{
  width: 32%;
  min-width: 360px;
  background: #ffffff;
  border-left: 1px solid #dee2e6;
  padding: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}


/* === Options enrichies (image + commentaire) === */

/* on garde ton layout, on améliore juste la gestion multi-lignes */
.options-list label.opt-item{
  align-items: flex-start; /* permet commentaire en dessous sans décaler bizarrement */
  gap: 10px;               /* cohérent avec ton design */
}

.options-list label.opt-item input[type="checkbox"]{
  margin-top: 4px;         /* alignement visuel avec l'image/titre */
}

/* bloc texte à droite */
.opt-text{
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;                 /* prend la place restante */
  min-width: 0;            /* évite débordement */
}

.opt-title{
  font-weight: 700;        /* un peu plus lisible, cohérent avec ton style "bold" */
  color: #2C2C2C;
}

/* commentaire discret */
.opt-comment{
  font-size: 0.92em;
  color: #555;
  font-weight: 400;
  line-height: 1.25;
}

/* Images options : taille par défaut (PC) */
.opt-img{
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #dee2e6;
  background: #fff;
  flex: 0 0 auto;
}

/* Tablette : intermédiaire */
@media (max-width: 900px){
  .opt-img{
    width: 120px;
    height: 120px;
  }
}

/* Mobile : compact */
@media (max-width: 600px){
  .opt-img{
    width: 34px;
    height: 34px;
    border-radius: 6px;
  }
}

/* -- */

/* gestion du spinner de chargement */

#upload-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 1.5em;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.upload-message {
  text-align: center;
}

.spinner {
  margin: 0 auto 10px;
  width: 40px;
  height: 40px;
  border: 6px solid #fff;
  border-top: 6px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

#viewer-loading {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	color: #333;
	text-align: center;
	font-size: 1.2em;
	z-index: 10;
	pointer-events: none;
}

/* les spinner pour les clock menu */

.menu-spinner {
	display: flex;
	justify-content: center;
	align-items: center;
	margin-top: 10px;
	gap: 10px;
}

.menu-spinner .mini-spinner {
	width: 30px;
	height: 30px;
	border: 4px solid #ccc;
	border-top: 4px solid #4682B4;
	border-radius: 50%;
	animation: miniSpin 0.8s linear infinite;
}

.spinner-text {
    font-size: 14px;
    color: #4682B4;
    font-weight: 500;
}

@keyframes miniSpin {
	to {
		transform: rotate(360deg);
	}
}

/* === Overlay global "module en cours de chargement" === */

.sym-module-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(2px);
  z-index: 99998; /* en-dessous du gros modal (99999), au-dessus du reste */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.25s ease-out;
}

.sym-module-loading-overlay.sym-module-loading-hidden {
  opacity: 0;
  pointer-events: none;
}

.sym-module-loading-spinner {
  padding: 1.5rem 2rem;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  font-size: 1.1rem;
  font-weight: 500;
  color: #3D3D3D;
  text-align: center;
}

.sym-module-loading-ring {
  width: 36px;
  height: 36px;
  margin: 0 auto 10px;
  border-radius: 50%;
  border: 3px solid #e0e0e0;
  border-top-color: #60B339;
  animation: symModuleSpin 0.9s linear infinite;
}

.sym-module-loading-text {
  font-size: 0.95rem;
}

/* Réutilisation / ajout d'une anim dédiée si tu veux la séparer */
@keyframes symModuleSpin {
  to { transform: rotate(360deg); }
}



/* --- modal duplication panier --- */
.modal.stl-hidden {
  display: none;
}
/* Empêche la page derrière de "débordre" et garantit un centre correct */
.modal{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;

  /* ✅ si le clavier mobile réduit la hauteur, on évite les bugs */
  padding: 12px;
}

/* ✅ la modale ne dépasse jamais l'écran, scroll interne si besoin */
.modal-content{
  width: min(680px, 92vw);
  background: #fff;
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.2);

  max-height: min(90vh, 720px);       /* desktop/tablette */
  overflow-y: auto;                   /* ✅ ascenseur si trop haut */
  -webkit-overflow-scrolling: touch;  /* ✅ scroll fluide iOS */
  
  position: relative;
}

/* Mobile : un peu plus bas, plus confortable */
@media (max-width: 600px){
  .modal-content{
    max-height: 85vh;
    max-height: 85dvh;
    padding: 14px;
  }
}

.modal-content h3 { margin: 0 0 8px 0; }
.modal-sub { margin: 0 0 12px 0; color: #555; }
.duplicate-list { list-style: none; margin: 0; padding: 0;}
.duplicate-list li { border:1px solid #ddd; border-radius:8px; padding:10px; margin-bottom:8px; cursor:pointer; }
.duplicate-list li:hover { background:#f8f9fa; }
.modal-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:10px; }
.btn-outline { background:#fff; color:#60B339; border:1px solid #60B339; }


/* ===== Viewer modal (plein écran centré & responsive) ===== */
#stl-viewer-modal {
  /* .modal a déjà display:flex + centré ; on s’assure juste qu’il prendra tout l’écran */
  position: fixed;
  inset: 0;
  z-index: 99999;
}

#stl-viewer-modal .modal-content {
  width: min(1200px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  padding: 20px;
}

#stl-viewer-modal h2 {
  margin: 0 0 8px 0;
}

#stl-viewer-modal .muted {
  margin-bottom: 10px;
}

/* Conteneur du canvas déplacé dans la modale */
#viewer-modal-content {
  width: 100%;
  height: clamp(60vh, 72vh, 82vh);
  min-height: 360px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

/* Bouton de fermeture dans l’angle */
#stl-viewer-modal .close[data-close-modal] {
  position: absolute;
  top: 10px;
  right: 14px;
  background: transparent;
  color: #333;
  border: none;
  font-size: 26px;
  line-height: 1;
  padding: 0 6px;
  cursor: pointer;
}

/* Mobile tweaks */
@media (max-width: 600px) {
  #stl-viewer-modal .modal-content {
    width: 96vw;
    max-height: 94vh;
    padding: 14px;
    border-radius: 10px;
  }
  #viewer-modal-content {
    height: 65vh;      /* un peu plus compact sur téléphone */
    min-height: 300px;
  }
}


/* Bouton ? dans le choix méthode */
.method-help-btn{
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 2px solid #60B339;
  background: #fff;
  color: #60B339;
  font-weight: 800;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 10px;
}

.method-help-btn:hover{
  background: #60B339;
  color: #fff;
}

/* FAQ dans la modale */
.method-help-faq details{
  border: 1px solid #dee2e6;
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 10px;
  background: #f8f9fa;
}

.method-help-faq summary{
  cursor: pointer;
  font-weight: 700;
  color: #2C2C2C;
  list-style: none;
}

.method-help-faq summary::-webkit-details-marker{ display:none; }

.method-help-faq .faq-answer{
  margin-top: 10px;
  color: #333;
  font-weight: 400;
}

.method-help-faq .muted{
  color: #666;
  font-size: 0.95em;
}

