/* ============================================
   NIVEAU 25 — LES COMPOSANTS UI
   Styles spécifiques au chapitre
   ============================================ */

/* ---------- SECTION DÉMO ---------- */
.demo-section {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1rem;
  background: #f8fafc;
}

.demo-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.demo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.demo-row:last-child { margin-bottom: 0; }

/* ---------- BUTTONS ---------- */
.demo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  font-family: inherit;
}

.demo-btn--primary { background: #2563eb; color: white; }
.demo-btn--primary:hover { background: #1d4ed8; }

.demo-btn--secondary { background: #64748b; color: white; }
.demo-btn--secondary:hover { background: #475569; }

.demo-btn--outline { background: transparent; color: #2563eb; border: 2px solid #2563eb; }
.demo-btn--outline:hover { background: #2563eb; color: white; }

.demo-btn--ghost { background: transparent; color: #64748b; }
.demo-btn--ghost:hover { background: #f1f5f9; color: #1e293b; }

.demo-btn--danger { background: #dc2626; color: white; }
.demo-btn--danger:hover { background: #b91c1c; }

.demo-btn--success { background: #16a34a; color: white; }
.demo-btn--success:hover { background: #15803d; }

.demo-btn--sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
.demo-btn--md { padding: 0.55rem 1.1rem; font-size: 0.9rem; }
.demo-btn--lg { padding: 0.75rem 1.5rem; font-size: 1rem; }

.demo-btn--icon {
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  border-radius: 50%;
  font-size: 1rem;
}

.demo-btn--loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.demo-btn--loading::after {
  content: '';
  position: absolute;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.demo-btn--disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- CARDS ---------- */
.demo-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.demo-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

.demo-card__img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
}

.demo-card__body { padding: 1.25rem; }
.demo-card__title { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; color: #1e293b; }
.demo-card__text { color: #64748b; font-size: 0.9rem; line-height: 1.6; margin-bottom: 1rem; }
.demo-card__footer { padding: 1rem 1.25rem; border-top: 1px solid #e2e8f0; display: flex; gap: 0.5rem; }

/* Product card */
.demo-product { text-align: center; }
.demo-product .demo-card__img { height: 200px; }
.demo-product__price { font-size: 1.3rem; font-weight: 700; color: #2563eb; }
.demo-product__price--old { font-size: 0.9rem; color: #94a3b8; text-decoration: line-through; margin-left: 0.5rem; }

/* Profile card */
.demo-profile { text-align: center; padding: 2rem 1.25rem; }
.demo-profile__avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
}
.demo-profile__name { font-weight: 700; font-size: 1.1rem; margin-bottom: 0.25rem; }
.demo-profile__role { color: #64748b; font-size: 0.85rem; margin-bottom: 1rem; }
.demo-profile__socials { display: flex; justify-content: center; gap: 0.75rem; }
.demo-profile__social {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  text-decoration: none;
  font-size: 0.8rem;
  transition: all 0.2s;
}
.demo-profile__social:hover { background: #2563eb; color: white; }

/* Stats card */
.demo-stats { display: flex; align-items: center; gap: 1rem; padding: 1.25rem; }
.demo-stats__icon {
  width: 3rem;
  height: 3rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.demo-stats__icon--blue { background: #eff6ff; color: #2563eb; }
.demo-stats__icon--green { background: #f0fdf4; color: #16a34a; }
.demo-stats__icon--purple { background: #faf5ff; color: #7c3aed; }
.demo-stats__icon--orange { background: #fff7ed; color: #ea580c; }
.demo-stats__number { font-size: 1.5rem; font-weight: 700; color: #1e293b; }
.demo-stats__label { font-size: 0.8rem; color: #64748b; }
.demo-stats__trend { font-size: 0.75rem; font-weight: 600; }
.demo-stats__trend--up { color: #16a34a; }
.demo-stats__trend--down { color: #dc2626; }

/* Blog card */
.demo-blog__meta { display: flex; gap: 0.5rem; font-size: 0.8rem; color: #94a3b8; margin-bottom: 0.75rem; }

/* Team card */
.demo-team { text-align: center; padding: 1.5rem 1.25rem; }
.demo-team__avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #ec4899);
  margin: 0 auto 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.3rem;
  font-weight: 700;
}

/* Testimonial card */
.demo-testimonial { padding: 1.5rem; }
.demo-testimonial__quote {
  font-style: italic;
  color: #475569;
  line-height: 1.7;
  margin-bottom: 1rem;
  position: relative;
  padding-left: 1.5rem;
  border-left: 3px solid #2563eb;
}
.demo-testimonial__author { display: flex; align-items: center; gap: 0.75rem; }
.demo-testimonial__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #475569;
}

/* ---------- NAVIGATION ---------- */
.demo-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.demo-navbar__logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: #2563eb;
  text-decoration: none;
}

.demo-navbar__links { display: flex; gap: 1.5rem; list-style: none; }
.demo-navbar__link {
  color: #475569;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.demo-navbar__link:hover,
.demo-navbar__link--active { color: #2563eb; }

.demo-navbar__cta {
  background: #2563eb;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Sidebar nav */
.demo-sidebar {
  width: 220px;
  background: #1e293b;
  border-radius: 10px;
  padding: 1rem 0;
  color: #94a3b8;
}

.demo-sidebar__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.25rem;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.15s;
}

.demo-sidebar__item:hover { background: rgba(255,255,255,0.05); color: white; }
.demo-sidebar__item--active { background: rgba(255,255,255,0.1); color: white; font-weight: 600; }

/* Breadcrumbs */
.demo-breadcrumbs { display: flex; gap: 0.5rem; font-size: 0.85rem; color: #94a3b8; }
.demo-breadcrumbs a { color: #2563eb; text-decoration: none; }
.demo-breadcrumbs a:hover { text-decoration: underline; }
.demo-breadcrumbs__sep { color: #cbd5e1; }

/* Pagination */
.demo-pagination { display: flex; gap: 0.35rem; }
.demo-pagination__btn {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: white;
  color: #475569;
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.15s;
}
.demo-pagination__btn:hover { border-color: #2563eb; color: #2563eb; }
.demo-pagination__btn--active { background: #2563eb; color: white; border-color: #2563eb; }

/* Tabs */
.demo-tabs { display: flex; border-bottom: 2px solid #e2e8f0; gap: 0; }
.demo-tab {
  padding: 0.6rem 1.25rem;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  font-family: inherit;
}
.demo-tab:hover { color: #1e293b; }
.demo-tab--active { color: #2563eb; border-bottom-color: #2563eb; font-weight: 600; }

/* ---------- FEEDBACK ---------- */
.demo-alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.demo-alert--success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.demo-alert--warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.demo-alert--error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.demo-alert--info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* Toast */
.demo-toast {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  background: #1e293b;
  color: white;
  border-radius: 8px;
  font-size: 0.85rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Badge */
.demo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.4;
}

.demo-badge--status { }
.demo-badge--success { background: #dcfce7; color: #166534; }
.demo-badge--warning { background: #fef3c7; color: #92400e; }
.demo-badge--error { background: #fee2e2; color: #991b1b; }
.demo-badge--info { background: #dbeafe; color: #1e40af; }

.demo-badge--count {
  background: #dc2626;
  color: white;
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 0.35rem;
  border-radius: 9999px;
  font-size: 0.65rem;
}

/* Progress bar */
.demo-progress {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
}

.demo-progress__bar {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.5s ease;
}

.demo-progress__bar--blue { background: #2563eb; }
.demo-progress__bar--green { background: #16a34a; }
.demo-progress__bar--orange { background: #f59e0b; }
.demo-progress__bar--red { background: #dc2626; }

/* Skeleton */
.demo-skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 6px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---------- OVERLAY ---------- */
.demo-modal-overlay {
  position: relative;
  background: rgba(0,0,0,0.3);
  border-radius: 12px;
  padding: 3rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 250px;
}

.demo-modal {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  overflow: hidden;
}

.demo-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.demo-modal__title { font-weight: 700; font-size: 1.1rem; }

.demo-modal__close {
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #94a3b8;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.2rem;
}
.demo-modal__close:hover { background: #f1f5f9; color: #1e293b; }

.demo-modal__body { padding: 1.5rem; color: #475569; line-height: 1.6; }

.demo-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid #e2e8f0;
}

/* Tooltip */
.demo-tooltip-wrapper {
  position: relative;
  display: inline-block;
}

.demo-tooltip-wrapper:hover .demo-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.demo-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #1e293b;
  color: white;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
  pointer-events: none;
  z-index: 10;
}

.demo-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1e293b;
}

/* Popover */
.demo-popover {
  position: relative;
  display: inline-block;
}

.demo-popover__content {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  min-width: 220px;
  z-index: 10;
}

/* Dropdown */
.demo-dropdown {
  position: relative;
  display: inline-block;
}

.demo-dropdown__menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.35rem;
  min-width: 180px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 10;
}

.demo-dropdown__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  color: #475569;
  font-size: 0.85rem;
  text-decoration: none;
  transition: background 0.15s;
}

.demo-dropdown__item:hover { background: #f1f5f9; color: #1e293b; }
.demo-dropdown__divider { height: 1px; background: #e2e8f0; margin: 0.35rem 0; }

/* Accordion */
.demo-accordion { border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; }

.demo-accordion__item { border-bottom: 1px solid #e2e8f0; }
.demo-accordion__item:last-child { border-bottom: none; }

.demo-accordion__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0.9rem 1.25rem;
  background: transparent;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: #1e293b;
  transition: background 0.15s;
  text-align: left;
  font-family: inherit;
}

.demo-accordion__header:hover { background: #f8fafc; }

.demo-accordion__icon {
  transition: transform 0.2s;
  font-size: 0.8rem;
  color: #94a3b8;
}

.demo-accordion__item--open .demo-accordion__icon { transform: rotate(180deg); }

.demo-accordion__body {
  padding: 0 1.25rem 1rem;
  color: #475569;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ---------- FORM COMPONENTS ---------- */
.demo-input-group {
  display: flex;
  align-items: stretch;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  overflow: hidden;
  background: white;
}

.demo-input-group:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.demo-input-group__prefix,
.demo-input-group__suffix {
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  background: #f9fafb;
  color: #6b7280;
  font-size: 0.85rem;
  border: none;
}

.demo-input-group__input {
  flex: 1;
  border: none;
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
  outline: none;
  font-family: inherit;
}

/* Custom checkbox */
.demo-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  user-select: none;
}

.demo-checkbox input { display: none; }

.demo-checkbox__check {
  width: 1.15rem;
  height: 1.15rem;
  border: 2px solid #d1d5db;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}

.demo-checkbox input:checked + .demo-checkbox__check {
  background: #2563eb;
  border-color: #2563eb;
  color: white;
}

/* Custom radio */
.demo-radio {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  user-select: none;
}

.demo-radio input { display: none; }

.demo-radio__circle {
  width: 1.15rem;
  height: 1.15rem;
  border: 2px solid #d1d5db;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}

.demo-radio input:checked + .demo-radio__circle {
  border-color: #2563eb;
}

.demo-radio input:checked + .demo-radio__circle::after {
  content: '';
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #2563eb;
}

/* Switch */
.demo-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.demo-switch input { display: none; }

.demo-switch__track {
  width: 2.75rem;
  height: 1.5rem;
  background: #d1d5db;
  border-radius: 9999px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.demo-switch input:checked + .demo-switch__track {
  background: #2563eb;
}

.demo-switch__thumb {
  width: 1.2rem;
  height: 1.2rem;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 0.15rem;
  left: 0.15rem;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.demo-switch input:checked + .demo-switch__track .demo-switch__thumb {
  transform: translateX(1.25rem);
}

/* Select */
.demo-select {
  padding: 0.6rem 2rem 0.6rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: white;
  font-size: 0.9rem;
  color: #1e293b;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  cursor: pointer;
  font-family: inherit;
}

.demo-select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* Range slider */
.demo-range {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 9999px;
  outline: none;
}

.demo-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: #2563eb;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* File upload */
.demo-file-upload {
  border: 2px dashed #d1d5db;
  border-radius: 10px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #fafafa;
}

.demo-file-upload:hover {
  border-color: #2563eb;
  background: #eff6ff;
}

.demo-file-upload__icon { font-size: 2rem; margin-bottom: 0.5rem; color: #94a3b8; }
.demo-file-upload__text { color: #64748b; font-size: 0.85rem; }
.demo-file-upload__text strong { color: #2563eb; }

/* ---------- LAYOUT COMPONENTS ---------- */
.demo-hero {
  background: linear-gradient(135deg, #1e3a8a, #2563eb, #7c3aed);
  color: white;
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: center;
}

.demo-hero__title { font-size: 1.8rem; font-weight: 800; margin-bottom: 0.75rem; }
.demo-hero__text { font-size: 1.05rem; opacity: 0.9; margin-bottom: 1.5rem; max-width: 500px; margin-left: auto; margin-right: auto; }
.demo-hero__actions { display: flex; gap: 0.75rem; justify-content: center; }

.demo-footer {
  background: #1e293b;
  color: #94a3b8;
  border-radius: 12px;
  padding: 2.5rem 2rem;
}

.demo-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 768px) {
  .demo-footer__grid { grid-template-columns: 1fr; }
}

.demo-footer__brand { font-size: 1.1rem; font-weight: 700; color: white; margin-bottom: 0.75rem; }
.demo-footer__desc { font-size: 0.85rem; line-height: 1.6; }
.demo-footer__heading { font-weight: 600; color: white; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.75rem; }
.demo-footer__link { display: block; color: #94a3b8; text-decoration: none; font-size: 0.85rem; margin-bottom: 0.4rem; transition: color 0.15s; }
.demo-footer__link:hover { color: white; }
.demo-footer__bottom { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid #334155; text-align: center; font-size: 0.8rem; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 640px) {
  .demo-navbar__links { display: none; }
  .demo-hero { padding: 2rem 1rem; }
  .demo-hero__title { font-size: 1.3rem; }
  .demo-footer__grid { grid-template-columns: 1fr; gap: 1.5rem; }
}
