/**
 * Barre de navigation basse My Best Réseau — commune à toutes les applications
 * Bouton central contextualisé pour publier.
 */

body.has-mbr-taskbar {
  padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
}

.mbr-taskbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  padding: 0.35rem 0.5rem;
  padding-bottom: max(0.35rem, env(safe-area-inset-bottom));
  box-sizing: border-box;
  max-width: 100vw;
  background: rgba(15, 23, 42, 0.78);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.35);
}

.mbr-taskbar__inner {
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.15rem;
  box-sizing: border-box;
}

.mbr-taskbar__item {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.2rem;
  padding: 0.35rem 0.2rem 0.25rem;
  min-height: 52px;
  border-radius: 12px;
  text-decoration: none;
  color: #94a3b8;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: color 0.2s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

.mbr-taskbar__item i {
  font-size: 1.2rem;
  line-height: 1;
}

.mbr-taskbar__item span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.mbr-taskbar__item:hover {
  color: #cbd5e1;
}

.mbr-taskbar__item--active {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.18);
}

/* ——— Action centrale : publier ——— */
.mbr-taskbar__publish-wrap {
  flex: 0 0 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -1.25rem;
  padding: 0 0.15rem 0.1rem;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

.mbr-taskbar__publish {
  width: 74px;
  min-height: 68px;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  color: #fff;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0) 42%),
    linear-gradient(135deg, #2563eb 0%, #0ea5e9 48%, #4338ca 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    0 16px 36px rgba(37, 99, 235, 0.34),
    0 0 0 5px rgba(37, 99, 235, 0.1);
  transform: translateY(-2px);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.mbr-taskbar__publish-wrap:hover .mbr-taskbar__publish,
.mbr-taskbar__publish-wrap:focus-visible .mbr-taskbar__publish {
  transform: translateY(-5px);
  filter: saturate(1.08);
  box-shadow:
    0 20px 44px rgba(37, 99, 235, 0.42),
    0 0 0 6px rgba(14, 165, 233, 0.14);
}

.mbr-taskbar__publish-wrap:focus-visible {
  outline: 3px solid rgba(96, 165, 250, 0.45);
  outline-offset: 5px;
  border-radius: 26px;
}

.mbr-taskbar__publish-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  font-size: 1.05rem;
  line-height: 1;
}

.mbr-taskbar__publish-main,
.mbr-taskbar__publish-context {
  max-width: 66px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.05;
}

.mbr-taskbar__publish-main {
  margin-top: 0.08rem;
  font-size: 0.68rem;
  font-weight: 800;
}

.mbr-taskbar__publish-context {
  font-size: 0.55rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.76);
}

.mbr-publish-sheet[hidden] {
  display: none;
}

.mbr-publish-sheet {
  position: fixed;
  inset: 0;
  z-index: 1001;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

.mbr-publish-sheet__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(15, 23, 42, 0.38);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.mbr-publish-sheet__panel {
  position: relative;
  width: min(100% - 1.25rem, 440px);
  margin: 0 auto calc(5.25rem + env(safe-area-inset-bottom, 0px));
  border-radius: 24px;
  padding: 1.05rem;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
  transform: translateY(1rem);
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
  box-sizing: border-box;
}

.mbr-publish-sheet.is-open {
  pointer-events: auto;
}

.mbr-publish-sheet.is-open .mbr-publish-sheet__backdrop {
  opacity: 1;
}

.mbr-publish-sheet.is-open .mbr-publish-sheet__panel {
  opacity: 1;
  transform: translateY(0);
}

.mbr-publish-sheet__close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  background: #f1f5f9;
  cursor: pointer;
}

.mbr-publish-sheet__head {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding-right: 2.55rem;
}

.mbr-publish-sheet__icon {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.24);
  font-size: 1.22rem;
}

.mbr-publish-sheet__kicker {
  margin: 0 0 0.12rem;
  color: #2563eb;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.mbr-publish-sheet h2 {
  margin: 0;
  color: #0f172a;
  font-size: 1.15rem;
  line-height: 1.16;
  font-weight: 850;
  letter-spacing: 0;
}

