/* ============================================
   NOVA PANEL — Side Panel + Floating Button
   ============================================ */

/* Floating "Demander à Nova" Button */
.nova-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: .82rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--a), var(--a2));
  box-shadow: 0 6px 24px rgba(91, 53, 232, .35), 0 0 0 0 rgba(91, 53, 232, .3);
  transition: all .3s cubic-bezier(.4, 0, .2, 1);
  animation: nova-pulse 3s infinite;
}

.nova-fab:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 10px 32px rgba(91, 53, 232, .45);
}

.nova-fab.g {
  background: linear-gradient(135deg, var(--gold), var(--g2));
  color: #1a0a00;
  box-shadow: 0 6px 24px rgba(201, 150, 10, .35), 0 0 0 0 rgba(201, 150, 10, .3);
  animation: nova-pulse-g 3s infinite;
}

.nova-fab.g:hover {
  box-shadow: 0 10px 32px rgba(201, 150, 10, .45);
}

.nova-fab i {
  font-size: .9rem;
}

.nova-fab .nova-fab-dot {
  width: 7px;
  height: 7px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 6px #22c55e;
  animation: nova-dot-pulse 2s infinite;
}

@keyframes nova-pulse {
  0%, 100% { box-shadow: 0 6px 24px rgba(91, 53, 232, .35), 0 0 0 0 rgba(91, 53, 232, .3); }
  50% { box-shadow: 0 6px 24px rgba(91, 53, 232, .35), 0 0 0 8px rgba(91, 53, 232, 0); }
}

@keyframes nova-pulse-g {
  0%, 100% { box-shadow: 0 6px 24px rgba(201, 150, 10, .35), 0 0 0 0 rgba(201, 150, 10, .3); }
  50% { box-shadow: 0 6px 24px rgba(201, 150, 10, .35), 0 0 0 8px rgba(201, 150, 10, 0); }
}

@keyframes nova-dot-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

/* Overlay */
.nova-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, .4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: all .35s ease;
}

.nova-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* Side Panel */
.nova-side {
  position: fixed;
  top: 0;
  right: -440px;
  z-index: 1000;
  width: 420px;
  max-width: 92vw;
  height: 100vh;
  background: var(--card);
  border-left: 1.5px solid var(--ab);
  box-shadow: -12px 0 40px rgba(0, 0, 0, .15);
  display: flex;
  flex-direction: column;
  transition: right .4s cubic-bezier(.4, 0, .2, 1);
}

.nova-side.open {
  right: 0;
}

.nova-side.g {
  border-left-color: var(--gb);
}

/* Panel Header */
.nova-side-head {
  padding: 18px 20px;
  background: linear-gradient(135deg, var(--al), transparent);
  border-bottom: 1px solid var(--ab);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.nova-side.g .nova-side-head {
  background: linear-gradient(135deg, var(--gl), transparent);
  border-bottom-color: var(--gb);
}

.nova-side-ava {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--a), var(--a2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  box-shadow: 0 4px 12px rgba(91, 53, 232, .3);
  flex-shrink: 0;
}

.nova-side.g .nova-side-ava {
  background: linear-gradient(135deg, var(--gold), var(--g2));
  color: #1a0a00;
  box-shadow: 0 4px 12px rgba(201, 150, 10, .3);
}

.nova-side-info {
  flex: 1;
}

.nova-side-name {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: .95rem;
  color: var(--text);
}

.nova-side-status {
  font-size: .7rem;
  color: #22c55e;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nova-side-status::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #22c55e;
  border-radius: 50%;
  display: inline-block;
  animation: nova-dot-pulse 2s infinite;
}

.nova-side-model {
  font-size: .64rem;
  padding: 3px 9px;
  border-radius: 100px;
  font-weight: 700;
  background: var(--al);
  color: var(--a);
  border: 1px solid var(--ab);
}

.nova-side.g .nova-side-model {
  background: var(--gl);
  color: var(--gold);
  border-color: var(--gb);
}

.nova-side-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--ab);
  background: var(--bg);
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  transition: all .2s;
}

