/* Nova Forest Global Chat Widget
   Loaded on all pages via /assets/chat/widget.js */

/* Chat trigger button (floating)
   IMPORTANT: Scope to the real chat button only.
   (Some pages also used .chat-button-trigger on other elements like the robot image.) */
button#chatTriggerButton.chat-button-trigger{
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 60px;
  height: 60px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.35), 0 4px 12px rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100001;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}
button#chatTriggerButton.chat-button-trigger svg{ width: 24px; height: 24px; fill: #fff; }
button#chatTriggerButton.chat-button-trigger:hover{ transform: translateY(-1px); }
button#chatTriggerButton.chat-button-trigger:active{ transform: translateY(0); }

/* Safety: never reposition robot/other non-button triggers */
img.chat-button-trigger,
.nova-section-robot.chat-button-trigger{
  position: static !important;
  right: auto !important;
  bottom: auto !important;
  border-radius: 0 !important;
  background: none !important;
  box-shadow: none !important;
  display: initial !important;
  z-index: auto !important;
}

/* Chat modal */
.chat-modal{
  display: none;
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 460px;
  height: 700px;
  max-height: 85vh;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.5) inset;
  overflow: hidden;
  z-index: 100000;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
.chat-modal.active{
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}
.chat-modal.fullscreen{
  bottom: 0;
  right: 0;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
  border-radius: 0;
}
.chat-modal.minimized{
  height: 60px;
  max-height: 60px;
  overflow: hidden;
}
.chat-modal.minimized .chat-messages,
.chat-modal.minimized .chat-input-container,
.chat-modal.minimized .chat-quick-actions{ display:none; }

.chat-container{
  display:flex;
  flex-direction:column;
  height:100%;
  background:#fff;
}

