:root {
  --primary: #005CAF;
  --secondary: #28A745;
  --bg-sidebar: #FFFFFF;
  --bg-menu: #F5F5F5;
  --bg-card: #FFFFFF;
  --text: #333333;
}
*, *::before, *::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: var(--text);
  background: var(--bg-card);
}
header {
  color: #fff;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
header a.logout {
  color: #fff;
  text-decoration: none;
}
.container {
  display: flex;
  height: calc(100vh - 56px);
}
.menu {
  width: 200px;
  background: var(--bg-menu);
  border-right:1px solid #ddd;
  padding: 1rem;
}
.menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.menu li {
  margin-bottom: 1rem;
}
.menu a {
  text-decoration:none;
  color: var(--text);
  font-weight: bold;
  cursor: pointer;
}
.menu a.active {
  color: var(--primary);
}
.content {
  flex:1;
  padding: 1rem;
  overflow-y:auto;
}
.view {
  display: none;
}
.view.active {
  display: block;
}
.card {
  background: var(--bg-card);
  padding:1rem;
  margin-bottom:1rem;
  border-radius:4px;
  box-shadow:0 2px 4px rgba(0,0,0,0.05);
}
table {
  width:100%;
  border-collapse:collapse;
  margin-bottom:1rem;
}
th,td {
  padding:0.75rem;
  border-bottom:1px solid #eee;
}
th {
  background: var(--primary);
  color:#fff;
  text-align:left;
}
tr:nth-child(even) {
  background:#FAFAFA;
}
form.inline {
  display: inline-flex;
  gap:0.5rem;
  align-items:center;
}
input,select,button {
  padding:0.5rem;
  border:1px solid #ccc;
  border-radius:4px;
}
button {
  background: var(--secondary);
  color:#fff;
  border:none;
  cursor:pointer;
}

/* Emoji Picker Styles */
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.emoji-item {
  cursor: pointer;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  text-align: center;
  font-size: 1.5rem;
  transition: all 0.2s;
}
.emoji-item.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}


/* Ajustement initial de la marge pour éviter chevauchement */
.content {
  margin-left: 60px;
}

/* Déplacement sur hover pour correspondre à la largeur */
.sidebar:hover ~ .content {
  margin-left: 200px;
}


/* Layout pour la liste des projets et le contenu dynamique */
.content-layout {
  display: flex;
}
.projects-col {
  flex: 1;
  border-right: 1px solid #ddd;
  padding: 1rem;
  overflow-y: auto;
}
.content-layout > main.content {
  flex: 3;
  padding: 1rem;
  overflow-y: auto;
}


/* Décalage pour la nouvelle layout */
.page-wrapper .content-layout {
  margin-left: 60px;
  transition: margin-left 0.2s ease;
}
.sidebar:hover ~ .page-wrapper .content-layout {
  margin-left: 200px;
}

/* Positionnement du bouton Créer un projet en bas de la colonne */
.projects-col {
  position: relative;
}
.create-project-btn {
  position: absolute;
  bottom: 1rem;
  width: calc(100% - 2rem);
  text-align: center;
}
.create-project-btn .save-btn {
  width: 100%;
}

/* ----------------------------- */
/* Style pour la liste des projets */
/* ----------------------------- */
.projects-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.projects-list li {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e0e0e0;
  cursor: pointer;
  transition: background 0.2s ease;
}
.projects-list li:last-child {
  border-bottom: none;
}
.projects-list li:hover {
  background: #f9f9f9;
}
.projects-list li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  color: inherit;
}
.projects-list li a .project-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 0.5rem;
}
.projects-list li a .project-timestamp {
  font-size: 0.875rem;
  color: #888;
}
/* Si vous avez un badge de statut ou une icône à droite : */
.projects-list li a .project-badge {
  margin-left: auto;
  font-size: 0.875rem;
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
  background: #eee;
  color: #555;
}

/* Adresse sous le nom du projet */
.project-address {
  display: block;
  font-size: 0.75rem;
  color: #888;
  margin-top: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Meta info under project name: label and truncated address */
.project-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #888;
  margin-top: 0.25rem;
  width: 100%;
}
.meta-label {
  flex: 0 0 auto;
  margin-right: 0.5rem;
}
.meta-value {
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}

/* Forcer le nom du projet en block afin de faire apparaître la meta sur une ligne en dessous */
.projects-list li a .project-name {
  display: block;
}

/* Force two-line layout: header and meta under */
.projects-list li a {
  display: block;
}
.project-header {
  display: flex;
  align-items: center;
  font-size: 1rem;
}
.project-header .project-emoji {
  margin-right: 0.5rem;
}
.project-header .project-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #888;
  margin-top: 0.25rem;
}
.meta-label {
  flex: 0 0 auto;
  margin-right: 0.5rem;
}
.meta-value {
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}


/* Ensure Google Places autocomplete dropdown appears above other elements */
.pac-container {
  z-index: 3000 !important;
}

/* Sidebar bottom icons */
.menu.sidebar { display: flex; flex-direction: column; height: 100%; }
.menu.sidebar ul:first-child { flex: 1; }
.menu.sidebar .bottom-menu { margin: 0; list-style: none; padding: 0 1rem 1rem; }
.menu.sidebar .bottom-menu .menu-item { display: flex; align-items: center; padding: 0.5rem 0; }
