/* Dashboard layout with left sidebar */
:root {
  --accent-color: rgb(38, 90, 216);
  --accent-light: rgba(38, 90, 216, 0.08);
  --accent-hover: rgba(38, 90, 216, 0.12);
  --accent-foreground: #ffffff;
  --sidebar-bg: #fafafa;
  --sidebar-hover: rgba(0, 0, 0, 0.04);
  --text-color: #1c1e21;
  --text-secondary: #65676b;
  --text-muted: #8a8d91;
  --border-color: rgba(0, 0, 0, 0.08);
  --divider-color: rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: none;
}

.modal-controls {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  justify-content: flex-end;
}

html, body {
  height: 100%;
  background: #ffffff;
  font-family: 'SF Pro Display', 'SF Pro', -apple-system, 'Roboto', system-ui, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  color: var(--text-color);
  font-weight: 400; /* base body is regular */
  font-size: 16px; /* base text size */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.sidebar-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: var(--sidebar-bg);
/* modal-body uses the default padding defined below */
}

/* Custom scrollbar for sidebar */
.sidebar-container::-webkit-scrollbar {
  width: 6px;
}
.sidebar-container::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-container::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
}
.sidebar-container::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

.sidebar-header {
  padding: 24px 20px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-color) 0%, #4f7df3 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.sidebar-header h1 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-divider {
  height: 1px;
  background: var(--divider-color);
  margin: 8px 16px;
}

.main-content {
  margin-left: 260px;
  height: 100vh;
  overflow-y: auto;
  padding: 24px 32px;
}

/* Typography and subtle main-card elevation */
.main-content {
  font-size: 16px; /* ensure main content uses 16px as requested */
  line-height: 1.5;
  color: var(--text-color);
  background: #fff;
}

/* Sidebar navigation */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  flex: 1;
}

.nav-section {
  margin-bottom: 16px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 12px 6px;
  margin-bottom: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 15px;
  line-height: 1.3;
  transition: all 150ms ease;
  position: relative;
}

.nav-link-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-link-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.75;
  fill: none;
}

.nav-text {
  position: relative;
  flex: 1;
}

.nav-text::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  transform: scaleX(0);
  transform-origin: left;
  width: 100%;
  height: 2px;
  background: var(--accent-color);
  border-radius: 1px;
  transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover {
  background: var(--sidebar-hover);
  color: var(--text-color);
}

.nav-link:hover .nav-link-icon {
  opacity: 1;
}

.nav-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-color);
}

.nav-link.active,
.nav-link[aria-current="page"] {
  background: var(--accent-light);
  color: var(--accent-color);
  font-weight: 600;
}

.nav-link.active .nav-link-icon,
.nav-link[aria-current="page"] .nav-link-icon {
  opacity: 1;
}

.nav-link.active .nav-text::after,
.nav-link[aria-current="page"] .nav-text::after {
  transform: scaleX(1);
}

/* Sidebar footer */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--divider-color);
  margin-top: auto;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 150ms ease;
}

