/* ============================================
   NAZARS.RU — AI CHAT WIDGET STYLES
   ============================================ */

#nzr-chat {
  position: fixed;
  bottom: 100px;
  right: 24px;
  z-index: 9000;
  font-family: 'Jost', sans-serif;
}

/* ── Toggle button ── */

#nzr-btn {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: #1a1a1a;
  color: #c9a96e;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  transition: transform .2s, box-shadow .2s, background .2s;
  outline: none;
}

#nzr-btn:hover {
  transform: scale(1.08);
  background: #222;
  box-shadow: 0 6px 28px rgba(0,0,0,0.5);
}

#nzr-btn:focus-visible {
  outline: 2px solid #c9a96e;
  outline-offset: 3px;
}

.nzr-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4caf50;
  border: 2px solid #1a1a1a;
}

/* Pulse animation */
@keyframes nzrPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201,169,110,.5); }
  50%       { box-shadow: 0 0 0 12px rgba(201,169,110,0); }
}

#nzr-btn.nzr-pulse {
  animation: nzrPulse 1s ease 2;
}

/* ── Chat box ── */

#nzr-box {
  position: absolute;
  bottom: 64px;
  right: 0;
  width: 320px;
  max-height: 460px;
  background: #111;
  border: 1px solid rgba(201,169,110,.25);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0,0,0,.6);

  opacity: 0;
  transform: translateY(12px) scale(.97);
  pointer-events: none;
  transition: opacity .25s, transform .25s;
}

#nzr-box.nzr-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* ── Header ── */

.nzr-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #181818;
  border-bottom: 1px solid rgba(201,169,110,.15);
  flex-shrink: 0;
}

.nzr-head-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nzr-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c9a96e, #8b6f3e);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nzr-head strong {
  display: block;
  color: #f0e8d8;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
}

.nzr-status {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #888;
  font-size: 11px;
}

.nzr-status i {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4caf50;
}

.nzr-close {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s;
}

.nzr-close:hover { color: #c9a96e; }

/* ── Messages ── */

.nzr-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
}

.nzr-messages::-webkit-scrollbar { width: 4px; }
.nzr-messages::-webkit-scrollbar-track { background: transparent; }
.nzr-messages::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }

.nzr-msg {
  max-width: 82%;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.45;
  word-break: break-word;
}

.nzr-bot {
  background: #1e1e1e;
  color: #d4c9b8;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  border: 1px solid rgba(255,255,255,.06);
}

.nzr-user {
  background: linear-gradient(135deg, #c9a96e, #a88245);
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}

/* Typing indicator */
.nzr-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 14px;
}

@keyframes nzrBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .4; }
  40%            { transform: translateY(-5px); opacity: 1; }
}

.nzr-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c9a96e;
  display: inline-block;
  animation: nzrBounce 1.2s infinite;
}

.nzr-typing span:nth-child(2) { animation-delay: .15s; }
.nzr-typing span:nth-child(3) { animation-delay: .3s; }

/* ── Input row ── */

.nzr-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid rgba(201,169,110,.12);
  background: #141414;
  flex-shrink: 0;
}

#nzr-input {
  flex: 1;
  background: #1e1e1e;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  padding: 8px 12px;
  color: #e8dcc8;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}

#nzr-input::placeholder { color: #555; }

#nzr-input:focus {
  border-color: rgba(201,169,110,.4);
}

#nzr-send {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: none;
  background: #c9a96e;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, transform .1s;
  flex-shrink: 0;
}

#nzr-send:hover { background: #b8943f; }
#nzr-send:active { transform: scale(.93); }
#nzr-send:disabled { opacity: .5; cursor: not-allowed; }

/* ── Mobile ── */

@media (max-width: 480px) {
  #nzr-chat {
    bottom: 80px;
    right: 16px;
  }

  #nzr-box {
    width: calc(100vw - 32px);
    right: -8px;
    max-height: 400px;
  }
}
