/*
 * Finition des vues Admin > Configuration > Customisation / Transfert.
 * Cette couche n'altère pas les composants React ni leurs appels API.
 */

body.cc-route-admin.cc-admin-customisation-page,
body.cc-route-admin.cc-admin-transfer-page {
  --cc-workspace-card: #111114;
  --cc-workspace-card-raised: #151519;
  --cc-workspace-line: rgba(255, 255, 255, 0.095);
  --cc-workspace-line-strong: rgba(255, 255, 255, 0.16);
  --cc-workspace-muted: #8d8d98;
}

/* Player selector */
/* The blurred cards create stacking contexts: raise the whole selector row. */
body.cc-route-admin.cc-admin-customisation-page .dashboard-sidebar.admin-sidebar,
body.cc-route-admin.cc-admin-transfer-page .dashboard-sidebar.admin-sidebar {
  position: relative;
  z-index: 30;
}

body.cc-route-admin.cc-admin-customisation-page .admin-player-search,
body.cc-route-admin.cc-admin-transfer-page .admin-player-search {
  position: relative;
  grid-template-columns: minmax(190px, 230px) minmax(0, 1fr);
  gap: 22px;
  min-height: 86px;
  padding: 16px 18px;
  overflow: visible;
  background:
    radial-gradient(circle at 0 50%, rgba(255, 0, 51, 0.075), transparent 20rem),
    linear-gradient(180deg, rgba(18, 18, 21, 0.99), rgba(12, 12, 15, 0.99));
}

body.cc-route-admin.cc-admin-customisation-page .admin-player-search > h3,
body.cc-route-admin.cc-admin-transfer-page .admin-player-search > h3 {
  gap: 10px;
  color: #f4f4f6;
  font-size: 0.82rem;
  font-weight: 720;
}

body.cc-route-admin.cc-admin-customisation-page .admin-player-search > h3 svg,
body.cc-route-admin.cc-admin-transfer-page .admin-player-search > h3 svg {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  padding: 7px;
  overflow: visible;
  border-radius: 8px;
  background: rgba(255, 0, 51, 0.1);
  color: var(--cc-accent);
}

body.cc-route-admin.cc-admin-customisation-page .admin-player-search > .player-dropdown-container,
body.cc-route-admin.cc-admin-transfer-page .admin-player-search > .player-dropdown-container {
  min-width: 0;
  width: 100%;
}

body.cc-route-admin.cc-admin-customisation-page .admin-player-search .player-dropdown-trigger,
body.cc-route-admin.cc-admin-transfer-page .admin-player-search .player-dropdown-trigger,
body.cc-route-admin.cc-admin-transfer-page .transfer-column .player-dropdown-trigger {
  min-height: 50px;
  padding: 0 15px;
  border-color: var(--cc-workspace-line);
  background: rgba(8, 8, 10, 0.82);
  color: #ededf0;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

body.cc-route-admin.cc-admin-customisation-page .player-dropdown-trigger:hover,
body.cc-route-admin.cc-admin-transfer-page .player-dropdown-trigger:hover {
  border-color: rgba(255, 0, 51, 0.4);
  background: rgba(255, 255, 255, 0.035);
}

body.cc-route-admin.cc-admin-customisation-page .player-dropdown-trigger:focus-visible,
body.cc-route-admin.cc-admin-transfer-page .player-dropdown-trigger:focus-visible {
  border-color: rgba(255, 0, 51, 0.72);
  outline: 3px solid rgba(255, 0, 51, 0.12);
  outline-offset: 2px;
}

body.cc-route-admin.cc-admin-customisation-page .selected-player-info,
body.cc-route-admin.cc-admin-transfer-page .selected-player-info {
  grid-column: 2;
  min-width: 0;
  min-height: 50px;
  margin: 0;
  padding: 9px 12px;
  border-color: rgba(255, 0, 51, 0.24);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 0, 51, 0.1), rgba(255, 0, 51, 0.035));
}

