/* =============================================
   ナカシンヤ チャットボット ウィジェット
   nakashinya-chat.css  v1.0.0
   ============================================= */

#nc-bubble {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #1a4d6e;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(26, 77, 110, 0.38);
  transition: transform 0.2s, box-shadow 0.2s;
  z-index: 9999;
}
#nc-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(26, 77, 110, 0.48);
}
#nc-bubble svg {
  width: 26px;
  height: 26px;
  fill: #fff;
  transition: opacity 0.15s;
}
#nc-bubble .nc-icon-close { display: none; }
#nc-bubble.nc-open .nc-icon-chat  { display: none; }
#nc-bubble.nc-open .nc-icon-close { display: block; }

#nc-dot {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 14px;
  height: 14px;
  background: #e85c41;
  border-radius: 50%;
  border: 2px solid #fff;
  animation: nc-pulse 2s infinite;
}
@keyframes nc-pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.25); }
}

/* ---------- panel ---------- */
#nc-panel {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 340px;
  height: 460px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.16);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.85) translateY(20px);
  transform-origin: bottom right;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.2s ease;
  z-index: 9998;
  font-family: 'Hiragino Sans', 'Noto Sans JP', 'Yu Gothic', sans-serif;
}
#nc-panel.nc-open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* mobile */
@media (max-width: 480px) {
  #nc-panel {
    width: calc(100vw - 24px);
    right: 12px;
    bottom: 92px;
  }
}

/* ---------- header ---------- */
#nc-header {
  background: #1a4d6e;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}
#nc-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
}
.nc-header-title { font-size: 13.5px; font-weight: 500; color: #fff; }
.nc-header-sub   { font-size: 11px; color: rgba(255,255,255,0.72); margin-top: 1px; }

/* ---------- messages ---------- */
#nc-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f7f8fb;
  scroll-behavior: smooth;
}
#nc-msgs::-webkit-scrollbar { width: 4px; }
#nc-msgs::-webkit-scrollbar-thumb { background: #d4d4d4; border-radius: 2px; }

.nc-msg {
  display: flex;
  gap: 7px;
  align-items: flex-end;
  max-width: 92%;
}
.nc-msg.nc-bot  { align-self: flex-start; }
.nc-msg.nc-user { align-self: flex-end; flex-direction: row-reverse; }

.nc-bub {
  padding: 9px 13px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.nc-msg.nc-bot  .nc-bub {
  background: #fff;
  border: 0.5px solid #e2e2e2;
  border-bottom-left-radius: 3px;
  color: #1a1a1a;
}
.nc-msg.nc-user .nc-bub {
  background: #1a4d6e;
  color: #fff;
  border-bottom-right-radius: 3px;
}
.nc-bot-ic {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #1a4d6e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #fff;
  font-weight: 600;
  flex-shrink: 0;
}

/* typing indicator */
.nc-typing-bub {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  background: #fff;
  border: 0.5px solid #e2e2e2;
  border-radius: 16px;
  border-bottom-left-radius: 3px;
}
.nc-typing-bub span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #aaa;
  animation: nc-bounce 1.1s infinite;
}
.nc-typing-bub span:nth-child(2) { animation-delay: 0.18s; }
.nc-typing-bub span:nth-child(3) { animation-delay: 0.36s; }
@keyframes nc-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%           { transform: translateY(-5px); }
}

/* ---------- quick replies ---------- */
#nc-quick {
  padding: 8px 10px 6px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  background: #f7f8fb;
  border-top: 0.5px solid #ebebeb;
  flex-shrink: 0;
}
.nc-qbtn {
  padding: 5px 11px;
  border-radius: 20px;
  border: 0.5px solid #1a4d6e;
  background: transparent;
  font-size: 11.5px;
  color: #1a4d6e;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.15s;
}
.nc-qbtn:hover { background: rgba(26,77,110,0.08); }

/* ---------- input ---------- */
#nc-input-row {
  padding: 10px 12px;
  display: flex;
  gap: 8px;
  border-top: 0.5px solid #ebebeb;
  background: #fff;
  flex-shrink: 0;
}
#nc-input {
  flex: 1;
  border: 0.5px solid #ccc;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  background: #fff;
  color: #1a1a1a;
  transition: border-color 0.15s;
}
#nc-input:focus { border-color: #1a4d6e; }

#nc-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1a4d6e;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
#nc-send-btn:hover    { opacity: 0.85; }
#nc-send-btn:disabled { opacity: 0.35; cursor: default; }
#nc-send-btn svg { width: 17px; height: 17px; fill: #fff; }
