@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;900&display=swap');

:root {
  --wiki-bg: #0d0f12;
  --wiki-surface: #15181e;
  --wiki-surface-hover: #1c2028;
  --wiki-primary: #3b82f6;
  --wiki-primary-glow: rgba(59, 130, 246, 0.4);
  --wiki-text-main: #f3f4f6;
  --wiki-text-muted: #9ca3af;
  --wiki-border: #2dd4bf22;
  --sidebar-width: 280px;
  --nav-height: 70px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Montserrat', sans-serif;
  background-color: var(--wiki-bg);
  color: var(--wiki-text-main);
  overflow-x: hidden;
}

* {
  box-sizing: border-box;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--wiki-bg);
}
::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--wiki-primary);
}

/* Layout */
.wiki-layout {
  display: flex;
  min-height: calc(100vh - var(--nav-height));
  margin-top: var(--nav-height);
}

/* Navbar (top) */
.wiki-navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  background: rgba(13, 15, 18, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--wiki-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 1000;
}

.wiki-nav-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.wiki-logo {
  height: 40px;
  cursor: pointer;
}

.wiki-nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-wiki-nav {
  padding: 0.7rem 1.4rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--wiki-border);
  color: var(--wiki-text-main);
  backdrop-filter: blur(5px);
  position: relative;
  overflow: hidden;
}

.btn-wiki-nav::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.05),
    transparent
  );
  transition: 0.5s;
}

.btn-wiki-nav:hover::before {
  left: 100%;
}

.btn-wiki-nav:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: var(--wiki-primary);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  background: rgba(255, 255, 255, 0.06);
}

.btn-wiki-nav i {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: var(--wiki-primary);
}

.btn-wiki-nav:hover i {
  transform: scale(1.2) rotate(8deg);
}

.btn-accueil {
  border-color: var(--wiki-border);
}

.btn-discord {
  background: linear-gradient(135deg, #5865F2, #4752c4);
  color: white;
  border: none;
  box-shadow: 0 4px 15px rgba(88, 101, 242, 0.3);
}

.btn-discord:hover {
  background: linear-gradient(135deg, #4752c4, #3b449b);
  box-shadow: 0 8px 25px rgba(88, 101, 242, 0.5);
}

.btn-discord i {
  color: white;
}

/* Mobile Sidebar Toggle */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--wiki-text-main);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Sidebar */
.wiki-sidebar {
  width: var(--sidebar-width);
  background: var(--wiki-surface);
  border-right: 1px solid var(--wiki-border);
  height: calc(100vh - var(--nav-height));
  position: fixed;
  top: var(--nav-height);
  left: 0;
  overflow-y: auto;
  padding: 1.5rem 1rem;
  transition: var(--transition);
  z-index: 900;
}

/* --- Bouton Compte (Nav) --- */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-account-glow {
  display: flex !important;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 8px 18px;
  border-radius: 50px;
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
}

.btn-account-glow .btn-icon {
  color: #fff;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.1);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s;
}

.btn-account-glow .btn-text {
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  transition: color 0.3s;
}

.btn-account-glow:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.05));
  border-color: rgba(59, 130, 246, 0.6);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.25), inset 0 0 10px rgba(59, 130, 246, 0.1);
  transform: translateY(-2px);
}

