:root {
  --bg: #fafafa;
  --fg: #111;
  --muted: #9aa0a6;
  --accent: #2563eb;
  --grid: #e5e7eb;
  --grid-strong: #cfd3d7;
  --track-bg: #ffffff;
  --event-fg: #ffffff;
  --warning: #ef4444;
  --handle: #1118;
}

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: Inter, system-ui, Segoe UI, Roboto, Arial, sans-serif;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Affichage de la date et de l'heure */
.date-time-display {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 15;
  pointer-events: none;
  margin-top: 20px; /* Espacement du haut */
}
 
.current-date {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.current-time {
  font-size: 4rem;
  font-weight: 300;
  color: var(--fg);
  letter-spacing: -0.02em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  line-height: 1;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--grid);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}

.toolbar .title {
  font-weight: 600;
  margin-right: auto;
}

.toolbar button {
  border: 1px solid var(--grid);
  background: #fff;
  border-radius: 999px;
  padding: .5rem .9rem;
  cursor: pointer;
}

.toolbar button:hover {
  border-color: #bbb;
  background: #f6f7f8;
}

.toolbar input[type="range"] {
  width: 240px;
}

.zoom-indicator {
  font-size: .85rem;
  color: var(--muted);
  background: #f6f7f8;
  padding: .4rem .8rem;
  border-radius: 999px;
  border: 1px solid var(--grid);
  min-width: 60px;
  text-align: center;
}

.viewport {
  position: relative;
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

canvas {
  display: block;
  width: 1600px;
  height: 1000px; /* Hauteur fixe de 1000px */
  margin: 0 auto;
}

.legend {
  font-size: .85rem;
  color: var(--muted);
}

.tooltip {
  position: fixed;
  pointer-events: none;
  background: #111;
  color: #fff;
  border-radius: .5rem;
  padding: .4rem .6rem;
  font-size: .8rem;
  box-shadow: 0 6px 18px #0003;
  z-index: 20;
  white-space: nowrap;
}

/* Styles pour le champ de saisie de tâches */
.task-input-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
}

.task-input-wrapper {
  display: flex;
  align-items: center;
  background: #fff;
  border: 2px solid var(--grid);
  border-radius: 25px;
  padding: 8px 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  min-width: 300px;
  max-width: 500px;
  transition: all 0.2s ease;
}

.task-input-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

#taskInput {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  padding: 8px 12px;
  color: var(--fg);
}

#taskInput::placeholder {
  color: var(--muted);
}

#addTaskBtn {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  transition: all 0.2s ease;
  margin-left: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 36px;
}

/* Mode "Revenir à maintenant" - bouton centré et pleine largeur */
#addTaskBtn[data-mode="now"] {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  margin-left: 0;
  justify-content: center;
  min-width: unset;
}

#addTaskBtn:hover {
  background: #1d4ed8;
  transform: scale(1.05);
}

#addTaskBtn:active {
  transform: scale(0.95);
}

/* Menu de navigation */
.nav-menu {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
}

.nav-toggle {
  width: 50px;
  height: 50px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: white;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transition: all 0.2s ease;
}

.nav-toggle:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.nav-toggle:active {
  transform: translateY(0);
}

.nav-dropdown {
  position: absolute;
  top: 60px;
  left: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 8px;
  min-width: 180px;
  border: 1px solid var(--grid-strong);
}

.nav-item {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
  font-size: 14px;
  color: var(--fg);
  transition: all 0.2s ease;
}

.nav-item:hover {
  background: var(--bg);
  color: var(--accent);
}

/* Panneau de paramètres */
.settings-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  z-index: 2000;
  min-width: 400px;
  max-width: 500px;
  max-height: 80vh;
  overflow: hidden;
  border: 1px solid var(--grid-strong);
  opacity: 0;
  transition: all 0.2s ease;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--grid);
  background: var(--bg);
}

.settings-header h3 {
  margin: 0;
  font-size: 18px;
  color: var(--fg);
}

.close-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  font-size: 20px;
  cursor: pointer;
  border-radius: 8px;
  color: var(--muted);
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: var(--grid);
  color: var(--fg);
}

.settings-content {
  padding: 24px;
  max-height: 60vh;
  overflow-y: auto;
}

.settings-section {
  margin-bottom: 24px;
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-section h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.settings-btn {
  display: block;
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 8px;
  border: 1px solid var(--grid-strong);
  border-radius: 8px;
  background: white;
  color: var(--fg);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.settings-btn:hover {
  background: var(--bg);
  border-color: var(--accent);
  color: var(--accent);
}

.settings-btn.danger {
  color: var(--warning);
  border-color: var(--warning);
}

.settings-btn.danger:hover {
  background: #fef2f2;
  border-color: #dc2626;
}

.settings-btn:last-child {
  margin-bottom: 0;
}

/* Overlay pour le panneau de paramètres */
.settings-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1500;
  backdrop-filter: blur(4px);
}


