/* Voice preview custom player */
.ny-voice-preview { display: grid; grid-template-rows: auto auto; gap: 6px; padding: 8px 10px; border: 1px solid #263040; border-radius: 10px; background: #0c1424; box-shadow: 0 6px 16px rgba(0,0,0,.28); --ny-accent: #ffd700; min-width: 240px; }
.ny-voice-preview .ny-vp-main { display: grid; grid-template-columns: 36px 1fr 36px; align-items: center; gap: 10px; }
.ny-voice-preview .ny-vp-actions { display: none; }
.ny-vp-btn { min-width: 88px; height: 36px; }
.ny-vp-play { width: 38px; height: 38px; border-radius: 8px; background: #0b1220; border: 1px solid #334155; color: #e5e7eb; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,.22); transition: background .18s ease, transform .18s ease; }
.ny-vp-play:hover { background: #111a2a; transform: translateY(-1px); }
.ny-vp-play svg { pointer-events: none; }
.ny-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 14px; border-radius: 9999px;
  border: 1px solid #334155; background: #0b1220; color: #e5e7eb;
  font-weight: 700; cursor: pointer; transition: all .18s ease; user-select: none;
}
.ny-btn:hover { filter: brightness(1.06); border-color: #475569; }
.ny-btn:active { transform: translateY(1px); }
.ny-btn--icon, .ny-voice-btn { width: 40px; height: 40px; padding: 0; border-radius: 9999px; }
.ny-btn--icon { background: #0b1220; border: 1px solid #334155; }
.ny-btn--primary, .ny-voice-primary { background: linear-gradient(180deg, var(--ny-accent), color-mix(in srgb, var(--ny-accent) 85%, #000 15%)); border: none; color: #0f172a; box-shadow: 0 4px 12px rgba(255,215,0,.25); }
.ny-btn--danger, .ny-voice-danger { background: transparent; color: #fecaca; border: 1px solid rgba(239,68,68,.55); }
.ny-btn--danger:hover, .ny-voice-danger:hover { background: rgba(239,68,68,.12); }
.ny-voice-btn { background: #0b1220; color: #e5e7eb; }
.ny-voice-btn:hover { background: #111827; }
.ny-voice-wave { position: relative; height: 34px; border-radius: 8px; width: 100%; background: rgba(34,197,94,.08); overflow: hidden; border: 1px solid rgba(148,163,184,.18); }
.ny-voice-progress {
  position: absolute; inset: 0 auto 0 0; width: 0%;
  background: linear-gradient(90deg, rgba(34,197,94,.18), rgba(34,197,94,.08));
  pointer-events: none;
}
.ny-voice-bars { position: relative; display: flex; align-items: center; height: 100%; padding: 0 6px; }
.ny-voice-bars span { display: inline-block; width: 3px; margin: 0 1px; border-radius: 2px; background: #86efac; opacity: .85; animation: ny-bar-pulse 1.5s infinite ease-in-out; }
.ny-voice-chip { background: rgba(34,197,94,.1); color: #a7f3d0; border: 1px solid rgba(34,197,94,.25); padding: 3px 7px; border-radius: 8px; font-weight: 700; font-size: 12px; cursor: pointer; }

/* reduce default audio visibility if exists */
#ny-voice-preview audio { display: none; }

/* Delete icon button next to send */
#ny-voice-delete-btn.ny-vp-del-icon,
.ny-vp-del-icon { width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(239,68,68,.55); background: #a51212; color: #fecaca; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,.22); transition: background .18s ease, transform .18s ease; }
.ny-vp-del-icon:hover { background: #d11e1e; transform: translateY(-1px); }

/* Strong theme overrides to prevent global button styles affecting preview controls */
#ny-chatbot-container .ny-vp-play,
#ny-chatbot-container #ny-voice-delete-btn.ny-vp-del-icon,
#ny-chatbot-container .ny-vp-del-icon {
  all: unset !important;
  appearance: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 1 !important;
  text-decoration: none !important;
  box-shadow: none !important;
  vertical-align: middle !important;
  cursor: pointer !important;
}
#ny-chatbot-container .ny-vp-play {
  width: 38px !important; height: 38px !important; border-radius: 8px !important;
  background: #0b1220 !important; border: 1px solid #334155 !important; color: #e5e7eb !important;
}
#ny-chatbot-container .ny-vp-play:hover { background: #111a2a !important; transform: translateY(-1px) !important; }
#ny-chatbot-container #ny-voice-delete-btn.ny-vp-del-icon,
#ny-chatbot-container .ny-vp-del-icon {
  width: 42px !important; height: 42px !important; border-radius: 50% !important;
  background: #a51212 !important; border: 1px solid rgba(239,68,68,.55) !important; color: #fecaca !important;
}
#ny-chatbot-container #ny-voice-delete-btn.ny-vp-del-icon:hover,
#ny-chatbot-container .ny-vp-del-icon:hover { background: #d11e1e !important; transform: translateY(-1px) !important; }

@keyframes ny-bar-pulse {
  0%, 100% { opacity: .7; }
  50% { opacity: 1; }
}

/* Voice preview layout in form */
#ny-chat-form.preview-mode { display: grid !important; grid-template-columns: 1fr auto auto; grid-template-areas: 'voice del send'; column-gap: 8px !important; align-items: center; padding: .5em .9em !important; }
#ny-chat-form.preview-mode > *:not(#ny-voice-preview):not(#ny-send-btn):not(#ny-voice-delete-btn) { display: none !important; }
#ny-chat-form.preview-mode #ny-voice-preview { grid-area: voice; width: 100%; justify-self: stretch; }
#ny-chat-form.preview-mode #ny-voice-delete-btn { grid-area: del; justify-self: end; }
#ny-chat-form.preview-mode #ny-send-btn { grid-area: send; justify-self: end; margin: 0 !important; }
/* Ensure delete button is hidden outside of preview mode */
#ny-chat-form:not(.preview-mode) #ny-voice-delete-btn { display: none !important; }
/* NY Chatbot Frontend - Minimal CSS
   This file intentionally contains only lightweight helpers.
   The full, dynamic and theme-safe styles are injected inline
   by the frontend renderer to honor user settings. */

/* Tooltip show/hide transitions (used by JS add/remove class) */
#ny-circle-tooltip {
    transition: all 0.3s ease !important;
}

#ny-circle-tooltip.show {
    opacity: 1 !important;
    transform: translateY(0) !important;
    visibility: visible !important;
}

#ny-circle-tooltip.hide {
    opacity: 0 !important;
    transform: translateY(10px) !important;
    visibility: hidden !important;
}

/* Force close button to top-left of tooltip (resilient to themes) */
#ny-circle-tooltip { position: fixed !important; }
#ny-circle-tooltip .ny-tooltip-close {
  all: unset !important;
  position: absolute !important;
  top: 12px !important;
  left: 12px !important;
  width: 26px !important;
  height: 26px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50% !important;
  background: rgba(248,250,252,0.9) !important;
  border: 1px solid rgba(226,232,240,0.6) !important;
  color: #64748b !important;
  cursor: pointer !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.7) !important;
}
/* Make room for the close button inside tooltip content */
#ny-circle-tooltip .ny-tooltip-content { padding-left: 35px !important; }

/* Ensure images inside messages never overflow container */
#ny-chat-messages img {
    max-width: 100%;
    height: auto;
}

/* CSAT under message time and improved quick replies bar */
.ny-bot-message .ny-message-meta{display:flex;align-items:center;gap:8px;margin-top:6px}
.ny-bot-message .ny-csat{display:flex;gap:6px}
.ny-bot-message .ny-csat .ny-csat-btn{background:#0b1620;color:#e5e7eb;border:1px solid rgba(148,163,184,.3);border-radius:6px;padding:2px 8px;font-size:12px;cursor:pointer}
.ny-bot-message .ny-csat .ny-csat-btn[data-rate="1"]{background:#0b1f17;color:#86efac;border-color:#166534}
.ny-bot-message .ny-csat .ny-csat-btn[data-rate="-1"]{background:#2a0e0e;color:#fecaca;border-color:#991b1b}
#ny-quick-replies{position:sticky;bottom:0;backdrop-filter:blur(6px);padding:1.2em 1.2em .6em;z-index:2}
#ny-quick-replies .ny-qr-item{white-space:nowrap}