/* account.css : Page Mon Compte */

/* ===============================
   HEADER
   =============================== */
/* Styles communs header/site-name centralisés dans main.css */

/* ===============================
   MAIN
   =============================== */
#main-container.account-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start; /* empêche l'étirement space-evenly hérité de main.css */
  padding: 1.5rem 1rem;
}

/* ===============================
   BLOC COMPTE
   =============================== */
/* Empêche la compression flex : les blocs doivent déborder (→ scrollbar sur #main-container) */
#account-block,
#my-clubs-section,
#danger-zone-section {
  flex-shrink: 0;
}

#account-block {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 2rem;
  width: min(680px, 96vw);
  background-color: hsl(45, 100%, 92%);
  border: 0.2rem solid var(--custom-green);
  border-radius: var(--radius-s);
  box-shadow:
    1px 1px 0 hsl(0, 0%, 100%),
    -1px 1px 0 hsl(0, 0%, 100%),
    1px -1px 0 hsl(0, 0%, 100%),
    -1px -1px 0 hsl(0, 0%, 100%);
  padding: 1.5rem;
}

/* ===============================
   AVATAR
   =============================== */
#avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

#avatar-frame {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background-image: radial-gradient(ellipse, hsl(120, 100%, 16%), hsl(0, 0%, 0%));
  border: 0.2rem solid var(--custom-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-xxxl);
  color: var(--white-1);
  text-shadow: 1px 2px 3px hsla(0, 0%, 0%, 0.8);
  -webkit-user-select: none;
  user-select: none;
  cursor: default;
  overflow: hidden;
  position: relative;
}

/* Image avatar dans le disque */
#avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* ===============================
   MODALE RECADRAGE AVATAR (Cropper.js)
   =============================== */
.avatar-crop-overlay {
  position: fixed;
  inset: 0;
  background-color: hsla(0, 0%, 0%, 0.75);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  align-items: safe center;
  justify-content: center;
  overflow-y: auto;
  padding: max(env(safe-area-inset-top, 0px), 1rem) max(env(safe-area-inset-right, 0px), 1rem)
    max(env(safe-area-inset-bottom, 0px), 1rem) max(env(safe-area-inset-left, 0px), 1rem);
  animation: fadeIn 0.2s ease both;
}

.avatar-crop-overlay.hidden {
  display: none;
}

.avatar-crop-box {
  background: hsl(0, 0%, 100%);
  border-radius: var(--radius-s);
  padding: 1.2rem 1.5rem;
  width: min(380px, 96vw);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: zoomIn 0.25s ease both;
}

.avatar-crop-box h3 {
  font-size: var(--font-m);
  color: hsl(120, 100%, 12%);
  margin: 0;
  text-align: center;
}

.avatar-crop-container {
  width: 100%;
  max-height: 300px;
  overflow: hidden;
}

.avatar-crop-container img {
  display: block;
  max-width: 100%;
}

.avatar-crop-actions {
  display: flex;
  gap: 0.8rem;
  justify-content: flex-end;
}

/* ===============================
   INFOS ET FORMULAIRE
   =============================== */
#account-info {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  flex: 1;
}

#account-info h2 {
  font-size: var(--font-l);
  color: hsl(120, 100%, 12%);
  margin: 0 0 0.3rem 0;
}

.account-info-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--font-m);
  color: hsl(0, 0%, 20%);
}

.account-info-label {
  color: hsl(0, 0%, 33%);
  min-width: 6rem;
}

.account-info-value {
  color: hsl(0, 0%, 7%);
}

.account-text-action {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: var(--font-m);
  color: hsl(120, 100%, 16%);
  text-decoration: underline;
  cursor: pointer;
}

.account-text-action:hover {
  color: hsl(120, 100%, 12%);
}

/* ===============================
   FORMULAIRE CHANGEMENT MP (modale)
   =============================== */
#change-password-modal #change-password-form {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin: 0;
  padding: 0;
  border: none;
}

/* ===============================
   RESPONSIVE
   =============================== */
@media (max-width: 540px) {
  #account-block {
    flex-direction: column;
    align-items: center;
  }

  #account-info {
    width: 100%;
  }

  .account-info-label {
    min-width: 5rem;
  }
}

/* ===============================
   SECTION MES CLUBS
   =============================== */
#my-clubs-section {
  width: min(680px, 96vw);
  margin-top: 1.5rem;
  background-color: hsl(45, 100%, 92%);
  border: 0.2rem solid var(--custom-green);
  border-radius: var(--radius-s);
  padding: 1.2rem 1.5rem;
}

