/* ----- Container principal ----- */
.container {
  width: 100%;
  max-width: 90em;
  margin: 30px auto 8vw;
  padding: 0 20px 35px;
}

/* ----- Sections ----- */
.tab-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
  animation: fadeInUp 0.5s ease-in-out;
}

.tab-buttons button {
  flex: 1;
  max-width: 200px;
  padding: 5px 20px;
  text-transform: uppercase;
  font-size: 1rem;
  border: 2px solid var(--tab-buttons-border);
  background: var(--tab-buttons-bg);
  color: var(--tab-buttons-color);
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.tab-buttons button:hover,
.tab-buttons .active {
  background: var(--tab-buttons-hover-bg);
  color: var(--tab-buttons-hover-color);
}

/* ----- Contenu de l’onglet ----- */
.content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  background: var(--form-main-bg);
  border: 1px solid #333;
  border-radius: 18px;
}

/* ----- Convert map card ----- */
.convert-map-layout {
  background: var(--form-main-bg);
  border-radius: 18px;
  margin-top: 14px;
  padding: 28px 25px 10px 25px;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  height: auto;
  animation: fadeIn 0.3s ease-in-out;
}

.convert-map-layout:not(.active) { 
  display: none !important;
}

.convert-map-layout.active {
  display: flex !important;
}

/* ----- Bouton "copy map to clipboard" ----- */
.copy-btn {
  align-self: center;
  margin: 0 auto 15px;
  padding: 8px 16px;
  background: var(--block-label-bg);
  color: var(--block-label-color);
  border: none;
  border-radius: 4px;
  font-weight: bold;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.3s;
  display: flex;
}

