:root {
  --bg: #0f172a;
  --card: #111827;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.15);
  --text: #f1f5f9;
  --muted: #cbd5e1;
  --danger: #f97373;
}

* {
  box-sizing: border-box;
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
}

body {
  margin: 0;
  background: radial-gradient(circle at top, #1f2937 0, #020617 55%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 16px;
  padding-bottom: 100px; /* Espace pour le footer fixe */
}

.app {
  width: 100%;
  max-width: 900px;
  background: linear-gradient(
    145deg,
    rgba(15, 23, 42, 0.96),
    rgba(15, 23, 42, 0.98)
  );
  border-radius: 18px;
  padding: 16px 16px 24px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

header {
  margin-bottom: 12px;
}

.title {
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent);
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.subtitle {
  font-size: 0.8rem;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 768px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

.card {
  background: radial-gradient(
    circle at top left,
    rgba(15, 23, 42, 0.9),
    rgba(15, 23, 42, 1)
  );
  border-radius: 14px;
  padding: 12px;
  border: 1px solid rgba(31, 41, 55, 0.9);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

label {
  font-size: 0.75rem;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
}

input,
textarea,
select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  padding: 8px 9px;
  font-size: 0.85rem;
  transition: border-color 0.2s;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
}

textarea {
  min-height: 60px;
  resize: vertical;
}

.row {
  display: flex;
  gap: 8px;
}

.row > div {
  flex: 1;
}

.btn {
  border-radius: 999px;
  border: none;
  padding: 8px 14px;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  color: #0b1120;
  font-weight: 600;
}

.btn-primary:hover {
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.4);
}

.btn-ghost {
  background: rgba(15, 23, 42, 0.9);
  color: var(--muted);
  border: 1px solid rgba(55, 65, 81, 0.9);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-small {
  padding: 4px 9px;
  font-size: 0.75rem;
}

.pill-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pill {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(75, 85, 99, 0.9);
  color: var(--muted);
  cursor: pointer;
  background: transparent;
  transition: all 0.2s;
}

.pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pill.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.tasks-list {
  max-height: 360px;
  overflow-y: auto;
}

.task {
  border-radius: 12px;
  padding: 8px 9px;
  margin-bottom: 6px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(31, 41, 55, 0.9);
  transition: border-color 0.2s;
}

.task:hover {
  border-color: rgba(56, 189, 248, 0.5);
}

.task-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
}

.task-meta {
  font-size: 0.7rem;
  color: var(--muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.priority-badge {
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 0.7rem;
  border: 1px solid transparent;
}

.priority-high {
  background: rgba(248, 113, 113, 0.15);
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.4);
}

.priority-normal {
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.4);
}

.priority-low {
  background: rgba(74, 222, 128, 0.15);
  color: #86efac;
  border-color: rgba(74, 222, 128, 0.4);
}

/* ⭐ BOUTONS D'ACTION DES TÂCHES */
.task-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.task-actions button {
  padding: 5px 10px;
  font-size: 0.7rem;
  border-radius: 6px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.8);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.task-actions button:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.task-actions button:active {
  transform: translateY(0);
}

/* Bouton Export PDF */
.btn-export {
  width: 100%;
  padding: 10px 16px;
  margin-top: 12px;
  margin-bottom: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, 0.4);
  background: linear-gradient(
    135deg,
    rgba(56, 189, 248, 0.15),
    rgba(14, 165, 233, 0.15)
  );
  color: var(--accent);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-export:hover {
  background: linear-gradient(
    135deg,
    rgba(56, 189, 248, 0.25),
    rgba(14, 165, 233, 0.25)
  );
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

.btn-export:active {
  transform: translateY(0);
}

/* Responsive pour mobile */
@media (max-width: 480px) {
  .task-actions {
    gap: 4px;
  }

  .task-actions button {
    padding: 4px 8px;
    font-size: 0.65rem;
  }

  .btn-export {
    padding: 8px 12px;
    font-size: 0.75rem;
  }
}

/* ⭐ MAP */
#mapModal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

#mapContainer {
  width: 90%;
  height: 70%;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

#map {
  width: 100%;
  height: 100%;
}

.close-map-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 6px 10px;
  border: none;
  background: #000;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  z-index: 99999;
  font-weight: 600;
}

/* ⭐ FOOTER MODERNE - FIXE EN BAS */
.app-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.95) 0%,
    rgba(15, 23, 42, 0.98) 100%
  );
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(56, 189, 248, 0.2);
  padding: 12px 20px;
  z-index: 1000;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-logo {
  font-size: 1.8rem;
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.4));
}

.footer-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.footer-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.3px;
}

