/* ==========================================================================
   ARTEFACT - UI Kit & Design System (Mobile First)
   Page : /ui-kit.html
   Responsabilité : Agent UI/UX & Design System
   ========================================================================== */

/* Layout du conteneur UI Kit */
.ui-kit-container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Barre de navigation supérieure */
.ui-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-primary);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #000000;
  text-decoration: none;
  border-bottom: 2px solid #000000;
  padding-bottom: 2px;
  transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.back-link:hover {
  background-color: #000000;
  color: #ffffff;
  transform: translateX(-3px);
}

.back-link:focus-visible {
  outline: 3px solid #000000;
  outline-offset: 3px;
}

.ui-links-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sub-link {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #000000;
  background-color: #ffffff;
  border: 2px solid #000000;
  padding: 0.35rem 0.65rem;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sub-link:hover {
  background-color: #000000;
  color: var(--bg-neon);
}

.sub-link:focus-visible {
  outline: 3px solid #000000;
  outline-offset: 2px;
}

/* En-tête principal */
.ui-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ui-title {
  font-family: var(--font-primary);
  font-size: clamp(2rem, 7vw, 3rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--text-primary);
}

.ui-subtitle {
  font-family: var(--font-primary);
  font-size: 0.95rem;
  line-height: 1.45;
  color: #111111;
}

/* Console d'état en direct */
.ui-console {
  background-color: #000000;
  color: var(--bg-neon);
  padding: 0.85rem 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
  min-height: 52px;
  border: 2px solid #000000;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.console-prefix {
  color: #ffffff;
  font-weight: 700;
  opacity: 0.7;
}

/* Cartes de sections / Groupes de composants */
.ui-section {
  background-color: var(--card-bg);
  border: 2px solid #000000;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.ui-section-header {
  border-bottom: 2px solid #000000;
  padding-bottom: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ui-section-title {
  font-family: var(--font-primary);
  font-size: 1.15rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #000000;
}

.ui-section-desc {
  font-family: var(--font-primary);
  font-size: 0.82rem;
  color: #333333;
  line-height: 1.35;
}

/* Grille de spécimens */
.specimen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.specimen-box {
  background-color: #ffffff;
  border: 2px solid #000000;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.specimen-box.dark-bg {
  background-color: #000000;
  color: #ffffff;
}

.specimen-box.neon-bg {
  background-color: var(--bg-neon);
  color: #000000;
}

.specimen-label {
  font-family: var(--font-primary);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #666666;
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
  padding-bottom: 0.35rem;
}

.specimen-box.dark-bg .specimen-label {
  color: #888888;
  border-bottom-color: rgba(255, 255, 255, 0.2);
}

.specimen-box.neon-bg .specimen-label {
  color: #000000;
  border-bottom-color: rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   1. Liens & Textes Interactifs (Design System Universel)
   ========================================================================== */

/* Lien sur fond sombre (Identique au footer) */
.link-dark-bg {
  color: #ffffff;
  text-decoration: none;
  font-family: var(--font-primary);
  font-size: 0.9rem;
  display: inline-block;
  padding: 2px 0;
  transition: opacity 0.2s ease, text-decoration-color 0.2s ease;
}

.link-dark-bg:hover {
  opacity: 0.8;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--bg-neon);
}

.link-dark-bg:active {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--bg-neon);
}

.link-dark-bg:focus-visible {
  outline: 2px solid var(--bg-neon);
  outline-offset: 3px;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--bg-neon);
}

/* Lien sur fond clair / néon */
.link-neon-bg {
  color: #000000;
  text-decoration: none;
  font-family: var(--font-primary);
  font-size: 0.9rem;
  font-weight: 700;
  display: inline-block;
  padding: 2px 0;
  border-bottom: 2px solid transparent;
  transition: border-bottom-color 0.15s ease, background-color 0.15s ease, color 0.15s ease, transform 0.05s ease;
}

.link-neon-bg:hover {
  border-bottom-color: #000000;
  background-color: #000000;
  color: #ffffff;
  padding: 2px 4px;
}

.link-neon-bg:active {
  background-color: #000000;
  color: var(--bg-neon);
  transform: scale(0.98);
}

.link-neon-bg:focus-visible {
  outline: 3px solid #000000;
  outline-offset: 2px;
}

/* Lien avec flèche directionnelle */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-primary);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #000000;
  text-decoration: none;
  transition: transform 0.15s ease;
}

.link-arrow .arrow-icon {
  display: inline-block;
  transition: transform 0.15s ease;
}

.link-arrow:hover .arrow-icon {
  transform: translateX(4px);
}

.link-arrow:focus-visible {
  outline: 3px solid #000000;
  outline-offset: 2px;
}

/* Lien Pillule / Tag */
.link-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-primary);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #000000;
  background-color: #ffffff;
  border: 2px solid #000000;
  padding: 0.35rem 0.75rem;
  text-decoration: none;
  width: fit-content;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.05s ease;
}

.link-pill:hover {
  background-color: #000000;
  color: var(--bg-neon);
}

.link-pill:active {
  transform: scale(0.96);
}

.link-pill:focus-visible {
  outline: 3px solid #000000;
  outline-offset: 2px;
}

/* Titres spécifiques */
.footer-heading-specimen {
  font-family: var(--font-primary);
  font-size: 0.95rem;
  font-weight: 500;
  font-style: italic;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  color: #ffffff;
}

/* ==========================================================================
   2. Boutons & Démonstrateur Interactif des 5 États
   ========================================================================== */

.states-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  background-color: #ffffff;
  border: 2px solid #000000;
}

