/* Shopify App Premium UI - Variables & Design System */
:root {
  --shopify-green: #008060;
  --shopify-green-light: #f0fdf4;
  --shopify-green-dark: #004c3f;
  --shopify-blue: #005bd3;
  --shopify-red: #d82c0d;
  --bg-color: #f1f2f4;
  --surface: #ffffff;
  --sidebar-bg: #1a1d21;
  --text-main: #202223;
  --text-muted: #6d7175;
  --border-color: #e1e3e5;
  --border-radius: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.12);
  --font-family: -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --gradient-primary: linear-gradient(135deg, #008060 0%, #00a876 100%);
  --gradient-blue: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  min-height: 100vh;
}

/* App Shell Layout */
.app-sidebar {
  width: 220px;
  background: #f1f2f4;
  color: #202223;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #e1e3e5;
  padding: 16px 8px;
}

.sidebar-header {
  padding: 8px 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #e1e3e5;
  margin-bottom: 8px;
}

.sidebar-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #4a4d52;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
  font-weight: bold;
}

.sidebar-brand {
  font-size: 14px;
  font-weight: 700;
  color: #202223;
  letter-spacing: -0.2px;
}

.sidebar-nav {
  padding: 4px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: #4a4d52;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.1s ease;
}

.nav-item:hover {
  background: #e4e5e7;
  color: #202223;
}

.nav-item.active {
  background: #ffffff;
  color: #202223;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.nav-item .arrow-indent {
  color: #8c9196;
  font-size: 13px;
  margin-right: -2px;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* Header */
.top-navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-navbar-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge-published {
  background: #d1fae5;
  color: #065f46;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-published::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}

.container-fluid {
  padding: 32px;
  max-width: 1280px;
  width: 100%;
}

/* Onboarding Setup Card */
.setup-checklist-card {
  background: var(--surface);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  padding: 24px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}

.setup-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.setup-steps-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.setup-step-item {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  background: #fafafa;
}

.setup-step-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  cursor: pointer;
  background: #fff;
}

.setup-step-summary:hover {
  background: #f8fafc;
}

.setup-step-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.step-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px dashed #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.setup-step-body {
  padding: 18px;
  background: #f8fafc;
  border-top: 1px solid var(--border-color);
  font-size: 13px;
  color: #475569;
  line-height: 1.6;
}

/* Funnel Pipeline Visual Flow */
.funnel-pipeline {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 24px;
  position: relative;
}

.funnel-node-card {
  background: var(--surface);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all 0.2s ease;
}

.funnel-node-card:hover {
  border-color: #bbf7d0;
  box-shadow: var(--shadow-md);
}

.funnel-node-header {
  padding: 18px 24px;
  border-bottom: 1px solid #f1f2f4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fafafa;
}

.node-type-tag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.node-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 2px;
}

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

.funnel-node-body {
  padding: 20px 24px;
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
}

@media(max-width: 900px) {
  .funnel-node-body {
    flex-direction: column;
    align-items: flex-start;
  }
}

.product-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid #cbd5e1;
  padding: 12px;
  border-radius: 8px;
  background: #f8fafc;
  margin-top: 6px;
}

@media (max-width: 640px) {
  .modal-card {
    max-height: 95vh;
    border-radius: 12px;
  }
  .modal-body {
    padding: 16px;
  }
  .modal-header, .modal-footer {
    padding: 14px 16px;
  }
  .product-select-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    max-height: 180px;
  }
}

.node-product-info {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.node-img {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: #f1f5f9;
  object-fit: cover;
  border: 1px solid #e2e8f0;
}

.node-product-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 2px;
}

.node-product-meta {
  font-size: 13px;
  color: var(--text-muted);
}

/* Metrics Row */
.metrics-row {
  display: flex;
  gap: 24px;
  background: #f8fafc;
  padding: 12px 20px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

.metric-pill {
  display: flex;
  flex-direction: column;
  text-align: center;
  min-width: 65px;
}

.metric-pill .label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
}

.metric-pill .value {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

/* Connectors */
.funnel-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: -10px 0;
  position: relative;
  z-index: 1;
}

.connector-line {
  width: 2px;
  height: 24px;
  background: #cbd5e1;
}

.connector-badge {
  background: #fff;
  border: 1px solid #cbd5e1;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  padding: 3px 12px;
  border-radius: 999px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.connector-badge.accept {
  color: #059669;
  border-color: #a7f3d0;
  background: #ecfdf5;
}

.connector-badge.decline {
  color: #dc2626;
  border-color: #fecaca;
  background: #fef2f2;
}

/* Buttons & Elements */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #fff;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-primary {
  background: var(--shopify-green);
  color: #fff;
  border: none;
}

.btn-primary:hover {
  background: var(--shopify-green-dark);
  color: #fff;
}

.btn-premium {
  background: var(--gradient-primary);
  color: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 128, 96, 0.25);
}

.btn-premium:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 128, 96, 0.35);
  color: #fff;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 20px;
  overflow-y: auto;
}

.modal-card {
  background: #fff;
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  margin: auto;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  position: sticky;
  bottom: 0;
  z-index: 10;
}

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

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #334155;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
}

.form-control:focus {
  outline: none;
  border-color: var(--shopify-green);
  box-shadow: 0 0 0 3px rgba(0, 128, 96, 0.15);
}

/* Mobile & Tablet Responsive Media Queries */
@media (max-width: 768px) {
  body {
    flex-direction: column;
  }
  .app-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #e1e3e5;
    padding: 12px 16px;
  }
  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }
  .nav-item {
    padding: 6px 10px;
    font-size: 13px;
  }
  .top-navbar {
    padding: 12px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .container-fluid {
    padding: 16px;
  }
  .funnel-node-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .funnel-node-body {
    flex-direction: column;
    gap: 16px;
  }
  .metrics-row {
    width: 100%;
    justify-content: space-around;
  }
}