.footer-subtitle {
  font-size: 0.65rem;
  color: var(--muted);
  font-weight: 400;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-link-btn {
  background: linear-gradient(
    135deg,
    rgba(56, 189, 248, 0.15),
    rgba(14, 165, 233, 0.15)
  );
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--accent);
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-link-btn:hover {
  background: linear-gradient(
    135deg,
    rgba(56, 189, 248, 0.25),
    rgba(14, 165, 233, 0.25)
  );
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

.footer-icon {
  font-size: 1rem;
}

.footer-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: 999px;
  font-size: 0.7rem;
  color: #86efac;
}

.badge-icon {
  font-size: 0.9rem;
}

/* ⭐ MODALE LICENCE 2025-2026 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.show {
  display: flex;
  opacity: 1;
}

.modal-container {
  background: linear-gradient(
    145deg,
    rgba(17, 24, 39, 0.98) 0%,
    rgba(15, 23, 42, 0.98) 100%
  );
  border-radius: 24px;
  max-width: 700px;
  width: 100%;
  max-height: 85vh;
  overflow: hidden;
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(56, 189, 248, 0.2);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.show .modal-container {
  transform: scale(1) translateY(0);
}

.modal-header {
  background: linear-gradient(
    135deg,
    rgba(56, 189, 248, 0.15),
    rgba(14, 165, 233, 0.1)
  );
  padding: 24px 28px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close-btn {
  background: rgba(248, 113, 113, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: #fecaca;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.4rem;
  font-weight: 300;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.modal-close-btn:hover {
  background: rgba(248, 113, 113, 0.25);
  border-color: #f87171;
  transform: rotate(90deg);
}

.modal-body {
  padding: 28px;
  overflow-y: auto;
  max-height: calc(85vh - 180px);
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--muted);
}

.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.3);
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.5);
}

.license-section {
  margin-bottom: 24px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 12px;
  border-left: 3px solid rgba(56, 189, 248, 0.4);
}

.license-section h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.license-section p {
  margin: 8px 0;
  font-size: 0.8rem;
}

.license-section strong {
  color: var(--text);
  font-weight: 600;
}

.license-section ul {
  margin: 8px 0;
  padding-left: 20px;
}

.license-section li {
  margin: 6px 0;
  font-size: 0.75rem;
}

.license-footer {
  margin-top: 24px;
  padding: 16px;
  background: rgba(56, 189, 248, 0.08);
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.license-footer p {
  margin: 6px 0;
  font-size: 0.75rem;
  color: var(--text);
}

.modal-actions {
  padding: 20px 28px;
  background: rgba(15, 23, 42, 0.8);
  border-top: 1px solid rgba(56, 189, 248, 0.2);
  display: flex;
  justify-content: center;
}

.btn-accept {
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  color: #0b1120;
  border: none;
  padding: 12px 32px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

.btn-accept:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.5);
}

/* RESPONSIVE MOBILE & TABLETTE */
@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }

  .footer-brand {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }

  .footer-link-btn {
    width: 100%;
    justify-content: center;
  }

  .modal-container {
    max-height: 90vh;
    margin: 10px;
  }

  .modal-header {
    padding: 20px;
  }

  .modal-header h2 {
    font-size: 1.1rem;
  }

  .modal-body {
    padding: 20px;
    font-size: 0.75rem;
    max-height: calc(90vh - 160px);
  }

  .license-section h3 {
    font-size: 0.85rem;
  }

  .license-section p,
  .license-section li {
    font-size: 0.7rem;
  }
}
/* ⭐ OPTIMISATION FOOTER MOBILE — VERSION ULTRA COMPACTE */
@media (max-width: 480px) {
  /* Footer minimal sur mobile */
  .app-footer {
    padding: 4px 8px !important;
  }

  .footer-content {
    gap: 4px !important;
    flex-direction: row !important;
    justify-content: flex-end !important;
  }

  /* Masquer complètement la partie brand (logo + textes) */
  .footer-brand {
    display: none !important;
  }

  /* Masquer complètement le badge "100% Local & Privé" sur mobile */
  .footer-badge {
    display: none !important;
  }

  .footer-links {
    flex-direction: row !important;
    gap: 4px !important;
    width: auto !important;
  }

  /* LICENCE : Simple petite icône cliquable */
  .footer-link-btn {
    background: transparent !important;
    border: none !important;
    padding: 2px !important;
    font-size: 0.75rem !important;
    opacity: 0.4 !important;
    color: var(--muted) !important;
    box-shadow: none !important;
  }

  .footer-link-btn:hover {
    opacity: 0.7 !important;
    transform: none !important;
    background: transparent !important;
  }

  /* Masquer le texte "Licence & Conditions", garder juste l'icône */
  .footer-link-btn span:not(.footer-icon) {
    display: none !important;
  }

  /* Réduire l'espace sous le contenu */
  body {
    padding-bottom: 35px !important;
  }
}

/* ⭐ Correction de la hauteur de la liste sur mobile */
@media (max-width: 480px) {
  .tasks-list {
    max-height: none !important;
    height: auto !important;
  }
}

/* ⭐ Footer rétractable */
.app-footer {
  transition: transform 0.3s ease;
}

.app-footer.hide-footer {
  transform: translateY(100%);
}
#openLicenseBtn {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 6px;
  opacity: 0.85;
}

#openLicenseBtn:hover {
  opacity: 1;
}

/* ⭐ Couleurs fixes par type de bouton */

/* Modifier */
.btn-edit {
  border-color: rgba(251, 191, 36, 0.4);
  color: #fbbf24;
}
.btn-edit:hover {
  background: rgba(251, 191, 36, 0.15);
  border-color: #fbbf24;
}

/* Carte */
.btn-map {
  border-color: rgba(236, 72, 153, 0.4);
  color: #ec4899;
}
.btn-map:hover {
  background: rgba(236, 72, 153, 0.15);
  border-color: #ec4899;
}

/* GPS */
.btn-gps {
  border-color: rgba(168, 85, 247, 0.4);
  color: #a855f7;
}
.btn-gps:hover {
  background: rgba(168, 85, 247, 0.15);
  border-color: #a855f7;
}

/* Terminer */
.btn-done {
  border-color: rgba(74, 222, 128, 0.4);
  color: #4ade80;
}
.btn-done:hover {
  background: rgba(74, 222, 128, 0.15);
  border-color: #4ade80;
}

/* Supprimer */
.btn-delete {
  border-color: rgba(248, 113, 113, 0.4);
  color: #f87171;
}
.btn-delete:hover {
  background: rgba(248, 113, 113, 0.15);
  border-color: #f87171;
}