#my-clubs-section h2 {
  font-size: var(--font-l);

  color: hsl(120, 100%, 12%);
  margin: 0 0 0.8rem 0;
}

#clubs-table-wrapper {
  overflow-x: auto;
}

#clubs-table-wrapper::-webkit-scrollbar {
  height: 0.4rem;
}

#clubs-table-wrapper::-webkit-scrollbar-track {
  background: hsla(0, 0%, 0%, 0.08);
  border-radius: 999px;
}

#clubs-table-wrapper::-webkit-scrollbar-thumb {
  background: hsla(120, 100%, 16%, 0.55);
  border-radius: 999px;
}

#clubs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-s);
}

#clubs-table th,
#clubs-table td {
  padding: clamp(0.4rem, 0.9dvw, 0.5rem) clamp(0.35rem, 0.8dvw, 0.5rem);
  text-align: left;
  border-bottom: 1px solid hsl(48, 50%, 69%);
}

#clubs-table th {
  color: hsl(0, 0%, 33%);
  text-transform: uppercase;
  font-size: var(--font-s);
  letter-spacing: 0.03em;
}

#clubs-table tbody tr:last-child td {
  border-bottom: none;
}

.clubs-empty-msg {
  color: hsl(0, 0%, 53%);
  font-style: italic;
  padding: 0.8rem 0.4rem;
}

.balance-positive {
  color: hsl(120, 65%, 29%);
}

.balance-negative {
  color: hsl(6, 63%, 46%);
}

.clubs-owner-badge {
  font-size: var(--font-s);
  color: hsl(0, 0%, 53%);
  font-style: italic;
}

/* ===============================
   DANGER ZONE
   =============================== */
#danger-zone-section {
  width: min(680px, 96vw);
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  background-color: hsl(0, 100%, 98%);
  border: 0.2rem solid var(--color-red);
  border-radius: var(--radius-s);
  padding: 1.2rem 1.5rem;
  background: radial-gradient(
    ellipse at center,
    hsla(360, 60%, 16%, 1) 0%,
    hsla(360, 60%, 14%, 1) 50%,
    hsla(360, 60%, 10%, 1) 100%
  );
}

.danger-zone-title {
  font-size: var(--font-l);

  color: var(--white-1);
  margin: 0 0 0.5rem 0;
}

.danger-zone-desc {
  font-size: var(--font-s);
  color: var(--white-1);
  margin: 0 0 0.9rem 0;
}

/* Fin danger zone */

/* =========================
   Boutons account — migrés depuis buttons.css
   ========================= */

.btn-avatar-upload {
  --btn-bg: var(--color-green);
  font-size: var(--font-s);

  letter-spacing: normal;
  padding: var(--space-2) var(--space-4) var(--space-3);
  text-shadow:
    1px 1px 0px black,
    -1px 1px 0px black,
    1px -1px 0px black,
    -1px -1px 0px black;
  border-radius: var(--radius-xxxs);
}

.btn-avatar-remove {
  --btn-bg: var(--color-red);
  font-size: var(--font-s);

  letter-spacing: normal;
  padding: var(--space-2) var(--space-4) var(--space-3);
  text-shadow:
    1px 1px 0px black,
    -1px 1px 0px black,
    1px -1px 0px black,
    -1px -1px 0px black;
  border-radius: var(--radius-xxxs);
}

.btn-leave-club,
.btn-danger {
  /* Surcharges spécifiques : le reste (box-shadow, display, cursor…) vient de buttons.css */
  --btn-bg: var(--color-red);
  font-size: var(--font-s);

  letter-spacing: normal;
  padding: var(--space-2) var(--space-4) var(--space-3);
  text-shadow:
    1px 1px 0px black,
    -1px 1px 0px black,
    1px -1px 0px black,
    -1px -1px 0px black;
  border-radius: var(--radius-xxxs);
}

.btn-leave-club {
  padding: 0.3rem 0.7rem;
  font-size: var(--font-s);
}

.btn-danger {
  padding: 0.45rem 1.1rem;
  font-size: var(--font-s);
}

.btn-danger:disabled {
  background: hsl(0, 0%, 31%);
  cursor: not-allowed;
  pointer-events: none;
  filter: none;
}

#leave-club-container {
  z-index: 1000;
}

.leave-club-message {
  margin: 0;
  font-size: var(--font-s);
  text-align: center;
  line-height: 1.45;
  color: hsl(0, 0%, 7%);
}

#leave-club-error {
  margin-top: 0.45rem;
  text-align: center;
}