.nova-side-close:hover {
  background: var(--al);
  color: var(--a);
  border-color: var(--a);
}

/* Suggestions chips */
.nova-side-chips {
  padding: 10px 16px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--ab);
  flex-shrink: 0;
}

/* Chat messages area */
.nova-side-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nova-side-msgs::-webkit-scrollbar {
  width: 4px;
}

.nova-side-msgs::-webkit-scrollbar-thumb {
  background: var(--ab);
  border-radius: 4px;
}

/* Chat input */
.nova-side-input {
  padding: 14px 16px;
  border-top: 1px solid var(--ab);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.nova-side.g .nova-side-input {
  border-top-color: var(--gb);
}

.nova-side-inp {
  flex: 1;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--ab);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: .82rem;
  outline: none;
  transition: border-color .2s;
}

.nova-side-inp:focus {
  border-color: var(--a);
}

.nova-side.g .nova-side-inp {
  border-color: var(--gb);
}

.nova-side.g .nova-side-inp:focus {
  border-color: var(--gold);
}

.nova-side-send {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--a), var(--a2));
  border: none;
  cursor: pointer;
  color: #fff;
  font-size: .85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  flex-shrink: 0;
}

.nova-side.g .nova-side-send {
  background: linear-gradient(135deg, var(--gold), var(--g2));
  color: #1a0a00;
}

.nova-side-send:hover {
  transform: scale(1.06);
}

/* Messages inside panel */
.np-msg {
  display: flex;
  gap: 8px;
  max-width: 90%;
}

.np-msg.u {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.np-msg-av {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
}

.np-msg.ai .np-msg-av {
  background: linear-gradient(135deg, var(--a), var(--a2));
  color: #fff;
}

.nova-side.g .np-msg.ai .np-msg-av {
  background: linear-gradient(135deg, var(--gold), var(--g2));
  color: #1a0a00;
}

.np-msg.u .np-msg-av {
  background: var(--bg);
  border: 1px solid var(--ab);
  color: var(--text2);
}

.np-msg-b {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: .82rem;
  line-height: 1.65;
  color: var(--text);
}

.np-msg.ai .np-msg-b {
  background: var(--bg);
  border: 1px solid var(--ab);
  border-radius: 4px 12px 12px 12px;
}

.np-msg.u .np-msg-b {
  background: linear-gradient(135deg, var(--a), var(--a2));
  color: #fff;
  border-radius: 12px 4px 12px 12px;
}

.nova-side.g .np-msg.u .np-msg-b {
  background: linear-gradient(135deg, var(--gold), var(--g2));
  color: #1a0a00;
}

/* Responsive */
@media (max-width: 600px) {
  .nova-fab {
    bottom: 16px;
    right: 16px;
    padding: 10px 16px;
    font-size: .78rem;
  }

  .nova-side {
    width: 100vw;
    right: -100vw;
}

/* History Panel */
.np-history-panel {
  position: absolute;
  top: 76px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--card);
  z-index: 10;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4, 0, .2, 1);
}

.np-history-panel.show {
  transform: translateX(0);
}

.np-history-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--ab);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nova-side.g .np-history-header {
  border-bottom-color: var(--gb);
}

.np-history-title-main {
  font-weight: 800;
  font-size: .95rem;
  color: var(--text);
}

.np-history-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.np-history-item {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--ab);
  cursor: pointer;
  transition: all .2s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nova-side.g .np-history-item {
  border-color: var(--gb);
}

.np-history-item:hover {
  background: var(--al);
  border-color: var(--a);
  transform: translateY(-1px);
}

.nova-side.g .np-history-item:hover {
  background: var(--gl);
  border-color: var(--gold);
}

.np-history-item-title {
  font-size: .85rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-history-item-date {
  font-size: .7rem;
  color: var(--muted);
}
