/* Supprime l’ombre sur le titre de la popup de sélections sauvegardées */
#load-selections-popup .popup-content h3 {
  text-shadow: none;
  color: #1a2a6c;
}
/* Permet le drag sur tout le header du panneau flottant */
.floating-selection-panel .floating-header {
  cursor: grab;
}
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #ffffff;
  margin: 0;
  padding: 0;
  /* Nouvelle image de fond avec effet 16:9 */
  background-image: linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.2)),
    url("../images/images/Fond_1.webp");
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-position: center center;
  min-height: 100vh;
  /* Assurer le ratio 16:9 */
  aspect-ratio: 16/9;
  background-blend-mode: multiply;
}

/* Conteneur principal avec transparence progressive */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.1) 25%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.1) 75%,
    rgba(255, 255, 255, 0.05) 100%
  );
  pointer-events: none;
  z-index: -1;
}

header {
  background: linear-gradient(
    135deg,
    rgba(26, 42, 108, 0.85),
    rgba(178, 31, 31, 0.85)
  );
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  text-align: center;
  padding: 1rem 0;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Add or modify to place .user-nav on the right */
.user-nav {
  position: absolute;
  top: 20px;
  right: 30px;
  display: flex;
  align-items: center;
  gap: 15px;
  z-index: 10;
}

/* Vitrified style for the login button */
.user-nav button,
.user-nav .login-btn,
.user-nav .auth-btn,
.user-nav .logout-btn {
  background: linear-gradient(
    135deg,
    rgba(26, 42, 108, 0.95) 0%,
    rgba(26, 42, 108, 0.85) 50%,
    rgba(178, 31, 31, 0.9) 100%
  );
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  padding: 8px 20px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

/* Reflection effect */
.user-nav button::before,
.user-nav .login-btn::before,
.user-nav .auth-btn::before,
.user-nav .logout-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s ease;
}

/* Reflection animation on hover */
.user-nav button:hover::before,
.user-nav .login-btn:hover::before,
.user-nav .auth-btn:hover::before,
.user-nav .logout-btn:hover::before {
  left: 100%;
}

/* Button hover state - more pronounced effect */
.user-nav button:hover,
.user-nav .login-btn:hover,
.user-nav .auth-btn:hover,
.user-nav .logout-btn:hover {
  background: linear-gradient(
    135deg,
    rgba(26, 42, 108, 1) 0%,
    rgba(26, 42, 108, 0.9) 50%,
    rgba(178, 31, 31, 0.95) 100%
  );
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

/* Logout icon - REMOVED as no longer needed  
.user-nav .logout-btn::after {  
  content: "→";  
  margin-left: 5px;  
  display: inline-block;  
  transition: transform 0.3s ease;  
}  

.user-nav .logout-btn:hover::after {  
  transform: translateX(3px);  
}  
*/

/* Active/Pressed State */
.user-nav button:active,
.user-nav .login-btn:active,
.user-nav .auth-btn:active,
.user-nav .logout-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
  .user-nav {
    top: 10px;
    right: 15px;
    gap: 10px;
  }

  .user-nav button,
  .user-nav .login-btn,
  .user-nav .auth-btn,
  .user-nav .logout-btn {
    padding: 6px 14px;
    font-size: 13px;
  }

  .user-nav .user-name,
  .user-nav .username-display {
    font-size: 13px;
  }
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

/* Effet de brillance sur les sections */
section::before {
  transition: left 0.5s ease;
  pointer-events: none;
}

section:hover::before {
  left: 100%;
}

h1,
h2,
h3 {
  color: #ffffff;
  text-shadow: 1px 1px 2px #000, 0 0 2px #000;
}

h2 {
  border-bottom: 1px solid #eee;
  padding-bottom: 0.5rem;
}

form {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

button {
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.3s;
  background: linear-gradient(135deg, #1a2a6c, #b21f1f);
}

button:hover {
  background: linear-gradient(135deg, #b21f1f, #1a2a6c);
}

.button {
  display: inline-block;
  font-size: 18px;
  color: #ffffff;
  background: #e8491d;
  padding: 10px 20px;
  text-decoration: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.button:hover {
  background: #333;
}

input[type="file"] {
  border: 1px solid #ddd;
  padding: 0.5rem;
  border-radius: 4px;
  flex-grow: 1;
}

.generator {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0;
}

input[type="number"] {
  width: 60px;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
}

#frequences-chart {
  height: 400px;
  margin: 2rem 0;
}

ul {
  list-style-type: none;
  padding: 0;
}

li {
  background-color: #f0f8ff21;
  padding: 1rem;
  margin-bottom: 0.5rem;
  border-radius: 4px;
  border-left: 4px solid #003366;
  font-size: 1.2rem;
  font-weight: bold;
  text-align: center;
  color: white;
  text-shadow: 1px 1px 2px #000, 0 0 2px #000;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.results.active {
  display: block;
}

footer {
  background: linear-gradient(
    135deg,
    rgba(26, 42, 108, 0.9),
    rgba(26, 26, 44, 0.9)
  );
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  text-align: center;
  padding: 1.5rem;
  margin-top: 40px;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
}

/* === SECTIONS MODERNISÉES AVEC TRANSPARENCE === */

.upload {
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(226, 232, 240, 0.3);
  padding: 30px;
}

.upload::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #1e40af 0%, #f59e0b 50%, #dc2626 100%);
  opacity: 0.8;
}

/* Éléments enfants avec transparence progressive */
.chart {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.85) 0%,
    rgba(248, 250, 252, 0.8) 100%
  );
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 25px;
  margin: 30px 0;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(226, 232, 240, 0.3);
  position: relative;
  transition: all 0.3s ease;
}

.chart:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

.chart-explanation::before {
  content: "💡";
  position: absolute;
  top: 18px;
  right: 20px;
  font-size: 1.2em;
}

/* === GRAPHIQUES MODERNISÉS === */
.number-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 12px;
  background: linear-gradient(
    135deg,
    rgba(248, 250, 252, 0.75) 0%,
    rgba(241, 245, 249, 0.7) 100%
  );
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 16px;
  padding: 25px;
  margin: 25px 0;
  border: 2px solid #e2e8f0;
}

.complementary-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 12px;
  background: linear-gradient(
    135deg,
    rgba(254, 247, 255, 0.75) 0%,
    rgba(250, 245, 255, 0.7) 100%
  );
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 16px;
  padding: 25px;
  margin: 25px 0;
  border: 2px solid #e879f9;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.generator {
  background: linear-gradient(
    135deg,
    rgba(240, 249, 255, 0.7) 0%,
    rgba(224, 242, 254, 0.65) 100%
  );
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 16px;
  padding: 25px;
  margin: 25px 0;
  border: 2px solid #0ea5e9;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.floating-selection-panel.dragging {
  transition: none !important;
}