.copy-btn:hover {
  background: var(--button-hover-bg, #d1d1d1);
}

/* ----- Description ----- */
.description {
  font-size: 0.85em;
  text-align: center;
  margin-bottom: 20px;
  color: var(--text-color, #ddd);
  line-height: 1.4;
}

/* ----- Colonnes Yes/Maybe/No ----- */
.import-info {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.column {
  flex: 1;
  padding: 12px;
  background: var(--sub-form-bg);
  border-radius: 4px;
}

.column h3 {
  text-transform: capitalize;
  text-align: center;
  margin-bottom: 8px;
  font-size: 1em;
}

.column ul {
  list-style: none;
}

.column li {
  margin-bottom: 6px;
  font-size: 0.85em;
  line-height: 1.3;
}

.column.yes h3   { color: var(--yes-color, #7fff7f); }
.column.maybe h3 { color: var(--maybe-color, #ffff7f); }
.column.no h3    { color: var(--no-color, #ff7f7f); }

/* ----- Summary ----- */
.summary {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
}

.summary-inner {
  display: flex;
  align-items: center;
  background: var(--panel-bg, #3b4757);
  padding: 8px 12px;
  border-radius: 4px;
}

.summary-header {
  text-transform: uppercase;
  font-size: 0.75em;
  margin-right: 10px;
  color: var(--text-muted, #bbb);
}

.icons img {
  width: 24px;
  height: 24px;
  margin-right: 6px;
}

/* ----- Contrôles bas ----- */
.convert-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  width: 100%;
}

.diff-btn {
  margin-left: auto;
}

.convert-controls label {
  font-size: 0.9em;
  color: var(--text-color, #ddd);
}

.convert-controls select,
.convert-controls button {
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.1);
  background: var(--block-label-bg);
  color: var(--block-label-color);
  cursor: pointer;
  transition: background 0.3s;
}

.convert-controls button:hover {
  background: var(--button-hover-bg, #d1d1d1);
}

.mapdata {
  flex: 1 0 auto;
  width: 100%;
  min-height: 200px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  background: var(--sub-form-bg);
  color: var(--input-bg);
  resize: vertical;
  font-size: 0.9em;
}

/* ----- Diffchecker ----- */
.diff-line {
  white-space: pre;
  font-family: monospace;
}
.diff-line.added   { color: #4CAF50; }
.diff-line.removed { color: #F44336; }

/* ----- Footer ----- */
.footer {
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  font-size: 0.8em;
  color: var(--text-muted, #888);
}

.footer-left {
  text-align: left;
  color: var(--text-muted, #888);
}

.footer-right {
  text-align: right;
  color: var(--text-muted, #888);
}

/* ----- Styles globaux de la zone “Map settings” ----- */
#mapSettings {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background-color: var(--form-main-bg);
  border: 1px solid #333;
  border-radius: 18px;
  max-height: 80vh;
  overflow-y: auto;
}

/* ----- Global Infos (bans à gauche, boutons à droite) ----- */
.global-infos {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.global-bans {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow-x: auto;
}

.global-ban-icon {
  padding: 4px 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  font-size: 0.9rem;
  color: var(--input-bg);
  user-select: none;
  transition: transform 0.15s;
}
.global-ban-icon:hover {
  transform: scale(1.01);
}

.settings-buttons {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
}

/* ----- Boutons d’édition (Edit mode & Global settings) ----- */
.edit-mode-btn,
.global-edit-mode-btn {
  padding: 6px 12px;
  background-color: #007bff;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.edit-mode-btn:hover,
.global-edit-mode-btn:hover {
  background-color: #1171d9;
}

/* ----- Checkpoint-card ----- */
.checkpoint-card {
  background: var(--sub-form-bg);
  position: relative;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 16px;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.checkpoint-card:hover {
  background-color: #2a2d35;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
}

.checkpoint-card.editable {
  cursor: pointer;
  outline: 2px dashed var(--pagination-hover);
}
.checkpoint-card.editable:hover {
  background-color: #3a3d45;
}

.empty-message {
  color: #fff;
  font-size: 1.4rem;
  text-align: center;
  padding: 24px 0;
  width: 100%;
  box-sizing: border-box;
}

.move-controls {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
}
.move-controls button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-color, #ddd);
}

.move-controls button:disabled {
  cursor: not-allowed;
}

.move-controls button:hover {
  color: var(--text-highlight, #fff);
}

.checkpoint-card > .checkpoint-header {
  flex: 0 0 100%;
}

.checkpoint-card > .section {
  flex: 1 1 0;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}

.checkpoint-card > .move-controls {
  flex: 0 0 100%;
}

.checkpoint-card .section__items {
  max-height: 140px;
  padding: 6px 10px;
  overflow-y: auto;
  flex-shrink: 0;
}

.checkpoint-card .section__items::-webkit-scrollbar {
  width: 6px;
}
.checkpoint-card .section__items::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
}

/* ----- Header interne ----- */
.checkpoint-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

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

.checkpoint-header__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.checkpoint-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #676767;
  color: #fff;
  font-weight: bold;
  font-size: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 0 8px rgb(167 167 167 / 70%);
  flex-shrink: 0;
}

.coords-inline {
  font-size: 0.9rem;
  color: #ffffff;
  font-weight: bold;
  white-space: nowrap;
  flex-shrink: 0;
}

.original-label {
  font-size: 0.8rem;
  color: #cccccc;
}

.ban-icons {
  display: flex;
  gap: 6px;
}

.ban-icon {
  font-size: 1.2rem;
  color: #ff6666;
  opacity: 0.85;
  user-select: none;
}

/* ----- Section & sous‐sections ----- */
.section__title {
  font-size: 0.95rem;
  color: #cccccc;
  font-weight: 600;
  border-bottom: 1px solid #444;
  padding-bottom: 4px;
  margin-bottom: 4px;
}

.section--bans .section__title {
  color: #ff6666;
}

/* ----- Élément “detail” (Killball/Pinball) ----- */
.section__items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #e0e0e0;
}

.detail__text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ----- Animations ----- */
@keyframes pulse-blue   { 0%,100%{box-shadow:0 0 6px #00aaff;}50%{box-shadow:0 0 10px #00aaff;} }
@keyframes pulse-green  { 0%,100%{box-shadow:0 0 6px #33cc33;}50%{box-shadow:0 0 10px #33cc33;} }
@keyframes pulse-orange { 0%,100%{box-shadow:0 0 6px #ff8800;}50%{box-shadow:0 0 10px #ff8800;} }
@keyframes pulse-purple { 0%,100%{box-shadow:0 0 6px #9b59b6;}50%{box-shadow:0 0 10px #9b59b6;} }

/* ----- Circle pinball/killorbs/portals ----- */
.circle {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.circle-blue   { background:#00aaff; animation:pulse-blue 1.5s infinite ease-in-out; }
.circle-green  { background:#33cc33; animation:pulse-green 1.5s infinite ease-in-out; }
.circle-orange { background:#ff8800; animation:pulse-orange 1.5s infinite ease-in-out; }
.circle-purple { background:#9b59b6; animation:pulse-purple 1.5s infinite ease-in-out; }

/* Icons */
.pinball-icons { display: flex; gap: 6px; margin-left: 8px; }
.pinball-icon  { width: 16px; height: 16px; object-fit: contain; }
.ability-icons { display: flex; gap: 8px; margin-left: 4px; }
.ability-icon  { width: 24px; height: 24px; }

/* ----- Help ----- */
.content {
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background-color: var(--form-main-bg);;
  border: 1px solid #333;
  border-radius: 18px;
  color: #ffffff;
  font-family: sans-serif;
}

.content h2 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1.4rem;
  color: #f0f0f0;
  border-bottom: 1px solid #444;
  padding-bottom: 4px;
}

.content p {
  margin: 0 0 12px 0;
  line-height: 1.5;
  font-size: 1rem;
  color: #d0d0d0;
}

.content ul {
  margin: 0;
  padding-left: 20px;
  list-style-type: disc;
  color: #d0d0d0;
}

.content ul li {
  margin-bottom: 6px;
  font-size: 0.95rem;
}

.content.active {
  display: flex;
}

/* ----- Modal ----- */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: none; /* Affiché via JS */
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-diff { display: none; align-items: center; justify-content: center; position: fixed; top:0; left:0; width:100%; height:100%; background: rgba(0,0,0,0.6); z-index:1000; }
.modal-diff.show { display: flex; }

.modal-content2 {
  background-color: #2d2f36;
  color: #fff;
  padding: 20px 24px;
  border-radius: 8px;
  width: 60vw;
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
}

.modal-content2 h3 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.2rem;
  color: #f0f0f0;
  border-bottom: 1px solid #b5b3b3;
  padding-bottom: 4px;
}

.sub-header {
  border-bottom: 1px solid #444;
}

.orb-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.orb-row input[type="number"] {
  width: 80px;
}

.pin-x,
.pin-y,
.pin-z,
.pin-f {
  min-width: 73px;
}

.orb-row label {
  display: flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
}

.portal-block {
  display: flex;
  gap: 6px;
  align-items: center;
}
.portal-block input[type="number"] {
  width: 80px;
}

#editFieldsContainer {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#editFieldsContainer label {
  font-size: 0.9rem;
  margin-bottom: 4px;
  margin-right: 10px;
  white-space: nowrap;
}
#editFieldsContainer input[type="number"],
#editFieldsContainer select,
#editFieldsContainer textarea {
  width: fit-content;
  max-width: 15%;
  padding: 6px 8px;
  border: 1px solid #555;
  border-radius: 4px;
  background-color: #1e2228;
  color: #fff;
  font-size: 0.9rem;
  box-sizing: border-box;
}
#editFieldsContainer input[type="checkbox"] {
  margin-right: 6px;
}

.modal-close2 {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 1.8rem;
  cursor: pointer;
  color: #ccc;
  transition: color 0.2s ease;
}

.modal-close2:hover {
  color: var(--red, #e74c3c);
}

#globalSettingsForm {
  display: flex;
  flex-direction: column;
  margin-top: 12px;
}

.modal-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  align-items: center;
  margin-bottom: 12px;
}

.modal-label {
  font-size: 0.95em;
  color: #ddd;
  font-weight: 500;
}

.modal-input,
.modal-select {
  width: 100%;
  padding: 6px 10px;
  background: #40444b;
  border: 1px solid #555;
  border-radius: 4px;
  color: #eee;
  font-size: 0.95em;
  box-sizing: border-box;
}

.modal-input2,
.modal-select2 {
  width: 50%;
  padding: 6px 10px;
  background: #40444b;
  border: 1px solid #555;
  border-radius: 4px;
  color: #eee;
  font-size: 0.95em;
  box-sizing: border-box;
}

.modal-input:focus,
.modal-select:focus {
  outline: none;
  border-color: #7289da;
  background: #4b4e57;
}

.bans-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  width: 100%;
  margin-top: 4px;
}

.ban-label {
  display: flex;
  align-items: center;
  background: #ffffff;
  color: #333;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 0.9em;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  user-select: none;
}

.ban-label input[type="checkbox"] {
  margin-right: 8px;
  accent-color: #7289da;
}

.modal-buttons2 {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

.modal-buttons2 button {
  min-width: 100px;
  padding: 8px 14px;
  font-size: 0.95em;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  color: #fff;
  transition: background-color 0.2s ease;
}

.modal-buttons3 button {
  min-width: 100px;
  padding: 8px 14px;
  font-size: 0.95em;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  color: #fff;
  transition: background-color 0.2s ease;
}

.modal-buttons3 {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}
.modal-buttons3 .btn {
  padding: 6px 14px;
  border: none;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  font-weight: 500;
}
.modal-buttons3 .btn-save {
  background-color: #28a745;
}
.modal-buttons3 .btn-cancel {
  background-color: #dc3545;
}

#saveGlobalChangesBtn {
  background-color: var(--green);
  color: #fff;
}
#cancelGlobalChangesBtn {
  background-color: var(--red);
  color: #fff;
}
#saveGlobalChangesBtn:hover {
  background-color: var(--green-hover);
}
#cancelGlobalChangesBtn:hover {
  background-color: var(--red-hover);
}

#saveEditorChangesBtn {
  background-color: var(--green);
  color: #fff;
}
#cancelEditorChangesBtn {
  background-color: var(--red);
  color: #fff;
}
#saveEditorChangesBtn:hover {
  background-color: var(--green-hover);
}
#cancelEditorChangesBtn:hover {
  background-color: var(--red-hover);
}

.delete-checkpoint-btn {
  background-color: var(--red);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 12px;
  cursor: pointer;
  margin-right: auto;
  font-size: 0.9em;
  transition: background-color 0.2s ease;
}

.delete-checkpoint-btn:hover {
  background-color: var(--red-hover);
}

/* ----- Map name input ----- */
.map-name-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.map-name-text-wrapper {
  position: relative;
  flex: 1;
  min-width: 0;
}

.map-name-text-wrapper .modal-input2 {
  width: 100%;
  box-sizing: border-box;
}

.map-name-suggestions-container {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  box-sizing: border-box;
  background: #2f3136;
  border: 1px solid #484b51;
  border-radius: 4px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
}
.map-name-suggestions-container .suggestion-item {
  padding: 6px 10px;
  cursor: pointer;
  color: #ddd;
}
.map-name-suggestions-container .suggestion-item:hover {
  background: #40444b;
}

.map-name-suggestions-container {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  box-sizing: border-box;
  background: #2f3136;
  border: 1px solid #484b51;
  border-radius: 4px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
}

.map-name-input-wrapper .modal-input2 {
  flex: 1;
  min-width: 0;
}

.map-name-input-wrapper .modal-select2 {
  flex: none;
  width: auto;
}

.convert-map-layout,
#mapSettings {
  width: 100%;
  padding: 16px;
  background: var(--form-main-bg);
  border: 1px solid #333;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ----- Help section ----- */
.help-section {
  background-color: var(--form-main-bg);
  text-align: center;
  padding: 30px 20px;
  border-radius: 12px;
  color: #f0f0f0;
}

.help-step {
  margin-bottom: 40px;
}

.help-step:last-child {
  margin-bottom: 0;
}

.help-step strong {
  display: block;
  font-size: 1.4rem;
  margin-bottom: 0.5em;
  text-transform: uppercase;
  color: #ffffff;
}

.help-step p {
  max-width: 700px;
  margin: 0 auto 1em;
  line-height: 1.5;
  color: #d0d0d0;
  font-size: 1rem;
}

.help-step img {
  display: inline-block;
  margin-top: 0.5em;
  height: 80px;
  object-fit: contain;
}

/* ----- Responsive design  ----- */
@media (max-width: 500px) {
  .checkpoint-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .checkpoint-header__right {
    align-items: flex-start;
  }
  .coords-inline {
    font-size: 0.8rem;
  }
  .checkpoint-number {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
  }
  .ban-icon {
    font-size: 1.1rem;
  }

  .modal-content2 {
    width: 90vw;
    padding: 16px 20px;
  }
  .modal-row {
    grid-template-columns: 1fr;
    row-gap: 8px;
  }
  .modal-label {
    width: 100%;
  }
}

@media (min-width: 1024px) {
  #mapSettings {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .checkpoint-card {
    width: auto;
    margin: 0;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  #mapSettings {
    display: flex;
    gap: 12px;
  }
  .checkpoint-card {
    flex: 1 1 calc(50% - 12px);
  }
}

@media (max-width: 767px) {
  #mapSettings {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .checkpoint-card {
    flex: none;
    width: 100%;
  }

  .checkpoint-card {
    padding: 12px;
  }
}

@media (max-width: 600px) {
  .section__items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
  }
  .detail__text {
    font-size: 0.8rem;
  }
}

@media (max-width: 600px) {
  .help-step img {
    height: 60px;
  }
  .help-step p {
    font-size: 0.9rem;
  }
}

@media (max-width: 500px) {
  .global-infos {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .settings-buttons {
    width: 100%;
    justify-content: flex-end;
  }
  .convert-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .diff-btn {
    margin-left: 0;
  }
}

.convert-map-layout {
  padding: 24px;
}

@media (max-width: 767px) {
  .convert-map-layout {
    padding: 12px;
  }
}