body.cc-route-admin.cc-admin-customisation-page .selected-player-info strong,
body.cc-route-admin.cc-admin-transfer-page .selected-player-info strong {
  font-size: 0.8rem;
}

body.cc-route-admin.cc-admin-customisation-page .selected-player-info .license-text,
body.cc-route-admin.cc-admin-transfer-page .selected-player-info .license-text {
  overflow: hidden;
  color: #777783;
  font-size: 0.62rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.cc-route-admin.cc-admin-customisation-page .player-dropdown-menu,
body.cc-route-admin.cc-admin-transfer-page .player-dropdown-menu {
  z-index: 140;
  margin-top: 5px;
  border-color: var(--cc-workspace-line-strong);
  border-radius: 10px;
  background: rgba(15, 15, 18, 0.99);
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(18px);
}

body.cc-route-admin.cc-admin-customisation-page .dropdown-search,
body.cc-route-admin.cc-admin-transfer-page .dropdown-search {
  padding: 10px;
  border-bottom-color: var(--cc-workspace-line);
}

body.cc-route-admin.cc-admin-customisation-page .dropdown-item,
body.cc-route-admin.cc-admin-transfer-page .dropdown-item {
  min-height: 52px;
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

body.cc-route-admin.cc-admin-customisation-page .dropdown-item:hover,
body.cc-route-admin.cc-admin-transfer-page .dropdown-item:hover {
  background: rgba(255, 0, 51, 0.075);
}

/* Customisation workspace */
body.cc-route-admin.cc-admin-customisation-page .customisation-container {
  display: grid;
  gap: 16px;
}

body.cc-route-admin.cc-admin-customisation-page .customisation-header {
  min-height: 62px;
  padding: 12px 14px 12px 16px;
  border: 1px solid var(--cc-workspace-line);
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(18, 18, 21, 0.96), rgba(12, 12, 15, 0.96));
}

body.cc-route-admin.cc-admin-customisation-page .customisation-header .section-description {
  position: relative;
  padding-left: 14px;
  color: #a5a5af;
  font-size: 0.76rem;
}

body.cc-route-admin.cc-admin-customisation-page .customisation-header .section-description::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 5px;
  height: 26px;
  border-radius: 999px;
  background: var(--cc-accent);
  transform: translateY(-50%);
  box-shadow: 0 0 18px rgba(255, 0, 51, 0.34);
}

body.cc-route-admin.cc-admin-customisation-page .customisation-header strong {
  color: #ffffff;
  font-weight: 760;
}

body.cc-route-admin.cc-admin-customisation-page .save-btn {
  min-width: 134px;
  min-height: 38px;
  justify-content: center;
  border-color: var(--cc-workspace-line);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.72rem;
}