.chat-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:18px 20px;
  background:#fff;
  border-bottom:1px solid rgba(0,0,0,0.1);
  color:#1a1a1a;
  gap:12px;
}
.chat-header-info{ display:flex; align-items:center; gap:14px; }
.chat-avatar{
  width:44px; height:44px; border-radius:50%;
  background:#fff; display:flex; align-items:center; justify-content:center;
}
.chat-avatar img{ width:100%; height:100%; object-fit:contain; border-radius:50%; }
.chat-name{ font-weight:700; font-size:16px; color:#1a1a1a; }
.chat-status{ font-size:12px; color:#666; opacity:0.8; }

.chat-window-controls{ display:flex; align-items:center; gap:10px; }
.chat-control{
  width:34px; height:34px; border-radius:999px;
  border:1px solid rgba(0,0,0,0.08);
  background:rgba(255,255,255,0.9);
  cursor:pointer;
}

.chat-messages{
  flex:1;
  padding:18px;
  overflow:auto;
  background:#fff;
}
.message{ display:flex; flex-direction:column; margin-bottom:12px; max-width:88%; }
.message.sent{ margin-left:auto; align-items:flex-end; }
.message.received{ margin-right:auto; align-items:flex-start; }
.message-bubble{
  padding:12px 14px;
  border-radius:14px;
  font-size:14px;
  line-height:1.35;
  white-space:pre-wrap;
  word-break:break-word;
}
.message.sent .message-bubble{
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color:#fff;
}
.message.received .message-bubble{
  background: rgba(0,0,0,0.04);
  color:#1a1a1a;
}
.message-time{ font-size:11px; opacity:0.6; margin-top:4px; }

.chat-quick-actions{
  display:flex;
  gap:8px;
  padding:12px 14px;
  overflow:auto;
  border-top:1px solid rgba(0,0,0,0.06);
  background:#fff;
}
.chat-action-chip{
  border:1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.9);
  border-radius:12px;
  padding:10px 10px;
  display:flex;
  align-items:center;
  gap:8px;
  cursor:pointer;
  white-space:nowrap;
}
.chat-action-label{ font-size:12px; font-weight:600; color:#1a1a1a; }
.chat-action-icon{ font-size:18px; }

.chat-input-container{
  display:flex;
  gap:10px;
  padding:12px 14px;
  border-top:1px solid rgba(0,0,0,0.08);
  background:#fff;
}
.chat-attach-button{
  width:44px; height:44px; border-radius:12px;
  border:none;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
}
.chat-input{
  flex:1;
  height:44px;
  border-radius:12px;
  border:1px solid rgba(0,0,0,0.12);
  padding:0 12px;
  font-size:15px;
  text-transform:none !important;
  font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
}
.chat-input::placeholder{
  font-size:15px;
  text-transform:none !important;
  line-height:44px;
  opacity:1;
}
.chat-send{
  height:44px;
  min-width: 62px;
  padding: 0 14px;
  border-radius:12px;
  border:none;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color:#fff;
  font-weight:700;
  cursor:pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Payment modal */
.payment-modal{
  display:none;
  position:fixed;
  inset:0;
  z-index: 100002;
  align-items:center;
  justify-content:center;
}
.payment-modal.active{ display:flex; }
.payment-modal-overlay{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,0.55);
}
.payment-modal-content{
  position:relative;
  width:min(520px, calc(100vw - 40px));
  max-height: calc(100vh - 60px);
  overflow:auto;
  background:#fff;
  border-radius:16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.payment-modal-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:16px 18px;
  border-bottom:1px solid rgba(0,0,0,0.08);
}
.payment-modal-header h2{ margin:0; font-size:18px; }
.payment-modal-close{
  border:none;
  background:transparent;
  font-size:28px;
  line-height:1;
  cursor:pointer;
}
.payment-modal-body{ padding:16px 18px 18px; }
.payment-elements{ margin:14px 0; }
.payment-submit-btn{
  width:100%;
  padding:14px 16px;
  border:none;
  border-radius:12px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color:#fff;
  font-weight:800;
  cursor:pointer;
}
.payment-submit-btn:disabled{ opacity:0.6; cursor:not-allowed; }
.payment-error{ margin-top:10px; color:#b91c1c; font-weight:600; font-size:13px; }

/* Premium payment buttons (chat message) — same size, clear hierarchy */
.payment-options-container {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 100%;
}

/* Shared: same height, rounded corners, clean typography */
.payment-button-chat,
.pay-in-person-button {
  width: 100%;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  position: relative;
  z-index: 1;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
  overflow: hidden;
  box-sizing: border-box;
}

/* Primary CTA: Pay now — solid brand color, white text */
.payment-button-chat {
  border: none;
  color: #fff;
  background: #2F392A;
  box-shadow: 0 2px 8px rgba(47, 57, 42, 0.25), 0 1px 3px rgba(0, 0, 0, 0.08);
}

.payment-button-chat:hover {
  background: #3d4a35;
  box-shadow: 0 4px 12px rgba(47, 57, 42, 0.3), 0 2px 6px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.payment-button-chat:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(47, 57, 42, 0.2);
}

/* Secondary CTA: Pay in person — outline / soft neutral */
.pay-in-person-button {
  background: #f8f8f8;
  color: #374151;
  border: 1.5px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.pay-in-person-button:hover {
  background: #fff;
  border-color: #d1d5db;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.pay-in-person-button:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.payment-btn-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: inherit;
  white-space: nowrap;
  flex-shrink: 0;
}

.payment-btn-amount {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-left: 12px;
  white-space: nowrap;
  color: inherit;
  flex-shrink: 0;
}

.payment-btn-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
  flex: 1;
  gap: 2px;
  min-width: 0;
}

.payment-btn-subtitle {
  font-size: 11px;
  opacity: 0.9;
  font-weight: 500;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.payment-btn-subtitle-muted {
  opacity: 0.65;
  letter-spacing: 0;
}

.premium-payment-btn {
  position: relative;
  overflow: hidden;
}

.premium-payment-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  transition: left 0.4s ease;
}

.premium-payment-btn:hover::before {
  left: 100%;
}

.premium-payment-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.premium-payment-btn:disabled:hover {
  transform: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Buttons inside message bubbles — same width */
.message-bubble .payment-button-chat,
.message-bubble .pay-in-person-button {
  display: flex !important;
  width: 100% !important;
  max-width: 100% !important;
}

@media (max-width: 767px){
  .chat-modal{
    width: calc(100vw - 40px);
    height: calc(100vh - 100px);
    max-height: calc(100vh - 100px);
    right: 20px;
    left: 20px;
    bottom: 80px;
    border-radius: 24px;
  }
}

