/* Ankama Accounts Manager – styles inspirés de la version locale / Ventekamas */

/* Contexte global, limité au wrapper pour ne pas casser le thème */
.ankama-wrap {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #2c3142;
  max-width: 100%;
}

/* Titre global */
.ankama-wrap h1 {
  font-size: 1.6rem;
  margin: 1.2rem 0 0.8rem;
}

/* Cartes */
.ankama-wrap .card {
  background: #ffffff;
  border-radius: 20px;
  padding: 1.5rem 1.6rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 14px 30px rgba(15,23,42,0.08);
  border: 1px solid #e2e5ff;
  max-width: 100%;
}

/* Admin dashboard: collapsible + draggable sections */
.ankama-admin-dashboard .card {
  position: relative;
}

.ankama-admin-dashboard .card h2 {
  user-select: none;
}

.ankama-admin-dashboard .ankama-card-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-right: 0.35rem;
  border-radius: 10px;
  border: 1px solid #d1d5e5;
  background: #ffffff;
  color: #2c3142;
  font-size: 0.95rem;
  line-height: 1;
  cursor: grab;
}

.ankama-admin-dashboard .card.ui-sortable-helper .ankama-card-drag-handle {
  cursor: grabbing;
}

.ankama-admin-dashboard .ankama-card-toggle {
  margin-left: auto;
  background: #ffffff;
  color: #2c3142;
  border: 1px solid #d1d5e5;
  box-shadow: none;
  border-radius: 12px;
  padding: 0.15rem 0.55rem;
  font-size: 0.9rem;
}

.ankama-admin-dashboard .ankama-card-toggle:hover {
  opacity: 0.92;
}

.ankama-admin-dashboard .card.is-collapsed {
  padding-bottom: 1rem;
}

.ankama-admin-dashboard .ankama-card-body {
  margin-top: 0.9rem;
}

.ankama-admin-dashboard .ankama-card-placeholder {
  border: 2px dashed #d1d5e5;
  border-radius: 20px;
  background: rgba(112,101,255,0.06);
  margin-bottom: 1.5rem;
  min-height: 64px;
}

/* Notices (seller dashboard) */
.ankama-wrap .ankama-notice {
  border-radius: 16px;
  padding: 0.75rem 0.95rem;
  margin: 0 0 1rem;
  border: 1px solid #e2e5ff;
  background: #f4f3ff;
  font-size: 0.88rem;
  font-weight: 600;
}

.ankama-wrap .ankama-notice-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #7f1d1d;
}

.ankama-wrap .ankama-notice-success {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

/* Price preview on deposit form */
.ankama-wrap .ankama-price-preview {
  display: inline-flex; /* Fits content size */
  flex-direction: row;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.6rem; /* Smaller padding */
  border-radius: 8px;
  border: 1px solid #d1d5e5;
  background: #ffffff;
  font-size: 0.9rem; /* Slightly smaller text */
  font-weight: 700;
  width: auto; /* Ensure it's not full width */
  max-width: fit-content;
}

.ankama-wrap .card h2 {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.ankama-wrap .card h3 {
  margin-top: 0.8rem;
  margin-bottom: 0.4rem;
  font-size: 0.98rem;
}

.ankama-wrap .dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #7065ff;
}

.ankama-wrap small,
.ankama-wrap .small-text {
  font-size: 0.82rem;
  color: #7c8195;
}

.ankama-wrap label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.83rem;
  color: #555a6e;
}

/* Inputs / selects */
.ankama-wrap input[type="text"],
.ankama-wrap input[type="email"],
.ankama-wrap input[type="password"],
.ankama-wrap input[type="number"],
.ankama-wrap input[type="file"],
.ankama-wrap select,
.ankama-wrap textarea {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  border: 1px solid #d1d5e5;
  background: #ffffff;
  color: #2c3142;
  font-size: 0.88rem;
  box-sizing: border-box;
}

.ankama-wrap textarea {
  resize: vertical;
}

