body {
  background-color: #f9f9f9;
  font-family: 'Roboto', sans-serif;
  
  text-align: center;
  transition: background 0.3s ease;
}

#authStatusIcon {
  position: fixed;
  top: 6px;
  left: 8px;
  font-size: clamp(12px, 4vw, 32px);
  color: rgba(128, 128, 128, 0.7);
  /* medium gray, 70% opacity */
  z-index: 9999;
  pointer-events: auto;
  /* ✅ allow hover and click */
  cursor: pointer;
  /* show clickable cursor */
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  
  10% {
    opacity: 1;
    transform: translateY(0);
  }
  
  90% {
    opacity: 1;
    transform: translateY(0);
  }
  
  100% {
    opacity: 0;
    transform: translateY(-10px);
  }
}

.container {
  max-width: 90%;
  margin: auto;
  padding: 20px;
  background: white;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  border-radius: 12px;
}

.editmode .favorite-toggle {
  display: none !important;
}

.emoji-display {
  font-size: 1.6rem;
  font-weight: bold;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  min-width: 32px;
  max-width: 38px;
  max-height: 38px;
  line-height: 1.3;
  margin-bottom: 2px;
  color: #8678cc;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  overflow: visible;
}

.emoji-display:not([onclick]) {
  cursor: default;
}

.emoji-display:hover {
  transform: scale(1.3);
}

@keyframes subtle-shake {
  0% {
    transform: translateX(-0.4px) rotate(-0.4deg);
  }
  
  25% {
    transform: translateX(0.4px) rotate(0.4deg);
  }
  
  50% {
    transform: translateX(-0.4px) rotate(-0.4deg);
  }
  
  75% {
    transform: translateX(0.4px) rotate(0.4deg);
  }
  
  100% {
    transform: translateX(-0.4px) rotate(-0.4deg);
  }
}

.shortcut.editmode {
  animation: subtle-shake 0.8s infinite ease-in-out;
}

/* Modal Overlay */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 3000;
  align-items: center;
  justify-content: center;
}

/* Modal Content Box */
.modal-content.export-modal {
  background: white;
  padding: 24px 32px;
  border-radius: 14px;
  max-width: 95%;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  font-family: sans-serif;
}

.modal-content.export-modal h3 {
  margin-top: 0;
  font-size: 20px;
  color: #333;
}

.modal-content.export-modal p {
  margin: 8px 0 20px;
  font-size: 15px;
  color: #444;
}

/* Button Container */
.export-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* Format Buttons */
.export-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: bold;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.export-btn:hover {
  transform: scale(1.03);
  opacity: 0.9;
}

/* Individual Button Colors */
.export-btn.txt {
  background-color: #4CAF50;
  color: white;
}

.export-btn.lst {
  background-color: #2196F3;
  color: white;
}

.export-btn.both {
  background-color: #FF9800;
  color: white;
}

/* Cancel Button */
.cancel-btn {
  margin-top: 20px;
  background: none;
  border: none;
  color: #666;
  font-size: 13px;
  cursor: pointer;
}

/* Utility to show the modal */
.modal-overlay.show {
  display: flex;
}

.shortcut-feedback {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #2196F3, #1565C0);
  color: white;
  border-radius: 8px;
  font-weight: bold;
  font-size: 25px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  opacity: 1;
  transition: opacity 0.5s ease-out, transform 0.3s ease-out;
  transform: translateY(0);
}

.shortcut-feedback.fade-out {
  opacity: 0;
  transform: translateY(-10px);
}

.form-label {
  font-size: 14px;
  color: #025ba8;
  display: block;
  text-align: left;
  font-weight: bold;
}

#tagFilters {
  transition: max-height 0.3s ease, opacity 0.3s ease;
  overflow: hidden;
  max-height: 500px;
  /* valeur max raisonnable */
  opacity: 1;
}

#tagFilters.hidden {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

.filter-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #025ba8;
}

.filter-toggle input[type="checkbox"] {
  transform: scale(1.2);
  cursor: pointer;
}

#titleLockBtn:hover {
  color: #333;
}

#titleLockBtn:focus {
  outline: 2px solid #555;
  outline-offset: 2px;
}

.app-title {
  font-size: 1.9em;
  font-weight: 600;
  color: #f0f0f0;
  text-shadow: 1px 1px 2px #000;
}

.app-title[contenteditable="true"] {
  border-bottom: 2px solid #007bff;
  padding-bottom: 2px;
  outline: none;
}

#backToTopBtn {
  all: unset;
  /* ← this removes all default styles */
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.35);
  color: grey;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: opacity 0.3s ease, background-color 0.3s ease, transform 0.2s ease;
  z-index: 999;
}