.mbr-publish-sheet__hint {
  margin: 0.75rem 0 0;
  color: #64748b;
  font-size: 0.92rem;
  line-height: 1.35;
}

.mbr-publish-sheet__actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
  margin-top: 0.95rem;
}

.mbr-publish-sheet__primary,
.mbr-publish-sheet__secondary {
  min-height: 46px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.72rem 0.95rem;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 800;
  box-sizing: border-box;
}

.mbr-publish-sheet__primary {
  color: #fff;
  background: #2563eb;
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.22);
}

.mbr-publish-sheet__secondary {
  color: #1e293b;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.28);
}

.mbr-publish-sheet__primary:focus-visible,
.mbr-publish-sheet__secondary:focus-visible,
.mbr-publish-sheet__close:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.24);
  outline-offset: 2px;
}

/* ——— Orbe hub (accueil — élément visuel, sans action) ——— */
.mbr-taskbar__hub-wrap {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.2rem 0.15rem;
  margin-top: -1.35rem;
  pointer-events: none;
  user-select: none;
}

.mbr-taskbar__hub-orb {
  position: relative;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: block;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.35) inset,
    0 8px 28px rgba(100, 62, 235, 0.28),
    0 0 48px rgba(14, 165, 233, 0.18);
  animation: mbr-hub-float 4.5s ease-in-out infinite;
}

.mbr-taskbar__hub-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px solid rgba(100, 62, 235, 0.22);
  pointer-events: none;
}

.mbr-taskbar__hub-ring--a {
  animation: mbr-hub-ring-a 3.2s ease-out infinite;
}

.mbr-taskbar__hub-ring--b {
  inset: -12px;
  border-color: rgba(14, 165, 233, 0.16);
  animation: mbr-hub-ring-b 3.2s ease-out infinite 1.1s;
}

.mbr-taskbar__hub-sheen {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg at 50% 50%,
    #643eeb,
    #0ea5e9,
    #a78bfa,
    #f472b6,
    #fbbf24,
    #34d399,
    #643eeb
  );
  animation: mbr-orb-spin 12s linear infinite;
  opacity: 0.92;
}

.mbr-taskbar__hub-blobs {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  pointer-events: none;
}

.mbr-taskbar__hub-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(10px);
  opacity: 0.75;
  mix-blend-mode: screen;
}