.sidebar-user:hover {
  background: var(--sidebar-hover);
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e0e0e0 0%, #c0c0c0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Responsive styles */
@media (max-width: 768px) {
  .sidebar-container {
    width: 72px;
  }
  .main-content {
    margin-left: 72px;
    padding: 16px;
  }
  .sidebar-header h1,
  .nav-text,
  .nav-section-title,
  .sidebar-user-info {
    display: none;
  }
  .sidebar-header {
    padding: 16px;
    justify-content: center;
  }
  .sidebar-nav {
    padding: 8px;
  }
  .nav-link {
    padding: 12px;
    justify-content: center;
  }
  .nav-link-icon {
    margin: 0;
  }
  .sidebar-footer {
    padding: 12px;
  }
  .sidebar-user {
    padding: 8px;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .sidebar-container {
    position: fixed;
    bottom: 0;
    top: auto;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    border-right: none;
    border-top: 1px solid var(--border-color);
    background: rgba(250, 250, 250, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
  .main-content {
    margin-left: 0;
    margin-bottom: 64px;
  }
  .sidebar-header,
  .sidebar-footer,
  .nav-section-title {
    display: none;
  }
  .sidebar-nav {
    flex-direction: row;
    justify-content: space-around;
    padding: 8px 4px;
    width: 100%;
  }
  .nav-link {
    flex-direction: column;
    gap: 4px;
    padding: 8px 12px;
    font-size: 10px;
  }
  .nav-text {
    display: block;
  }
  .nav-text::after {
    display: none;
  }
  .nav-link.active,
  .nav-link[aria-current="page"] {
    background: transparent;
  }
  .nav-link.active .nav-link-icon,
  .nav-link[aria-current="page"] .nav-link-icon {
    color: var(--accent-color);
  }
}

/* ===========================================
   PAGE CONTENT STYLES
   =========================================== */

/* Top Bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

/* Search */
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f5f5f7;
  border-radius: 10px;
  padding: 10px 14px;
  flex: 1;
  max-width: 320px;
}

.search-box svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-input {
  border: none;
  background: none;
  font-size: 15px;
  color: var(--text-color);
  outline: none;
  width: 100%;
}

.search-input::placeholder {
  color: var(--text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 150ms ease;
  border: none;
  background: none;
}

.btn-primary {
  background: var(--accent-color);
  color: white;
}

.btn-primary:hover {
  background: rgb(30, 75, 190);
}

.btn-ghost {
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: rgba(0,0,0,0.04);
  color: var(--text-color);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 150ms ease;
}

.btn-icon:hover {
  background: rgba(0,0,0,0.05);
  color: var(--text-color);
}

/* Assistants List */
.assistants-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #f5f5f7;
  border-radius: 12px;
  overflow: hidden;
}

.assistant-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: white;
  transition: background 150ms ease;
}

.assistant-row:hover {
  background: #fafafa;
}

.assistant-info {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.assistant-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-blue { background: rgba(59,130,246,0.1); color: #3b82f6; }
.icon-green { background: rgba(34,197,94,0.1); color: #22c55e; }
.icon-purple { background: rgba(168,85,247,0.1); color: #a855f7; }
.icon-orange { background: rgba(249,115,22,0.1); color: #f97316; }

.assistant-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.assistant-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-color);
}

.assistant-platform {
  font-size: 13px;
  color: var(--text-muted);
}

.assistant-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  flex-shrink: 0;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-active { background: rgba(34,197,94,0.1); color: #16a34a; }
.status-active .status-dot { background: #16a34a; }

.status-training { background: rgba(234,179,8,0.1); color: #ca8a04; }
.status-training .status-dot { background: #ca8a04; animation: pulse 2s infinite; }

.status-paused { background: rgba(107,114,128,0.1); color: #6b7280; }
.status-paused .status-dot { background: #6b7280; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.assistant-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 200ms ease;
  padding: 20px;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: white;
  border-radius: 14px;
  width: 60vw;
  max-width: 720px;
  min-height: 70vh;
  max-height: 95vh;
  overflow: hidden;
  transform: scale(0.96);
  transition: transform 200ms ease;
  display: flex;
  flex-direction: column;
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: none; /* remove thin gray line under header */
}

.modal-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-color);
}

.modal-close {
  color: var(--text-muted);
}

.modal-body {
  padding: 20px;
  overflow: auto;
  flex: 1 1 auto;
  position: relative;
}

/* Ensure modal controls remain visible within the scrolling modal body */
.modal-body {
  padding-bottom: 84px; /* room for controls */
}
.modal-controls {
  position: sticky;
  bottom: 18px;
  background: transparent;
  z-index: 4;
}

/* Modal progress bar - sleek rounded track with green fill (3 steps) */
.modal-progress {
  display: block;
  width: 70%;
  max-width: 520px;
  height: 8px;
  background: transparent;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0 12px 0;
  align-self: center;
}
.modal-progress-bar {
  height: 100%;
  background: #16a34a; /* green */
  width: 0%;
  transition: width 280ms cubic-bezier(.2,.9,.2,1);
  border-radius: 999px;
}

/* Chat / single-question modal */
.question-title {
  margin: 0 0 12px 0;
  color: var(--text-color);
  /* Base smaller rule (overridden below for large view) */
  font-size: 16px;
}
.chat-area {
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  height: auto;
  min-height: 80px;
  max-height: 50vh;
  overflow: auto;
  margin-bottom: 12px;
}

/* Hide the chat area entirely when there are no messages so it doesn't show a large empty box */
.chat-area:empty {
  display: none;
}
.chat-message {
  margin-bottom: 10px;
  max-width: 85%;
  padding: 8px 10px;
  border-radius: 8px;
}
.chat-message.user {
  background: #eef2ff;
  align-self: flex-end;
}
.chat-message.assistant {
  background: #f3f4f6;
}
.chat-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.chat-input-row .form-textarea {
  flex: 1 1 auto;
  resize: vertical;
  min-height: 48px;
  max-height: 420px;
}

/* Big input card styling (like the attachment) */
.big-text-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}
.big-text-card .form-textarea {
  width: 100%;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.08);
  min-height: 160px;
  max-height: 60vh;
  resize: vertical;
  font-size: 16px;
  line-height: 1.5;
}
.btn-next-large {
  padding: 14px 18px;
  font-size: 16px;
  border-radius: 12px;
}

.modal-controls .btn-next-large {
  min-width: 160px;
}

/* Choice list styles for step 2 */
.choice-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.choice-card {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: 12px;
  background: white;
  border: 1px solid rgba(0,0,0,0.06);
  cursor: pointer;
  font-size: 15px;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
.choice-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(16,24,40,0.04);
  background: linear-gradient(180deg,#fff,#fbfbfd);
}

/* Selected state for choice cards */
.choice-card.selected {
  border: 2px solid var(--accent-color);
  background: linear-gradient(180deg, rgba(38,90,216,0.04), #fff);
  box-shadow: 0 8px 22px rgba(38,90,216,0.08);
  transform: translateY(-2px);
}

/* Modal controls layout */
.modal-controls {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  justify-content: flex-end;
}

/* Loading overlay for AI processing */
.loading-overlay {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  animation: fadeIn 300ms ease;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(38, 90, 216, 0.1);
  border-top: 4px solid var(--accent-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

.loading-overlay p {
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 500;
  margin: 0;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.btn {
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid rgba(0,0,0,0.06);
}

.btn-secondary:disabled {
  opacity: 0.5;
  cursor: default;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Larger visual weight to the question title to match the example */
.question-title {
  font-size: 34px;
  line-height: 1.02;
  margin-bottom: 20px;
  /* Apple-style title weight */
  font-weight: 700;
  font-family: "SF Pro Display", "SF Pro Text", -apple-system, "Helvetica Neue", Arial, "Segoe UI", Roboto, system-ui;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.4px;
}

@media (max-width: 640px) {
  .chat-area { height: calc(50vh - 140px); }
  .text-input-card { max-width: 95%; padding: 14px; }
  .text-input-card .form-textarea { min-height: 100px; }
  .question-title { font-size: 22px; }
}

/* Responsive: on small screens use full width and smaller min-height */
@media (max-width: 640px) {
  .modal {
    width: 95vw;
    max-width: 95vw;
    min-height: 50vh;
  }
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid rgba(0,0,0,0.06);
  background: #fafafa;
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 6px;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  color: var(--text-color);
  background: #f5f5f7;
  border: none;
  border-radius: 8px;
  transition: box-shadow 150ms ease;
  font-family: inherit;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-color);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

/* Responsive */
@media (max-width: 768px) {
  .top-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .search-box {
    max-width: none;
  }
  .assistant-row {
    flex-wrap: wrap;
  }
  .assistant-status {
    order: 3;
    margin-left: 54px;
  }
  .assistant-actions {
    order: 2;
    margin-left: auto;
  }
}

/* Virtual Assistant Customization Page */
.customize-container {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 24px;
  height: calc(100vh - 48px);
  max-height: calc(100vh - 48px);
}

.customize-panel {
  background: #fafafa;
  border-radius: 16px;
  padding: 24px;
  overflow-y: auto;
  height: 100%;
}

.customize-panel::-webkit-scrollbar {
  width: 6px;
}

.customize-panel::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.customize-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 24px;
  letter-spacing: -0.5px;
}

.customize-section {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--divider-color);
}

.customize-section:last-of-type {
  border-bottom: none;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.control-group {
  margin-bottom: 20px;
}

.control-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 8px;
}

.color-input-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
}

.color-input {
  width: 60px;
  height: 40px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 150ms ease;
}

.color-input:hover {
  border-color: var(--accent-color);
}

.color-text {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  font-family: 'SF Mono', Monaco, monospace;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.color-text:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(38, 90, 216, 0.1);
}

.text-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 15px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.text-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(38, 90, 216, 0.1);
}

.select-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 15px;
  background: white;
  cursor: pointer;
  transition: border-color 150ms ease;
}

.select-input:focus {
  outline: none;
  border-color: var(--accent-color);
}

.range-input {
  width: calc(100% - 60px);
  margin-right: 8px;
}

.range-value {
  display: inline-block;
  min-width: 50px;
  text-align: right;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.radio-group {
  display: flex;
  gap: 12px;
}

.radio-option {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 150ms ease;
}

.radio-option:hover {
  border-color: var(--accent-color);
  background: rgba(38, 90, 216, 0.02);
}

.radio-option input[type="radio"] {
  margin: 0;
  cursor: pointer;
}

.radio-option input[type="radio"]:checked + span {
  color: var(--accent-color);
  font-weight: 600;
}

.radio-option:has(input:checked) {
  border-color: var(--accent-color);
  background: rgba(38, 90, 216, 0.05);
}

.icon-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.icon-picker.expanded {
  grid-template-columns: repeat(4, 1fr);
}

.icon-option {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  transition: all 150ms ease;
}

.icon-option svg {
  width: 24px;
  height: 24px;
  stroke: var(--text-secondary);
}

.icon-option:hover {
  border-color: var(--accent-color);
  background: rgba(38, 90, 216, 0.02);
}

.icon-option.active {
  border-color: var(--accent-color);
  background: rgba(38, 90, 216, 0.08);
}

.icon-option.active svg {
  stroke: var(--accent-color);
}

/* Position Selector */
.position-selector {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.position-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.position-preset {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  background: white;
  cursor: pointer;
  transition: all 150ms ease;
}

.position-preset svg {
  width: 32px;
  height: 32px;
  stroke: var(--text-secondary);
}

.position-preset span {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.position-preset:hover {
  border-color: var(--accent-color);
  background: rgba(38, 90, 216, 0.02);
}

.position-preset.active {
  border-color: var(--accent-color);
  background: rgba(38, 90, 216, 0.08);
}

.position-preset.active svg {
  stroke: var(--accent-color);
}

.position-preset.active span {
  color: var(--accent-color);
}

.custom-position-inputs {
  background: #f9fafb;
  padding: 12px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.position-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

.position-input-group label {
  min-width: 60px;
  font-weight: 500;
}

.small-input {
  width: 70px;
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  text-align: center;
}

.small-input:focus {
  outline: none;
  border-color: var(--accent-color);
}

.drag-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 4px 0 0 0;
}

/* Custom Dropdown */
.custom-dropdown {
  position: relative;
}

.dropdown-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  background: white;
  cursor: pointer;
  transition: all 150ms ease;
}

.dropdown-trigger:hover {
  border-color: var(--accent-color);
}

.dropdown-trigger.open {
  border-color: var(--accent-color);
  border-radius: 10px 10px 0 0;
}

.dropdown-value {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-color);
}

.dropdown-arrow {
  width: 18px;
  height: 18px;
  stroke: var(--text-muted);
  transition: transform 200ms ease;
}

.dropdown-trigger.open .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid var(--accent-color);
  border-top: none;
  border-radius: 0 0 10px 10px;
  z-index: 100;
  display: none;
  overflow: hidden;
}

.dropdown-menu.open {
  display: block;
  animation: dropdownSlide 200ms ease;
}

@keyframes dropdownSlide {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: none;
  background: white;
  cursor: pointer;
  transition: background 150ms ease;
}

.dropdown-option:hover {
  background: rgba(38, 90, 216, 0.05);
}

.dropdown-option.selected {
  background: rgba(38, 90, 216, 0.08);
}

.option-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.option-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-color);
}

.option-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.option-check {
  width: 18px;
  height: 18px;
  stroke: var(--accent-color);
}

.btn-large {
  width: 100%;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.export-btn {
  margin-top: 8px;
}

/* Preview Panel */
.preview-panel {
  background: white;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  background: #fafafa;
}

.preview-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
}

.preview-badge {
  padding: 4px 10px;
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
}

.preview-frame {
  flex: 1;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
  overflow: hidden;
}

.preview-website {
  position: absolute;
  inset: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.preview-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: white;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.preview-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-color);
}

.preview-nav-links {
  display: flex;
  gap: 24px;
  font-size: 14px;
  color: var(--text-secondary);
}

.preview-nav-links span {
  cursor: pointer;
}

.preview-content {
  padding: 60px 40px;
}

.preview-content h1 {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.preview-content p {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 600px;
}

/* Chat Widget */
.chat-widget {
  position: absolute;
  z-index: 1000;
  transition: all 300ms ease;
}

.chat-widget.bottom-right {
  bottom: 24px;
  right: 24px;
}

.chat-widget.bottom-left {
  bottom: 24px;
  left: 24px;
}

.chat-widget-button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent-color);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(38, 90, 216, 0.4);
  transition: all 200ms ease;
}

.chat-widget-button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 24px rgba(38, 90, 216, 0.5);
}

.chat-widget-button:active {
  transform: scale(0.95);
}

.widget-icon {
  width: 28px;
  height: 28px;
  stroke: white;
  stroke-width: 2;
  fill: none;
}

.chat-window {
  position: absolute;
  bottom: 76px;
  right: 0;
  width: 380px;
  height: 500px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chat-widget.open .chat-window {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--accent-color);
  color: white;
  border-radius: 16px 16px 0 0;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-avatar svg {
  width: 20px;
  height: 20px;
  stroke: white;
}

.chat-assistant-name {
  font-size: 15px;
  font-weight: 600;
}

.chat-status {
  font-size: 12px;
  opacity: 0.8;
}

.chat-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms ease;
}

.chat-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.chat-close-btn svg {
  width: 16px;
  height: 16px;
  stroke: white;
}

.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: #f9fafb;
}

.chat-message {
  margin-bottom: 16px;
  animation: messageSlide 300ms ease;
}

@keyframes messageSlide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bot-message .message-content {
  background: white;
  color: var(--text-color);
  padding: 12px 16px;
  border-radius: 12px 12px 12px 4px;
  display: inline-block;
  max-width: 85%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.user-message {
  text-align: right;
}

.user-message .message-content {
  background: var(--accent-color);
  color: white;
  padding: 12px 16px;
  border-radius: 12px 12px 4px 12px;
  display: inline-block;
  max-width: 85%;
}

.chat-input-area {
  display: flex;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  background: white;
}

.chat-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 14px;
  transition: border-color 150ms ease;
}

.chat-input:focus {
  outline: none;
  border-color: var(--accent-color);
}

.chat-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-color);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 150ms ease;
}