body.cc-route-admin.cc-admin-customisation-page .save-btn.modified {
  border-color: rgba(255, 0, 51, 0.65);
  background: linear-gradient(135deg, #ff0033, #d4002b);
  box-shadow: 0 8px 22px rgba(255, 0, 51, 0.18);
}

body.cc-route-admin.cc-admin-customisation-page .custom-mode-selector {
  width: max-content;
  max-width: 100%;
  gap: 4px;
  justify-content: flex-start;
  margin: 0 auto;
  padding: 4px;
  border: 1px solid var(--cc-workspace-line);
  border-radius: 10px;
  background: rgba(10, 10, 12, 0.82);
}

body.cc-route-admin.cc-admin-customisation-page .custom-mode-btn {
  min-width: 136px;
  min-height: 38px;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #85858f;
  box-shadow: none;
  font-size: 0.74rem;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

body.cc-route-admin.cc-admin-customisation-page .custom-mode-btn.chaos-btn.active,
body.cc-route-admin.cc-admin-customisation-page .custom-mode-btn.rampe-btn.active {
  border-color: rgba(255, 0, 51, 0.32);
  background: rgba(255, 0, 51, 0.13);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 0, 51, 0.04);
}

body.cc-route-admin.cc-admin-customisation-page .custom-mode-btn:hover {
  transform: none;
  border-color: var(--cc-workspace-line-strong);
  background: rgba(255, 255, 255, 0.035);
  color: #e4e4e7;
}

body.cc-route-admin.cc-admin-customisation-page .customisation-unified {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(330px, 0.7fr);
  align-items: start;
  gap: 16px;
}

body.cc-route-admin.cc-admin-customisation-page .preview-container,
body.cc-route-admin.cc-admin-customisation-page .config-panel {
  min-width: 0;
  padding: 16px;
  border-radius: 11px;
  background: var(--cc-workspace-card);
}

body.cc-route-admin.cc-admin-customisation-page .preview-container h4,
body.cc-route-admin.cc-admin-customisation-page .config-panel::before {
  color: #f1f1f3;
  font-size: 0.7rem;
  font-weight: 740;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

body.cc-route-admin.cc-admin-customisation-page .preview-container h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

body.cc-route-admin.cc-admin-customisation-page .preview-container h4::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #35d07f;
  box-shadow: 0 0 0 4px rgba(53, 208, 127, 0.08);
}

body.cc-route-admin.cc-admin-customisation-page .fivem-preview {
  border: 1px solid var(--cc-workspace-line);
  border-radius: 9px;
  background: #050506;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.3);
}

body.cc-route-admin.cc-admin-customisation-page .preview-screen {
  min-height: 0;
  aspect-ratio: 16 / 9;
}

body.cc-route-admin.cc-admin-customisation-page .config-panel {
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 108px);
  overflow: hidden;
}

body.cc-route-admin.cc-admin-customisation-page .config-panel::before {
  content: 'Réglages de l’interface';
  display: block;
  margin-bottom: 12px;
}

body.cc-route-admin.cc-admin-customisation-page .config-panel-scroll {
  display: grid;
  max-height: calc(100vh - 165px);
  grid-template-columns: 1fr;
  gap: 8px;
  padding-right: 4px;
  overflow-y: auto;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
  scrollbar-width: thin;
}

body.cc-route-admin.cc-admin-customisation-page .category-section {
  border-color: rgba(255, 255, 255, 0.075);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
}

body.cc-route-admin.cc-admin-customisation-page .category-section.expanded {
  border-color: rgba(255, 0, 51, 0.28);
  background: rgba(255, 0, 51, 0.025);
}

body.cc-route-admin.cc-admin-customisation-page .category-header {
  min-height: 42px;
  padding: 8px 10px;
  background: transparent;
}

body.cc-route-admin.cc-admin-customisation-page .category-header:hover {
  background: rgba(255, 255, 255, 0.032);
}

body.cc-route-admin.cc-admin-customisation-page .category-icon {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  place-items: center;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.8rem;
}

body.cc-route-admin.cc-admin-customisation-page .category-name {
  color: #dedee2;
  font-size: 0.72rem;
  font-weight: 650;
}

body.cc-route-admin.cc-admin-customisation-page .category-toggle {
  margin-left: auto;
  color: #777781;
}

body.cc-route-admin.cc-admin-customisation-page .category-content {
  gap: 9px;
  max-height: none;
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.12);
}

/* Transfer workflow */
body.cc-route-admin.cc-admin-transfer-page .dashboard-section > .glass-card {
  position: relative;
  overflow: visible;
  padding: 24px;
  border-radius: 13px;
  background:
    radial-gradient(circle at 8% 0, rgba(255, 0, 51, 0.065), transparent 22rem),
    linear-gradient(180deg, rgba(18, 18, 21, 0.99), rgba(11, 11, 14, 0.99));
}

body.cc-route-admin.cc-admin-transfer-page .dashboard-section > .glass-card > h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 5px;
  color: #f5f5f6;
  font-size: 1rem;
  font-weight: 740;
}

