@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  --bg-primary: #090d16;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.7);
  --border-color: rgba(255, 255, 255, 0.08);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  
  --accent-color: #6366f1;
  --accent-hover: #4f46e5;
  --accent-glow: rgba(99, 102, 241, 0.15);

  --font-display: 'Outfit', sans-serif;
  --font-sans: 'Inter', sans-serif;
  
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(16, 163, 127, 0.05) 0%, transparent 40%);
}

/* Navbar */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(9, 13, 22, 0.8);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  background: linear-gradient(135deg, #6366f1, #10a37f);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.25rem;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(to right, #f3f4f6, #9ca3af);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.badge {
  background: rgba(16, 163, 127, 0.1);
  color: #10a37f;
  border: 1px solid rgba(16, 163, 127, 0.2);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* Dashboard Layout */
.dashboard-container {
  width: 100%;
  display: flex;
  height: calc(100vh - 88px);
  overflow: hidden;
  position: relative;
  gap: 0;
}

/* Sidebar Customizer Panel */
.dashboard-container #sidebar {
  width: 450px;
  flex-shrink: 0;
  border-radius: 0;
  border: none;
  border-right: 1px solid var(--border-color);
  margin: 0;
  height: 100%;
  box-shadow: none;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.dashboard-container #sidebar.collapsed {
  margin-left: -450px;
  opacity: 0;
  pointer-events: none;
}

/* Make preview fill the remaining area */
.dashboard-container .preview-container {
  flex: 1;
  border: none;
  border-radius: 0;
  box-shadow: none;
  height: 100%;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  margin-right: 1rem;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

.sidebar-toggle svg {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Rotate the toggle icon when collapsed */
#sidebar.collapsed ~ .preview-container .sidebar-toggle svg {
  transform: rotate(180deg);
}

@media (max-width: 1024px) {
  .dashboard-container {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }
  .dashboard-container #sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  .dashboard-container #sidebar.collapsed {
    margin-left: 0;
    display: none;
  }
  .sidebar-toggle {
    display: none;
  }
}

/* Scrollbars */
.scrollable {
  overflow-y: auto;
  padding-right: 0.5rem;
}

.scrollable::-webkit-scrollbar {
  width: 6px;
}

.scrollable::-webkit-scrollbar-track {
  background: transparent;
}

.scrollable::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.scrollable::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Panels */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.panel-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

/* Form Controls */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

select, input[type="text"] {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  color: white;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition-smooth);
}

select:focus, input[type="text"]:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 10px var(--accent-glow);
}

/* Color Picker Grids */
.color-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.color-input-wrapper {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.375rem 0.75rem;
  gap: 0.5rem;
}

.color-input-wrapper input[type="color"] {
  -webkit-appearance: none;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  background: transparent;
}

.color-input-wrapper input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-input-wrapper input[type="color"]::-webkit-color-swatch {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

.color-value {
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--text-primary);
  text-transform: uppercase;
}

/* Sliders */
.slider-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.slider-group input[type="range"] {
  flex: 1;
  accent-color: var(--accent-color);
  cursor: pointer;
}

.slider-val {
  font-size: 0.85rem;
  font-family: monospace;
  color: var(--text-secondary);
  width: 30px;
}

/* Code Snippet Box */
.code-box {
  background: #080c14;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  margin-top: 0.5rem;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.btn-copy {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-family: inherit;
  font-weight: 500;
  transition: var(--transition-smooth);
}

.btn-copy:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.code-box pre {
  padding: 1rem;
  overflow-x: auto;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #a5b4fc;
}

/* Preview Website Frame */
.preview-container {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #111827;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.preview-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: #1f2937;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }

.url-bar {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.25rem 3rem;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.8rem;
  color: #9ca3af;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.site-mockup {
  flex: 1;
  background: #f9fafb;
  color: #1f2937;
  position: relative;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Mockup Content (inside preview) */
.mock-hero {
  padding: 4rem 2rem 3rem;
  text-align: center;
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  border-bottom: 1px solid #e5e7eb;
}

.mock-hero h1 {
  font-family: var(--font-display);
  font-size: 2.25rem;
  color: #111827;
  margin-bottom: 1rem;
}

.mock-hero p {
  font-size: 1rem;
  color: #4b5563;
  max-width: 600px;
  margin: 0 auto 1.5rem;
}

.mock-btn {
  display: inline-block;
  background: #4f46e5;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.mock-btn:hover {
  background: #4338ca;
}

.mock-body {
  padding: 3rem 2rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
}

.mock-card {
  background: white;
  border: 1px solid #e5e7eb;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.mock-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  color: #111827;
}

.mock-card p {
  font-size: 0.85rem;
  color: #6b7280;
  line-height: 1.5;
}

/* Floating Chat Button on Mock Site */
.floating-chat-trigger {
  position: absolute;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--widget-primary-color, #10a37f);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, background-color 0.3s ease;
  z-index: 100;
}

.floating-chat-trigger:hover {
  transform: scale(1.05);
}

.floating-chat-trigger svg {
  width: 24px;
  height: 24px;
}

/* Embedded Chat Container (positioned floatingly inside the mockup) */
.embedded-chat-window {
  position: absolute;
  bottom: 92px;
  right: 24px;
  width: 380px;
  height: 520px;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  background: white;
  z-index: 100;
  overflow: hidden;
  display: none;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(0,0,0,0.08);
}

.embedded-chat-window.open {
  display: block;
}

#chat-widget {
  width: 100%;
  height: 100%;
}

/* Animations */
@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Presets Dropdown */
.presets-dropdown {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.2em;
  padding-right: 2.5rem;
}

.presets-dropdown option {
  background-color: var(--bg-secondary);
  color: white;
}

/* Custom Alert Banner */
.info-banner {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  gap: 0.75rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #a5b4fc;
}

.info-banner svg {
  flex-shrink: 0;
  color: var(--accent-color);
  width: 20px;
  height: 20px;
}