.btn-account-glow:hover .btn-icon {
  background: var(--wiki-primary);
  color: #fff;
  transform: scale(1.15) rotate(5deg);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.btn-account-glow:hover .btn-text {
  color: #fff;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.btn-account-glow::after {
  display: none !important;
}

/* --- MODERATION MODAL (Profile & Déconnexion) --- */
.mod-overlay {
  z-index: 10001 !important;
}

.mod-box {
  background: linear-gradient(135deg, #0d1117, #05070a) !important;
  border: 1px solid rgba(0, 184, 255, 0.2) !important;
  padding: 2.5rem !important;
  max-width: 450px !important;
}

.close-mod {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
}

.mod-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.mod-avatar-large {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 3px solid var(--wiki-primary);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.mod-status-badge {
  padding: 5px 15px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
  color: #aaa;
  text-transform: uppercase;
}

.mod-actions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 25px;
}

.btn-mod-action {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 600;
  font-size: 0.95rem;
}

.btn-mod-action i {
  font-size: 1.1rem;
}

.btn-mod-action.delete:hover {
  background: rgba(255, 165, 0, 0.1);
  border-color: orange;
  color: orange;
}

.btn-mod-action.ban:hover {
  background: rgba(255, 64, 64, 0.2);
  border-color: #ff4040;
  box-shadow: 0 0 15px rgba(255, 64, 64, 0.3);
}

.btn-mod-action.unban:hover {
  background: rgba(0, 255, 136, 0.2);
  border-color: #00ff88;
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

.btn-mod-action.logout-btn-neutral:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

/* --- AUTH MODALS --- */
.auth-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.auth-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.auth-modal-box {
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2rem;
  border-radius: 15px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.auth-modal-overlay.active .auth-modal-box {
  transform: scale(1);
}

.auth-modal-icon {
  font-size: 3rem;
  color: #5865F2;
  margin-bottom: 1rem;
}

.auth-modal-icon.warning {
  color: #ffcc00;
}

.auth-modal-box p {
  color: #bbb;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.auth-modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.auth-modal-actions button {
  padding: 10px 20px;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-cancel {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.btn-cancel:hover {
  background: rgba(255, 255, 255, 0.2);
}
.btn-confirm {
  background: #5865F2;
  color: #fff;
}
.btn-confirm:hover {
  background: #4752c4;
}
.btn-confirm.red {
  background: #ff4444;
}
.btn-confirm.red:hover {
  background: #cc0000;
}

/* Accordion Logic */
.category-group {
  margin-bottom: 0.5rem;
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem;
  background: transparent;
  color: var(--wiki-text-main);
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.category-header:hover {
  background: var(--wiki-surface-hover);
  color: var(--wiki-primary);
}

.category-header i.fa-chevron-down {
  transition: var(--transition);
  font-size: 0.8rem;
}

.category-group.active .category-header {
  background: rgba(59, 130, 246, 0.1);
  color: var(--wiki-primary);
}

.category-group.active .category-header i.fa-chevron-down {
  transform: rotate(180deg);
}

.subcategory-list {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-in-out;
  padding-left: 1rem;
  margin-top: 0.2rem;
}

.category-group.active .subcategory-list {
  max-height: 500px;
}

.subcategory-link {
  display: block;
  padding: 0.6rem 1rem;
  color: var(--wiki-text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  border-radius: 6px;
  transition: var(--transition);
  position: relative;
}

.subcategory-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 0;
  background: var(--wiki-primary);
  border-radius: 0 4px 4px 0;
  transition: var(--transition);
}

.subcategory-link:hover, .subcategory-link.active {
  color: var(--wiki-text-main);
  background: var(--wiki-surface-hover);
  padding-left: 1.5rem;
}

.subcategory-link:hover::before, .subcategory-link.active::before {
  height: 60%;
}


/* Main Content */
.wiki-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 3rem 4rem;
  max-width: 1200px;
}

.wiki-page-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #fff, #9ca3af);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.wiki-card {
  background: var(--wiki-surface);
  border: 1px solid var(--wiki-border);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.wiki-text {
  line-height: 1.8;
  color: var(--wiki-text-muted);
  font-size: 1.05rem;
}

/* Chain Reveal Animation Classes */
.reveal-item {
  opacity: 0;
  transform: translateY(20px);
  animation: revealUp 0.6s ease forwards;
}

@keyframes revealUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Support Cards */
.support-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.support-card {
  background: var(--wiki-bg);
  border: 1px solid var(--wiki-border);
  border-radius: 10px;
  padding: 1.5rem;
  text-align: center;
  transition: var(--transition);
  text-decoration: none;
  color: var(--wiki-text-main);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.support-card:hover {
  border-color: var(--wiki-primary);
  box-shadow: 0 0 20px var(--wiki-primary-glow);
  transform: translateY(-5px);
}

.support-icon {
  font-size: 2.5rem;
  color: var(--wiki-primary);
}

/* Content Accordion (for Lexique, Rules, Pre-requis) */
.content-accordion {
  border: 1px solid var(--wiki-border);
  border-radius: 8px;
  margin-bottom: 1rem;
  overflow: hidden;
  background: var(--wiki-surface);
}

.content-accordion-header {
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.02);
  transition: var(--transition);
}

.content-accordion-header:hover {
  background: rgba(255, 255, 255, 0.05);
}

.content-accordion.active .content-accordion-header {
  border-bottom: 1px solid var(--wiki-border);
  color: var(--wiki-primary);
}

.content-accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  padding: 0 1.5rem;
  color: var(--wiki-text-muted);
  line-height: 1.6;
}

.content-accordion.active .content-accordion-body {
  max-height: 3000px;
  padding: 1.5rem;
}

/* Responsive */
@media (max-width: 900px) {
  .wiki-sidebar {
    transform: translateX(-100%);
  }
  .wiki-sidebar.open {
    transform: translateX(0);
    box-shadow: 10px 0 30px rgba(0,0,0,0.5);
  }
  .wiki-content {
    margin-left: 0;
    padding: 2rem 1.5rem;
  }
  .mobile-toggle {
    display: block;
  }
}