#backToTopBtn:hover {
  background-color: rgba(0, 0, 0, 0.4);
  transform: scale(1.05);
}

#backToTopBtn.show {
  opacity: 1;
  pointer-events: auto;
}

.left-button {
  background: transparent;
  font-size: 1.5em;
  color: #777;
  padding: 4px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.left-button:hover {
  background: transparent;
  color: #000;
}

@keyframes holdPopEffect {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(0, 123, 255, 0.0);
  }
  
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 123, 255, 0.4);
  }
  
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(0, 123, 255, 0.0);
  }
}

.hold-pop {
  animation: holdPopEffect 1s ease-in-out;
  border-radius: 8px;
  z-index: 1;
  position: relative;
}

#clearSearchBtn:hover {
  color: #e53935;
}

#searchToggleBtn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.7em;
  color: #eee;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#searchToggleBtn:hover {
  color: #000;
}

.status-dot.modifie {
  color: red;
}

.status-dot.non-modifie {
  color: green;
}

#copyToast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #28a745;
  color: white;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 25px;
  font-weight: bold;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 9999;
}

#copyToast.show {
  opacity: 1;
}

.status-bar {
  display: flex;
  justify-content: center;
  gap: 10px;
  font-size: 10px;
  color: #888;
  margin-top: 12px;
}

#buttonGroupWrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  overflow: hidden;
}

#buttonGroupWrapper.hidden {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

#buttonGroupWrapper.visible {
  max-height: 250px;
  /* adjust height as needed */
  opacity: 1;
  pointer-events: auto;
}

.labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.labels h2 {
  margin: 0 auto;
  font-size: clamp(36px, 5vw, 100px);
  font-weight: 600;
  text-align: center;
  color: #8678CC;
  letter-spacing: 0.7px;
  line-height: 1.2;
  position: relative;
  width: fit-content;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.button-group {
  margin-top: 20px;
  background: rgba(240, 240, 240, 0.8);
  /* Same subtle background */
  border-radius: 10px;
  padding: 10px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: background 0.3s ease;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  align-items: center;
}

button {
  padding: 6px 10px;
  font-size: 24px;
  border: none;
  background: linear-gradient(45deg, #007bff, #00c6ff);
  color: white;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.2s ease-in-out;
}

button:hover {
  transform: scale(1.1);
  background: linear-gradient(45deg, #0056b3, #0091d1);
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 26px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

.shortcut.dragging {
  opacity: 0.5;
}

input:checked+.slider {
  background-color: #007bff;
}

input:checked+.slider:before {
  transform: translateX(22px);
}

#addSection {
  display: none;
  margin-top: 20px;
  padding: 15px;
  border-top: 2px solid #ddd;
}

input[type="text"] {
  width: 90%;
  padding: 12px;
  margin: 8px 0;
  border-radius: 8px;
  border: 1px solid #ccc;
}

.shortcut.compact {
  /* Layout */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* Sizing & spacing */
  padding: 12px;
  min-height: 120px;
  text-align: center;
  /* Font */
  font-size: 1.5em;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #111;
  /* Text effect */
  text-shadow:
    1px 1px 2px rgba(0, 0, 0, 0.12),
    0 0 1px rgba(255, 255, 255, 0.8);
  /* Background & border */
  background:
    linear-gradient(135deg, #f5f5f5 20%, #dcdcdc 90%),
    radial-gradient(circle at top right, rgba(120, 120, 120, 0.3), transparent 50%);
  /* Box shadow */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 6px 10px rgba(0, 0, 0, 0.1);
  /* Hover & click interaction */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  transform: perspective(600px) translateZ(0);
}

/* Hide extras in compact mode */
.shortcut.compact .info,
.shortcut.compact .tags,
.shortcut.compact .icons,
.shortcut.compact .move-handle {
  display: none !important;
}

.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 5px;
  margin-top: 10px;
}

.shortcut {
  background:
    linear-gradient(135deg, #f5f7fa 0%, #e8ecf3 100%),
    radial-gradient(circle at top right, rgba(180, 160, 255, 0.12), transparent 60%);
  color: #2a2a2a;
  font-size: 1.1em;
  font-weight: 500;
  border: 1px solid #d0d0d0;
  border-radius: 10px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 4px 6px rgba(0, 0, 0, 0.1),
    0 6px 12px rgba(0, 0, 0, 0.08);
  padding: 12px 16px;
  margin: 6px;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: row;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  transform: perspective(600px) translateZ(0);
}

.shortcut:active {
  transform: perspective(600px) translateZ(1px);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.1),
    0 2px 4px rgba(0, 0, 0, 0.1);
}

.info {
  font-size: 0.75em;
  color: #999;
  /* soft gray */
  margin-top: 2px;
  font-style: normal;
  font-weight: normal;
  user-select: text;
  /* allow selecting/copying */
  line-height: 1.2;
}

.shortcut:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
  /* deeper shadow on hover */
}

.shortcut.drag-over {
  border: 2px dashed #007bff;
  background: #f0f8ff;
  /* subtle highlight for drop target */
}

#sortButton {
  transition: background-color 0.2s ease, color 0.2s ease;
}

#sortButton:not(.active) i.fas {
  color: gray !important;
}

