/* ============================
   GLOBAL THEME (Inspired by xgrids.com)
   ============================ */

/* ==== BASE FONT & RESET ==== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
}

/* ==== COLOR PALETTE ==== */
:root {
  /* ?? Thème foncé par défaut */
  --color-bg: #0a0a0a;
  --color-text: #f9f9f9;
  --color-muted: #aaaaaa;
  --color-border: #2a2a2a;
  --color-primary: #3ea6ff;
  --color-primary-dark: #147cd6;
  --color-secondary: #e535ab;
  --color-accent: #00c6a2;
  --color-danger: #ff4d4f;
  --color-danger-text-on-bg: #ffffff;
  --color-success: #52c41a;
  --color-warning: #faad14;

  --radius: 1rem;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  --transition: all 0.2s ease;
}


/* ==== TYPOGRAPHY ==== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: 1rem;
  color: var(--color-text);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: var(--transition);
}

/* ? Appliqué uniquement aux liens textuels */
a:not(.button):not(.btn-main):hover {
  color: var(--color-primary-dark);

}

/* ==== BUTTONS ==== */
.button,
button,
input[type="submit"],
input[type="button"] {
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow);
  display: inline-block;
}

.button:hover,
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
}

.button:active,
button:active {
  transform: scale(0.98);
}

/* ==== FORMS ==== */
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  font-size: 1rem;
  background-color: #fff;
  color: var(--color-text);
  transition: var(--transition);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(0,112,243,0.2);
}

/* ==== CONTAINERS / UTILITAIRES ==== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  transition: var(--transition);
}

.card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.badge {
  display: inline-block;
  background: var(--color-muted);
  color: #fff;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* ==== LISTS ==== */
ul, ol {
  color: var(--color-text);
}
li {
  margin-bottom: 0.5rem;
}

/* ==== RESPONSIVE ==== */
@media (max-width: 768px) {
  html { font-size: 15px; }

  .container {
    padding: 1rem;
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.5rem; }
  .button, button {
    padding: 0.65rem 1.2rem;
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  html { font-size: 14px; }
  .card {
    padding: 1rem;
  }
}



.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #111;
  color: white;
  padding: 2rem 2.5rem;
  border-radius: 1rem;
  box-shadow: var(--shadow);
  max-width: 500px;
  width: 90%;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  transform: scale(0.95);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.modal.active .modal-content {
  transform: scale(1);
  opacity: 1;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  border-radius: 50%;
  padding: 0.5rem;
  font-size: 1.2rem;
  color: white;
  cursor: pointer;
  transition: background 0.2s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

.modal-content h2 {
  font-size: 1.8rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 0.5rem;
}

.form-projet-donnee {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.form-projet-donnee input[type="text"] {
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border-radius: 0.5rem;
  border: none;
  background-color: #222;
  color: white;
  box-shadow: inset 0 0 0 1px var(--color-border);
}

.form-projet-donnee input[type="file"] {
  font-size: 0.9rem;
  color: white;
  background: none;
  border: none;
}

.form-projet-donnee button[type="submit"] {
  align-self: center;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  background: var(--color-primary);
  border: none;
  border-radius: 0.5rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s ease;
  box-shadow: var(--shadow);
}

.form-projet-donnee button[type="submit"]:hover {
  background: var(--color-primary-dark);
}

.vignette-preview-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.vignette-preview {
  max-width: 100%;
  max-height: 120px;
  border-radius: 0.5rem;
  object-fit: cover;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow);
}

/* Stylise le champ file */
.file-upload {
  position: relative;
  overflow: hidden;
  display: inline-block;
  background: #222;
  color: white;
  padding: 0.7rem 1.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.95rem;
  text-align: center;
  width: 100%;
  text-align: center;
  margin-top: 1rem;
  box-shadow: var(--shadow);
}

.file-upload input[type="file"] {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  height: 100%;
  width: 100%;
  cursor: pointer;
}

.form-error {
  color: var(--color-danger);
  font-size: 0.8rem;
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
  display: none;  /* Masquer par défaut */
}
.form-error:not(:empty) {
    display: block;  /* Afficher seulement si le contenu n'est pas vide */
}

.buttons-row {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.buttons-row button {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border-radius: 0.5rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: var(--shadow);
  min-width: 160px;
}

.btn-cancel {
  background: var(--color-primary);
  color: white;
  border: none;
}

.btn-cancel:hover {
  background: var(--color-primary-dark);
}

.btn-confirm {
  background: var(--color-primary);
  color: white;
  border: none;
}

.btn-confirm:hover {
  background: var(--color-primary-dark);
}

.btn-danger {
  background: var(--color-danger);
  color: white;
  border: none;
}

.btn-danger:hover {
  background: var(--color-danger); /* même couleur => pas de changement */
}
.spinner {
  border: 4px solid rgba(255,255,255,0.1);
  border-top: 4px solid var(--color-primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 0.8s linear infinite;
  margin: 1rem auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

