/* ==========================================
   1. VARIABLES & CONFIGURATION GÉNÉRALE
   ========================================== */
:root {
  --bg-deep: #0b0d1a;
  --brand-main: #4b1d8b;
  --brand-magenta: #8f48c5;
  --brand-blue: #49b6ff;
  --brand-gold: #ffc821;
  --brand-light: #a8f0ff;
}

body {
  font-family: "Poppins", sans-serif;
  background-color: var(--bg-deep);
  color: #e2e8f0;
  background-image: radial-gradient(
    circle at 50% -10%,
    #4b1d8b44,
    transparent 600px
  );
  min-height: 100vh;
}

/* ==========================================
   2. NAVIGATION & HEADER
   ========================================== */
.header-nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 40px 20px;
}

.logo-container img {
  height: 80px;
  width: auto;
  filter: drop-shadow(0 0 10px var(--brand-magenta));
  transition: all 0.3s ease;
}

.logo-container:hover img {
  filter: drop-shadow(0 0 20px var(--brand-blue));
  transform: rotate(-5deg) scale(1.1);
}

.title-main {
  font-size: 4rem;
  font-weight: 900;
  text-transform: uppercase;
  font-style: italic;
  letter-spacing: -2px;
}

.title-aria {
  color: var(--brand-magenta);
  text-shadow: 0 0 15px rgba(143, 72, 197, 0.6);
}

/* ==========================================
   3. BARRE DE RECHERCHE
   ========================================== */
.search-bar {
  background: rgba(30, 41, 59, 0.5);
  border: 2px solid var(--brand-main);
  transition: all 0.3s ease;
}

.search-bar:focus {
  border-color: var(--brand-gold);
  box-shadow: 0 0 15px rgba(255, 200, 33, 0.2);
}

/* ==========================================
   4. BOUTONS & ÉLÉMENTS D'ACTION
   ========================================== */
.nav-btn {
  background: rgba(75, 29, 139, 0.3);
  border: 1px solid var(--brand-magenta);
  color: white;
  transition: all 0.2s;
}

.nav-btn:hover {
  background: var(--brand-magenta);
  border-color: var(--brand-light);
  transform: translateY(-2px);
}

.edit-btn {
  opacity: 0;
  transition: opacity 0.2s;
  color: #64748b;
}

.group:hover .edit-btn {
  opacity: 1;
}

.edit-btn:hover {
  color: var(--brand-gold) !important;
}

/* ==========================================
   5. CARTES WIKI & CONTENU
   ========================================== */
.category-title {
  color: var(--brand-light);
  border-left: 4px solid var(--brand-gold);
  padding-left: 15px;
  background: linear-gradient(90deg, rgba(143, 72, 197, 0.2), transparent);
}

.glass {
  background: linear-gradient(
    135deg,
    rgba(75, 29, 139, 0.2),
    rgba(143, 72, 197, 0.1)
  );
  backdrop-filter: blur(12px);
  border: 1px solid rgba(143, 72, 197, 0.3);
  padding: 2rem;
  border-radius: 24px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.glass:hover {
  border-color: var(--brand-blue);
  background: rgba(143, 72, 197, 0.2);
  transform: translateY(-5px);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(73, 182, 255, 0.1);
}

.glass h3 {
  font-size: 1.1rem;
  line-height: 1.4;
  margin-bottom: 1rem;
  color: #ffffff;
  font-weight: 700;
}

.glass p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #94a3b8;
}
/* ==========================================
   6. MODALE WYSIWYG
   ========================================== */

/* Fenêtre */
.modal-window {
  background: linear-gradient(
    135deg,
    rgba(75, 29, 139, 0.25),
    rgba(143, 72, 197, 0.12)
  );
  backdrop-filter: blur(20px);
  border: 1px solid rgba(143, 72, 197, 0.4);
  border-radius: 24px;
  box-shadow:
    0 25px 60px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(143, 72, 197, 0.1);
}

/* En-tête */
.modal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}
.modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

/* Labels & inputs */
.modal-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #64748b;
}

.modal-input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: #e2e8f0;
  font-family: "Poppins", sans-serif;
  font-size: 0.88rem;
  padding: 0.6rem 1rem;
  outline: none;
  width: 100%;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.modal-input:focus {
  border-color: var(--brand-magenta);
  box-shadow: 0 0 0 3px rgba(143, 72, 197, 0.15);
}
.modal-input::placeholder {
  color: #475569;
}

/* ---- TOOLBAR ---- */
.wysiwyg-toolbar {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(143, 72, 197, 0.25);
  border-bottom: none;
}

