/* Merged CSS file */
:root {
  /* Light Theme (Default) */
  --success: #4CAF50;
  --success-hover: #45a049;
  --transition: all 0.3s ease;
  --background: #f0f0f0;
  --card-bg: #ffffff;
  --text: #333333;
  --text-light: #666666;
  --border: #cccccc;
  --toggle-bg: #cccccc;
  --toggle-active: #3e5c98;
  --section-bg: #f9f9f9;
  --section-hover: #f0f0f0;
  --section-border: #3e5c98;
  --button-hover: #2b3e6f;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 2px 5px rgba(0, 0, 0, 0.15);
}

/* Dark Theme */
[data-theme="dark"] {
  --success: #22c55e;
  --success-hover: #16a34a;
  --background: #0f172a;
  --card-bg: #1e293b;
  --text: #f1f5f9;
  --text-light: #94a3b8;
  --border: #334155;
  --toggle-bg: #475569;
  --toggle-active: #6366f1;
  --section-bg: #1e293b;
  --section-hover: #334155;
  --section-border: #6366f1;
  --button-hover: #4f46e5;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 2px 5px rgba(0, 0, 0, 0.4);
}

/* Theme Toggle Button */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.theme-toggle:hover {
  transform: scale(1.1);
}

.theme-toggle i {
  font-size: 1.25rem;
}

/* Bouton retour au menu */
.back-to-menu {
  position: fixed;
  top: 20px;
  left: 20px;
  background-color: var(--success);
  color: white;
  padding: 0.75rem 1.25rem;
  text-decoration: none;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  z-index: 100;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.back-to-menu:hover {
  background-color: var(--success-hover);
  transform: translateY(-2px);
}

/* Version responsive pour les petits écrans */
@media (max-width: 480px) {
  .back-to-menu {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
  }
}

/* Font declarations */
@font-face {
  font-family: "BrownFtv";
  src: url("fonts/BrownFtv-Regular.woff2") format("woff2"), url("fonts/BrownFtv-Regular.woff") format("woff"),
    url("fonts/BrownFtv-Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "BrownFtv";
  src: url("fonts/BrownFtv-Bold.woff2") format("woff2"), url("fonts/BrownFtv-Bold.woff") format("woff"),
    url("fonts/BrownFtv-Bold.ttf") format("truetype");
  font-weight: bold;
  font-style: normal;
}

/* Global styles */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  background-color: var(--background);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
}


/* Ajout de la police Poppins */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* Layout containers */
.container {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.canvas-section {
  flex: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
}

canvas {
  border: 0px;
  width: 100%;
  height: auto;
  max-width: 1920px;
}

.config-section {
  flex: 1;
  padding: 1%;
  background-color: var(--card-bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* Typography */
h2 {
  font-size: 2vh;
  margin-bottom: 1vh;
  color: var(--text);
}

label {
  display: block;
  margin: 0.3vh 0 0.2vh;
  font-size: 1.4vh;
  color: var(--text);
}

/* Form elements */
input,
select {
  width: 100%;
  padding: 0.4vh;
  margin-bottom: 0.5vh;
  font-size: 1.4vh;
  background-color: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--border);
}

#fileName {
  margin-bottom: 5px;
}

#importXMLInput {
  display: ;
}

/* Checkbox styles */
.checkbox-container {
  display: flex;
  align-items: center;
  font-size: 1.4vh;
  margin-bottom: 0.8vh;
  color: var(--text);
}

input[type="checkbox"] {
  transform: scale(1.5);
  margin-right: 10px;
}

/* Toggle switch styles */
.toggle-switch-container {
  display: flex;
  align-items: center;
  margin: 15px 0;
  padding: 5px;
  background-color: var(--section-bg);
  border-radius: 8px;
  border-left: 4px solid var(--section-border);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.toggle-switch-container:hover {
  background-color: var(--section-hover);
  box-shadow: var(--shadow-hover);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
  margin-right: 10px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--toggle-bg);
  transition: .4s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: var(--toggle-active);
}

input:focus + .toggle-slider {
  box-shadow: 0 0 1px var(--toggle-active);
}

input:checked + .toggle-slider:before {
  transform: translateX(26px);
}

.toggle-label {
  font-size: 1.4vh;
  font-weight: 500;
  color: var(--text);
}

.toggle-description {
  font-size: 1.2vh;
  color: var(--text-light);
  margin-top: 3px;
}

/* Layout helpers */
.inline-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0.8vh;
}

.inline-container label {
  margin-bottom: 0;
  white-space: nowrap;
  flex: 1;
}

.inline-container select,
.inline-container input[type="color"] {
  flex: 2;
}

.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1vh 0;
  width: 100%;
}

/* Buttons */
button {
  padding: 1vh;
  background-color: var(--success);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 1.6vh;
  width: 100%;
  margin-bottom: 1vh;
}

button:hover {
  background-color: var(--button-hover);
}

/* Bouton retour au menu */
.back-to-menu {
    position: fixed;
    top: 20px;
    left: 20px;
    background-color: var(--success);
    color: white;
    padding: 0.75rem 1.25rem;
    text-decoration: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    z-index: 100;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.back-to-menu:hover {
    background-color: var(--success-hover);
    transform: translateY(-2px);
}

/* Color picker and team entry */
.color-picker-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5vh;
}

.team-entry {
  display: flex;
  align-items: center;
  margin-bottom: 0.5vh;
}

.team-entry select {
  flex: 3;
  margin-right: 5px;
}

.team-entry input {
  flex: 1;
  margin-left: 5px;
}

.range-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0.8vh;
}

.range-container input {
  flex: 1;
}

/* Responsive styles */
@media (max-width: 768px) {
  .canvas-section {
    flex: 1;
  }

  .config-section {
    flex: 1;
    padding: 5px;
  }

  h2,
  label,
  input,
  select,
  .toggle-label,
  .checkbox-container,
  button {
    font-size: 3vw;
  }

  .toggle-description {
    font-size: 2.5vw;
  }

  .toggle-switch {
    width: 40px;
    height: 20px;
  }

  .toggle-slider:before {
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
  }

  input:checked + .toggle-slider:before {
    transform: translateX(20px);
  }

  input[type="checkbox"] {
    transform: scale(1.2);
  }
}