body.cc-route-admin.cc-admin-transfer-page .dashboard-section > .glass-card > h3 svg {
  color: var(--cc-accent);
}

body.cc-route-admin.cc-admin-transfer-page .dashboard-section > .glass-card > .section-description {
  margin: 0;
  color: #82828c;
  font-size: 0.74rem;
}

.cc-transfer-guide {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid rgba(103, 139, 255, 0.16);
  border-radius: 8px;
  background: rgba(82, 113, 214, 0.055);
}

.cc-transfer-guide > .material-icons {
  color: #829cf2;
  font-size: 17px;
}

.cc-transfer-guide > div {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 8px;
}

.cc-transfer-guide strong {
  flex: 0 0 auto;
  color: #c6d1f7;
  font-size: 0.69rem;
}

.cc-transfer-guide span:not(.material-icons) {
  color: #77809e;
  font-size: 0.66rem;
}

body.cc-route-admin.cc-admin-transfer-page .transfer-container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px minmax(0, 1fr);
  align-items: stretch;
  gap: 14px;
  margin-top: 18px;
}

body.cc-route-admin.cc-admin-transfer-page .transfer-column {
  position: relative;
  min-width: 0;
  min-height: 158px;
  padding: 18px;
  border: 1px solid var(--cc-workspace-line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.018);
}

body.cc-route-admin.cc-admin-transfer-page .transfer-column::before,
body.cc-route-admin.cc-admin-transfer-page .transfer-action::before {
  content: attr(data-step);
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  margin-right: 8px;
  border: 1px solid rgba(255, 0, 51, 0.22);
  border-radius: 7px;
  background: rgba(255, 0, 51, 0.08);
  color: #ff6d8a;
  font-size: 0.63rem;
  font-weight: 760;
}

body.cc-route-admin.cc-admin-transfer-page .transfer-column h4 {
  display: inline-flex;
  margin: 0 0 14px;
  color: #dddddf;
  font-size: 0.72rem;
  font-weight: 720;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body.cc-route-admin.cc-admin-transfer-page .transfer-player-card {
  min-height: 64px;
  padding: 12px 14px;
  border-color: rgba(255, 0, 51, 0.24);
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(255, 0, 51, 0.1), rgba(255, 0, 51, 0.035));
}

body.cc-route-admin.cc-admin-transfer-page .transfer-player-card.target {
  border-color: rgba(47, 210, 119, 0.24);
  background: linear-gradient(135deg, rgba(47, 210, 119, 0.1), rgba(47, 210, 119, 0.025));
}

body.cc-route-admin.cc-admin-transfer-page .transfer-player-card strong {
  color: #f5f5f6;
  font-size: 0.8rem;
}