.wy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 7px;
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: "Poppins", sans-serif;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1;
}
.wy-btn:hover {
  background: rgba(73, 182, 255, 0.15);
  border-color: var(--brand-blue);
  color: var(--brand-blue);
}
.wy-btn:active {
  transform: scale(0.93);
}
.wy-btn-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #f87171;
  color: #f87171;
}

.wy-sep {
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, 0.07);
  margin: 0 3px;
  flex-shrink: 0;
}

/* ---- ZONE D'ÉDITION ---- */
.wysiwyg-editor {
  min-height: 200px;
  max-height: 340px;
  overflow-y: auto;
  padding: 1rem 1.2rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(143, 72, 197, 0.25);
  color: #cbd5e1;
  font-family: "Poppins", sans-serif;
  font-size: 0.88rem;
  line-height: 1.75;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.wysiwyg-editor:focus {
  border-color: var(--brand-magenta);
  box-shadow: 0 0 0 3px rgba(143, 72, 197, 0.12);
}

/* Placeholder natif */
.wysiwyg-editor:empty::before {
  content: attr(data-placeholder);
  color: #475569;
  pointer-events: none;
  display: block;
}

/* ---- STYLES DU CONTENU DANS L'ÉDITEUR ---- */
.wysiwyg-editor h2,
.wiki-content h2 {
  color: var(--brand-light);
  font-size: 1.1rem;
  font-weight: 800;
  margin: 0.8rem 0 0.3rem;
  padding-left: 10px;
  border-left: 3px solid var(--brand-gold);
}

.wysiwyg-editor h3,
.wiki-content h3 {
  color: #a78bfa;
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0.6rem 0 0.2rem;
}

.wysiwyg-editor strong,
.wiki-content strong {
  color: #ffffff;
  font-weight: 700;
}

.wysiwyg-editor em,
.wiki-content em {
  color: #c4b5fd;
  font-style: italic;
}

.wysiwyg-editor u,
.wiki-content u {
  text-decoration-color: var(--brand-blue);
}

.wysiwyg-editor code,
.wiki-content code {
  background: rgba(73, 182, 255, 0.1);
  color: var(--brand-blue);
  padding: 2px 7px;
  border-radius: 6px;
  font-family: "JetBrains Mono", "Courier New", monospace;
  font-size: 0.82rem;
  border: 1px solid rgba(73, 182, 255, 0.2);
}

.wysiwyg-editor blockquote,
.wiki-content blockquote {
  border-left: 3px solid var(--brand-magenta);
  background: rgba(143, 72, 197, 0.08);
  padding: 0.5rem 1rem;
  border-radius: 0 10px 10px 0;
  color: #c4b5fd;
  margin: 0.6rem 0;
  font-style: italic;
}

.wysiwyg-editor ul,
.wiki-content ul {
  padding-left: 1.4rem;
  margin: 0.4rem 0;
  list-style: none;
}
.wysiwyg-editor ul li::before,
.wiki-content ul li::before {
  content: "▸";
  color: var(--brand-gold);
  font-size: 0.7rem;
  margin-right: 0.5rem;
}

.wysiwyg-editor ol,
.wiki-content ol {
  padding-left: 1.6rem;
  margin: 0.4rem 0;
  color: #94a3b8;
}
.wysiwyg-editor ol li::marker,
.wiki-content ol li::marker {
  color: var(--brand-blue);
  font-weight: 700;
}

.wysiwyg-editor a,
.wiki-content a {
  color: var(--brand-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.wysiwyg-editor img,
.wiki-content img {
  max-width: 100%;
  border-radius: 12px;
  margin: 0.5rem 0;
  border: 1px solid rgba(143, 72, 197, 0.2);
}

/* Scrollbar de l'éditeur */
.wysiwyg-editor::-webkit-scrollbar {
  width: 4px;
}
.wysiwyg-editor::-webkit-scrollbar-track {
  background: transparent;
}
.wysiwyg-editor::-webkit-scrollbar-thumb {
  background: rgba(143, 72, 197, 0.4);
  border-radius: 4px;
}

/* ---- PIED DE MODALE ---- */
.modal-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-btn-cancel {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #64748b;
  cursor: pointer;
  font-family: "Poppins", sans-serif;
  transition: all 0.2s;
}
.modal-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}

.modal-btn-save {
  background: linear-gradient(135deg, var(--brand-main), var(--brand-magenta));
  border: none;
  color: white;
  cursor: pointer;
  font-family: "Poppins", sans-serif;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(143, 72, 197, 0.3);
}
.modal-btn-save:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(143, 72, 197, 0.5);
}
.modal-btn-save:active {
  transform: translateY(0);
}
