/* === Imports === */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

/* === Base === */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: 'Inter', sans-serif;
  background: #f0f4f8;
  color: #333;
  overflow-x: hidden;
}

#app {
  display: flex;
  min-height: 100vh;
}

.small {
  font-size: 0.7em;
}

.user-coins-box {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 10px;
  border: 1px solid #d1d5db; /* gris clair */
  border-radius: 8px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-weight: 600;
  color: #b45309; /* or chaud */
  background-color: #fffaf0; /* très clair */
  user-select: none;
  min-width: 50px;
  justify-content: center;
}

.cp-quests-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px; /* un peu plus d’espace que 3px, sans changer la taille */
  padding: 2px 10px; /* padding d’origine */
  border: 1.2px solid #d1b507; /* or chaud un peu plus lumineux et subtil */
  border-radius: 8px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-weight: 600;
  font-size: 0.875rem; /* taille un peu mieux adaptée */
  color: #a16207; /* or chaud légèrement plus foncé que l’original */
  background-color: #fff9eb; /* très clair, tirant légèrement vers l’or */
  user-select: none;
  min-width: 50px; /* taille d’origine */
  cursor: default;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
  box-shadow: 0 1px 3px rgba(209, 181, 7, 0.15); /* ombre discrète */
}

.cp-quests-box:hover,
.cp-quests-box:focus {
  background-color: #fff2c1; /* fond un peu plus chaud */
  border-color: #b45309; /* or chaud plus marqué */
  color: #78350f;
  outline: none;
  box-shadow: 0 0 6px rgba(180, 83, 9, 0.5); /* glow léger */
}

.user-coins {
    font-size: 1rem;
}

.user-coins-box i {
    color: #f59e0b !important;
    font-size: 0.8rem !important;
}

/* === Sidebar === */
.sidebar {
  width: 260px;
  background: #1e293b;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  padding: 2em 1.5em;
  box-shadow: 2px 0 8px rgba(0,0,0,0.1);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 1000;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2em;
}

.sidebar-nav {
  flex-grow: 1; /* Prend tout l'espace vertical disponible */
  display: flex;
  flex-direction: column;
  overflow-y: auto; /* Scrolling si besoin */
}

.sidebar-header h1 {
  font-weight: 700;
  font-size: 1.8rem;
  color: #FFFFFF;
}

.sidebar-header h1 i {
  margin-right: 0.6em;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  padding: 0.8em 1em;
  margin-bottom: 1em;
  font-weight: 600;
  color: #cbd5e1;
  text-decoration: none;
  border-radius: 8px;
  transition: background-color 0.3s ease;
}

.sidebar-nav a i {
  margin-right: 0.8em;
  font-size: 1.1rem;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: #00ff00;
  color: black;
}

.sidebar-close {
    display: none;    
}

.bottom-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding-bottom: 1rem;
  flex-wrap: wrap;           /* permet le retour à la ligne si trop large */
  overflow-wrap: break-word; /* évite que le texte déborde */
  word-break: break-word;    /* au cas où */
  max-width: 100%;           /* reste dans la largeur parent */
  box-sizing: border-box;    /* inclut padding dans la largeur */
}

.bottom-links a {
  color: #02dded;
  font-size: 0.75rem;
  text-decoration: none;
  font-weight: normal;
  cursor: pointer;
  transition: color 0.2s;

  max-width: 100%;       /* ne dépasse pas du parent */
  white-space: normal;   /* autorise le retour à la ligne dans le lien */
  word-wrap: break-word; /* casse le mot s'il est trop long */
  overflow-wrap: break-word;
}

.bottom-links a:hover {
  color: #555; /* un peu plus foncé au survol */
}

/* === Gift === */