/* Styles for the floating panel content */
.floating-header {
  background: linear-gradient(
    135deg,
    rgba(26, 42, 108, 0.9),
    rgba(178, 31, 31, 0.9)
  );
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: white;
  padding: 10px;
  font-weight: bold;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  text-align: center;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Styles for the move handle (scoped to floating panel) */
.floating-selection-panel .drag-handle {
  cursor: move;
  padding: 0 5px;
  display: flex;
  align-items: center;
}

/* Add a tooltip to inform about the double-click */
.floating-selection-panel .drag-handle::after {
  content: "Double-cliquez pour réinitialiser";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 1001;
  pointer-events: none;
}

.floating-selection-panel .drag-handle:hover::after {
  visibility: visible;
  opacity: 1;
}

.floating-selection-panel .drag-icon {
  font-size: 20px;
  line-height: 1;
}

/* Style for the toggle button */
.toggle-button {
  cursor: pointer;
  font-size: 14px;
  padding: 0 5px;
  -webkit-user-select: none;
  user-select: none;
}

/* Animation during movement */
.floating-selection-panel.dragging {
  opacity: 0.8;
  box-shadow: 0 0 15px rgba(26, 42, 108, 0.5);
}

.floating-instructions {
  color: #666666;
  font-size: 14px;
  margin-bottom: 10px;
  text-align: center;
}

/* Rolled state */
.floating-numbers.collapsed {
  max-height: 0;
  padding: 0 10px;
  overflow: hidden;
}

/* Adding an animation to make the panel visible/invisible as needed */
@media (max-width: 1200px) {
  .floating-selection-panel {
    right: 10px;
    width: 200px;
  }
}

@media (max-width: 768px) {
  .floating-selection-panel {
    width: 180px;
    top: 80px;
    right: 5px;
  }
}

@media (max-width: 480px) {
  .floating-selection-panel {
    width: calc(100% - 20px);
    right: 10px;
    left: 10px;
    top: 60px;
  }
}

/* Disable selection while moving the panel */
body.no-select,
body.no-select * {
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  cursor: move !important;
  /* Stop any ongoing selection */
  -webkit-touch-callout: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

/* Allow selection only for items where it is necessary */
input[type="text"],
input[type="number"],
textarea,
.selectable,
.selectable * {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: auto;
}

/* Disable selection while moving the panel */
body.no-select {
  -webkit-user-select: none;
  user-select: none;

  cursor: move;
}

.number-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

/* Styles for the notification popup */
.notification-popup {
  position: absolute;
  background-color: rgba(51, 51, 51, 0.9);
  color: white;
  padding: 10px 15px;
  border-radius: 5px;
  font-size: 14px;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: opacity 0.3s ease-in-out;
  max-width: 300px;
  text-align: center;
}

.notification-popup.hidden {
  opacity: 0;
  visibility: hidden;
}

.notification-content {
  position: relative;
}

.notification-popup:after {
  content: "";
  position: absolute;
  top: -10px;
  left: 20px;
  border-width: 0 10px 10px;
  border-style: solid;
  border-color: rgba(51, 51, 51, 0.9) transparent;
}

/* Styles for the confirmation popup */
.confirmation-popup {
  position: absolute;
  background-color: white;
  border: 2px solid #003366;
  border-radius: 8px;
  padding: 15px;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: opacity 0.3s ease-in-out;
  max-width: 300px;
  text-align: center;
}

.confirmation-popup.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.confirmation-content p {
  margin: 5px 0;
  color: #333;
}

.confirmation-info {
  font-style: italic;
  color: #666;
  font-size: 0.9em;
}

.confirmation-buttons {
  display: flex;
  justify-content: space-around;
  margin-top: 15px;
}

.confirm-button {
  background-color: #ff6b6b;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
}

.cancel-button {
  background-color: #808080;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
}

.confirm-button:hover {
  background-color: #ff5252;
}

.cancel-button:hover {
  background-color: #707070;
}

/* Styles for actions in the floating panel */
.floating-actions {
  display: flex;
  justify-content: space-between;
  padding: 6px; /* 8px * 0.8 = 6.4px ≈ 6px */
  border-top: 1px solid #c2c8e1;
  background-color: #23272f;
  color: #c2c8e1;
  font-size: 0.76rem; /* 0.95rem * 0.8 = 0.76rem */
  word-break: break-word;
}

.action-button {
  padding: 4px 6px; /* 5px 8px * 0.8 = 4px 6.4px ≈ 4px 6px */
  border: 1px solid #ccc;
  border-radius: 3px; /* 4px * 0.8 = 3.2px ≈ 3px */
  cursor: pointer;
  font-size: 0.64em; /* 0.8em * 0.8 = 0.64em */
  transition: all 0.2s;
  background: linear-gradient(
    135deg,
    rgba(26, 42, 108, 0.9),
    rgba(178, 31, 31, 0.9)
  );
}

.action-button:hover {
  background-color: #f0f0f0;
  border-color: #aaa;
}

.save-button {
  color: #ffffff;
  font-size: 0.64rem; /* 0.8rem * 0.8 = 0.64rem */
  word-break: break-word;
}

.load-button {
  color: #ffffff;
  font-size: 0.8rem;
  word-break: break-word;
}

/* Styles for the list of saved selections */
.selections-list {
  max-height: 350px;
  overflow-y: auto;
  margin: 10px 0 25px 0;
  border-radius: 10px;
  background-color: #f9f9f9;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
  padding: 10px;
  scrollbar-width: thin;
  scrollbar-color: #1a2a6c #f0f0f0;
}

.selections-list::-webkit-scrollbar {
  width: 8px;
}

.selections-list::-webkit-scrollbar-thumb {
  background-color: #1a2a6c;
  border-radius: 4px;
}

.selections-list::-webkit-scrollbar-track {
  background-color: #f0f0f0;
  border-radius: 4px;
}

.selection-item {
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 10px;
  cursor: default;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-left: 4px solid #1a2a6c;
  background-color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.selection-item:hover {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.selection-item:last-child {
  margin-bottom: 0;
}

.selection-info {
  flex: 1;
}

.selection-name {
  font-weight: bold;
  color: #1a2a6c;
  font-size: 1.05rem;
  margin-bottom: 3px;
}

.selection-date {
  color: #6c7a89;
  font-size: 0.8rem;
  margin-bottom: 8px;
}

.selection-numbers {
  margin-top: 5px;
  color: #2c3e50;
  background-color: #f8f9fa;
  padding: 8px 12px;
  border-radius: 6px;
  font-family: "Courier New", monospace;
  font-size: 0.95rem;
  display: inline-block;
}

.selection-actions {
  display: flex;
  gap: 8px;
}

.selection-actions button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #f0f4f8;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #555;
}

.load-btn {
  color: #27ae60 !important;
}

.load-btn:hover {
  background-color: #e3f9ec;
  transform: scale(1.1);
}

.edit-btn {
  color: #3498db !important;
}

.edit-btn:hover {
  background-color: #e3f4fc;
  transform: scale(1.1);
}

.delete-btn {
  color: #e74c3c !important;
}

.delete-btn:hover {
  background-color: #fce3e3;
  transform: scale(1.1);
}

.no-selections {
  text-align: center;
  padding: 20px;
  color: #7f8c8d;
  font-style: italic;
}

/* Styles for the button in edit mode */
.action-button.edit-mode {
  background: linear-gradient(135deg, #f0f4c3, #dcedc8);
  color: #33691e;
  border-color: #8bc34a;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(139, 195, 74, 0.3);
}

.action-button.edit-mode:hover {
  background: linear-gradient(135deg, #dcedc8, #c5e1a5);
  border-color: #689f38;
}

/* Styles for the list of saved selections */
.selections-list {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 15px;
  border: 1px solid #eee;
}

.selection-item {
  padding: 10px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.selection-item:hover {
  background-color: #f9f9f9;
}

.selection-item:last-child {
  border-bottom: none;
}

.selection-name {
  font-weight: bold;
}

.selection-date {
  color: #7f8c8d;
  font-size: 0.8em;
}

.selection-numbers {
  margin-top: 5px;
  color: #2c3e50;
  font-family: monospace;
}

.selection-actions {
  display: flex;
}

.selection-actions button {
  background: none;
  border: none;
  font-size: 1.2em;
  cursor: pointer;
  margin-left: 5px;
}

.load-btn {
  color: #27ae60;
}

.delete-btn {
  color: #e74c3c;
}

/* Styles for numbers in the grid */
.number {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin: 5px;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
  -webkit-user-select: none;
  user-select: none;
}

.number:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Common style for ALL selected numbers */
.number.selected {
  position: relative;
  border: 3px solid #00ccff !important; /* Blue border for ALL numbers, including the red ones */
  box-shadow: 0 0 12px rgba(0, 204, 255, 0.7) !important; /* Blue glow for ALL */
}

/* Add a green checkmark to indicate selection */
.number.selected::after {
  content: "✓";
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: 16px;
  height: 16px;
  background-color: #00cc00;
  color: white;
  border-radius: 50%;
  font-size: 12px;
  line-height: 16px;
  text-align: center;
  font-weight: bold;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

/* Classes for frequencies (colors) - these rules only define the background color */
.number.priority-very-high {
  background-color: #ff4500;
  color: white;
  box-shadow: 0 0 8px rgba(255, 69, 0, 0.6);
  border: 2px solid #ff4500;
}

.number.priority-high {
  background-color: #ff8c00;
  color: white;
  box-shadow: 0 0 6px rgba(255, 140, 0, 0.5);
}

.number.priority-medium {
  background-color: #ffd700;
  color: black;
  box-shadow: 0 0 5px rgba(255, 215, 0, 0.4);
}

.number.priority-low {
  background-color: #98fb98;
  color: black;
}

.number.priority-very-low {
  background-color: #e0ffff;
  color: black;
}

.number.priority-very-high.selected {
  background-color: #ff4500;
  color: white;
}

.number.priority-high.selected {
  background-color: #ff8c00;
  color: white;
}

.number.priority-medium.selected {
  background-color: #ffd700;
  color: black;
}

.number.priority-low.selected {
  background-color: #98fb98;
  color: black;
}

.number.priority-very-low.selected {
  background-color: #e0ffff;
  color: black;
}

/* Improved toast message */
.toast-message {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 15px 20px;
  border-radius: 8px;
  z-index: 3000;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  max-width: 90%;
  width: 400px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  text-align: left;
}

.toast-message.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-message.success {
  background-color: rgba(40, 167, 69, 0.9);
}

.toast-title {
  font-weight: bold;
  margin-bottom: 8px;
  font-size: 1.1em;
}

.toast-content p {
  margin: 5px 0;
  font-size: 0.9em;
  line-height: 1.4;
}

/* Floating action button */
.floating-action-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 12px 20px;
  background-color: #4b6cb7;
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
  z-index: 2000;
}

.floating-action-button:hover {
  background-color: #3b5998;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
}

.floating-action-button.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Styles for confirmation dialogs - Version modernisée */

/* Overlay harmonisé pour toutes les modales principales */
.confirmation-dialog,
.name-dialog,
.custom-dialog,
.popup-modal,
.export-modal {
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.5) 0%,
    rgba(26, 42, 108, 0.3) 100%
  );
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.confirmation-dialog.visible,
.name-dialog.visible,
.custom-dialog.visible,
.popup-modal.visible {
  opacity: 1;
  visibility: visible;
}

.confirmation-dialog-content,
.name-dialog-content,
.dialog-content,
.popup-content {
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(248, 250, 252, 0.9) 50%,
    rgba(226, 232, 240, 0.95) 100%
  );
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 16px;
  padding: 30px;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(26, 42, 108, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transform: translateY(-30px) scale(0.9);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
}

/* Effet de brillance subtle */
.confirmation-dialog-content::before,
.name-dialog-content::before,
.dialog-content::before,
.popup-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.6s ease;
  pointer-events: none;
}

.confirmation-dialog.visible .confirmation-dialog-content,
.name-dialog.visible .name-dialog-content,
.custom-dialog.visible .dialog-content,
.popup-modal.visible .popup-content {
  transform: translateY(0) scale(1);
}

/* Animation de brillance au hover */
.confirmation-dialog-content:hover::before,
.name-dialog-content:hover::before,
.dialog-content:hover::before,
.popup-content:hover::before {
  left: 100%;
}

.confirmation-dialog h4,
.name-dialog h4 {
  margin-top: 0;
  color: #1a2a6c;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 8px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Style pour le paragraphe */
.confirmation-dialog p,
.name-dialog p {
  color: #4a5568;
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 25px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Styles pour les icônes de dialogue */
.dialog-icon {
  font-size: 1.3em;
  margin-right: 8px;
  display: inline-block;
  animation: icon-glow 2s ease-in-out infinite alternate;
}

.dialog-icon.danger-icon {
  animation: danger-icon-pulse 1.5s ease-in-out infinite alternate;
}

.dialog-icon.info-icon {
  animation: info-icon-bounce 2s ease-in-out infinite;
}

@keyframes icon-glow {
  0% {
    text-shadow: 0 0 5px rgba(26, 42, 108, 0.5);
  }
  100% {
    text-shadow: 0 0 8px rgba(26, 42, 108, 0.8);
  }
}

@keyframes danger-icon-pulse {
  0% {
    text-shadow: 0 0 5px rgba(220, 53, 69, 0.5);
    transform: scale(1);
  }
  100% {
    text-shadow: 0 0 10px rgba(220, 53, 69, 0.8);
    transform: scale(1.05);
  }
}

@keyframes info-icon-bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-3px);
  }
  60% {
    transform: translateY(-1px);
  }
}

.confirmation-dialog-buttons,
.name-dialog-buttons {
  display: flex;
  justify-content: flex-end;
  margin-top: 25px;
  gap: 15px;
}

.confirmation-dialog button,
.name-dialog button {
  padding: 12px 24px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Bouton de confirmation (danger) */
.btn-confirm {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.btn-confirm.danger {
  background: linear-gradient(135deg, #dc3545 0%, #b02a37 100%);
  box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
  animation: danger-pulse 2s ease-in-out infinite alternate;
}

@keyframes danger-pulse {
  0% {
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
  }
  100% {
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.5);
  }
}

/* Bouton d'annulation */
.btn-cancel {
  background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

/* Bouton de sauvegarde */
.btn-save {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

/* Effets au hover */
.btn-confirm:hover {
  background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(192, 57, 43, 0.4);
}

.btn-confirm.danger:hover {
  background: linear-gradient(135deg, #b02a37 0%, #91252d 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(176, 42, 55, 0.5);
  animation: none;
}

.btn-cancel:hover {
  background: linear-gradient(135deg, #5a6268 0%, #4e555b 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(108, 117, 125, 0.4);
}

.btn-save:hover {
  background: linear-gradient(135deg, #20c997 0%, #1e7e34 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(40, 167, 69, 0.4);
}

/* Effet de brillance sur les boutons */
.confirmation-dialog button::before,
.name-dialog button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s ease;
  pointer-events: none;
}

.confirmation-dialog button:hover::before,
.name-dialog button:hover::before {
  left: 100%;
}

/* État pressed */
.confirmation-dialog button:active,
.name-dialog button:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

#edit-selection-name {
  width: 100%;
  padding: 10px;
  margin-top: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}

/* Quick actions in the floating panel */
.floating-quick-actions {
  display: flex;
  justify-content: center;
  padding: 4px; /* 5px * 0.8 = 4px */
  border-top: 1px solid #c2c8e1;
}

.quick-action-btn {
  width: 26px; /* 32px * 0.8 = 25.6px ≈ 26px */
  height: 26px; /* 32px * 0.8 = 25.6px ≈ 26px */
  border-radius: 50%;
  background: none;
  border: 1px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 2px; /* 3px * 0.8 = 2.4px ≈ 2px */
  padding: 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-action-btn:hover {
  background-color: #e9ecef;
  transform: scale(1.1);
}

.quick-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.quick-action-btn.active {
  background-color: #e74c3c;
  color: white;
  border-color: #c0392b;
}

.quick-action-btn.active:hover {
  background-color: #c0392b;
}

.action-icon {
  font-style: normal;
  font-size: 16px;
}

/* Badge to indicate available selections */
.selections-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: #e74c3c;
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.action-button {
  position: relative; /* To position the badge */
}

.action-button.has-selections {
  background-color: #f0f9ff;
  border-color: #3498db;
}

/* Styles for the button in edit mode */
.action-button.edit-mode {
  background-color: #f0f4c3;
  color: #7cb342;
  border-color: #7cb342;
  font-weight: bold;
}

.action-button.edit-mode:hover {
  background-color: #dce775;
}

/* Correction of styles for the .hidden class and the popup */
.hidden {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Styles to properly display the source file in the selection list */
.selection-source {
  font-size: 0.8rem;
  color: #607d8b;
  margin-bottom: 5px;
  background-color: #f1f8e9;
  padding: 2px 6px;
  border-radius: 3px;
  display: inline-block;
}

.selection-source span {
  font-weight: bold;
}

/* Styles for the dialog box with choices */
.custom-dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  visibility: visible;
  transition: opacity 0.3s;
}

.custom-dialog.visible {
  opacity: 1;
}

.custom-dialog .dialog-content {
  background-color: white;
  border-radius: 8px;
  padding: 20px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transform: translateY(-20px);
  transition: transform 0.3s;
}

.custom-dialog.visible .dialog-content {
  transform: translateY(0);
}

.dialog-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

/* Improved style for choice buttons */
.choice-button {
  display: block;
  width: 100%;
  text-align: left;
  background: linear-gradient(135deg, #1a2a6c, #003366);
  border: 1px solid #1a2a6c;
  padding: 12px 15px;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 10px;
  transition: all 0.2s ease;
  color: white;
  font-weight: bold;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.choice-button:hover {
  background: linear-gradient(135deg, #2a3a7c, #1a4376);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.choice-description {
  margin: 5px 0 0;
  font-size: 0.9em;
  color: rgba(255, 255, 255, 0.8);
  font-weight: normal;
}

/* Specific style for the cancel button */
.cancel-button {
  background: linear-gradient(135deg, #7f8c8d, #6c7a7d);
  color: white;
  border: 1px solid #7f8c8d;
  text-align: center;
  font-weight: normal;
}

.cancel-button:hover {
  background: linear-gradient(135deg, #95a5a6, #7f8c8d);
}

/* Style for highlighting the recommended option */
.choice-button[data-recommended="true"] {
  background: linear-gradient(135deg, #2980b9, #3498db);
  border: 2px solid #2980b9;
  position: relative;
  overflow: hidden;
}

.choice-button[data-recommended="true"]:hover {
  background: linear-gradient(135deg, #3498db, #41a9e6);
}

.choice-button[data-recommended="true"]::before {
  content: "Recommandé";
  position: absolute;
  top: 5px;
  right: 5px;
  background-color: #f39c12;
  color: white;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.7em;
  font-weight: bold;
}

/* Style for disabled buttons in the dialog box */
.choice-button.disabled {
  background-color: #cccccc;
  color: #888888;
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

.choice-button.disabled:hover {
  background-color: #cccccc;
  transform: none;
  box-shadow: none;
}

/* Improvements for the floating panel */
.floating-selection-panel {
  max-height: 80vh;
  overflow-y: hidden;
}

/* Section titles in the floating panel */
.section-title {
  font-weight: bold;
  color: #c2c8e1;
  font-size: 0.95rem;
  word-break: break-word;
  padding: 8px 10px;
  margin: 0;
  font-size: 14px;
  background-color: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  border-top: 1px solid #e9ecef;
  text-align: left;
  background: #23272f;
  border-color: #323846;
}

/* Separation between sections */
.floating-section {
  margin-bottom: 10px;
  padding-bottom: 5px;
}

/* Styles for the complementary numbers grid */
.complementary-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
  margin: 20px auto;
  width: 95%;
  max-width: 500px;
  box-sizing: border-box;
  justify-content: center;
  padding: 10px;
  background-color: rgba(
    230,
    57,
    70,
    0.05
  ); /* Pale red instead of pale green */
  border-radius: 8px;
  border: 1px solid rgba(230, 57, 70, 0.25);

  /* Style for the complementary numbers in the grid */
  .complementary-ball {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin: 0 auto;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    -webkit-user-select: none;
    user-select: none;
    background: linear-gradient(
      135deg,
      #d62828,
      #e63946
    ); /* Red FDJ instead of green */
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
    border: 2px solid white;
  }

  /* Style for the selected complementary numbers */
  .complementary-ball.selected {
    position: relative;
    border: 3px solid #ffcc00 !important;
    box-shadow: 0 0 12px rgba(255, 204, 0, 0.7) !important;
    transform: scale(1.05);
  }

  /* Check for the selected complementary numbers */
  .complementary-ball.selected::after {
    content: "✓";
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 16px;
    height: 16px;
    background-color: #ffcc00;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    line-height: 16px;
    text-align: center;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  }

  .complementary-numbers-text {
    color: #d62828;
  }

  /* Style for the delete button of additional numbers */
  .clear-complementary-btn {
    background-color: #e63946; /* Red instead of green */
    margin-top: 10px;
  }

  .clear-complementary-btn:hover {
    background-color: #d62828; /* Dark red instead of dark green */
  }

  /* Container for side-by-side graphics */
  .charts-container {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap; /* Autoriser le retour à la ligne pour éviter l'écrasement */
  }

  /* Columns for charts */
  .chart-column {
    flex: 1 1 420px; /* Largeur flexible avec base confortable */
    min-width: 360px; /* Empêcher des colonnes trop étroites */
  }

  /* Smaller graphics when side by side */
  .smaller-chart {
    height: 300px; /* Smaller than the original 400px */
  }

  /* Responsive: switch to one column on mobile */
  @media (max-width: 768px) {
    .charts-container {
      flex-direction: column;
    }

    .smaller-chart {
      height: 350px; /* A little larger on mobile for readability */
    }
  }

  /* Styles for special jackpot and victory notifications */
  .jackpot-notification-popup {
    background: linear-gradient(135deg, #ffd700, #ffa500);
    border: 3px solid #ffd700;
    min-width: 300px;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.7);
    animation: pulse 1.5s infinite alternate;
  }

  .jackpot-notification h2 {
    color: #ff0000;
    font-size: 28px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
  }

  .jackpot-notification p {
    color: #000;
  }

  .confetti-animation {
    font-size: 24px;
    margin: 15px 0;
    animation: bounce 0.8s infinite alternate;
  }

  .winning-notification-popup {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border: 2px solid #4caf50;
  }

  .winning-notification h3 {
    color: #2e7d32;
    font-size: 22px;
    margin-bottom: 10px;
  }

  .winning-notification p {
    color: #333;
    font-size: 16px;
  }

  @keyframes pulse {
    0% {
      box-shadow: 0 2px 6px rgba(245, 87, 108, 0.4);
    }
    to {
      box-shadow: 0 2px 12px rgba(245, 87, 108, 0.6);
    }
  }

  @keyframes bounce {
    0% {
      transform: translateY(0);
    }
    100% {
      transform: translateY(-10px);
    }
  }

  /* Rolled state - modify to preserve titles */
  .floating-numbers.collapsed {
    max-height: 40px; /* Enough height to display the title */
    padding: 5px 10px;
    overflow: hidden;
  }

  /* Styles for the choice dialog box */
  .choice-button {
    display: block;
    width: 100%;
    text-align: left;
    background-color: #f5f8ff;
    border: 1px solid #dbe3ff;
    padding: 12px 15px;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 10px;
    transition: all 0.2s ease;
  }

  .choice-button:hover {
    background-color: #eef2ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  }

  .choice-description {
    margin: 5px 0 0;
    font-size: 0.9em;
    color: #666;
    font-weight: normal;
  }

  .format-warning {
    background-color: #fff3cd;
    color: #856404;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    border-left: 4px solid #ffc107;
  }
}

/* === SECTION UPLOAD MODERNISÉE === */
.upload {
  background: linear-gradient(135deg, #ffffff00 0%, #f8fafc00 100%);
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 25px;
  margin: 0 auto 30px auto;
  max-width: 800px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.upload::before {
  content: "";
  position: absolute;
  top: 0;
  left: 10px;
  right: 10px;
  height: 4px;
  background: linear-gradient(90deg, #1e40af 0%, #f59e0b 50%, #dc2626 100%);
  border-radius: 20px 20px 0 0;
  opacity: 0.9;
  pointer-events: none;
}

.upload h2 {
  color: #ffffff;
  font-size: 1.8rem;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.upload h2::before {
  content: "📊";
}

/* Style pour les fichiers prédéfinis */
.predefined-files {
  border-radius: 16px;
  padding: 20px;
  margin-top: 20px;
  border: 1px solid #e2e8f0;
  max-width: 100%;
}

.predefined-files h3 {
  color: #ffffff;
  font-size: 1.3rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.predefined-files h3::before {
  content: "📋";
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
  margin-top: 16px;
  max-width: 100%;
}

.file-item {
  background: linear-gradient(135deg, #d400ff6e 0%, #1501abbd 100%);
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.file-item:hover {
  background: linear-gradient(135deg, #d400ff1d 0%, #1501ab27 100%);
  border-color: #3b82f6;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
}

.file-icon {
  font-size: 2rem;
  margin-bottom: 10px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.file-name {
  font-weight: 600;
  color: #ffffff;
  font-size: 0.95rem;
  line-height: 1.4;
}

.results::after {
  content: "";
  position: absolute;
  top: 0px;
  left: 6px;
  right: 6px;
  height: 4px;
  background: linear-gradient(90deg, #10b981 0%, #3b82f6 50%, #8b5cf6 100%);
  border-radius: 12px 12px 0 0;
  opacity: 0.9;
  pointer-events: none;
}

/* Éléments enfants avec transparence progressive */
.chart {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.85) 0%,
    rgba(248, 250, 252, 0.8) 100%
  );
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 25px;
  margin: 30px 0;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(226, 232, 240, 0.3);
  position: relative;
  transition: all 0.3s ease;
}

.chart:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

.chart-explanation::before {
  content: "💡";
  position: absolute;
  top: 18px;
  right: 20px;
  font-size: 1.2em;
}

/* === GRAPHIQUES MODERNISÉS === */
.number-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 12px;
  background: linear-gradient(
    135deg,
    rgba(248, 250, 252, 0.75) 0%,
    rgba(241, 245, 249, 0.7) 100%
  );
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 16px;
  padding: 25px;
  margin: 25px 0;
  border: 2px solid #e2e8f0;
}

.complementary-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 12px;
  background: linear-gradient(
    135deg,
    rgba(254, 247, 255, 0.75) 0%,
    rgba(250, 245, 255, 0.7) 100%
  );
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 16px;
  padding: 25px;
  margin: 25px 0;
  border: 2px solid #e879f9;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.generator {
  background: linear-gradient(
    135deg,
    rgba(240, 249, 255, 0.7) 0%,
    rgba(224, 242, 254, 0.65) 100%
  );
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 16px;
  padding: 25px;
  margin: 25px 0;
  border: 2px solid #0ea5e9;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

/* Panneau flottant avec transparence*/
.floating-selection-panel {
  position: fixed;
  top: 200px;
  right: 20px;
  width: 230px;
  background: linear-gradient(135deg, #23272f 0%, #2d3340 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2px solid rgba(26, 42, 108, 0.2);
  border-radius: 6px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
  z-index: 1001;
  transition: all 0.3s ease;
  padding: 0;
  max-height: 56vh;
  overflow-y: hidden;
  cursor: default;
  color: #c2c8e1;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  /* Assure que le panneau reste dans les limites de l'écran */
  max-width: calc(100vw - 40px);
}

.floating-selection-panel.minimized {
  width: 220px;
}

.floating-selection-panel.dragging {
  transition: none !important;
}

/* Styles for the floating panel content */
.floating-header {
  background: linear-gradient(
    135deg,
    rgba(26, 42, 108, 0.9),
    rgba(178, 31, 31, 0.9)
  );
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: white;
  padding: 10px;
  font-weight: bold;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.floating-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: -80%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  filter: blur(4px);
  pointer-events: none;
  transition: left 0.5s cubic-bezier(0.4, 1.6, 0.6, 1);
  z-index: 2;
}

.floating-header:hover::before {
  left: 110%;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.minimize-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  color: white;
}

.minimize-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.minimize-icon {
  font-size: 1.2rem;
  line-height: 1;
}

/* Corps du panneau flottant */
.floating-panel-body {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  max-height: calc(56vh - 60px);
}

/* Styles for the move handle */
.drag-handle {
  cursor: move;
  padding: 0 5px;
  display: flex;
  align-items: center;
}

/* Add a tooltip to inform about the double-click */
.drag-handle::after {
  content: "Double-cliquez pour réinitialiser";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 1001;
  pointer-events: none;
}

.drag-handle:hover::after {
  visibility: visible;
  opacity: 1;
}

.drag-icon {
  font-size: 20px;
  line-height: 1;
}

/* Style for the toggle button */
.toggle-button {
  cursor: pointer;
  font-size: 14px;
  padding: 0 5px;
  -webkit-user-select: none;
  user-select: none;
}

/* Animation during movement */
.floating-selection-panel.dragging {
  opacity: 0.8;
  box-shadow: 0 0 15px rgba(26, 42, 108, 0.5);
}

.floating-numbers {
  padding: 10px;
  min-height: 40px;
  max-height: none;
  overflow-y: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.floating-instructions {
  color: #666666;
  font-size: 14px;
  margin-bottom: 10px;
  text-align: center;
}

/* Rolled state */
.floating-numbers.collapsed {
  max-height: 0;
  padding: 0 10px;
  overflow: hidden;
}

/* Styles pour les boules du floating panel déplacés vers charts-tables.css */

/* Style for the empty message */
.empty-selection-message {
  color: #c2c8e1;
  font-size: 0.95rem;
  word-break: break-word;
  text-align: center;
  padding: 8px;
  font-style: italic;
}

/* Styles for the complementary numbers grid */
.complementary-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
  margin: 20px auto;
  width: 95%;
  max-width: 500px;
  box-sizing: border-box;
  justify-content: center;
  padding: 10px;
  background-color: rgba(
    230,
    57,
    70,
    0.05
  ); /* Pale red instead of pale green */
  border-radius: 8px;
  border: 1px solid rgba(230, 57, 70, 0.25);

  /* Style for the complementary numbers in the grid */
  .complementary-ball {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin: 0 auto;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    -webkit-user-select: none;
    user-select: none;
    background: linear-gradient(
      135deg,
      #d62828,
      #e63946
    ); /* Red FDJ instead of green */
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
    border: 2px solid white;
  }

  /* Style for the selected complementary numbers */
  .complementary-ball.selected {
    position: relative;
    border: 3px solid #ffcc00 !important;
    box-shadow: 0 0 12px rgba(255, 204, 0, 0.7) !important;
    transform: scale(1.05);
  }

  /* Check for the selected complementary numbers */
  .complementary-ball.selected::after {
    content: "✓";
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 16px;
    height: 16px;
    background-color: #ffcc00;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    line-height: 16px;
    text-align: center;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  }

  .complementary-numbers-text {
    color: #d62828;
  }

  /* Style for the delete button of additional numbers */
  .clear-complementary-btn {
    background-color: #e63946; /* Red instead of green */
    margin-top: 10px;
  }

  .clear-complementary-btn:hover {
    background-color: #d62828; /* Dark red instead of dark green */
  }

  /* Container for side-by-side graphics */
  .charts-container {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
  }

  /* Columns for charts */
  .chart-column {
    flex: 1 1 420px;
    min-width: 360px; /* Prevent too-narrow columns */
  }

  /* Smaller graphics when side by side */
  .smaller-chart {
    height: 300px; /* Smaller than the original 400px */
  }

  /* Responsive: switch to one column on mobile */
  @media (max-width: 768px) {
    .charts-container {
      flex-direction: column;
    }

    .smaller-chart {
      height: 350px; /* A little larger on mobile for readability */
    }
  }

  /* Styles for special jackpot and victory notifications */
  .jackpot-notification-popup {
    background: linear-gradient(135deg, #ffd700, #ffa500);
    border: 3px solid #ffd700;
    min-width: 300px;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.7);
    animation: pulse 1.5s infinite alternate;
  }

  .jackpot-notification h2 {
    color: #ff0000;
    font-size: 28px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
  }

  .jackpot-notification p {
    color: #000;
  }

  .confetti-animation {
    font-size: 24px;
    margin: 15px 0;
    animation: bounce 0.8s infinite alternate;
  }

  .winning-notification-popup {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border: 2px solid #4caf50;
  }

  .winning-notification h3 {
    color: #2e7d32;
    font-size: 22px;
    margin-bottom: 10px;
  }

  .winning-notification p {
    color: #333;
    font-size: 16px;
  }

  @keyframes pulse {
    0% {
      box-shadow: 0 2px 6px rgba(245, 87, 108, 0.4);
    }
    to {
      box-shadow: 0 2px 12px rgba(245, 87, 108, 0.6);
    }
  }

  @keyframes bounce {
    0% {
      transform: translateY(0);
    }
    100% {
      transform: translateY(-10px);
    }
  }

  /* Rolled state - modify to preserve titles */
  .floating-numbers.collapsed {
    max-height: 40px; /* Enough height to display the title */
    padding: 5px 10px;
    overflow: hidden;
  }

  /* Style for section titles that remain always visible */
  .section-title,
  .complementary-title {
    font-weight: bold;
    color: #c2c8e1;
    font-size: 0.95rem;
    word-break: break-word;
    padding: 5px 0;
    margin: 0;
    text-align: left;
    position: relative;
    z-index: 2;
  }

  /* Hide everything except the titles when the panel is collapsed */
  .floating-numbers.collapsed .floating-number,
  .floating-numbers.collapsed .complementary-number,
  .floating-numbers.collapsed .empty-selection-message {
    display: none;
  }

  /* Styles pour les choix du dialog box */
  .choice-button {
    display: block;
    width: 100%;
    text-align: left;
    background-color: #f5f8ff;
    border: 1px solid #dbe3ff;
    padding: 12px 15px;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 10px;
    transition: all 0.2s ease;
  }

  .choice-button:hover {
    background-color: #eef2ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  }

  .choice-description {
    margin: 5px 0 0;
    font-size: 0.9em;
    color: #666;
    font-weight: normal;
  }

  .format-warning {
    background-color: #fff3cd;
    color: #856404;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    border-left: 4px solid #ffc107;
  }
}

/* Avatar utilisateur stylé comme une boule (base) */
.user-nav .user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a2a6c 0%, #003366 60%, #3498db 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(26, 42, 108, 0.25),
    0 0 0 2px rgba(52, 152, 219, 0.08),
    inset 0 2px 8px rgba(255, 255, 255, 0.18),
    inset 0 -2px 8px rgba(26, 42, 108, 0.18);
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  cursor: pointer;
  border: 2px solid #3498db;
  transition: box-shadow 0.3s, background 0.3s, border 0.3s;
}

/* Reflet dynamique (bande) */
.user-nav .user-avatar::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.45) 50%,
    transparent 100%
  );
  transition: left 0.5s;
  z-index: 2;
  pointer-events: none;
}

.user-nav .user-avatar:hover::before,
.user-nav .user-avatar.animate-login::before {
  left: 100%;
  transition: left 0.7s cubic-bezier(0.4, 1.6, 0.6, 1);
}

/* Éclat statique */
.user-nav .user-avatar::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 10px;
  width: 60%;
  height: 22%;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.85) 0%,
    rgba(255, 255, 255, 0.15) 100%
  );
  border-radius: 50%;
  filter: blur(1px);
  opacity: 0.7;
  z-index: 1;
  pointer-events: none;
}

/* Hover: ombre et bord renforcés */
.user-nav .user-avatar:hover {
  box-shadow: 0 8px 24px rgba(26, 42, 108, 0.35),
    0 0 0 2px rgba(52, 152, 219, 0.13), 0 0 16px #3498db,
    inset 0 2px 12px rgba(255, 255, 255, 0.22),
    inset 0 -2px 12px rgba(26, 42, 108, 0.22);
  background: linear-gradient(135deg, #003366 0%, #3498db 100%);
  border: 2.5px solid #1a2a6c;
}

/* Animation à la connexion (couvre .animated et .animate-login) */
.user-nav .user-avatar.animated,
.user-nav .user-avatar.animate-login {
  animation: lottoBallSpin 5s cubic-bezier(0.4, 0, 0.6, 1),
    lottoBallGlow 5s ease-in-out;
}

/* 3D Rotation of the Sphere - Continuous and Smooth Animation */
@keyframes lottoBallSpin {
  0% {
    transform: rotateY(0deg) scale(0.7);
    opacity: 0;
  }
  10% {
    transform: rotateY(360deg) scale(1.15);
    opacity: 1;
  }
  20% {
    transform: rotateY(720deg) scale(1.1);
  }
  30% {
    transform: rotateY(1080deg) scale(1.05);
  }
  40% {
    transform: rotateY(1440deg) scale(1.1);
  }
  50% {
    transform: rotateY(1800deg) scale(1.15);
  }
  60% {
    transform: rotateY(2160deg) scale(1.1);
  }
  70% {
    transform: rotateY(2520deg) scale(1.05);
  }
  80% {
    transform: rotateY(2880deg) scale(1.02);
  }
  90% {
    transform: rotateY(3240deg) scale(1.01);
  }
  100% {
    transform: rotateY(3600deg) scale(1);
    opacity: 1;
  }
}

@keyframes lottoBallGlow {
  0% {
    box-shadow: 0 4px 12px rgba(26, 42, 108, 0.25),
      0 0 0 2px rgba(52, 152, 219, 0.08),
      inset 0 2px 8px rgba(255, 255, 255, 0.18),
      inset 0 -2px 8px rgba(26, 42, 108, 0.18);
  }
  10% {
    box-shadow: 0 0 8px #3498db, 0 0 0 2px rgba(52, 152, 219, 0.15),
      0 0 8px #1a2a6c, inset 0 2px 12px rgba(255, 255, 255, 0.2),
      inset 0 -2px 12px rgba(26, 42, 108, 0.2);
  }
  20% {
    box-shadow: 0 0 10px #3498db, 0 0 0 2px rgba(52, 152, 219, 0.2),
      0 0 10px #1a2a6c, inset 0 2px 16px rgba(255, 255, 255, 0.22),
      inset 0 -2px 16px rgba(26, 42, 108, 0.22);
  }
  30% {
    box-shadow: 0 0 12px #3498db, 0 0 0 2px rgba(52, 152, 219, 0.25),
      0 0 12px #1a2a6c, inset 0 2px 20px rgba(255, 255, 255, 0.25),
      inset 0 -2px 20px rgba(26, 42, 108, 0.25);
  }
  40% {
    box-shadow: 0 0 14px #3498db, 0 0 0 2px rgba(52, 152, 219, 0.3),
      0 0 14px #1a2a6c, inset 0 2px 24px rgba(255, 255, 255, 0.28),
      inset 0 -2px 24px rgba(26, 42, 108, 0.28);
  }
  50% {
    box-shadow: 0 0 16px #3498db, 0 0 0 2px rgba(52, 152, 219, 0.35),
      0 0 16px #1a2a6c, inset 0 2px 28px rgba(255, 255, 255, 0.3),
      inset 0 -2px 28px rgba(26, 42, 108, 0.3);
  }
  60% {
    box-shadow: 0 0 14px #3498db, 0 0 0 2px rgba(52, 152, 219, 0.3),
      0 0 14px #1a2a6c, inset 0 2px 24px rgba(255, 255, 255, 0.28),
      inset 0 -2px 24px rgba(26, 42, 108, 0.28);
  }
  70% {
    box-shadow: 0 0 12px #3498db, 0 0 0 2px rgba(52, 152, 219, 0.25),
      0 0 12px #1a2a6c, inset 0 2px 20px rgba(255, 255, 255, 0.25),
      inset 0 -2px 20px rgba(26, 42, 108, 0.25);
  }
  80% {
    box-shadow: 0 0 10px #3498db, 0 0 0 2px rgba(52, 152, 219, 0.2),
      0 0 10px #1a2a6c, inset 0 2px 16px rgba(255, 255, 255, 0.22),
      inset 0 -2px 16px rgba(26, 42, 108, 0.22);
  }
  90% {
    box-shadow: 0 0 8px #3498db, 0 0 0 2px rgba(52, 152, 219, 0.15),
      0 0 8px #1a2a6c, inset 0 2px 12px rgba(255, 255, 255, 0.2),
      inset 0 -2px 12px rgba(26, 42, 108, 0.2);
  }
  100% {
    box-shadow: 0 4px 12px rgba(26, 42, 108, 0.25),
      0 0 0 2px rgba(52, 152, 219, 0.08),
      inset 0 2px 8px rgba(255, 255, 255, 0.18),
      inset 0 -2px 8px rgba(26, 42, 108, 0.18);
  }
}

/* Animation d'apparition */
.user-nav .user-info {
  animation: fadeInRight 0.5s ease-out;
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Style harmonieux pour le nom d'utilisateur connecté */
.user-nav .user-name {
  display: inline-block;
  margin: 0 10px 0 6px;
  padding: 0 10px;
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.02em;
  border-radius: 18px;
  background: linear-gradient(
    90deg,
    rgba(26, 42, 108, 0.7) 0%,
    rgba(52, 152, 219, 0.25) 100%
  );
  box-shadow: 0 2px 8px rgba(26, 42, 108, 0.08);
  line-height: 36px;
  min-width: 60px;
  text-align: center;
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
  vertical-align: middle;
}

.user-nav .user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Badge admin harmonieux */
.user-nav .admin-badge {
  display: inline-block;
  margin-left: 0;
  padding: 0 14px;
  height: 36px;
  line-height: 36px;
  border-radius: 18px;
  background: linear-gradient(90deg, #764ba2 0%, #3498db 100%);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 8px rgba(52, 152, 219, 0.1);
  text-transform: lowercase;
  border: none;
  vertical-align: middle;
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}

/* Responsive for the admin badge */
@media (max-width: 768px) {
  .user-nav .admin-badge {
    font-size: 11px;
    padding: 0 8px;
    height: 24px;
    line-height: 24px;
    border-radius: 12px;
    min-width: 36px;
  }
}

.draglayer .drag {
  fill: #ffffff00 !important;
  stroke: #00000000 !important;
}

/* Responsive: section upload plus étroite sur mobile */
@media (max-width: 768px) {
  main {
    max-width: 100%;
    padding: 1rem;
  }

  .upload {
    max-width: 100%;
    padding: 20px;
    margin: 0 auto 20px auto;
  }

  .file-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .file-item {
    padding: 12px;
  }

  .predefined-files {
    padding: 16px;
    margin-top: 16px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  main {
    max-width: 750px;
  }

  .upload {
    max-width: 700px;
  }
}