.chat-send-btn:hover {
  transform: scale(1.05);
}

.chat-send-btn svg {
  width: 18px;
  height: 18px;
  stroke: white;
}

@media (max-width: 1200px) {
  .customize-container {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
  }
  
  .customize-panel {
    height: auto;
    max-height: 600px;
  }
  
  .preview-panel {
    height: 600px;
  }
}

/* AI Chat Test Styles */
.dashboard-header {
  padding: 20px;
  border-bottom: 1px solid #e0e0e0;
}

.dashboard-header h2 {
  margin: 0;
  color: var(--text-color);
}

.dashboard-content {
  padding: 20px;
}

.chat-test-section h3 {
  margin-bottom: 15px;
  color: var(--text-color);
}

.chat-messages {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  height: 300px;
  overflow-y: auto;
  padding: 10px;
  margin-bottom: 15px;
  background-color: #fafafa;
}

.chat-message {
  margin-bottom: 10px;
  padding: 8px 12px;
  border-radius: 6px;
}

.chat-message.user {
  background-color: var(--accent-color);
  color: white;
  text-align: right;
}

.chat-message.ai {
  background-color: #e9ecef;
  color: var(--text-color);
}

.chat-input-container {
  display: flex;
  gap: 10px;
}

#chat-input {
  flex: 1;
  padding: 10px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
}

#send-button {
  padding: 10px 20px;
  background-color: var(--accent-color);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

#send-button:hover {
  background-color: #2c5aa0;
}

#send-button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}