.gift-code-form {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.gift-code-form input {
    flex: 1;
    padding: 8px;
}

.gift-code-form button {
    padding: 8px 15px;
    background-color: #28a745;
    color: white;
    border: none;
    cursor: pointer;
}

.success {
    color: green;
    margin-top: 10px;
}

.error {
    color: red;
    margin-top: 10px;
}

/* === Main === */
.main-container {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  margin-left: 260px;
  width: 100%;
  overflow-x: hidden;
}

.main-header {
  background: white;
  height: 3.5rem;
  max-height: 3.5rem;
  padding: 0 1em;
  box-shadow: 0 2px 6px rgba(0,0,0,0.07);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1em;
}

. main.content {
  min-height: 600px;
}

.user-info {
  font-weight: 600;
  font-size: 1rem;
  color: #1e293b;
  display: flex;
  align-items: center;
}

.user-info i {
  font-size: 1.8rem;
  margin-right: 0.5em;
  color: #2563eb;
}

.content {
  padding: 2em;
  flex-grow: 1;
  background: #fff;
  margin: 1em 2em 2em 2em;
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.08);
  max-width: 100%;
  overflow-x: hidden;
}

/* === Components === */
.alert {
  padding: 1em;
  margin-bottom: 1.5em;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
}

.alert-error {
  background-color: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.alert-success {
  background-color: #d1fae5;
  color: #047857;
  border: 1px solid #6ee7b7;
}

.card {
  background: #f9fafb;
  border-radius: 12px;
  padding: 2em;
  margin-bottom: 2em;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

h2 {
  font-weight: 700;
  margin-bottom: 1.2em;
  font-size: 1.8rem;
  color: #1e293b;
}

.burger-btn {
  display: none; /* caché par défaut */
}

/* === Quota === */
.quota-container {
  margin-bottom: 1.5em;
}

.quota-bar {
  width: 100%;
  height: 28px;
  background: #e0e7ff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: inset 0 0 5px #c7d2fe;
}

.quota-bar-fill {
  height: 100%;
  background: #2563eb;
  width: 0;
  transition: width 0.5s ease;
}

.quota-text {
  display: block;
  margin-top: 0.5em;
  font-weight: 600;
  color: #334155;
}

/* === Upload Form === */
.upload-section form {
  display: flex;
  gap: 1em;
  align-items: center;
  flex-wrap: wrap;
}

.upload-section input[type="file"] {
  flex-grow: 1;
  border-radius: 10px;
  padding: 0.7em;
  border: 2px solid #cbd5e1;
  font-size: 1rem;
  width: 100%;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.upload-section input[type="file"]:hover {
  border-color: #2563eb;
}

.upload-section button.btn-primary {
  background: #2563eb;
  color: white;
  border: none;
  padding: 0.7em 1.6em;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.3s ease;
}

.upload-section button.btn-primary:hover {
  background: #1e40af;
}

/* --- FORM ACCOUNT --- */
.account-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 480px;
  margin: auto;
  padding: 1rem;
}

.account-form .form-group {
  display: flex;
  flex-direction: column;
}

.account-form label {
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: #2c3e50;
}

.account-form input[type="text"],
.account-form input[type="email"],
.account-form input[type="password"],
.account-form input[type="date"],
.account-form input[type="file"] {
  padding: 0.6rem 1rem;
  border: 1.8px solid #b0bec5;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.25s ease;
}

.account-form input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 6px rgba(37, 99, 235, 0.4);
}

.avatar-preview {
  margin-bottom: 1rem;
  text-align: center;
}

.avatar-preview img {
  max-width: 100px;
  height: auto;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.form-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: flex-start;
  margin-top: 1rem;
}

.btn-primary {
  background-color: #2563eb;
  color: white;
  padding: 0.6rem 1.4rem;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.3s ease;
}

.btn-primary:hover {
  background-color: #1e40af;
}

.btn-secondary {
  background-color: #64748b;
  color: white;
  padding: 0.6rem 1.4rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.3s ease;
}

.btn-secondary:hover {
  background-color: #475569;
}

#formDeleteAccount input[type="password"],
#formDeleteAccount input[type="text"] {
  padding: 0.6rem 1rem;
  border: 1.8px solid #b0bec5;
  border-radius: 8px;
  font-size: 1rem;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.25s ease;
}

#formDeleteAccount input[type="password"]:focus,
#formDeleteAccount input[type="text"]:focus {
  border-color: #1976d2;
  outline: none;
}

