/* Mrkt360 Widget Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #0066cc;
  --primary-dark: #004999;
  --primary-light: #3388ee;
  --success: #00c853;
  --bg: #f8f9fa;
  --panel: #ffffff;
  --text: #111827;
  --text-light: #6b7280;
  --border: #e5e7eb;
  --gradient: linear-gradient(135deg, #004999 0%, #0066cc 60%, #3388ee 100%);
  --user-gradient: linear-gradient(135deg, #0066cc, #3388ee);
  --shadow: 0 24px 60px rgba(0,102,204,0.25);
  --radius: 28px;
  --radius-sm: 12px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; font-family: 'Inter', system-ui, -apple-system, sans-serif; }

/* Launcher */
.mrkt360-launcher-wrap {
  position: fixed; right: 24px; bottom: 24px; z-index: 99999;
  display: flex; gap: 14px;
  animation: mrkt360FloatIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.8s both;
  font-family: inherit;
}
@keyframes mrkt360FloatIn {
  from { opacity: 0; transform: translateY(30px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.mrkt360-tooltip {
  background: #fff; color: var(--primary-dark); font-size: 14px; font-weight: 700;
  padding: 14px 20px; border-radius: 999px;
  box-shadow: 0 12px 30px rgba(0,102,204,0.25);
  cursor: pointer; display: flex; align-items: center; gap: 10px;
  letter-spacing: -0.025em; transition: var(--transition);
}
.mrkt360-tooltip:hover { transform: translateY(-3px); box-shadow: 0 16px 35px rgba(0,102,204,0.35); }
.mrkt360-tooltip-close { margin-left: 6px; opacity: 0.5; font-size: 16px; font-weight: 800; transition: opacity 0.2s; }
.mrkt360-tooltip:hover .mrkt360-tooltip-close { opacity: 0.9; }

.mrkt360-launcher {
  position: relative; width: 68px; height: 68px; border: none; border-radius: 50%;
  background: var(--panel); box-shadow: 0 12px 30px rgba(0,102,204,0.5);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: var(--transition); overflow: hidden;
}
.mrkt360-launcher:hover { transform: translateY(-3px) scale(1.06); box-shadow: 0 20px 45px rgba(0,102,204,0.65); }
.mrkt360-launcher svg { width: 54%; height: 54%; }
.mrkt360-launcher-wrap::after {
  content: ''; position: absolute; bottom: 4px; right: 4px;
  width: 16px; height: 16px; background: var(--success);
  border-radius: 50%; border: 3px solid #fff; z-index: 10000;
}

/* Widget container */
.mrkt360-widget {
  position: fixed; right: 24px; bottom: 100px;
  width: 440px; max-width: calc(100vw - 32px);
  height: 740px; max-height: calc(100vh - 140px);
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden; display: none; flex-direction: column; z-index: 99999;
  backdrop-filter: blur(12px);
  animation: mrkt360PopIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.mrkt360-widget.open { display: flex; }
@keyframes mrkt360PopIn {
  from { opacity: 0; transform: translateY(24px) scale(0.96) rotateX(2deg); }
  to { opacity: 1; transform: translateY(0) scale(1) rotateX(0); }
}

/* Header */
.mrkt360-header {
  padding: 18px 20px 14px;
  background: var(--gradient); color: #fff; position: relative;
}
.mrkt360-header-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px;
}
.mrkt360-brand { display: flex; gap: 14px; align-items: center; }
.mrkt360-avatar {
  width: 60px; height: 60px; border-radius: 50%;
  background: #fff; border: 3px solid rgba(255,255,255,0.95);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden;
  flex-shrink: 0;
}
.mrkt360-avatar svg { width: 70%; height: 70%; }
.mrkt360-title {
  font-size: 16px; font-weight: 800; line-height: 1.2;
  letter-spacing: -0.02em;
}
.mrkt360-subtitle {
  font-size: 12px; opacity: 0.8; margin-top: 4px;
  font-weight: 500; letter-spacing: 0.02em;
}
.mrkt360-close {
  appearance: none; border: none; background: rgba(255,255,255,0.15);
  color: #fff; width: 38px; height: 38px; border-radius: 50%;
  cursor: pointer; font-size: 22px; display: flex; align-items: center; justify-content: center;
  transition: var(--transition); flex-shrink: 0;
}
.mrkt360-close:hover { background: rgba(255,255,255,0.25); transform: scale(1.08); }

/* Body */
.mrkt360-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  background: linear-gradient(180deg, #f0f7fa 0%, #fafbfc 60%, #fff 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
 padding-bottom: 80px;}
.mrkt360-body::-webkit-scrollbar { width: 6px; }
.mrkt360-body::-webkit-scrollbar-track { background: transparent; }
.mrkt360-body::-webkit-scrollbar-thumb { background: #c8dfe8; border-radius: 3px; }
.mrkt360-body::-webkit-scrollbar-thumb:hover { background: #a8d4e8; }
.mrkt360-body::-webkit-scrollbar { width: 6px; }
.mrkt360-body::-webkit-scrollbar-track { background: transparent; }
.mrkt360-body::-webkit-scrollbar-thumb { background: #c8dfe8; border-radius: 3px; }

/* Bubbles */
.mrkt360-bubble-row {
  display: flex; gap: 10px; align-items: flex-end;
  animation: mrkt360FadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes mrkt360FadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.mrkt360-bubble-row.bot { justify-content: flex-start; }
.mrkt360-bubble-row.user { justify-content: flex-end; }

.mrkt360-bubble {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 20px;
  font-size: 15px;
  line-height: 1.55;
  font-weight: 400;
  box-shadow: 0 4px 16px rgba(15,23,42,0.06);
  white-space: pre-wrap;
  word-break: break-word;
  hyphens: auto;
  overflow-wrap: anywhere;
}
.mrkt360-bubble-row.bot .mrkt360-bubble {
  background: #f8f9fa;
  color: #212529;
  border-bottom-left-radius: 8px;
  border: 1px solid #e9ecef;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.mrkt360-bubble-row.user .mrkt360-bubble {
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 8px;
  font-weight: 500;
}

/* Footer / Input area */
.mrkt360-footer {
  border-top: 1px solid var(--border);
  padding: 16px;
  background: var(--panel);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
  position: relative;
  z-index: 10;
}
.mrkt360-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mrkt360-text-input,
.mrkt360-date-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
  font-size: 15px;
  outline: none;
  background: #f9fbff;
  color: var(--text);
  transition: var(--transition);
  font-family: inherit;
  line-height: 1.4;
}
.mrkt360-text-input:focus,
.mrkt360-date-input:focus {
  border-color: var(--primary-light);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(0,102,204,0.12), 0 4px 12px rgba(0,102,204,0.1);
}
.mrkt360-text-input:focus,
.mrkt360-date-input:focus {
  border-color: var(--primary-light); background: #fff;
  box-shadow: 0 0 0 4px rgba(0,102,204,0.12), 0 4px 12px rgba(0,102,204,0.1);
}
.mrkt360-textarea {
  min-height: 100px;
  resize: vertical;
  border-radius: 16px;
  padding: 16px 18px;
}

/* Choice buttons grid */
.mrkt360-choice-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 8px;
 width: 100%; max-width: 100%; box-sizing: border-box; }
@media (min-width: 600px) {
  .mrkt360-choice-list {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 900px) {
  .mrkt360-choice-list {
    grid-template-columns: repeat(4, 1fr);
  }
}
.mrkt360-choice-btn {
  border: 1.5px solid #c8dfe8;
  background: #f0f7fb;
  color: var(--primary-dark);
  padding: 14px 12px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
  transition: var(--transition);
  user-select: none;
  line-height: 1.3;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mrkt360-choice-btn:hover {
  border-color: var(--primary);
  background: #e0f2f9;
  color: var(--primary-dark);
  transform: translateY(-1.5px);
  box-shadow: 0 4px 12px rgba(0,102,204,0.12);
}
.mrkt360-choice-btn:active {
  transform: scale(0.98);
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.mrkt360-choice-btn:hover {
  border-color: var(--primary); background: #e0f2f9; color: var(--primary-dark);
  transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,102,204,0.12);
}
.mrkt360-choice-btn:active {
  transform: scale(0.96); background: var(--primary); color: #fff; border-color: var(--primary);
}

/* Multi-select checkboxes */
.mrkt360-multi-select-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mrkt360-multi-select-container {
  max-height: 40vh;
  overflow-y: auto;
  padding-right: 4px;
}
.mrkt360-checkbox-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #f0f7fb;
  border: 1.5px solid #c8dfe8;
  border-radius: 14px;
  cursor: pointer;
  transition: var(--transition);
  min-height: 52px;
}
.mrkt360-checkbox-item:hover {
  border-color: var(--primary);
  background: #e0f2f9;
}
.mrkt360-checkbox-item input {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  flex-shrink: 0;
}
.mrkt360-checkbox-item span {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}
.mrkt360-checkbox-item:hover { border-color: var(--primary); background: #e0f2f9; }
.mrkt360-checkbox-item input { width: 20px; height: 20px; accent-color: var(--primary); flex-shrink: 0; }
.mrkt360-checkbox-item span { font-size: 13px; font-weight: 600; color: var(--text); }

/* Action buttons */
.mrkt360-action-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 6px;
}
.mrkt360-btn {
  appearance: none; border: none; border-radius: 14px;
  padding: 13px 18px; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: var(--transition); font-family: inherit;
}
.mrkt360-btn:hover { transform: translateY(-1.5px); }
.mrkt360-btn:active { transform: scale(0.97); }
.mrkt360-btn.primary {
  flex: 1;
  background: var(--user-gradient);
  color: #fff;
  box-shadow: 0 6px 16px rgba(0,102,204,0.25);
  font-weight: 700;
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 15px;
}
.mrkt360-btn.secondary {
  background: #e8f4f8;
  color: var(--primary);
  font-weight: 600;
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 15px;
}
.mrkt360-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none;
}

/* Helper text & errors */
.mrkt360-helper {
  font-size: 12.5px;
  color: var(--text-light);
  padding: 0 2px;
  font-weight: 500;
}
.mrkt360-error {
  color: #dc2626;
  font-size: 13px;
  min-height: 20px;
  padding: 6px 4px 0;
  font-weight: 600;
}
.mrkt360-success-box,
.mrkt360-error-box {
  border-radius: 16px;
  padding: 16px;
  font-size: 14.5px;
  line-height: 1.55;
  font-weight: 500;
  max-width: 100%;
  word-wrap: break-word;
}
.mrkt360-success-box {
  background: #ecfdf5; border: 1px solid #bbf7d0; color: #166534;
}
.mrkt360-error-box {
  background: #fef2f2; border: 1px solid #fecaca; color: #991b1b;
}

/* Typing indicator */
.mrkt360-typing {
  display: inline-flex; gap: 6px; align-items: center;
  padding: 12px 16px; background: #fff; border-radius: 20px;
  border-bottom-left-radius: 8px;
  border: 1px solid #eef2f7; box-shadow: 0 6px 16px rgba(15,23,42,0.06);
}
.mrkt360-typing span {
  width: 8px; height: 8px; border-radius: 50%; background: #94a3b8;
  animation: mrkt360Blink 1.1s infinite ease-in-out;
}
.mrkt360-typing span:nth-child(2) { animation-delay: 0.14s; }
.mrkt360-typing span:nth-child(3) { animation-delay: 0.28s; }
@keyframes mrkt360Blink {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}

/* CTA buttons */
.mrkt360-cta-btn {
  width: 100%; text-align: left; padding: 14px 16px;
  background: #fff; border: 1.5px solid var(--border);
  border-radius: 14px; margin-bottom: 10px;
  transition: var(--transition); cursor: pointer;
  display: flex; flex-direction: column; gap: 4px;
}
.mrkt360-cta-btn:hover {
  border-color: var(--primary); box-shadow: 0 6px 16px rgba(0,102,204,0.12);
  transform: translateY(-1.5px);
}
.mrkt360-cta-btn strong {
  font-size: 14.5px; font-weight: 700; color: var(--text);
}
.mrkt360-cta-btn span {
  font-size: 12.5px; color: var(--text-light); font-weight: 500;
}

/* Responsive */

  .mrkt360-launcher-wrap { right: 12px; bottom: 12px; }
  .mrkt360-choice-list { grid-template-columns: 1fr; }
  .mrkt360-avatar { width: 52px; height: 52px; }
  .mrkt360-title { font-size: 15px; }
}
/* Responsive - enhanced */
@media (max-width: 768px) {
  .mrkt360-widget {
    right: 16px; bottom: 80px;
    width: calc(100vw - 32px);
    height: calc(100vh - 110px);
    max-height: none;
    border-radius: 24px;
  }
  .mrkt360-launcher-wrap { right: 16px; bottom: 16px; }
  .mrkt360-header { padding: 16px; }
  .mrkt360-avatar { width: 56px; height: 56px; }
  .mrkt360-title { font-size: 17px; }
  .mrkt360-subtitle { font-size: 13px; }
  .mrkt360-bubble { font-size: 15px; }
}

@media (max-width: 520px) {
  .mrkt360-widget {
    right: 12px; bottom: 70px;
    width: calc(100vw - 24px);
    height: calc(100vh - 90px);
    border-radius: 20px;
  }
  .mrkt360-launcher-wrap { right: 12px; bottom: 12px; }
  .mrkt360-avatar { width: 52px; height: 52px; }
  .mrkt360-title { font-size: 16px; }
  .mrkt360-subtitle { font-size: 12px; }
  .mrkt360-bubble { font-size: 15px; line-height: 1.5; }
  .mrkt360-choice-list { grid-template-columns: 1fr; }
  .mrkt360-choice-list {
    max-height: 40vh;
    overflow-y: auto;
    padding-right: 4px;
  }
  .mrkt360-choice-btn {
    min-height: 44px;
    font-size: 14px;
  }
  .mrkt360-btn { padding: 14px 16px; font-size: 15px; }
}

@media (max-width: 380px) {
  .mrkt360-widget {
    right: 8px; bottom: 60px;
    width: calc(100vw - 16px);
    height: calc(100vh - 80px);
    border-radius: 18px;
  }
  .mrkt360-launcher-wrap { right: 8px; bottom: 8px; }
  .mrkt360-launcher { width: 60px; height: 60px; }
  .mrkt360-avatar { width: 48px; height: 48px; }
  .mrkt360-title { font-size: 15px; }
  .mrkt360-header { padding: 12px; }
  .mrkt360-bubble { font-size: 14px; }
  .mrkt360-text-input { padding: 12px 14px; font-size: 14px; }
}

/* Ensure body scroll works on mobile */
html, body { overflow-x: hidden; }