#sortButton.active i.fas {
  color: #007bff !important;
}

.tags {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag {
  background-color: #007bff;
  color: white;
  padding: 2px 4px;
  /* ↑ more vertical padding */
  border-radius: 4px;
  font-size: 12px;
  /* slightly larger for emoji */
  font-weight: bold;
  line-height: 1.2;
  /* ensures taller line box */
  display: inline-flex;
  /* aligns emoji/text better */
  align-items: center;
  /* vertical center alignment */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.tag-filter-container {
  margin: 15px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  border-radius: 10px;
  padding: 10px;
  transition: background 0.3s ease;
}

.tag-filter {
  background-color: #e0e0e0;
  padding: 4px 8px;
  /* ↑ more vertical space */
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.25s ease, transform 0.2s ease;
  font-size: 14px;
  font-weight: normal;
  color: #aaa;
  text-shadow: none;
  display: inline-flex;
  /* ensures emoji aligns well */
  align-items: center;
  line-height: 1.25;
}

.tag-filter:hover {
  background-color: #d5d5d5;
  transform: scale(1.05);
}

/* --- Active AND Mode --- */
.tag-filter.and-mode.active {
  background-color: #28a745 !important;
  /* Green */
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  font-weight: bold;
}

/* --- Active OR Mode --- */
.tag-filter.or-mode.active {
  background-color: #007bff !important;
  /* Blue */
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  font-weight: bold;
}

/* --- Hover while active --- */
.tag-filter.and-mode.active:hover {
  background-color: #1c7c35 !important;
  /* Darker green */
}

.tag-filter.or-mode.active:hover {
  background-color: #0056b3 !important;
  /* Darker blue */
}

.icons {
  display: flex;
  gap: 5px;
}

.icon {
  margin-left: 5px;
  font-size: 18px;
  cursor: pointer;
  transition: transform 0.3s ease, color 0.3s ease;
}

.icon:hover {
  transform: scale(1.2);
  color: #ff5722;
}

.move-handle {
  padding-right: 10px;
  font-size: 20px;
  color: #333;
}

.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="small"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="small"]::before {
  content: 'Petit';
}

.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="large"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="large"]::before {
  content: 'Grand';
}

.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="huge"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="huge"]::before {
  content: 'Énorme';
}

.ql-snow .ql-picker.ql-color .ql-picker-item[data-value=""]::before,
.ql-snow .ql-picker.ql-background .ql-picker-item[data-value=""]::before {
  content: 'Défaut';
}

/* Define the actual font sizes */
.ql-size-small {
  font-size: 0.75em;
}

.ql-size-large {
  font-size: 1.5em;
}

.ql-size-huge {
  font-size: 2.5em;
}

.ql-align-center {
  text-align: center;
}

.ql-align-right {
  text-align: right;
}

.ql-align-justify {
  text-align: justify;
}

.info-modal-content {
  background: #fff;
  color: #222;
  padding: 30px;
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  position: relative;
  font-family: 'Segoe UI', sans-serif;
  animation: fadeIn 0.3s ease-in-out;
}

.info-modal-content h2 {
  font-size: 22px;
  margin-bottom: 20px;
  color: #2c3e50;
  text-align: center;
}

.info-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.info-modal-content h3 {
  font-size: 18px;
  margin-bottom: 10px;
  color: #34495e;
  text-align: left;
}

.info-modal-content ul {
  list-style: none;
  padding-left: 0;
  margin: 10px;
}

.info-modal-content li {
  margin-bottom: 8px;
  font-size: 14px;
  text-align: left;
}

.close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 20px;
  color: #888;
  cursor: pointer;
}

.close-btn:hover {
  color: #333;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.hidden {
  display: none !important;
}

.link-with-copy {
  position: relative;
}

.copy-icon {
  margin-left: 6px;
  cursor: pointer;
  font-size: 1em;
  opacity: 0;
  transition: opacity 0.2s;
}

.link-with-copy:hover .copy-icon {
  opacity: 1;
}