#formDeleteAccount button.btn-danger {
  padding: 0.6rem 1.5rem;
  background-color: #dc2626;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#formDeleteAccount button.btn-danger:hover {
  background-color: #b91c1c;
}

#formDeleteAccount button#cancelDelete {
  padding: 0.6rem 1.5rem;
  background-color: #e0e0e0;
  color: #333;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  margin-left: 1em;
  transition: background-color 0.3s ease;
}

#formDeleteAccount button#cancelDelete:hover {
  background-color: #cfcfcf;
}

#deleteError {
  color: red;
  margin-top: 0.5em;
  display: none;
  font-weight: 600;
}

/* Responsive */
@media (max-width: 540px) {
  .account-form {
    max-width: 100%;
    padding: 0 1rem;
  }

  .form-actions {
    flex-direction: column;
  }
}


/* === Progress Bar === */
.progress-wrapper {
  margin-top: 1em;
  background: #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  height: 24px;
  box-shadow: inset 0 0 6px #cbd5e1;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: #2563eb;
  transition: width 0.3s ease;
}

.progress-text {
  margin-top: 0.5em;
  font-weight: 600;
  color: #2563eb;
  text-align: center;
}

/* === Bannière Cookies === */
#cookie-consent-banner {
  display: none; /* cacher par défaut */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #f9fafb;
  border-top: 1px solid #ddd;
  padding: 1em;
  text-align: center;
  font-size: 0.95rem;
  color: #111;
  z-index: 9999;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  align-items: center;
  justify-content: center;
  gap: 0.8em;
  flex-wrap: wrap;
  display: none; /* assure bien caché par défaut */
}

/* === Files Table === */
.files-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

.files-table thead {
  background: #2563eb;
  color: white;
}

.files-table th, .files-table td {
  padding: 1em 1.5em;
  border: 1px solid #e2e8f0;
  text-align: left;
}

.files-table tbody tr:nth-child(even) {
  background: #f9fafb;
}

.file-link {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
}

.file-link:hover {
  text-decoration: underline;
}

/* === Plans === */

.active-plan {
    position: relative;
}

.active-plan::after {
    content: "Plan actuel";
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: #10b981;
    color: white;
    font-size: 0.75em;
    padding: 4px 8px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
    border-bottom: 1px dotted #666;
}

.tooltiptext {
    visibility: hidden;
    width: 280px;
    background-color: #f9f9f9;
    color: #333;
    text-align: left;
    border-radius: 10px;
    padding: 10px 15px;
    position: absolute;
    z-index: 100;
    top: 125%;        /* changé bottom -> top pour afficher en dessous */
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    font-size: 0.85em;
    line-height: 1.4;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    pointer-events: none;
}

/* Triangle simple blanc pointant vers le haut */
.tooltiptext::after {
    content: "";
    position: absolute;
    bottom: 100%;      /* triangle au-dessus de la bulle */
    left: 50%;
    margin-left: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent #f9f9f9 transparent;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

/* === Quests === */
.quest-category-block {
  margin: 2em 0;
  padding: 1.5em;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}

.quest-category-title {
  font-size: 1.4em;
  margin-bottom: 1em;
  color: #111827;
}

.quest-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1em;
}

.quest-item {
  flex: 1 1 300px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 1em;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);

  display: flex;
  flex-direction: column;
  justify-content: space-between; /* espace entre contenu haut et bas */
  min-height: 220px; /* Ajuste la hauteur minimum selon besoin */
}


.quest-item.completed {
  background-color: #ecfdf5;
  border-color: #34d399;
}

.quest-item h4 {
  margin-top: 0;
}