/* Boutons */
.ankama-wrap button,
.ankama-wrap .button {
  border-radius: 999px;
  border: none;
  background: #7065ff;
  color: #ffffff;
  padding: 0.5rem 0.95rem;
  font-size: 0.85rem;
  cursor: pointer;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  text-decoration: none;
  box-shadow: 0 10px 20px rgba(112,101,255,0.35);
}

.ankama-wrap button.secondary,
.ankama-wrap .button.secondary {
  background: #ffffff;
  color: #2c3142;
  border: 1px solid #d1d5e5;
  box-shadow: none;
}

.ankama-wrap button.btn-danger,
.ankama-wrap .button.btn-danger {
  border-color: #fecaca;
  color: #b91c1c;
}

.ankama-wrap button.small,
.ankama-wrap .button.small {
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
}

.ankama-wrap button:hover,
.ankama-wrap .button:hover {
  opacity: 0.93;
}

/* Liens "texte" */
.ankama-wrap .linklike {
  background: none;
  border: none;
  padding: 0;
  margin-left: 0.2rem;
  color: #7065ff;
  font-size: 0.8rem;
  text-decoration: underline;
  box-shadow: none;
  border-radius: 0;
}

/* Grille de filtres standard (admin + certaines parties vendeur) */
.ankama-wrap .filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem 1rem;
  align-items: flex-end;
}

.ankama-wrap .filters .full {
  grid-column: 1 / -1;
}

/* Formulaire payout vendeur (vertical) */
.ankama-wrap .payout-form {
  display: block;
  margin-top: 0.7rem;
}

.ankama-wrap .payout-form > div {
  margin-bottom: 0.7rem;
}

/* Bloc résumé payout */
.ankama-wrap .seller-payout-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}

/* Crypto fields alignés verticalement aussi */
.ankama-wrap .payout-crypto {
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  background: #f5f4ff;
}

.ankama-wrap .payout-crypto > div {
  margin-bottom: 0.55rem;
}

.ankama-wrap .payout-method-block {
  display: none;
}

/* Toujours visible, on laisse JS gérer la visibilité fine */
.ankama-wrap .payout-method-block.visible {
  display: block;
}

/* Tableau */
.ankama-wrap .table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.ankama-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.ankama-wrap thead {
  background: #f4f3ff;
}

.ankama-wrap thead th {
  text-align: left;
  padding: 0.55rem 0.6rem;
  font-weight: 600;
  border-bottom: 1px solid #e2e5ff;
  white-space: nowrap;
}

.ankama-wrap tbody td {
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid #edf0ff;
  vertical-align: top;
}

.ankama-wrap tbody tr:nth-child(even) td {
  background: #fafbff;
}

.ankama-wrap tbody tr:hover td {
  background: #e7e1ff;
}

/* Ligne compte retiré */
.ankama-wrap tr.row-retired td {
  background: #fef2f2 !important;
}

/* Badges */
.ankama-wrap .badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
}

.ankama-wrap .badge-pill {
  border-radius: 999px;
  border: 1px solid #d1d5e5;
  padding: 0.15rem 0.6rem;
  font-size: 0.73rem;
  color: #555a6e;
  background: #f9f9ff;
}