body.cc-route-admin.cc-admin-transfer-page .transfer-player-card span {
  overflow: hidden;
  color: #74747e;
  font-size: 0.63rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.cc-route-admin.cc-admin-transfer-page .transfer-hint {
  display: flex;
  min-height: 64px;
  align-items: center;
  margin: 0;
  padding: 0 14px;
  border: 1px dashed var(--cc-workspace-line-strong);
  border-radius: 9px;
  color: #71717b;
  font-size: 0.7rem;
}

body.cc-route-admin.cc-admin-transfer-page .transfer-arrow {
  align-self: center;
  padding: 0;
  color: var(--cc-accent);
  filter: drop-shadow(0 0 10px rgba(255, 0, 51, 0.24));
}

body.cc-route-admin.cc-admin-transfer-page .transfer-column .player-dropdown-container {
  margin: 0;
}

body.cc-route-admin.cc-admin-transfer-page .transfer-column .player-dropdown-trigger {
  min-height: 64px;
}

body.cc-route-admin.cc-admin-transfer-page .transfer-column .transfer-player-card.target {
  margin-top: 10px;
}

body.cc-route-admin.cc-admin-transfer-page .clear-target {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
  color: #8b8b94;
}

body.cc-route-admin.cc-admin-transfer-page .transfer-action {
  grid-column: 1 / -1;
  margin: 0;
  padding: 16px 18px;
  border: 1px solid var(--cc-workspace-line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.018);
  text-align: left;
}

body.cc-route-admin.cc-admin-transfer-page .transfer-btn {
  min-height: 42px;
  gap: 9px;
  padding: 0 18px;
  border: 1px solid rgba(255, 0, 51, 0.58);
  border-radius: 8px;
  background: linear-gradient(135deg, #ff0033, #d3002a);
  box-shadow: 0 10px 28px rgba(255, 0, 51, 0.16);
  font-size: 0.75rem;
}

body.cc-route-admin.cc-admin-transfer-page .transfer-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(255, 0, 51, 0.24);
}

body.cc-route-admin.cc-admin-transfer-page .transfer-result {
  display: inline-flex;
  margin: 0 0 0 12px;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 0.68rem;
  vertical-align: middle;
}

@media (max-width: 1220px) {
  body.cc-route-admin.cc-admin-customisation-page .customisation-unified {
    grid-template-columns: 1fr;
  }

  body.cc-route-admin.cc-admin-customisation-page .config-panel {
    position: static;
    max-height: none;
  }

  body.cc-route-admin.cc-admin-customisation-page .config-panel-scroll {
    max-height: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }
}

@media (max-width: 900px) {
  body.cc-route-admin.cc-admin-customisation-page .admin-player-search,
  body.cc-route-admin.cc-admin-transfer-page .admin-player-search {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  body.cc-route-admin.cc-admin-customisation-page .selected-player-info,
  body.cc-route-admin.cc-admin-transfer-page .selected-player-info {
    grid-column: 1;
  }

  body.cc-route-admin.cc-admin-transfer-page .transfer-container {
    grid-template-columns: 1fr;
  }

  body.cc-route-admin.cc-admin-transfer-page .transfer-arrow {
    min-height: 34px;
    transform: rotate(90deg);
  }

  body.cc-route-admin.cc-admin-transfer-page .transfer-action {
    grid-column: auto;
  }
}

@media (max-width: 680px) {
  body.cc-route-admin.cc-admin-customisation-page .customisation-header {
    align-items: stretch;
    flex-direction: column;
  }

  body.cc-route-admin.cc-admin-customisation-page .save-btn {
    width: 100%;
  }

  body.cc-route-admin.cc-admin-customisation-page .custom-mode-selector {
    width: 100%;
  }

  body.cc-route-admin.cc-admin-customisation-page .custom-mode-btn {
    min-width: 0;
    flex: 1;
    padding: 0 10px;
  }

  body.cc-route-admin.cc-admin-customisation-page .preview-container,
  body.cc-route-admin.cc-admin-customisation-page .config-panel,
  body.cc-route-admin.cc-admin-transfer-page .dashboard-section > .glass-card {
    padding: 14px;
  }

  body.cc-route-admin.cc-admin-customisation-page .config-panel-scroll {
    grid-template-columns: 1fr;
  }

  .cc-transfer-guide {
    align-items: flex-start;
  }

  .cc-transfer-guide > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  body.cc-route-admin.cc-admin-transfer-page .transfer-column {
    min-height: 0;
    padding: 14px;
  }

  body.cc-route-admin.cc-admin-transfer-page .transfer-action {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
  }

  body.cc-route-admin.cc-admin-transfer-page .transfer-btn,
  body.cc-route-admin.cc-admin-transfer-page .transfer-result {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: center;
    margin: 0;
  }
}

.cc-customisation-load-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.cc-customisation-load-state h3,
.cc-customisation-load-state p {
  margin: 0;
}

.cc-customisation-load-state .save-btn {
  justify-content: center;
  max-width: 280px;
}

@media (prefers-reduced-motion: reduce) {
  body.cc-route-admin.cc-admin-customisation-page *,
  body.cc-route-admin.cc-admin-transfer-page * {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