.quest-status {
  margin-top: 1em;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.quest-item .status {
  font-weight: 500;
  color: #6b7280;
}

.quest-item .status.success {
  color: #10b981;
}

/* === Buttons === */
.btn {
  border: none;
  cursor: pointer;
  border-radius: 8px;
  padding: 0.5em 1em;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: 0.9rem;
  transition: background-color 0.3s ease;
  text-decoration: none;
  color: white;
}

.btn-sm {
  padding: 0.3em 0.8em;
  font-size: 0.8rem;
}

.btn-primary {
  background-color: #2563eb;
}

.btn-primary:hover {
  background-color: #1e40af;
}

.btn-danger {
  background-color: #dc2626;
}

.btn-danger:hover {
  background-color: #991b1b;
}

/* === Fallback === */
.no-files {
  text-align: center;
  font-style: italic;
  color: #64748b;
  padding: 2em 0;
}

/* === Cards mode (mobile) === */
.tile-container {
  display: none;
  flex-direction: column;
  gap: 1em;
}

.file-tile {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 1.5em 2em;
    margin-bottom: 1.8em;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
}

.file-tile h3 {
    font-weight: 700;
    font-size: 1.3rem;
    margin-bottom: 0.4em;
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.file-tile h3 i {
    color: #2563eb;
    font-size: 1.4rem;
}

.file-link {
    color: #2563eb;
    text-decoration: none;
    transition: color 0.25s ease;
}

.file-link:hover {
    color: #1e40af;
    text-decoration: underline;
}

.description-text {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 1em;
    min-height: 2.4em;
    white-space: pre-wrap;
}

.description-form textarea {
    width: 100%;
    border-radius: 8px;
    border: 1.5px solid #cbd5e1;
    padding: 0.5em 0.75em;
    font-size: 0.95rem;
    resize: vertical;
    margin-bottom: 0.6em;
}

.description-form input[type="password"] {
    width: 60%;
    padding: 0.4em 0.6em;
    border-radius: 8px;
    border: 1.5px solid #cbd5e1;
    font-size: 0.95rem;
    margin-bottom: 0.8em;
}

.description-form label {
    font-size: 0.9rem;
    margin-right: 0.4em;
    user-select: none;
}

.description-form input[type="checkbox"] {
    transform: scale(1.1);
    margin-left: 0.3em;
    vertical-align: middle;
}

.description-form button {
    padding: 0.5em 1.2em;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    margin-right: 0.8em;
    transition: background-color 0.3s ease;
}

.description-form > div {
    margin-top: 0.6em;
    display: flex;
    gap: 1em;
    justify-content: flex-start; /* ou center, selon ton goût */
    align-items: center;
}

.file-tile .desc {
  font-style: italic;
  color: #555;
  margin-bottom: 0.8em;
  white-space: pre-wrap;
}

.file-tile .info {
  font-size: 0.9em;
  margin-bottom: 0.3em;
}

.actions {
  display: flex;
  gap: 1em;
  align-items: center;
  justify-content: flex-start; /* ou center si tu veux centrer */
  margin-top: 1em;
}

.actions button,
.actions a {
  display: inline-flex;
  align-items: center;
  padding: 0.5em 1em;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background-color 0.3s ease;
  color: white;
  background-color: #2563eb;
}

.actions a {
  background-color: #ef4444;
}

.actions button:hover {
  background-color: #1e40af;
}

.actions a:hover {
  background-color: #dc2626;
}

.actions a i {
  margin-right: 0.4em;
}

/* === Login Page === */
.login-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2em;
}

.login-header {
  margin-bottom: 2em;
  color: #2563eb;
  font-weight: 700;
  font-size: 2rem;
  display: flex;
  align-items: center;
  gap: 0.5em;
}

.login-header i {
  font-size: 2.5rem;
}

.login-header h1 {
    color: #4f4f4f;
    text-shadow: 0 0 5px rgba(0,0,0,0.7);
}

.login-main {
  background: white;
  width: 100%;
  max-width: 400px;
  padding: 2.5em 2em;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  box-sizing: border-box;
}

.login-main h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 1.5em;
  display: flex;
  align-items: center;
  gap: 0.5em;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.2em;
}

.login-form label {
  font-weight: 600;
  color: #334155;
  font-size: 0.9rem;
}

.login-form input[type="text"],
.login-form input[type="password"],
.login-form input[type="email"] {
  padding: 0.75em 1em;
  font-size: 1rem;
  border-radius: 10px;
  border: 2px solid #cbd5e1;
  transition: border-color 0.3s ease;
  outline-offset: 2px;
}

.login-form input:focus {
  border-color: #2563eb;
  outline: none;
}