.ankama-wrap .badge-status-pending_verification { background: rgba(59,130,246,.12); color: #2563eb; }
.ankama-wrap .badge-status-verified            { background: rgba(34,197,94,.12);  color: #15803d; }
.ankama-wrap .badge-status-reserved            { background: rgba(249,115,22,.12); color: #c2410c; }
.ankama-wrap .badge-status-pending_payment    { background: rgba(234,179,8,.14);  color: #a16207; }
.ankama-wrap .badge-status-sold_paid           { background: rgba(56,189,248,.12); color: #0369a1; }
.ankama-wrap .badge-status-rejected            { background: rgba(248,113,113,.12);color: #b91c1c; }
.ankama-wrap .badge-status-cancelled           { background: rgba(148,163,184,.12);color: #4b5563; }
.ankama-wrap .badge-status-retired             { background: rgba(252,165,165,.18);color: #b91c1c; }

.ankama-wrap .badge-payout-none            { background: rgba(148,163,184,.12); color: #4b5563; }
.ankama-wrap .badge-payout-pending_payout  { background: rgba(234,179,8,.15);   color: #854d0e; }
.ankama-wrap .badge-payout-paid            { background: rgba(22,163,74,.18);   color: #166534; }

/* Chips */
.ankama-wrap .chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid #d1d5e5;
  font-size: 0.75rem;
  margin-right: 0.35rem;
  color: #555a6e;
  background: #ffffff;
}

/* KPI cards */
.ankama-wrap .kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
}

.ankama-wrap .kpi-card {
  padding: 0.7rem 0.75rem;
  background: linear-gradient(135deg, #f9fafb, #f1f5ff);
  border-radius: 14px;
  border: 1px solid #e2e5ff;
}

.ankama-wrap .kpi-label {
  font-size: 0.75rem;
  color: #6b7280;
}

.ankama-wrap .kpi-value {
  margin-top: 0.15rem;
  font-weight: 700;
  font-size: 1.1rem;
}

/* Tabs vendeur */
.ankama-wrap .tabs {
  display: flex;
  gap: 0.35rem;
  border-bottom: 1px solid #e5e7eb;
}

.ankama-wrap .tab-button {
  background: transparent;
  border-radius: 999px 999px 0 0;
  border: none;
  box-shadow: none;
  padding: 0.45rem 0.9rem;
  font-size: 0.83rem;
  color: #6b7280;
  border-bottom: 2px solid transparent;
}

.ankama-wrap .tab-button.active {
  color: #1f2933;
  border-color: #7065ff;
  background: #f5f4ff;
}

.ankama-wrap .tab-content {
  display: none;
  margin-top: 0.75rem;
}

.ankama-wrap .tab-content.active {
  display: block;
}

/* Pagination */
.ankama-wrap .pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.82rem;
}

.ankama-wrap .pagination-buttons {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Checkbox grid (config / export) */
.ankama-wrap .checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
}

.ankama-wrap .checkbox-inline {
  display: inline-flex;
  align-items: center;
  font-size: 0.82rem;
  color: #4b5563;
}

.ankama-wrap .checkbox-inline input {
  width: auto;
  margin-right: 0.25rem;
}

/* Modal */
.ankama-wrap .ankama-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.42);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

.ankama-wrap .ankama-modal-backdrop.active {
  display: flex;
}

.ankama-wrap .ankama-modal {
  background: #ffffff;
  border-radius: 18px;
  padding: 1.1rem 1.3rem;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 18px 36px rgba(15,23,42,0.28);
}

/* Créé / maj, etc. */
.ankama-wrap .mt-1 { margin-top: 0.25rem; }
.ankama-wrap .mt-2 { margin-top: 0.5rem; }
.ankama-wrap .mb-1 { margin-bottom: 0.5rem; }
.ankama-wrap .mb-2 { margin-bottom: 0.75rem; }

/* Crédentials masqués */
.ankama-wrap .cred-value {
  font-family: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Form inline vendeur retrait */
.ankama-wrap .inline-form {
  display: inline-block;
}

/* Admin / seller layout force full width */
.ankama-admin-dashboard .card,
.ankama-seller-dashboard .card {
  max-width: 100% !important;
}

/* Responsive */
@media (max-width: 1024px) {
  .ankama-wrap .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ankama-wrap .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .ankama-wrap .filters {
    grid-template-columns: 1fr;
  }
  .ankama-wrap .kpi-grid {
    grid-template-columns: 1fr;
  }
  .ankama-wrap .seller-payout-summary {
    flex-direction: column;
    align-items: flex-start;
  }
}


/* Écran de login requis pour le vendeur */
.ankama-seller-dashboard.ankama-login-required {
  min-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Carte floue au milieu */
.ankama-login-overlay {
  text-align: center;
  padding: 2rem 2.4rem;
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.82);
  color: #f9fafb;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  max-width: 480px;
  width: 100%;
}

.ankama-login-overlay h2 {
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
  color: #f9fafb;
}

.ankama-login-overlay .small-text,
.ankama-login-overlay p {
  color: #e5e7eb;
}

.ankama-login-overlay .dot {
  background: #fbbf24;
}


/* Cartes de configuration API (multi‑endpoint) */
.ankama-api-config {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: #ffffff;
}

.ankama-api-config-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
}

.ankama-api-config-header strong {
  flex: 1;
}

.ankama-api-config-toggle {
  border: none;
  background: transparent;
  font-size: 14px;
  cursor: pointer;
  padding: 0 4px;
}

.ankama-api-config-meta {
  white-space: nowrap;
  font-size: 12px;
}

.ankama-api-config-body {
  margin-top: 8px;
}

.ankama-api-config.is-collapsed .ankama-api-config-body {
  display: none;
}

/* ==========================
   Seller dashboard refresh
   ========================== */

.ankama-seller-dashboard .seller-header{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:1rem;
  margin: 0.2rem 0 1rem;
}

.ankama-seller-dashboard .seller-header-left h2{
  margin: 0;
}

.ankama-seller-dashboard .seller-header-actions{
  display:flex;
  gap:0.5rem;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.ankama-wrap button.small,
.ankama-wrap .button.small{
  padding: 0.45rem 0.8rem;
  font-size: 0.82rem;
}

.ankama-seller-dashboard .seller-kpi-card{
  padding: 1.1rem 1.2rem;
}

.ankama-seller-dashboard .seller-layout{
  display:grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  grid-template-areas: "main aside";
  gap: 1.2rem;
  align-items:start;
}

.ankama-seller-dashboard .seller-main{ grid-area: main; }
.ankama-seller-dashboard .seller-aside{ grid-area: aside; }

/* When "Mes comptes" tab is active, give the table the full available width */
.ankama-seller-dashboard.aam-tab-mescomptes .seller-layout{
  grid-template-columns: 1fr;
  grid-template-areas: "aside" "main";
}

.ankama-seller-dashboard.aam-tab-mescomptes .seller-aside{
  /* Grid gap already provides spacing; keep payout card truly "on top" */
  margin-top: 0;
}

.ankama-seller-dashboard .seller-main,
.ankama-seller-dashboard .seller-aside{
  min-width: 0;
}

@media (max-width: 1024px){
  .ankama-seller-dashboard .seller-layout{
    grid-template-columns: 1fr;
    grid-template-areas: "aside" "main";
  }
}

/* Tabs: more "pill" look, theme-friendly */
.ankama-seller-dashboard .tabs{
  border-bottom: none;
  background: #f9fafb;
  border: 1px solid #e2e5ff;
  border-radius: 999px;
  padding: 0.25rem;
}

.ankama-seller-dashboard .tab-button{
  border-radius: 999px;
  padding: 0.48rem 0.95rem;
  color: #6b7280;
  border-bottom: none;
}

.ankama-seller-dashboard .tab-button.active{
  background: #ffffff;
  color: #2c3142;
  box-shadow: 0 10px 20px rgba(15,23,42,0.08);
  border: 1px solid #e2e5ff;
}

/* Deposit form: simpler grid */
.ankama-seller-dashboard #tab-depot form.filters{
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 640px){
  .ankama-seller-dashboard #tab-depot form.filters{
    grid-template-columns: 1fr;
  }
}

/* Price preview (seller deposit): modern + clean, keeps theme colors */
.ankama-seller-dashboard #tab-depot .ankama-price-preview{
  display: flex;
  width: 100%;
  max-width: none;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  border: 1px solid #e2e5ff;
  background: linear-gradient(135deg, #ffffff, #f4f3ff);
  box-shadow: 0 10px 20px rgba(15,23,42,0.06);
  font-size: 1.02rem;
  font-weight: 800;
}

.ankama-seller-dashboard #tab-depot .ankama-price-preview::before{
  content: '$';
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f4f3ff;
  border: 1px solid #e2e5ff;
  color: #7065ff;
  font-weight: 900;
  flex: 0 0 auto;
}

.ankama-seller-dashboard #tab-depot #ankama_deposit_price_range{
  margin-left: auto;
  font-weight: 600;
}

/* Toolbar + collapsible filters */
.ankama-seller-dashboard .aam-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.1rem 0.2rem;
}

.ankama-seller-dashboard .aam-toolbar-right{
  display:flex;
  gap:0.5rem;
}

.ankama-seller-dashboard #sellerFiltersWrapper{
  margin-top: 0.4rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid #e2e5ff;
  border-radius: 16px;
  background: linear-gradient(135deg, #f9fafb, #f1f5ff);
}

/* Table wrapper: add breathing space */
.ankama-seller-dashboard .table-wrapper{
  border-radius: 16px;
  border: 1px solid #e2e5ff;
  background: #ffffff;
  overflow-x: visible; /* avoid horizontal scrolling on desktop */
}

@media (max-width: 900px){
  .ankama-seller-dashboard .table-wrapper{
    overflow-x: auto;
  }
}

/* Make the seller table fit better without scrolling */
.ankama-seller-dashboard table.aam-accounts-table{
  table-layout: fixed;
}

.ankama-seller-dashboard table.aam-accounts-table th,
.ankama-seller-dashboard table.aam-accounts-table td{
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ankama-seller-dashboard table.aam-accounts-table thead th{
  white-space: normal;
}

/* Keep some columns compact */
.ankama-seller-dashboard table.aam-accounts-table th:nth-child(1),
.ankama-seller-dashboard table.aam-accounts-table td:nth-child(1){
  width: 64px;
}

.ankama-seller-dashboard table.aam-accounts-table th:nth-child(5),
.ankama-seller-dashboard table.aam-accounts-table td:nth-child(5){
  width: 70px;
}

.ankama-seller-dashboard table.aam-accounts-table th:nth-child(6),
.ankama-seller-dashboard table.aam-accounts-table td:nth-child(6){
  width: 90px;
}

.ankama-seller-dashboard table.aam-accounts-table th:nth-child(11),
.ankama-seller-dashboard table.aam-accounts-table td:nth-child(11){
  width: 110px;
}

@media (max-width: 900px){
  .ankama-seller-dashboard .table-wrapper{
    overflow-x: auto; /* on small screens, allow scroll instead of breaking layout */
  }
  .ankama-seller-dashboard table.aam-accounts-table{
    table-layout: auto;
  }
}

/* Modern price preview (keeps theme colors) */
.ankama-seller-dashboard #tab-depot .ankama-price-preview{
  display:flex;
  align-items:center;
  gap: 0.7rem;
  width: 100%;
  max-width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  border: 1px solid #e2e5ff;
  background: linear-gradient(135deg, #ffffff, #f4f3ff);
  box-shadow: 0 10px 20px rgba(15,23,42,0.06);
  font-size: 1.05rem;
  font-weight: 800;
}

.ankama-seller-dashboard #tab-depot .ankama-price-preview::before{
  content: '$';
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background: #f4f3ff;
  border: 1px solid #e2e5ff;
  color: #7065ff;
  font-weight: 900;
}

.ankama-seller-dashboard #ankama_deposit_price_range{
  margin-left: auto;
  font-weight: 600;
}

/* Empty state */
.ankama-seller-dashboard .aam-empty-state{
  text-align:center;
  padding: 1.2rem 1rem;
  border: 1px dashed #d1d5e5;
  border-radius: 16px;
  background: #f9fafb;
}
