/* ── CSS Variables for Theme Support ── */
:root {
    --bs-primary: #1a4fa0;
    --bs-primary-bg-subtle: #eef2ff;
    --bs-primary-dark: #0e3a7a;
    --bs-primary-light: #3b82f6;
}
/* ── Layout ── */
    *, *::before, *::after { box-sizing: border-box; }
    body { margin: 0; font-family: 'Segoe UI', system-ui, sans-serif; background: #f0f2f5; }
    #app { display: flex; height: 100vh; overflow: hidden; }
/* ── Sidebar ── */
    #sidebar {
      width: 320px; min-width: 320px; background: #fff;
      border-right: 1px solid #e0e4ea;
      display: flex; flex-direction: column; overflow: hidden;
    }
    #sidebar-header {
      padding: 16px 18px 12px;
      border-bottom: 1px solid #e8eaf0;
      background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-primary-light) 100%);
      color: #fff;
    }
    #sidebar-header h6 { margin: 0; font-weight: 700; font-size: 14px; }
    #sidebar-header small { opacity: .75; font-size: 11px; }

    #component-list {
      flex: 1; overflow-y: auto; padding: 10px 8px;
    }

    .comp-item {
      border-radius: 10px; margin-bottom: 5px;
      border: 1.5px solid transparent;
      cursor: pointer; transition: all .18s;
      background: #f7f8fa;
    }
    /* .comp-item:hover { background: var(--bs-primary-bg-subtle); border-color: var(--bs-primary-light); } */
    .comp-item.active { background: var(--bs-primary-bg-subtle); border-color: var(--bs-primary); }
    .comp-item-header { display: flex; align-items: center; gap: 10px; padding: 9px 10px; }
    .comp-icon {
      width: 32px; height: 32px; border-radius: 8px;
      display: flex; align-items: center; justify-content: center;
      font-size: 15px; flex-shrink: 0;
    }
    .comp-label { font-size: 13px; font-weight: 600; color: #1e293b; }
    .comp-sublabel { font-size: 11px; color: #64748b; }

    /* Reorder + visibility controls */
    .comp-controls {
      display: flex; align-items: center; gap: 3px;
      padding: 0 10px 8px 52px;
    }
    .comp-controls .ctrl-btn {
      border: 1px solid #d1d5db; background: #fff; border-radius: 5px;
      width: 26px; height: 26px; cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      font-size: 12px; color: #475569; transition: all .15s;
      flex-shrink: 0;
    }
    /* .ctrl-btn:hover { background: var(--bs-primary-bg-subtle); border-color: var(--bs-primary); color: var(--bs-primary); } */
    .ctrl-btn.vis-btn.hidden-state { background: #fff7ed; border-color: #fb923c; color: #ea580c; }
    .ctrl-btn:disabled { opacity: .3; cursor: default; }

    /* Edit panel */
    #edit-panel {
      border-top: 1px solid #e8eaf0; 
      background: #fafbff;
      position: relative;
      overflow: hidden; 
      transition: max-height .3s ease;
    }
    #edit-panel-resize-handle {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 10px;
      cursor: ns-resize;
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 10;
      user-select: none;
      flex-shrink: 0;
    }

    #edit-panel-resize-handle::before {
      content: '';
      width: 36px;
      height: 3px;
      background: #cbd5e1;
      border-radius: 99px;
      pointer-events: none;
      transition: background .15s;
    }

    #edit-panel-resize-handle:hover::before,
    #edit-panel-resize-handle.dragging::before {
      background: #1a4fa0;
    }

    /* give the fields area room to scroll inside resized panel */
    #panel-fields {
      overflow-y: auto;
      max-height: calc(100% - 80px);
    }
    #edit-panel.visible { max-height: 500px; overflow-y: auto; }
    .panel-title {
      padding: 10px 14px 6px; font-size: 13px; font-weight: 700;
      color: #1e293b; border-bottom: 1px solid #e8eaf0;
    }
    #panel-fields { padding: 10px 14px; }
    .field-group { margin-bottom: 12px; }
    .field-group label { font-size: 11px; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px; display: block; }
    .form-control-sm { font-size: 12.5px; }
    #edit-panel .btn { border-radius: 7px; background-color: var(--bs-primary); border-color: var(--bs-primary); }
    #edit-panel .btn:hover { background-color: var(--bs-primary-dark); }

    /* ── Preview ── */
    #preview-area { flex: 1; overflow-y: auto; background: #f0f2f5; }
    #preview-toolbar {
      position: sticky; top: 0; z-index: 10;
      background: #fff; border-bottom: 1px solid #e0e4ea;
      padding: 10px 20px; display: flex; align-items: center;
    }
    .toolbar-title { font-size: 13px; font-weight: 600; color: #374151; }
    #preview-card { max-width: 780px; margin: 24px auto 48px; background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 4px 24px rgba(0,0,0,.09); }

    /* ── Landing page styles with CSS variables ── */
    .lp-hero {
      background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-primary-light) 100%);
      color: #fff; padding: 52px 48px 44px;
    }
    .partner-badge {
      display: inline-block; background: rgba(255,255,255,.15);
      border: 1px solid rgba(255,255,255,.3);
      border-radius: 20px; font-size: 12px; font-weight: 600;
      padding: 4px 14px; margin-bottom: 18px; letter-spacing: .4px;
    }
    .lp-hero h1 { 
      font-size: 28px; 
      font-weight: 600; 
      margin: 0 0 10px; 
    }
    .tagline { font-size: 17px; font-style: italic; opacity: .85; margin-bottom: 2px; }
    .tagline-bold { font-size: 17px; font-weight: 700; margin-bottom: 16px; }
    .intro-text { font-size: 14px; line-height: 1.7; opacity: .88; max-width: 600px; margin-bottom: 24px; }
    .login-btn {
      display: inline-flex; align-items: center;
      background: #fff; color: var(--bs-primary);
      padding: 10px 22px; border-radius: 8px;
      font-size: 14px; font-weight: 700; cursor: pointer;
      transition: all 0.3s ease;
    }
    .login-btn:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }

    .lp-section { padding: 40px 48px; border-bottom: 1px solid #f0f2f5; }
    .lp-section:last-child { border-bottom: none; }
    .lp-section-label { font-size: 11px; font-weight: 700; color: var(--bs-primary); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 10px; }
    .lp-section-title { font-size: 20px; 
      font-weight: 400; 
      color: #1e293b; 
      margin-bottom: 8px; 
    }
    .lp-section-sub { font-size: 13.5px; color: #64748b; line-height: 1.6; max-width: 580px; }

    /* Products */
    .product-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-top: 20px; }
    .product-card {
      border: 1.5px solid #e2e8f0; border-radius: 12px;
      padding: 18px 14px; text-align: center; background: #fafbff;
      transition: all 0.3s ease;
    }
    .product-card:hover {
      transform: translateY(-4px);
      box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
    .product-card.hidden-card { opacity: .35; filter: grayscale(1); }
    .prod-icon { font-size: 24px; color: var(--bs-primary); margin-bottom: 8px; }
    .prod-name { font-size: 13px; font-weight: 700; color: #1e293b; }
    .prod-sub { font-size: 11px; color: #94a3b8; margin-top: 3px; }

    /* Features */
    .feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
    .feature-item { display: flex; gap: 14px; align-items: flex-start; }
    .feature-icon-wrap { 
      width: 38px; 
      height: 38px; 
      border-radius: 10px; 
      /* background: var(--bs-primary-bg-subtle); */
      color: var(--bs-primary); 
      display: flex; 
      align-items: center; 
      justify-content: center; 
      font-size: 17px; 
      flex-shrink: 0; 
    }
    .feature-name { font-size: 13.5px; font-weight: 700; color: #1e293b; }
    .feature-desc { font-size: 12.5px; color: #64748b; line-height: 1.5; margin-top: 3px; }

    /* RM */
    .rm-card { display: flex; gap: 18px; align-items: flex-start; margin-top: 20px; background: #f8faff; border: 1.5px solid #e2e8f0; border-radius: 12px; padding: 20px; }
    .rm-avatar { width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(135deg, var(--bs-primary), var(--bs-primary-light)); color: #fff; font-size: 18px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
    .rm-name { font-size: 16px; font-weight: 700; color: #1e293b; }
    .rm-role { font-size: 12px; color: var(--bs-primary); font-weight: 600; margin-bottom: 8px; }
    .rm-detail { font-size: 13px; color: #475569; margin-bottom: 4px; }
    .rm-detail i { margin-right: 6px; color: #94a3b8; }

    /* Steps */
    .steps-list { display: flex; flex-direction: column; gap: 18px; }
    .step-item { display: flex; gap: 16px; align-items: flex-start; }
    .step-num { 
      width: 36px;
      height: 36px;
      border-radius: 50%;
      /* background: var(--bs-primary-bg-subtle); */
      color: var(--bs-primary);
      font-size: 13px;
      font-weight: 800;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }
    .step-title { font-size: 14px; font-weight: 700; color: #1e293b; }
    .step-desc { font-size: 13px; color: #64748b; line-height: 1.6; margin-top: 3px; }

    /* Trust bar */
    .trust-bar { display: grid; grid-template-columns: repeat(4,1fr); gap: 0; background: linear-gradient(135deg, var(--bs-primary-dark) 0%, var(--bs-primary) 100%);}
    .trust-item { padding: 20px 16px; text-align: center; border-right: 1px solid rgba(255,255,255,.1);transition: all 0.3s ease;}
    .trust-item:hover {background: rgba(255,255,255,0.05);transform: translateY(-2px);}
    .trust-item:last-child { border-right: none; }
    .ti { font-size: 28px; color: rgba(255,255,255,0.9); margin-bottom: 10px; display: block;}
    .t-label { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 5px;}
    .t-sub { font-size: 11px; color: rgba(255,255,255,0.7); margin-top: 2px; }
    /* Footer */
    .lp-footer-note { padding: 20px 48px; background: #f8faff; font-size: 12px; color: #94a3b8; line-height: 1.6; border-top: 1px solid #e2e8f0; }

    /* CSR / The Idea section */
    .csr-section { padding: 40px 48px; border-bottom: 1px solid #f0f2f5; }
    .csr-eyebrow { font-size: 11px; font-weight: 700; color: var(--bs-primary); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 10px; }
    .csr-title { 
      font-size: 20px; 
      font-weight: 500; 
      color: #1e293b; 
      margin-bottom: 12px; 
      line-height: 1.3; 
    }
    .csr-body { font-size: 13.5px; color: #475569; line-height: 1.7; max-width: 600px; margin-bottom: 20px; }
    .csr-box {
      /* background: var(--bs-primary-bg-subtle);  */
      border-left: 4px solid var(--bs-primary);
      border-radius: 10px; 
      padding: 18px 20px;
      font-size: 13px; color: #374151; 
      line-height: 1.7;
    }
    .csr-box-label {
      font-size: 10px; font-weight: 800; letter-spacing: 1px;
      text-transform: uppercase; color: var(--bs-primary); margin-bottom: 8px;
    }

    /* Highlight on click */
    .highlight-section { outline: 3px solid var(--bs-primary); outline-offset: -3px; border-radius: 4px; }

    /* Hidden section overlay in preview */
    .section-hidden-preview { position: relative; opacity: .3; pointer-events: none; }
    .section-hidden-preview::after {
      content: 'HIDDEN'; position: absolute; inset: 0;
      display: flex; align-items: center; justify-content: center;
      font-size: 22px; font-weight: 900; letter-spacing: 4px;
      color: #94a3b8; background: rgba(255,255,255,.5);
    }
#btn-open-preview {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-primary-light) 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
    transition: opacity .15s, transform .1s;
}
.preview-wrap{
    max-width: 780px;
    margin: 24px auto 48px;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .09);
}
/* Mobile close button for sidebar */
#sidebar-close-btn {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  opacity: 0.85;
  transition: opacity 0.15s;
}
#sidebar-close-btn:hover { opacity: 1; }
#btn-open-sidebar {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 20px;
  z-index: 9999;
  background: var(--bs-primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  font-size: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
#btn-open-sidebar:hover { background: var(--bs-primary-dark); }

/* Vendor Logo Styles */
.vendor-logo {
  text-align: left;
  margin-bottom: 20px;
}
.partner-logo-img {
  max-width: 180px;
  max-height: 80px;
  width: auto;
  height: auto;
  object-fit: contain;
      filter: brightness(26.5);
}

/* Responsive styles */
@media (max-width: 768px) {
  #sidebar-close-btn {
    display: flex; /* ← show X button on mobile */
    align-items: center;
  }

  #sidebar.sidebar-hidden {
    display: none;
  }
  #preview-area.sidebar-closed {
    margin-left: 0;
    width: 100%;
  }

  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: repeat(1, 1fr); }
  .trust-bar    { grid-template-columns: repeat(2, 1fr); }
  .rm-card      { flex-wrap: wrap; }
  .partner-logo-img { max-width: 140px; max-height: 60px; }
}

@media (max-width: 480px) {
  .partner-logo-img { max-width: 100px; max-height: 50px; }
}
