/* ========================
   STYLES GÉNÉRAUX
   ======================== */
body {
  background: #111;
  color: #eee;
  font-family: Arial;
  padding: 15px 0;
  text-align: center;
  margin: 0;
}

h3 {
  color: #6cf;
  margin-bottom: 6px;
}

/* ========================
   BOUTONS
   ======================== */
button {
  cursor: pointer;
  background: #333;
  color: #eee;
  border: none;
  border-radius: 6px;
  padding: 4px 8px;
  margin: 2px 0;
  font-size: 14px;
  transition: all 0.2s;
}

button:hover {
  background: #555;
  transform: scale(1.05);
}

/* Bouton Démarrer */
#start-stop {
  width: 120px;
  background: linear-gradient(135deg, #6cf, #3a8);
  color: #fff;
  font-weight: bold;
  font-size: 16px;
  padding: 8px 0;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  transition: all 0.2s;
}

#start-stop:hover {
  background: linear-gradient(135deg, #3a8, #6cf);
  transform: scale(1.05);
  box-shadow: 0 6px 14px rgba(0,0,0,0.6);
}

.top-controls {
  display: flex;
  justify-content: space-between; /* extrémités gauche/droite */
  align-items: center;
  max-width: 600px;
  margin: 0 auto 15px auto;
  gap: 10px;
}

.top-controls .control {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.top-controls select,
.top-controls input {
  width: 60px;
  text-align: center;
}

.top-controls label{
  margin: 0 0 10px 0;
  color: #6cf;
  font-family: Arial;
  font-size: 16px;
  font-weight: 600;
}

/* ========================
   INFO ET BEAT
   ======================== */
#info {
  height: 20px;
  margin-bottom: 10px;
  color: #6cf;
  font-weight: bold;
}

#beat {
  width: 50px;
  height: 50px;
  margin: 10px auto;
  border-radius: 50%;
  background: #444;
  transition: all 0.1s;
}

#beat.active {
  box-shadow: 0 0 20px #fff;
}

/* ========================
   INPUT / SELECT
   ======================== */
input, select {
  background: #555;
  color: #fff;
  border: 1px solid #777;
  border-radius: 4px;
  padding: 2px 4px;
  margin: 2px 0;
  font-size: 13px;
  text-align: center;
  width: 90%;
  min-width: 40px;
}

/* ========================
   CONTAINERS
   ======================== */
.tables-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 10px;
}

.table-container {
  max-width: 1000px;
  margin: 0 auto 15px auto;
}

.config-table {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 5px auto;
  max-width: 1000px;
}

.row {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.cell {
  min-width: 0;
  background: #222;
  padding: 6px;
  border: 1px solid #555;
  border-radius: 6px;
  overflow: hidden;
}

/* ========================
   TABLEAUX
   ======================== */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 6px;
}

th, td {
  border: 1px solid #555;
  padding: 4px;
  font-size: 12px;
  text-align: center;
}

th {
  background: #222;
  color: #6cf;
}

td {
  background: #111;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ========================
   CANVAS
   ======================== */
#visual-panel {
  width: 100%;
  max-width: 100%;
  height: 450px;
  margin: 0 0 50px 0;
  background: #181818;
  border: 1px solid #555;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6cf;
  font-size: 14px;
  font-weight: bold;
  border-radius: 0;
  cursor: grab;
}

#visual-panel:active {
  cursor: grabbing;
}


/* ========================
   SLIDER ESPACEMENT
   ======================== */
.div-bar-spacing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 10px 0;
}

.bar-spacing-label {
  font-weight: bold;
  color: #6cf;
  margin-bottom: 6px;
}

.bar-spacing-label span {
  background: #6cf;
  color: #111;
  padding: 2px 6px;
  border-radius: 6px;
  margin-left: 6px;
  min-width: 24px;
  display: inline-block;
  text-align: center;
}

#bar-spacing {
  width: 400px;
}

/* ========================
   MODE PLEIN ÉCRAN
   ======================== */
.fullscreen-toggle {
  position: fixed;
  bottom: 10px;
  right: 10px;
  z-index: 1000;
  background: linear-gradient(135deg, #6cf, #3a8);
  color: #fff;
  font-weight: bold;
  padding: 10px 20px;
  font-size: 14px;
  transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

body.fullscreen-mode {
  overflow: hidden;
}

body.fullscreen-mode #normal-mode,
body.fullscreen-mode .div-bar-spacing,
body.fullscreen-mode .tables-buttons {
  display: none !important;
}

body.fullscreen-mode #visual-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw;
  margin: 0;
  border: none;
}

.fullscreen-controls {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;
  display: flex;
  gap: 30px;
  align-items: center;
  background: rgba(17, 17, 17, 0.95);
  padding: 20px 40px;
  border-radius: 12px;
  border: 2px solid #6cf;
  transition: transform 0.5s ease-in-out, opacity 0.5s ease-in-out;
}

.fullscreen-controls.hidden {
  display: none;
}

.fullscreen-controls.auto-hidden {
  transform: translateX(-50%) translateY(200px);
  opacity: 0;
  pointer-events: none;
}

.fs-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.fs-control label {
  color: #6cf;
  font-size: 16px;
  font-weight: bold;
}

.fs-control select,
.fs-control input[type="number"] {
  width: 80px;
  font-size: 18px;
  padding: 8px;
  text-align: center;
}

.fs-spacing {
  min-width: 300px;
}

.fs-spacing label {
  white-space: nowrap;
}

.fs-spacing input[type="range"] {
  width: 280px;
}

.fs-start-button {
  width: 150px;
  height: 60px;
  font-size: 20px;
  background: linear-gradient(135deg, #6cf, #3a8);
  color: #fff;
  font-weight: bold;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
  transition: all 0.2s;
}

.fs-start-button:hover {
  background: linear-gradient(135deg, #3a8, #6cf);
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0,0,0,0.6);
}

/* ========================
   PANNEAU CONFIGURATION
   ======================== */
.config-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2000;
  background: #222;
  border: 2px solid #6cf;
  border-radius: 12px;
  padding: 20px;
  min-width: 800px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.8);
}

.config-panel.hidden {
  display: none;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #6cf;
}

.panel-header h3 {
  margin: 0;
  color: #6cf;
}

.close-btn {
  background: #ff4444;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.close-btn:hover {
  background: #ff6666;
  transform: scale(1.1);
}

.panel-content {
  color: #eee;
}

.panel-content table {
  width: 100%;
  margin-bottom: 15px;
}

.panel-content input,
.panel-content button {
  width: 100%;
}

.config-section {
  margin-bottom: 30px;
  padding: 15px;
  background: #1a1a1a;
  border-radius: 8px;
  border: 1px solid #444;
}

.config-section h4 {
  color: #6cf;
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 18px;
}

.config-section:last-child {
  margin-bottom: 0;
}