.login-form button.btn-primary {
  background-color: #2563eb;
  color: white;
  border: none;
  padding: 0.85em 1.5em;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  transition: background-color 0.3s ease;
}

.login-form button.btn-primary:hover {
  background-color: #1e40af;
}

.register-link {
  margin-top: 1.5em;
  text-align: center;
  font-size: 0.95rem;
  color: #64748b;
}

.register-link a {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
}

.register-link a:hover {
  text-decoration: underline;
}

/* === Responsive === */
@media (max-width: 768px) {
  .main-container {
    margin-left: 0;
    padding: 1em;
    padding-top: 3.5rem;
    transition: filter 0.3s ease;
  }

  .main-container.dimmed {
    filter: brightness(0.6);
    pointer-events: none;
  }

  .main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100vw;
    height: 3.5rem;
    background: white;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1em;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.07);
  }

  .content {
    margin: 1em 0.5em 2em 0.5em;
  }

  .files-table {
    display: none;
  }

  .tile-container {
    display: flex;
  }

  .sidebar {
    top: -100vh;
    left: 0;
    width: 100vw;
    height: 100vh;
    transition: top 0.3s ease;
    z-index: 1300;
    padding-top: 4rem;
  }

  .sidebar.open {
    top: 0;
  }

  .sidebar-close {
    display: block;
    position: absolute;
    top: 1em;
    right: 1em;
    font-size: 2rem;
    background: transparent;
    border: none;
    color: #fff;
    z-index: 1400;
    cursor: pointer;
  }

  .burger-btn {
    display: block;
    background: transparent;
    border: none;
    font-size: 1.8rem;
    color: #2563eb;
    cursor: pointer;
  }
}

@media (max-width: 480px) {
  .login-main {
    padding: 2em 1.5em;
    width: 100%;
    margin: 0 1em;
  }

  .settings-section {
    padding: 1.5em 1.2em;
    margin: 1em;
  }

  .settings-section h2 {
    font-size: 1.5rem;
  }

  .settings-section form button.btn-primary {
    font-size: 1rem;
    padding: 0.7em 1.2em;
  }
}

/* === Administration === */

.users-tiles-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
    padding-top: 1rem;
}

.user-tile {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.12);
    padding: 1rem 1.2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 160px;
}

.user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.user-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #2c3e50;
}

.status {
    font-weight: 700;
    padding: 0.25em 0.6em;
    border-radius: 20px;
    font-size: 0.85rem;
    user-select: none;
}

.status.active {
    background-color: #d1fae5;
    color: #065f46;
}

.status.inactive {
    background-color: #fee2e2;
    color: #b91c1c;
}

.quota-info {
    margin-bottom: 1rem;
}

.quota-bar {
    background-color: #e2e8f0;
    border-radius: 8px;
    height: 16px;
    overflow: hidden;
    margin-bottom: 0.3rem;
    position: relative;
}

.quota-bar-fill {
    background-color: #2563eb;
    height: 100%;
    transition: width 0.3s ease;
}

.quota-info small {
    color: #64748b;
    font-size: 0.9rem;
}

.action-form {
    text-align: center;
}

.action-form button {
    width: 100%;
    font-size: 0.95rem;
}

/* Responsive: moins de colonnes sur petit écran */
@media (max-width: 480px) {
    .users-tiles-container {
        grid-template-columns: 1fr;
    }
}
.file-actions {
  display: flex;
  gap: 0.5rem; /* espace entre les boutons */
  flex-wrap: wrap; /* permet de passer à la ligne si écran trop petit */
}

.file-actions form {
  margin: 0;
}

.stat-card {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.2em;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    font-family: Arial, sans-serif;
}

.stat-value {
    font-size: 1.8em;
    font-weight: bold;
    color: #111827;
}

.stat-label {
    margin-top: 0.5em;
    font-size: 0.95em;
    color: #4b5563;
}

/* Boutons de description */
.btn-edit-desc,
.btn-save-desc,
.btn-cancel-desc {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 6px;
    margin-right: 6px;
    font-weight: 500;
    transition: background-color 0.2s ease, transform 0.15s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.06);
}