.mbr-taskbar__hub-blob--a {
  width: 68%;
  height: 68%;
  left: -4%;
  top: 8%;
  background: radial-gradient(circle, #818cf8 0%, transparent 70%);
  animation: mbr-blob-a 5.5s ease-in-out infinite;
}

.mbr-taskbar__hub-blob--b {
  width: 62%;
  height: 62%;
  right: -6%;
  bottom: 2%;
  background: radial-gradient(circle, #22d3ee 0%, transparent 70%);
  animation: mbr-blob-b 6.5s ease-in-out infinite;
}

.mbr-taskbar__hub-blob--c {
  width: 52%;
  height: 52%;
  left: 24%;
  bottom: -4%;
  background: radial-gradient(circle, #f472b6 0%, transparent 70%);
  animation: mbr-blob-c 5s ease-in-out infinite;
}

.mbr-taskbar__hub-orbit {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  animation: mbr-orb-spin 18s linear infinite;
  pointer-events: none;
}

.mbr-taskbar__hub-dot {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  margin: -2.5px 0 0 -2.5px;
  transform: rotate(var(--hub-angle, 0deg)) translateY(-34px);
  box-shadow: 0 0 6px currentColor;
}

.mbr-taskbar__hub-dot--1 {
  --hub-angle: 0deg;
  color: #f59e0b;
  background: #f59e0b;
}

.mbr-taskbar__hub-dot--2 {
  --hub-angle: 72deg;
  color: #f472b6;
  background: #f472b6;
}

.mbr-taskbar__hub-dot--3 {
  --hub-angle: 144deg;
  color: #14b8a6;
  background: #14b8a6;
}

.mbr-taskbar__hub-dot--4 {
  --hub-angle: 216deg;
  color: #6366f1;
  background: #6366f1;
}

.mbr-taskbar__hub-dot--5 {
  --hub-angle: 288deg;
  color: #0ea5e9;
  background: #0ea5e9;
}

.mbr-taskbar__hub-core {
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(
    circle at 38% 32%,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(255, 255, 255, 0.72) 42%,
    rgba(224, 231, 255, 0.88) 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -2px 8px rgba(100, 62, 235, 0.08);
  animation: mbr-hub-core 4s ease-in-out infinite;
}

.mbr-taskbar__hub-icons {
  position: relative;
  width: 22px;
  height: 22px;
}

.mbr-taskbar__hub-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  color: #643eeb;
  opacity: 0;
  transform: scale(0.82);
  animation: mbr-hub-icon-cycle 10s ease-in-out infinite;
}

.mbr-taskbar__hub-icon--1 { animation-delay: 0s; }
.mbr-taskbar__hub-icon--2 { animation-delay: 2s; }
.mbr-taskbar__hub-icon--3 { animation-delay: 4s; }
.mbr-taskbar__hub-icon--4 { animation-delay: 6s; }
.mbr-taskbar__hub-icon--5 { animation-delay: 8s; }

@keyframes mbr-hub-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes mbr-hub-ring-a {
  0% {
    transform: scale(0.92);
    opacity: 0.65;
  }
  70%,
  100% {
    transform: scale(1.18);
    opacity: 0;
  }
}

@keyframes mbr-hub-ring-b {
  0% {
    transform: scale(0.88);
    opacity: 0.45;
  }
  70%,
  100% {
    transform: scale(1.22);
    opacity: 0;
  }
}

@keyframes mbr-hub-core {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
}

@keyframes mbr-hub-icon-cycle {
  0%,
  16%,
  100% {
    opacity: 0;
    transform: scale(0.82);
  }
  4%,
  12% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mbr-taskbar__hub-orb,
  .mbr-taskbar__hub-ring,
  .mbr-taskbar__hub-sheen,
  .mbr-taskbar__hub-blob,
  .mbr-taskbar__hub-orbit,
  .mbr-taskbar__hub-core,
  .mbr-taskbar__hub-icon,
  .mbr-taskbar__orb {
    animation: none !important;
  }

  .mbr-taskbar__hub-icon--1 {
    opacity: 1;
    transform: none;
  }
}

/* ——— Orbe central Moob ——— */
.mbr-taskbar__orb-wrap {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.2rem 0.15rem;
  margin-top: -1.35rem;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.mbr-taskbar__orb {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: block;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12) inset,
    0 4px 24px rgba(99, 91, 255, 0.45),
    0 0 40px rgba(14, 165, 233, 0.25);
  animation: mbr-orb-float 4s ease-in-out infinite;
}

.mbr-taskbar__orb-sheen {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg at 50% 50%,
    #38bdf8,
    #818cf8,
    #c084fc,
    #f472b6,
    #fb923c,
    #fbbf24,
    #34d399,
    #38bdf8
  );
  animation: mbr-orb-spin 10s linear infinite;
  opacity: 0.95;
}

.mbr-taskbar__orb-mid {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 30% 25%,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0.08) 38%,
    transparent 62%
  );
  animation: mbr-orb-pulse 3s ease-in-out infinite;
  pointer-events: none;
}

.mbr-taskbar__orb-core {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 40% 35%,
    rgba(255, 255, 255, 0.35),
    rgba(120, 180, 255, 0.25) 45%,
    rgba(99, 91, 255, 0.5) 100%
  );
  filter: blur(0.5px);
  animation: mbr-orb-core 5s ease-in-out infinite;
  pointer-events: none;
}

.mbr-taskbar__orb-blobs {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  pointer-events: none;
}

.mbr-taskbar__orb-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(12px);
  opacity: 0.85;
  mix-blend-mode: screen;
}

