/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #8b5cf6;
  --text: #1f2937;
  --text-light: #6b7280;
  --bg: #ffffff;
  --bg-light: #f9fafb;
  --border: #e5e7eb;
  --shadow: rgba(0, 0, 0, 0.1);
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg-light);
  line-height: 1.6;
}

/* Dark mode */
body.dark-mode {
  --text: #f9fafb;
  --text-light: #9ca3af;
  --bg: #111827;
  --bg-light: #1f2937;
  --border: #374151;
  --shadow: rgba(0, 0, 0, 0.3);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Navigation */
.nav {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 1.25rem;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: bold;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Buttons */
.btn {
  padding: 0.625rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}

.btn-secondary {
  background: white;
  color: var(--primary);
  border: 2px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--primary);
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-icon {
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-light);
}

.btn-full {
  width: 100%;
}

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

/* Hero Section */
.hero {
  background: linear-gradient(135deg, #eef2ff 0%, #faf5ff 100%);
  padding: 5rem 0;
  text-align: center;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero-title {
  font-size: 3.75rem;
  font-weight: bold;
  margin-bottom: 1.5rem;
  background: linear-gradient(
    135deg,
    var(--primary),
    var(--secondary),
    #ec4899
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-light);
  margin-bottom: 2rem;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Features Section */
.features {
  padding: 4rem 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.feature-card {
  background: white;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 4px 6px var(--shadow);
  transition: transform 0.2s;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px var(--shadow);
}

.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin-bottom: 1rem;
}

.feature-title {
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.feature-desc {
  color: var(--text-light);
}

/* Templates Section */
.templates {
  padding: 5rem 0;
  background: white;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title {
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1.25rem;
  color: var(--text-light);
}

.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.template-card {
  background: white;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 4px 6px var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.template-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px var(--shadow);
}

.template-preview {
  height: 200px;
  position: relative;
  padding: 1rem;
}

.template-widgets {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  height: 100%;
}

.widget-preview {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0.5rem;
}

.template-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
}

.template-info {
  padding: 1.5rem;
}

.template-title {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.template-desc {
  color: var(--text-light);
  margin-bottom: 1rem;
}

.template-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tag {
  background: #eef2ff;
  color: var(--primary);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
}

/* CTA Section */
.cta {
  padding: 5rem 0;
}

.cta-box {
  background: linear-gradient(
    135deg,
    var(--primary),
    var(--secondary),
    #ec4899
  );
  padding: 3rem;
  border-radius: 1.5rem;
  text-align: center;
  color: white;
  box-shadow: 0 20px 40px var(--shadow);
}

.cta-title {
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

.cta-subtitle {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

/* Footer */
.footer {
  background: white;
  border-top: 1px solid var(--border);
  padding: 3rem 0;
  text-align: center;
}

.footer-text {
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.footer-copy {
  color: var(--text-light);
  font-size: 0.875rem;
}

/* Builder Page Styles */
.builder-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.builder-header {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dashboard-select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  background: white;
  cursor: pointer;
}

.builder-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.sidebar {
  width: 280px;
  background: white;
  border-right: 1px solid var(--border);
  padding: 1.5rem;
  overflow-y: auto;
}

body.dark-mode .sidebar {
  background: var(--bg);
}

.sidebar-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.sidebar-hint {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

.widget-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.widget-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: white;
  cursor: grab;
  transition: all 0.2s;
  font-size: 0.875rem;
}

body.dark-mode .widget-btn {
  background: var(--bg-light);
  border-color: var(--border);
  color: var(--text);
}

.widget-btn:hover {
  background: var(--bg-light);
  border-color: var(--primary);
  transform: translateX(4px);
}

.widget-btn.dragging {
  opacity: 0.5;
  cursor: grabbing;
  transform: scale(0.95);
}

.widget-icon {
  font-size: 1.25rem;
}

.canvas {
  flex: 1;
  padding: 1.5rem;
  overflow: auto;
  position: relative;
  background: var(--bg-light);
}

.canvas-grid {
  position: relative;
  min-height: calc(100vh - 120px);
  min-width: 100%;
  background-image: radial-gradient(circle, var(--border) 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: 10px 10px;
}

.canvas-grid.drag-over {
  background-color: rgba(99, 102, 241, 0.05);
  border-radius: 1rem;
}

.empty-state {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 3rem;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.empty-title {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.empty-desc {
  color: var(--text-light);
  margin-bottom: 1rem;
}

.drop-zone-hint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  border: 2px dashed var(--border);
  border-radius: 0.75rem;
  color: var(--text-light);
  font-size: 0.875rem;
  animation: pulse 2s infinite;
}

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

/* Widget placeholder during drag */
.widget-placeholder {
  border: 2px dashed var(--primary);
  border-radius: 0.75rem;
  padding: 2rem;
  text-align: center;
  color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
  animation: placeholderPulse 1s infinite;
}

@keyframes placeholderPulse {
  0%,
  100% {
    background: rgba(99, 102, 241, 0.05);
  }
  50% {
    background: rgba(99, 102, 241, 0.1);
  }
}

/* Widget Styles */
.widget {
  background: white;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem;
  box-shadow: 0 2px 4px var(--shadow);
  position: absolute;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, border-color 0.2s;
}

body.dark-mode .widget {
  background: var(--bg);
  border-color: var(--border);
}

.widget:hover {
  box-shadow: 0 4px 12px var(--shadow);
  border-color: var(--primary);
}

.widget.dragging-widget {
  opacity: 0.8;
  z-index: 1000;
  box-shadow: 0 12px 32px var(--shadow);
  border-color: var(--primary);
}

.widget.resizing {
  opacity: 0.9;
  border-color: var(--secondary);
}

.widget.drag-target {
  border-color: var(--primary);
  border-style: dashed;
}

.widget.removing {
  animation: removeWidget 0.2s ease-out forwards;
}

@keyframes removeWidget {
  to {
    opacity: 0;
    transform: scale(0.9);
  }
}

/* Resize handle */
.resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 20px;
  height: 20px;
  cursor: se-resize;
  background: transparent;
  z-index: 10;
}

.resize-handle::before {
  content: "";
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--border);
  border-bottom: 2px solid var(--border);
  transition: border-color 0.2s;
}

.widget:hover .resize-handle::before {
  border-color: var(--primary);
}

.widget-large {
  grid-column: span 2;
}

.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  cursor: grab;
  flex-shrink: 0;
}

.widget-header:active {
  cursor: grabbing;
}

.widget-title {
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.widget-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.widget-content {
  flex: 1;
  overflow: auto;
}

.widget-source {
  font-size: 0.75rem;
  color: var(--text-light);
  padding: 0.25rem 0.5rem;
  background: var(--bg-light);
  border-radius: 0.25rem;
}

.widget-remove {
  background: transparent;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1.25rem;
  line-height: 1;
  border-radius: 0.25rem;
  transition: all 0.2s;
}

.widget-remove:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.widget-content {
  color: var(--text);
  cursor: default;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 1rem;
  max-width: 400px;
  width: 90%;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.modal-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-size: 1rem;
  margin-bottom: 1rem;
}

.modal-buttons {
  display: flex;
  gap: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }

  .sidebar {
    width: 200px;
  }

  .templates-grid {
    grid-template-columns: 1fr;
  }
}

/* Import Data Modal */
.modal-large {
  max-width: 700px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-light);
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

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

/* Security Notice */
.security-notice {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.1),
    rgba(99, 102, 241, 0.1)
  );
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  color: var(--text);
}

.security-notice svg {
  color: var(--success);
  flex-shrink: 0;
}

body.dark-mode .security-notice {
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.15),
    rgba(99, 102, 241, 0.15)
  );
}

.import-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.import-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: none;
  background: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  transition: all 0.2s;
}

.import-tab:hover {
  background: var(--bg-light);
  color: var(--text);
}

.import-tab.active {
  background: var(--primary);
  color: white;
}

.import-content {
  display: none;
}

.import-content.active {
  display: block;
}

/* File Drop Zone */
.file-drop-zone {
  border: 2px dashed var(--border);
  border-radius: 1rem;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.file-drop-zone:hover,
.file-drop-zone.drag-over {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

.file-drop-zone svg {
  color: var(--text-light);
  margin-bottom: 1rem;
}

.drop-zone-text {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.drop-zone-subtext {
  color: var(--text-light);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.supported-formats {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.format-badge {
  padding: 0.25rem 0.75rem;
  background: var(--bg-light);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-light);
}

/* Sheets & Paste Inputs */
.sheets-input-group,
.paste-input-group {
  margin-bottom: 1rem;
}

.input-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.input-hint {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 0.5rem;
}

.modal-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-family: monospace;
  resize: vertical;
}

/* Data Preview */
.data-preview {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.preview-header h4 {
  font-size: 1rem;
  font-weight: 600;
}

.preview-info {
  font-size: 0.75rem;
  color: var(--text-light);
  padding: 0.25rem 0.5rem;
  background: var(--bg-light);
  border-radius: 0.25rem;
}

.preview-table-wrapper {
  overflow-x: auto;
  max-height: 300px;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.preview-table th,
.preview-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.preview-table th {
  background: var(--bg-light);
  font-weight: 600;
  position: sticky;
  top: 0;
}

.preview-table .more-rows td {
  text-align: center;
  color: var(--text-light);
  font-style: italic;
}

.preview-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.preview-actions select {
  flex: 1;
}

/* Loading & Error States */
.loading-state,
.error-state {
  text-align: center;
  padding: 2rem;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.error-state svg {
  color: var(--error);
  margin-bottom: 1rem;
}

.error-state p {
  color: var(--error);
  margin-bottom: 1rem;
}

/* Data Table Widget */
.data-table-container {
  min-height: 200px;
}

.data-table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.data-search-input {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  width: 200px;
}

.data-info {
  font-size: 0.75rem;
  color: var(--text-light);
}

.data-table-wrapper {
  overflow-x: auto;
  max-height: 300px;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th {
  background: var(--bg-light);
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  position: sticky;
  top: 0;
  white-space: nowrap;
}

.data-table th:hover {
  background: var(--border);
}

.data-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.data-table tbody tr:hover {
  background: var(--bg-light);
}

.sort-icon {
  margin-left: 0.5rem;
  opacity: 0.5;
}

.data-table-footer {
  text-align: center;
  padding: 0.75rem;
  color: var(--text-light);
  font-size: 0.75rem;
  background: var(--bg-light);
  border-top: 1px solid var(--border);
}

/* Chart Widget */
.chart-container {
  min-height: 250px;
}

.chart-toolbar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.chart-select {
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  font-size: 0.75rem;
  background: white;
}

body.dark-mode .chart-select {
  background: var(--bg);
  color: var(--text);
}

.chart-area {
  height: 200px;
  position: relative;
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 100%;
  padding: 1rem;
  background: var(--bg-light);
  border-radius: 0.5rem;
}

.chart-bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  max-width: 60px;
}

.chart-bar {
  width: 100%;
  max-width: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 0.25rem 0.25rem 0 0;
  position: relative;
  transition: height 0.3s ease;
  min-height: 4px;
}

.chart-bar-value {
  position: absolute;
  top: -1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
}

.chart-bar-label {
  font-size: 0.625rem;
  color: var(--text-light);
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Line Chart */
.line-chart {
  width: 100%;
  height: 150px;
}

.line-labels {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  font-size: 0.625rem;
  color: var(--text-light);
}

/* Pie Chart */
.pie-chart {
  width: 120px;
  height: 120px;
  display: block;
  margin: 0 auto;
}

.pie-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

/* Notification Toast */
.notification {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 1rem 1.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px var(--shadow);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 2000;
}

.notification.show {
  transform: translateY(0);
  opacity: 1;
}

.notification.success {
  border-left: 4px solid var(--success);
}

.notification.success svg {
  color: var(--success);
}

/* Widget Configuration Modal */
.modal-medium {
  max-width: 500px;
}

.config-widget-type {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
}

.config-section {
  margin-bottom: 1.5rem;
}

.config-section-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.config-group {
  margin-bottom: 1rem;
}

.config-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.config-input,
.config-select,
.config-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.2s;
}

.config-input:focus,
.config-select:focus,
.config-textarea:focus {
  outline: none;
  border-color: var(--primary);
}

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

.config-hint {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

/* Color Presets */
.color-presets {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.color-preset {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}

.color-preset:hover {
  transform: scale(1.1);
}

.color-preset.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

.config-color-picker {
  width: 50px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  cursor: pointer;
  padding: 0;
  overflow: hidden;
}

.config-color-picker::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.config-color-picker::-webkit-color-swatch {
  border: none;
  border-radius: 0.25rem;
}

/* Size Presets */
.size-presets {
  display: flex;
  gap: 0.75rem;
}

.size-preset {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--bg);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.2s;
}

.size-preset:hover {
  border-color: var(--primary);
}

.size-preset.active {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.size-preset .size-icon {
  font-size: 1.25rem;
}

.size-preset span:last-child {
  font-size: 0.75rem;
  color: var(--text-light);
}

/* Drag Ghost */
.drag-ghost {
  position: absolute;
  top: -1000px;
  left: -1000px;
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: white;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}