.btn-edit-desc {
    background-color: #0d6efd; /* bleu Bootstrap */
    color: #fff;
}

.btn-edit-desc:hover {
    background-color: #0b5ed7;
    transform: translateY(-1px);
}

.btn-save-desc {
    background-color: #198754;
    color: #fff;
}

.btn-save-desc:hover {
    background-color: #157347;
    transform: translateY(-1px);
}

.btn-cancel-desc {
    background-color: #dc3545;
    color: #fff;
}

.btn-cancel-desc:hover {
    background-color: #bb2d3b;
    transform: translateY(-1px);
}
.tile-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.file-tile {
    background-color: #fff;
    border-radius: 12px;
    padding: 1.2rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.file-tile:hover {
    transform: translateY(-3px);
}

.file-tile h3 {
    font-size: 1rem;
    margin-bottom: 0.5em;
    word-break: break-all;
}

.file-tile h3 a {
    text-decoration: none;
    color: #333;
}

.file-tile .desc {
    font-size: 0.9rem;
    margin-bottom: 0.7em;
    color: #666;
}

.file-tile .info {
    font-size: 0.8rem;
    margin-bottom: 0.4em;
    color: #444;
}

.file-tile .actions {
    margin-top: 1em;
    display: flex;
    gap: 1.4em;
    align-items: center;
}

.actions button.edit-btn {
    background-color: #2563eb;
    color: white;
    padding: 0.5em 1.2em;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.actions button.edit-btn:hover {
    background-color: #1e40af;
}

/* --- Modal --- */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.5);

  display: flex;
  align-items: center;
  justify-content: center;

  z-index: 1000;

  /* Important : évite que d'autres éléments interfèrent */
  box-sizing: border-box;
}

.modal-content {
  background: #fff;
  padding: 20px;
  border-radius: 6px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
}

/* --- Paiement section --- */

.coin-selection {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.coin-option {
    flex: 1;
    cursor: pointer;
}

.coin-option input[type="radio"] {
    display: none;
}

.coin-card {
    border: 2px solid #ccc;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    transition: border-color 0.3s, box-shadow 0.3s;
    user-select: none;
    font-weight: 600;
    color: #444;
}

.coin-amount {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.coin-price {
    display: block;
    font-size: 1rem;
    color: #007bff;
}

.coin-option input[type="radio"]:checked + .coin-card {
    border-color: #007bff;
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.5);
    color: #0056b3;
}

.coin-option:hover .coin-card {
    border-color: #0056b3;
}
@media (max-width: 480px) {
    .coin-selection {
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* --- Status files --- */

.badge {
  padding: 0.3em 0.6em;
  border-radius: 0.5em;
  font-size: 0.85em;
  display: inline-block;
}
.badge-warning { background-color: #ffc107; color: #212529; }
.badge-success { background-color: #28a745; color: white; }
.badge-danger { background-color: #dc3545; color: white; }
.badge-secondary { background-color: #6c757d; color: white; }


/* --- Toggle --- */
.toggle-switch {
    appearance: none;
    -webkit-appearance: none;
    width: 45px;
    height: 26px;
    background: #ccc;
    border-radius: 50px;
    position: relative;
    outline: none;
    cursor: pointer;
    transition: background 0.3s ease-in-out;
}
.toggle-switch:checked {
    background: #4ade80; /* vert style iOS */
}
.toggle-switch::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease-in-out;
}
.toggle-switch:checked::before {
    transform: translateX(19px);
}

body.dragging {
  outline: 3px dashed #3b82f6;
  outline-offset: -15px;
  background-color: #f0f8ff;
}


.loader {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin: 10px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@media screen and (max-width: 768px) {
  .hide-on-mobile {
    display: none !important;
  }
}

.folder-tile, .file-tile {
  border: 1px solid #ccc;
  padding: 10px;
  margin-bottom: 0.5em;
  background-color: #fafafa;
  border-radius: 4px;
}
.folder-tile {
  background-color: #f0f8ff;
}
.folder-tile.drop-hover {
  background-color: #d0ffd0;
}
.file-tile.dragging {
  opacity: 0.5;
}
.folder-tile a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: bold;
  text-decoration: none;
}