.mbr-taskbar__orb-blob--a {
  width: 70%;
  height: 70%;
  left: -5%;
  top: 10%;
  background: radial-gradient(circle, #22d3ee 0%, transparent 70%);
  animation: mbr-blob-a 6s ease-in-out infinite;
}

.mbr-taskbar__orb-blob--b {
  width: 65%;
  height: 65%;
  right: -8%;
  bottom: 0;
  background: radial-gradient(circle, #a78bfa 0%, transparent 70%);
  animation: mbr-blob-b 7s ease-in-out infinite;
}

.mbr-taskbar__orb-blob--c {
  width: 55%;
  height: 55%;
  left: 22%;
  bottom: -5%;
  background: radial-gradient(circle, #fb7185 0%, transparent 70%);
  animation: mbr-blob-c 5.5s ease-in-out infinite;
}

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

@keyframes mbr-orb-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

@keyframes mbr-orb-pulse {
  0%,
  100% {
    opacity: 0.85;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.03);
  }
}

@keyframes mbr-orb-core {
  0%,
  100% {
    opacity: 0.9;
  }
  50% {
    opacity: 1;
  }
}

@keyframes mbr-blob-a {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(8px, -6px) scale(1.08);
  }
  66% {
    transform: translate(-4px, 4px) scale(0.95);
  }
}

@keyframes mbr-blob-b {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(-10px, -8px) scale(1.1);
  }
}

@keyframes mbr-blob-c {
  0%,
  100% {
    transform: translate(0, 0);
  }
  40% {
    transform: translate(6px, 8px);
  }
  80% {
    transform: translate(-6px, -4px);
  }
}

/* Thème clair (pages avec fond clair) */
body.mbr-taskbar--light .mbr-taskbar {
  background: rgba(255, 255, 255, 0.82);
  border-top-color: rgba(100, 62, 235, 0.15);
  box-shadow: 0 -8px 32px rgba(100, 62, 235, 0.1);
}

body.mbr-taskbar--light .mbr-taskbar__item {
  color: #64748b;
}

body.mbr-taskbar--light .mbr-taskbar__item:hover {
  color: #475569;
}

body.mbr-taskbar--light .mbr-taskbar__item--active {
  color: #643eeb;
  background: rgba(100, 62, 235, 0.12);
}

body.mbr-taskbar--light .mbr-taskbar__publish {
  box-shadow:
    0 16px 34px rgba(37, 99, 235, 0.24),
    0 0 0 5px rgba(37, 99, 235, 0.08);
}

body.mbr-taskbar--light .mbr-taskbar__hub-orb {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.55) inset,
    0 10px 32px rgba(100, 62, 235, 0.22),
    0 0 52px rgba(14, 165, 233, 0.14);
}

@media (min-width: 1024px) {
  .mbr-taskbar__inner {
    max-width: 560px;
  }
}

@media (max-width: 380px) {
  .mbr-taskbar {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }

  .mbr-taskbar__item {
    min-height: 48px;
    padding-left: 0.1rem;
    padding-right: 0.1rem;
    font-size: 0.56rem;
  }

  .mbr-taskbar__item i {
    font-size: 1.08rem;
  }

  .mbr-taskbar__publish-wrap {
    flex-basis: 70px;
  }

  .mbr-taskbar__publish {
    width: 66px;
    min-height: 64px;
    border-radius: 21px;
  }

  .mbr-taskbar__publish-main {
    font-size: 0.62rem;
  }

  .mbr-taskbar__publish-context {
    max-width: 58px;
    font-size: 0.5rem;
  }

  .mbr-taskbar__hub-orb {
    width: 56px;
    height: 56px;
  }

  .mbr-taskbar__hub-dot {
    transform: rotate(var(--hub-angle, 0deg)) translateY(-30px);
  }

  .mbr-publish-sheet__panel {
    width: calc(100% - 0.8rem);
    margin-bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
    border-radius: 20px;
    padding: 0.9rem;
  }
}