.states-table th,
.states-table td {
  border: 1px solid #000000;
  padding: 0.65rem 0.75rem;
  text-align: left;
}

.states-table th {
  background-color: #000000;
  color: #ffffff;
  font-family: var(--font-primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.72rem;
}

.buttons-interactive-bar {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
  background-color: #ffffff;
  border: 2px solid #000000;
  padding: 0.85rem;
}

.interactive-test-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   3. Badges, Puces & Statuts
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-primary);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.6rem;
  width: fit-content;
  border-radius: 0;
}

.badge-dark {
  background-color: #000000;
  color: var(--bg-neon);
}

.badge-neon {
  background-color: var(--bg-neon);
  color: #000000;
  border: 2px solid #000000;
}

.badge-outline {
  background-color: transparent;
  color: #000000;
  border: 2px solid #000000;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--bg-neon);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 rgba(0, 255, 0, 0.7);
  animation: pulse-ring 1.8s infinite;
}

@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 255, 0, 0.7);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(0, 255, 0, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 255, 0, 0);
  }
}

/* ==========================================================================
   4. Cartes, Surfaces & Conteneurs
   ========================================================================== */

.card-interactive {
  background-color: var(--card-bg);
  border: 2px solid #000000;
  border-radius: 0;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.card-interactive:hover {
  transform: translateY(-4px);
  box-shadow: 4px 4px 0 #000000;
  background-color: #eaeaea;
}

.card-interactive:active {
  transform: translateY(0);
  box-shadow: none;
}

.card-interactive:focus-visible {
  outline: 3px solid #000000;
  outline-offset: 3px;
}

/* ==========================================================================
   5. Formulaires & Contrôles Brutalistes
   ========================================================================== */

.input-brutalist {
  width: 100%;
  padding: 0.75rem 0.85rem;
  font-family: var(--font-primary);
  font-size: 0.85rem;
  border: 2px solid #000000;
  background-color: #ffffff;
  color: #000000;
  border-radius: 0;
  caret-color: var(--bg-neon);
  transition: background-color 0.15s ease;
}

.input-brutalist:focus {
  outline: 3px solid #000000;
  outline-offset: 2px;
}

.select-brutalist {
  width: 100%;
  padding: 0.75rem 0.85rem;
  font-family: var(--font-primary);
  font-size: 0.85rem;
  border: 2px solid #000000;
  background-color: #ffffff;
  color: #000000;
  border-radius: 0;
  cursor: pointer;
}

.select-brutalist:focus {
  outline: 3px solid #000000;
  outline-offset: 2px;
}

/* Switch Artefact */
.switch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 120px;
  min-height: 44px;
  padding: 0.5rem 0.85rem;
  font-family: var(--font-primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 0;
  border: 2px solid #000000;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.switch-icon {
  width: 12px;
  height: 12px;
  display: inline-block;
  border: 2px solid #000000;
  transition: background-color 0.15s ease;
}

.switch-btn[aria-checked="false"] {
  background-color: #ffffff;
  color: #000000;
  border-color: #000000;
}

.switch-btn[aria-checked="false"] .switch-icon {
  background-color: transparent;
}

.switch-btn[aria-checked="false"]:hover:not(:disabled) {
  background-color: #000000;
  color: #ffffff;
}

.switch-btn[aria-checked="false"]:hover:not(:disabled) .switch-icon {
  border-color: #ffffff;
  background-color: #ffffff;
}

.switch-btn[aria-checked="true"] {
  background-color: var(--bg-neon);
  color: #000000;
  border-color: #000000;
}

.switch-btn[aria-checked="true"] .switch-icon {
  background-color: #000000;
}

.switch-btn[aria-checked="true"]:hover:not(:disabled) {
  background-color: #000000;
  color: var(--bg-neon);
  border-color: #000000;
}

.switch-btn[aria-checked="true"]:hover:not(:disabled) .switch-icon {
  border-color: var(--bg-neon);
  background-color: var(--bg-neon);
}

.switch-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.switch-btn:focus-visible {
  outline: 3px solid #000000;
  outline-offset: 3px;
}

/* ==========================================================================
   6. Composants Spécialisés (Upload Box & Glyphes)
   ========================================================================== */

.upload-box {
  background-color: #ffffff;
  border: 2px dashed #000000;
  border-radius: 0;
  padding: 2rem 1.25rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.upload-box:hover,
.upload-box.is-dragover {
  background-color: #f0fff0;
  border-color: #000000;
  border-style: solid;
}

.upload-box.is-dragover {
  background-color: var(--bg-neon);
}

.upload-box:focus-visible {
  outline: 3px solid #000000;
  outline-offset: 3px;
}

.upload-icon {
  font-size: 2rem;
  line-height: 1;
}

.upload-title {
  font-family: var(--font-primary);
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.upload-desc {
  font-size: 0.8rem;
  color: #555555;
  max-width: 320px;
}

/* Toast de notification */
.toast-neon {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(140%);
  background-color: #000000;
  color: var(--bg-neon);
  border: 2px solid var(--bg-neon);
  font-family: var(--font-primary);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.75rem 1.25rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  text-align: center;
}

.toast-neon.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Bloc d'exemple de code */
.code-block {
  background-color: #000000;
  color: #ffffff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  padding: 0.85rem 1rem;
  border: 2px solid #000000;
  overflow-x: auto;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.code-copy-btn {
  background-color: var(--bg-neon);
  color: #000000;
  border: 1px solid #000000;
  font-family: var(--font-primary);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  transition: transform 0.05s ease, background-color 0.15s ease;
}

.code-copy-btn:hover {
  background-color: #ffffff;
}

.code-copy-btn:active {
  transform: scale(0.95);
}
