/* ========= LightSync Pro — Admin Theme (Frontend-like) ========= */
/* Scope everything to our page */
.wrap.lightsyncpro {
  --lsp-bg: transparent;                /* deep canvas for contrast (behind hero) */
  --lsp-surface: #0f1117;           /* darker panels */
  --lsp-card: #ffffff;              /* white cards for content density */
  --lsp-text: #0f172a;              /* slate-900 */
  --lsp-subtext: #6b7280;           /* slate-500 */
  --lsp-primary: #ff5757;           /* brand coral/red */
  --lsp-primary-700: #e94343;       /* hover */
  --lsp-accent: #2563eb;            /* electric blue accent */
  --lsp-success: #22c55e;
  --lsp-warning: #f59e0b;
  --lsp-danger: #ef4444;
  --lsp-border: #e8ecf2;
  --lsp-border-strong: #dfe5ee;
  --lsp-ring: rgba(37, 99, 235, .25);
 border-radius: 18px;
  font-family: Montserrat, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--lsp-text);
  background: transparent;
}

/* Hide all notices on LSP pages EXCEPT our own */
body.toplevel_page_lightsyncpro .notice:not(.lsp-notice),
body.toplevel_page_lightsyncpro .update-nag,
body.toplevel_page_lightsyncpro .error:not(.lsp-notice),
body.toplevel_page_lightsyncpro .updated:not(.lsp-notice),

body.lightsyncpro_page_lightsyncpro .notice:not(.lsp-notice),
body.lightsyncpro_page_lightsyncpro .update-nag,
body.lightsyncpro_page_lightsyncpro .error:not(.lsp-notice),
body.lightsyncpro_page_lightsyncpro .updated:not(.lsp-notice) {
  display: none !important;
}

/* Sync destination badges */
.lsp-badge-wp { 
    background: #dbeafe; 
    color: #1e40af; 
}
.lsp-badge-both { 
    background: #fef3c7; 
    color: #92400e; 
}

.lsp-sync-dest-header {
    margin-bottom: 12px;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}


.description-pending {position: relative; padding: 15px 25px; color: gray; text-align: left}

.note-important {padding: 15px; border-radius: 15px; background: #f1f1f1; margin: 10px}
.notice-error p {color: #000000 !important}
.notice-info p {color: #000000 !important}
.notice-warning p {color: #000000 !important}
.notice-error p {color: #000000 !important}
#lsp-activations {padding: 0; margin-bottom: 12px;}
a {color: #ff5757}

/* ---------- Hero (frontend-like gradient, glass logo area) ---------- */
.wrap.lightsyncpro .lsp-hero {
  margin: 0px 0 0px;
  border-radius: 18px;
  padding: 28px;
  display: grid;
  grid-template-columns: 300px 1fr auto;
  gap: 24px;
  align-items: center;

  background:
    radial-gradient(1200px 600px at 0% 0%, rgba(255, 87, 87, .25) 0%, rgba(255, 87, 87, 0) 60%),
    radial-gradient(1000px 500px at 100% 0%, rgba(37, 99, 235, .25) 0%, rgba(37, 99, 235, 0) 60%),
    linear-gradient(180deg, #0c0f14 0%, #0e1118 100%);
  border: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 20px 60px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.05);
}

.wrap.lightsyncpro .logo img { max-width: 220px; filter: drop-shadow(0 8px 24px rgba(0,0,0,.25)); }

.wrap.lightsyncpro .copy h1 {
  margin: 0 0 6px;
  font-weight: 800;
  letter-spacing: .2px;
  font-size: 24px;
  color: #fff;
}
.wrap.lightsyncpro .copy p { color: #d1d5db; margin: 0; }

.wrap.lightsyncpro .copy-upgrade {
  text-align: right;
}
.wrap.lightsyncpro .copy-upgrade .title {
  margin: 0 0 6px; color: #fff; font-size: 14px; opacity: .9; letter-spacing: .3px;
}
.wrap.lightsyncpro .copy-upgrade p { color: #e5e7eb; margin: 4px 0 0; }
.wrap.lightsyncpro .copy-upgrade .button.button-primary {
  background: var(--lsp-primary);
  border-color: transparent;
  box-shadow: 0 10px 30px rgba(255, 87, 87, .35);
}
.wrap.lightsyncpro .copy-upgrade .button.button-primary:hover { background: var(--lsp-primary-700); }

/* ---------- Grid ---------- */
.wrap.lightsyncpro .lsp-grid-cards {
  display: grid;
  padding: 35px;
  grid-template-columns: repeat(auto-fit, minmax(540px, 1fr));
  gap: 24px;
}

/* ---------- Cards (elevated, borderless) ---------- */
.wrap.lightsyncpro .lsp-card {
  background: var(--lsp-card);
  border: none;
  border-radius: 18px;
  margin: 0px 0px;
  box-shadow: 0 4px 24px rgba(15, 23, 42, .07);
  overflow: visible;
}

#lsp-naming {margin-top: 20px;}
#lsp-pick {margin-top: 20px;}
.wrap.lightsyncpro .lsp-card.wide { grid-column: 1 / -1; }

.wrap.lightsyncpro .lsp-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(0,0,0,.06);
  background: transparent;
}
.wrap.lightsyncpro .lsp-card-title {
  margin: 0; font-size: 25px; font-weight: 800;
  letter-spacing: .2px; color: #0b1220;
}
.wrap.lightsyncpro .lsp-card-body { padding: 30px; }

/* ---------- Badges (pill) ---------- */
.wrap.lightsyncpro .lsp-badge {
  font-size: 11px; font-weight: 600; letter-spacing: .3px;
  border-radius: 999px; padding: 6px 12px;
  border: none;
  color: var(--lsp-subtext); background: rgba(0,0,0,.05);
}
.wrap.lightsyncpro .lsp-badge-success {
  color: #166534; background: rgba(34,197,94,.15); border: none;
}
.wrap.lightsyncpro .lsp-badge-muted { color: #6b7280; }

/* Keep Original ON */
.wrap.lightsyncpro .lsp-badge.is-custom {
  color: #03421f; background: #b6f8cf; border-color: #88e9b0;
}

/* Pattern-based Names ON */
.wrap.lightsyncpro .lsp-badge.is-original {
  background: #ffffff;

  border-color: #dfe5ff;
}

/* ---------- Inputs ---------- */
.wrap.lightsyncpro input[type="text"],
.wrap.lightsyncpro input[type="email"],
.wrap.lightsyncpro input[type="number"],
.wrap.lightsyncpro textarea,
.wrap.lightsyncpro select {
  width: 100%; max-width: 560px;
  border: none;
  background: rgba(0,0,0,0.04); border-radius: 10px;
  padding: 10px 12px; box-shadow: none;
  transition: all 0.15s ease;
}
.wrap.lightsyncpro input:focus,
.wrap.lightsyncpro textarea:focus,
.wrap.lightsyncpro select:focus {
  outline: none;
  background: #fff;
  box-shadow: 0 0 0 2px var(--lsp-primary);
}

/* Custom select arrow */
.wrap.lightsyncpro select {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  padding-right: 40px;
  background-image:
    linear-gradient(45deg, transparent 50%, #9ca3af 50%),
    linear-gradient(135deg, #9ca3af 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 4px),
    calc(100% - 12px) calc(50% - 4px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  background-color: rgba(0,0,0,0.04);
}

/* Multi-select */
.wrap.lightsyncpro select[multiple] {
  height: 220px; background-image: none; padding-right: 12px;
}

/* ---------- Buttons ---------- */
.wrap.lightsyncpro .button {
  border-radius: 12px; padding: 5px 14px; font-weight: 700;
  transition: transform .06s ease, box-shadow .2s ease;
  border-color: #cbd5e1;
  color: #000000;
}
.wrap.lightsyncpro .button:active { transform: translateY(1px); }

.wrap.lightsyncpro .button.button-primary {
  background: var(--lsp-primary);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 24px rgba(255, 87, 87, .35);
}
.wrap.lightsyncpro .button.button-primary:hover { background: var(--lsp-primary-700); }

.wrap.lightsyncpro .lsp-btn {
  border-radius: 12px; padding: 8px 14px;
  text-decoration: none; border: 2px solid var(--lsp-border-strong);
  color: #0f172a; background: #fff; font-weight: 700;
}
.wrap.lightsyncpro .lsp-btn.primary {
  background: var(--lsp-accent); color: #fff; border-color: transparent;
  box-shadow: 0 10px 24px rgba(37,99,235,.25);
}
.wrap.lightsyncpro .lsp-btn.ghost:hover { border-color: #cbd5e1; }



/* ---------- Tables ---------- */
.wrap.lightsyncpro table.widefat {
  border-radius: 14px; overflow: hidden; border: 1px solid var(--lsp-border);
}
.wrap.lightsyncpro table.widefat th {
 
  font-weight: 700;
}

/* ---------- Pills ---------- */
.wrap.lightsyncpro .lsp-pills { display:flex; gap:10px; margin-bottom:14px; }
.wrap.lightsyncpro .lsp-pill {
  padding: 6px 12px; border-radius: 999px; border:1px solid var(--lsp-border);
  background:#fff; color:#111827; font-weight:700; font-size:12px; cursor:pointer;
}
.wrap.lightsyncpro .lsp-pill.active {
  border-color: var(--lsp-primary); color: var(--lsp-primary);
  box-shadow: 0 4px 12px var(--lsp-ring);
}

/* ---------- Sub-cards ---------- */
.wrap.lightsyncpro .sub-card { background: var(--lsp-card); grid-column: 1 / -1; }
.wrap.lightsyncpro .sub-card label { padding-right: 15px; }

/* ---------- Locking (scoped) ---------- */
.wrap.lightsyncpro .lsp-lock-wrap { position: relative; }
.wrap.lightsyncpro .lsp-lock-wrap.is-locked input,
.wrap.lightsyncpro .lsp-lock-wrap.is-locked select,
.wrap.lightsyncpro .lsp-lock-wrap.is-locked textarea,
.wrap.lightsyncpro .lsp-lock-wrap.is-locked label,
.wrap.lightsyncpro .lsp-lock-wrap.is-locked .button:not(.button-primary),
.wrap.lightsyncpro .lsp-lock-wrap.is-locked .lsp-btn {
  pointer-events: none; filter: grayscale(20%) opacity(.75);
}
.wrap.lightsyncpro .lsp-lock-overlay {
  position:absolute; inset:0; z-index: 2;
  background: rgba(255,255,255,0.82);
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:10px; text-align:center; border-radius:14px; border:1px dashed #d7dbe5;
}
.wrap.lightsyncpro .lsp-lock-overlay .dashicons { font-size:24px; width:24px; height:24px; }

/* ---------- Custom Toggle (frontend-like) ---------- */
.wrap.lightsyncpro .lsp-toggle {
  --toggle-h: 26px; --toggle-w: 48px;
  position: relative; display:inline-flex; align-items:center; gap:10px; cursor: pointer;
}
.wrap.lightsyncpro .lsp-toggle input[type="checkbox"] {
  position: absolute; opacity: 0; width: 0; height: 0;
}
.wrap.lightsyncpro .lsp-toggle .track {
  width: var(--toggle-w); height: var(--toggle-h);
  background: rgba(0,0,0,0.12); border-radius: 999px; position: relative; transition: background .2s ease;
  border: none;
}
.wrap.lightsyncpro .lsp-toggle .thumb {
  position: absolute; top: 50%; left: 3px; transform: translateY(-50%);
  width: 20px; height: 20px; background: #fff; border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0,0,0,.15); transition: left .2s ease;
}
.wrap.lightsyncpro .lsp-toggle input:checked + .track { background: var(--lsp-primary); border-color: transparent; }
.wrap.lightsyncpro .lsp-toggle input:checked + .track .thumb { left: calc(var(--toggle-w) - 23px); }

/* ---------- Range Slider (frontend-like) ---------- */
.wrap.lightsyncpro .lsp-range {
  --thumb: #fff; --fill: var(--lsp-accent); --track: #e5e7eb;
  width: 320px; max-width: 100%;
}
.wrap.lightsyncpro .lsp-range input[type="range"] {
  -webkit-appearance: none; width: 100%; height: 6px; background: rgba(0,0,0,0.08);
  border-radius: 999px; outline: none; border: none;
  background-image: linear-gradient(var(--fill), var(--fill));
  background-size: 0% 100%; background-repeat: no-repeat;
}
.wrap.lightsyncpro .lsp-range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 999px; background: var(--thumb);
  border: 2px solid var(--lsp-accent); box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.wrap.lightsyncpro .lsp-range input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 999px; background: var(--thumb);
  border: 2px solid var(--lsp-accent); box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.wrap.lightsyncpro .lsp-range .value {
  font-weight: 700; color: var(--lsp-accent); margin-left: 10px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .wrap.lightsyncpro .lsp-hero { grid-template-columns: 1fr; text-align: center; }
  .wrap.lightsyncpro .copy-upgrade { text-align: center; }
}
@media (max-width: 920px) {
  .wrap.lightsyncpro .lsp-grid-cards { grid-template-columns: 1fr; }
 
}
/* ===== LightSelect (CoreUI-like Multi Select) ===== */
.hidden { display: none !important; } /* safety */

.lsp-ms{position:relative;font-family:inherit;}
.lsp-ms .ms-control{
  display:flex;align-items:center;flex-wrap:wrap;gap:6px;
  min-height:42px;border:1px solid var(--lsp-border);background:#fff;border-radius:10px;
  padding:6px 10px;cursor:text
}
.lsp-ms .ms-control:focus-within{outline:2px solid var(--lsp-ring); outline-offset:2px}
.lsp-ms .ms-badge{
  display:inline-flex;align-items:center;gap:6px;
  font-size:12px;font-weight:600;background:#f1f5f9;border-radius:999px;
  padding:5px 10px;line-height:1;border:1px solid #e5e7eb;white-space:nowrap
}
.lsp-ms .ms-badge .ms-x{cursor:pointer;display:inline-block;line-height:1}
.lsp-ms .ms-input{
  border:0;flex:1 1 auto;min-width:120px;padding:6px 4px;font-size:14px;background:transparent
}
.lsp-ms .ms-input:focus{outline:none}
.lsp-ms .ms-dropdown{
  position:absolute;left:0;right:0;z-index:999;margin-top:6px;background:#fff;border:1px solid var(--lsp-border);
  border-radius:12px;box-shadow:0 10px 24px rgba(15,23,42,.08);overflow:visible
}
.lsp-ms .ms-head{
  display:flex;gap:8px;align-items:center;justify-content:space-between;padding:10px;border-bottom:1px solid var(--lsp-border)
}
.lsp-ms .ms-head .ms-actions{display:flex;gap:8px}
.lsp-ms .ms-head .button{padding:5px 10px;border-radius:8px;font-size:12px}
.lsp-ms .ms-list{max-height:260px;overflow:auto;}
.lsp-ms .ms-item{
  display:flex;align-items:center;gap:10px;padding:10px 12px;border-bottom:1px solid #f1f5f9;cursor:pointer
}
.lsp-ms .ms-item:last-child{border-bottom:0}
.lsp-ms .ms-item input{pointer-events:none}
.lsp-ms .ms-item:hover{background:#f8fafc}
.lsp-ms .ms-empty{padding:14px;text-align:center;color:var(--lsp-subtext);font-size:13px}
.lsp-ms .hidden{display:none !important}

/* states */
.lsp-ms.disabled .ms-control{background:#f9fafb;color:#9ca3af;cursor:not-allowed}
.lsp-ms.disabled .ms-input{display:none}

/* Scrollbar (nice-to-have) */
.lsp-ms .ms-list::-webkit-scrollbar{height:8px;width:8px}
.lsp-ms .ms-list::-webkit-scrollbar-thumb{background:#e5e7eb;border-radius:8px}
/* ===== LSP Mini MultiSelect ===== */
.lsp-ms{position:relative;font-family:inherit}
.lsp-ms .ms-control{
  display:flex;align-items:center;gap:8px;flex-wrap:wrap;
  min-height:44px;border:1px solid var(--lsp-border);background:#fff;border-radius:12px;
  padding:8px 10px;box-shadow:0 1px 0 rgba(0,0,0,.02) inset; cursor:text
}
.lsp-ms .ms-control:focus-within{outline:2px solid var(--lsp-ring); outline-offset:2px}
.lsp-ms .ms-badge{
  display:inline-flex;align-items:center;gap:8px;
  font-size:12px;font-weight:600;background:#f1f5f9;border-radius:999px;
  padding:6px 10px;border:1px solid #e5e7eb
}
.lsp-ms .ms-badge .ms-x{cursor:pointer}
.lsp-ms .ms-input{border:0;flex:1 1 auto;min-width:140px;padding:6px 4px;font-size:14px;background:transparent}
.lsp-ms .ms-input:focus{outline:none}

.lsp-ms .ms-dropdown{
  position:absolute;left:0;right:0;z-index:999;margin-top:8px;background:#fff;border:1px solid var(--lsp-border);
  border-radius:12px;box-shadow:0 10px 24px rgba(15,23,42,.08);overflow:hidden
}
.lsp-ms .ms-head{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;border-bottom:1px solid var(--lsp-border)}
.lsp-ms .ms-head .ms-title{font-weight:700}
.lsp-ms .ms-head .ms-actions{display:flex;gap:8px}
.lsp-ms .ms-list{max-height:260px;overflow:auto}
.lsp-ms .ms-item{display:flex;align-items:center;gap:10px;padding:10px 12px;border-bottom:1px solid #f3f4f6;cursor:pointer}
.lsp-ms .ms-item:last-child{border-bottom:0}
.lsp-ms .ms-item:hover{background:#f8fafc}
.lsp-ms .ms-empty{padding:14px;text-align:center;color:var(--lsp-subtext);font-size:13px}
.hidden{display:none!important}

/* ===== Layout: Sidebar + Content ===== */
.wrap.lightsyncpro .lsp-layout{
  display:grid;
  grid-template-columns: 260px minmax(0,1fr);
  gap:24px;
}

.wrap.lightsyncpro .lsp-side{
  position: sticky;
  top: 32px;         /* below WP admin bar */
  align-self: start;
  height: max-content;
  padding: 25px;
}

.wrap.lightsyncpro .lsp-main{ min-width: 0; max-width:960px }

/* Sidebar nav */
.wrap.lightsyncpro .lsp-nav{
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}
.wrap.lightsyncpro .lsp-nav a{
  display:flex; align-items:center; gap:8px;
  padding:10px 12px;
  border-radius: 8px;
  background:transparent;
  border:none;
  text-decoration:none;
  color: var(--lsp-subtext);
  font-weight: 500;
  transition: all 0.15s ease;
  position: relative;
}
.wrap.lightsyncpro .lsp-nav a:hover{
  color: var(--lsp-text);
  background: rgba(0,0,0,0.03);
}
.wrap.lightsyncpro .lsp-nav a.active{
  color: var(--lsp-text);
  font-weight: 600;
  background: transparent;
}
.wrap.lightsyncpro .lsp-nav a.active::after{
  content: '';
  position: absolute;
  bottom: 6px;
  left: 12px;
  right: 12px;
  height: 2px;
  background: linear-gradient(135deg, var(--lsp-primary), var(--lsp-primary-600));
  border-radius: 2px;
}
.wrap.lightsyncpro .lsp-nav a.lsp-kb-link{
  color: #0369a1;
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--lsp-border);
}
.wrap.lightsyncpro .lsp-nav a.lsp-kb-link:hover{
  background: rgba(14,165,233,0.08);
}
.wrap.lightsyncpro .lsp-nav a.lsp-kb-link .dashicons{
  font-size: 16px;
  width: 16px;
  height: 16px;
}

/* Content grid (classic, not masonry) */
.wrap.lightsyncpro .lsp-grid-cards{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(520px, 1fr));
  gap:18px;
}

/* Cards (slightly denser) */
.wrap.lightsyncpro .lsp-card{
  background: var(--lsp-card);
  border:1px solid var(--lsp-border);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(15,23,42,.06);
  overflow:visible;
}
.wrap.lightsyncpro .lsp-card-header{ padding:12px 14px; border-bottom:1px solid var(--lsp-border); }
.wrap.lightsyncpro .lsp-card-title{ margin:0; font-size:18px; font-weight:700; }
.wrap.lightsyncpro .lsp-card-body{ padding:30px; }

/* Compact table & fields */
.wrap.lightsyncpro .form-table{ margin:0; }
.wrap.lightsyncpro .form-table th,
.wrap.lightsyncpro .form-table td{ padding:8px; vertical-align:middle; }
.wrap.lightsyncpro .form-table th{ width: 180px; font-weight:600; color:#111827; }

.wrap.lightsyncpro input[type="text"],
.wrap.lightsyncpro input[type="email"],
.wrap.lightsyncpro input[type="number"],
.wrap.lightsyncpro select{
  width:100%;
  max-width:100%;
  padding:8px 10px;
  border-radius:8px;
  border:1px solid var(--lsp-border);
  background:#fff;
}

/* KPI strip (optional mini-cards under hero) */
.wrap.lightsyncpro .lsp-kpis{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:14px;
  margin-top:8px;
}
.wrap.lightsyncpro .lsp-kpi{
  background:#fff; border:1px solid var(--lsp-border); border-radius:12px; padding:12px;
  display:flex; align-items:center; justify-content:space-between;
}
.wrap.lightsyncpro .lsp-kpi .label{ color:#6b7280; font-size:12px; }
.wrap.lightsyncpro .lsp-kpi .value{ font-weight:800; }

/* Utility */
html { scroll-behavior: smooth; }

@media (max-width: 1850px){
  .wrap.lightsyncpro .copy h1 {
  margin: 0 0 6px;
  font-weight: 800;
  letter-spacing: .2px;
  font-size: 20px;
  color: #fff;
}
}

@media (max-width: 1024px){
  .wrap.lightsyncpro .lsp-layout{
    grid-template-columns: 1fr;
  }
  .wrap.lightsyncpro .lsp-side{ position: static; }
  .wrap.lightsyncpro .lsp-kpis{ grid-template-columns: repeat(2,1fr); }

   .wrap.lightsyncpro .copy h1 {
  margin: 0 0 6px;
  font-weight: 800;
  letter-spacing: .2px;
  font-size: 20px;
  color: #fff;
}
}

@media (max-width: 680px){
  .wrap.lightsyncpro .lsp-grid-cards{ grid-template-columns: 1fr; }
  .wrap.lightsyncpro .lsp-kpis{ grid-template-columns: 1fr; }
}

.lsp-bars {padding: 25px}

/* --- License & Usage: mobile containment --- */
.wrap.lightsyncpro #lsp-usage .widefat {
  display: block;           /* allow its own scroll context */
  width: 100%;
  max-width: 100%;
  overflow-x: auto;         /* horizontal scroll only inside the table */
  -webkit-overflow-scrolling: touch;
}

/* prevent header from stretching too much */
.wrap.lightsyncpro #lsp-usage .widefat thead,
.wrap.lightsyncpro #lsp-usage .widefat tbody,
.wrap.lightsyncpro #lsp-usage .widefat tr {
  display: table;           /* keep table semantics for sticky layouts */
  width: 100%;
  table-layout: auto;
}

/* allow long emails/URLs to wrap instead of forcing viewport wider */
.wrap.lightsyncpro #lsp-usage .widefat td,
.wrap.lightsyncpro #lsp-usage .widefat th {
  white-space: normal;
  overflow-wrap: anywhere;  /* modern */
  word-break: break-word;   /* fallback */
  vertical-align: middle;
}

/* Optional: make columns a bit tighter on small screens */
@media (max-width: 782px) { /* WP admin common breakpoint */
  .wrap.lightsyncpro #lsp-usage .widefat th,
  .wrap.lightsyncpro #lsp-usage .widefat td {
    padding: 8px 10px;
    font-size: 13px;
  }
  /* Hide one non-essential column on very small screens (example: last column) */
  .wrap.lightsyncpro #lsp-usage .widefat thead th:nth-child(4),
  .wrap.lightsyncpro #lsp-usage .widefat tbody td:nth-child(4) {
    display: none;
  }
}

/* Fix: previous grid min-widths could cause overflow on phones */
@media (max-width: 782px) {
  .wrap.lightsyncpro .lsp-grid-cards,
  .wrap.lightsyncpro .lsp-bars {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important;
    gap: 16px;
  }
}

/* If any KPI strip exists, make sure it wraps nicely */
.wrap.lightsyncpro .lsp-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px 12px;
}

.wrap.lightsyncpro .lsp-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* === Circular Progress Ring (brand-ready) ======================= */
.wrap.lightsyncpro {
  --lsp-accent: #ff5757;     /* brand accent */
  --lsp-accent-2: #ff7a7a;   /* slight variant if you want */
  --lsp-track: #e5e7eb;      /* ring background */
  --lsp-ring-gap: 7px;       /* ring thickness */
}

.wrap.lightsyncpro .lsp-progress.is-circle {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
}

.wrap.lightsyncpro .lsp-ring {
  --size: 88px;       /* ring size */
  --p: 0;             /* progress 0..100 driven via JS */
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  position: relative;
  flex: 0 0 auto; 

  /* The magic: a conic-gradient ring with a hole (mask) */
  background:
    conic-gradient(var(--lsp-accent) calc(var(--p) * 1%), var(--lsp-track) 0);
  -webkit-mask: radial-gradient(
      farthest-side,
      transparent calc(50% - var(--lsp-ring-gap)),
      #000 calc(50% - var(--lsp-ring-gap) + 1px)
    );
          mask: radial-gradient(
      farthest-side,
      transparent calc(50% - var(--lsp-ring-gap)),
      #000 calc(50% - var(--lsp-ring-gap) + 1px)
    );

  /* Indeterminate animation (paused by default) */
  animation: lsp-spin 1s linear infinite paused;
}

/* Center label */
.wrap.lightsyncpro .lsp-ring .lsp-center {
  position: relative;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  font-weight: 700;
  line-height: 1.1;
}

.wrap.lightsyncpro .lsp-percent {
  font-size: 18px;
  text-align: center;
}
.wrap.lightsyncpro .lsp-sub {
  font-size: 11px;
  color: var(--lsp-subtext, #6b7280);
  margin-top: 2px;
}

/* Indeterminate: spin the ring instead of filling it */
.wrap.lightsyncpro .lsp-ring.indeterminate {
  animation-play-state: running;
  background:
    conic-gradient(var(--lsp-accent) 25%, var(--lsp-track) 0);
}

/* Reduce motion respect */
@media (prefers-reduced-motion: reduce) {
  .wrap.lightsyncpro .lsp-ring.indeterminate {
    animation: none;
  }
}

/* Keyframes */
@keyframes lsp-spin {
  to { transform: rotate(360deg); }
}

/* === Linear Progress (fallback/companion) ======================= */
.wrap.lightsyncpro .lsp-linear {
  min-width: 180px;
  display: grid;
  align-items: center;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.wrap.lightsyncpro .lsp-linear .bar {
  height: 10px;
  width: 0%;
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--lsp-accent), var(--lsp-accent-2));
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.05);
  transition: width .2s ease;
}
.wrap.lightsyncpro .lsp-linear .txt {
  font-size: 12px;
  color: var(--lsp-subtext, #6b7280);
}

/* Optional: log styling */
.wrap.lightsyncpro .lsp-log {
  margin-top: 10px;
  max-height: 220px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  background: #fff;
  border: 1px solid var(--lsp-border, #e5e7eb);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 25px;
}
.wrap.lightsyncpro .lsp-ring {
  transition: filter .15s ease;
}
.wrap.lightsyncpro .lsp-ring:active,
.wrap.lightsyncpro .lsp-ring.indeterminate {
  filter: drop-shadow(0 0 10px rgba(255, 87, 87, .25));
}
/* ===== Floating / Glowing Save Button ===== */
.wrap.lightsyncpro .full-save {
  position: fixed;
  right: 5%;
  bottom: 20px;
  z-index: 9999;
  min-width: 260px;
  padding: 14px 18px;
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  color: #fff !important;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;

  /* Brand gradient */
  background: linear-gradient(135deg, var(--lsp-primary, #ff5757), var(--lsp-primary-600, #2563eb));
  box-shadow:
    0 10px 24px rgba(37, 99, 235, .25),
    0 0 0 0 rgba(255, 87, 87, 0.35);

  transform: translateY(0);
  transition: box-shadow .25s ease, transform .2s ease, opacity .2s ease;
}

/* Hidden by default until there are changes */
.wrap.lightsyncpro .full-save.is-hidden { opacity: 0; pointer-events: none; transform: translateY(12px); }

/* “Dirty” / needs saving pulse */
@keyframes lspPulse {
  0%   { box-shadow: 0 10px 24px rgba(37,99,235,.25), 0 0 0 0 rgba(255,87,87,.35); }
  70%  { box-shadow: 0 10px 24px rgba(37,99,235,.25), 0 0 0 16px rgba(255,87,87,0); }
  100% { box-shadow: 0 10px 24px rgba(37,99,235,.25), 0 0 0 0 rgba(255,87,87,0); }
}
.wrap.lightsyncpro .full-save.is-dirty { animation: lspPulse 1.6s ease-out infinite; }

/* Saving state (spinner + subdued) */
.wrap.lightsyncpro .full-save.is-saving { opacity: .85; animation: none; }
.wrap.lightsyncpro .full-save.is-saving::before{
  content: "";
  display: inline-block;
  width: 16px; height: 16px;
  margin-right: 8px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.8);
  border-top-color: transparent;
  vertical-align: -2px;
  animation: lspSpin .9s linear infinite;
}
@keyframes lspSpin { to { transform: rotate(360deg); } }

/* Saved flash */
.wrap.lightsyncpro .full-save .status {
  display: inline-block !important;
  opacity: 0;
  transition: opacity .2s ease;
}
.wrap.lightsyncpro .full-save.is-saved .status { opacity: 1; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  .wrap.lightsyncpro .full-save { transition: none; animation: none; }
  .wrap.lightsyncpro .full-save.is-dirty { animation: none; }
}

.lsp-btn.primary#lsp-start {
display: block;
  font-size:16px;
  font-weight:600;
  padding:14px 28px;
  border-radius:50px;
  border:none;
  background:linear-gradient(90deg,#ff5757,#ffbd59);
  color:#fff;
  cursor:pointer;
  box-shadow:0 6px 15px rgba(255,87,87,0.3);
  transition:all .25s ease;
  letter-spacing:0.5px;
}
.lsp-btn.primary#lsp-start:hover {
  transform:translateY(-2px);
  box-shadow:0 8px 20px rgba(255,87,87,0.4);
}
.lsp-btn.primary#lsp-start:active {
  transform:scale(.98);
}
.lsp-btn.primary#lsp-start.is-syncing {
  background:linear-gradient(90deg,#ff7a7a,#ffbd59);
  animation:lsp-pulse 1.2s ease-in-out infinite alternate;
}
@keyframes lsp-pulse {
  from { box-shadow:0 0 0 rgba(255,87,87,0.4); }
  to { box-shadow:0 0 16px rgba(255,189,89,0.8); }
}
/* Make the manual sync CTA punchy */
#lsp-start.lsp-btn.primary {
  font-weight: 700;
  border-radius: 999px;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--lsp-primary, #ff5757), var(--lsp-primary-600, #2563eb));
  color:#fff;
  box-shadow:0 8px 18px rgba(37,99,235,.20);
}
#lsp-start.lsp-btn.primary:hover { transform: translateY(-1px); }

/* Fix card clipping */
.wrap.lightsyncpro .lsp-grid.has-dropdown { overflow: visible !important; }

/* Fix dropdown panel clipping */
.lsp-ms .ms-dropdown { overflow: visible !important; z-index: 9999; }

/* Keep scrolling only on the list, not the panel */
.lsp-ms .ms-list { max-height: 260px; overflow: auto; }

.lsp-warning.lsp-renditions-pending {
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 3px;
    background: #fff7d1;
    border: 1px solid #f3d26b;
    font-size: 12px;
}

/* ========= Source Tabs ========= */
.lsp-source-tabs {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 0;
}

.lsp-source-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 28px;
    background: #fff;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 140px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(15,23,42,.05);
}

.lsp-source-tab:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(255, 87, 87, 0.15);
    transform: translateY(-2px);
}

.lsp-source-tab.active {
    background: #fff;
    box-shadow: 0 6px 24px rgba(255, 87, 87, 0.2), inset 0 -3px 0 var(--lsp-primary);
}

.lsp-source-tab:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.lsp-source-tab:disabled:hover {
    transform: none;
    box-shadow: 0 2px 12px rgba(15,23,42,.05);
}

.lsp-source-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 12px;
    color: var(--lsp-subtext);
    transition: all 0.2s ease;
}

.lsp-source-tab.active .lsp-source-icon {
    background: var(--lsp-primary);
    color: white;
}

.lsp-source-tab:hover:not(:disabled) .lsp-source-icon {
    background: #fee2e2;
    color: var(--lsp-primary);
}

.lsp-source-tab.active:hover .lsp-source-icon {
    background: var(--lsp-primary-700);
    color: white;
}

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

.lsp-source-status {
    font-size: 12px;
    color: var(--lsp-subtext);
    padding: 4px 10px;
    background: #f1f5f9;
    border-radius: 20px;
}

.lsp-source-status.connected {
    background: #d1fae5;
    color: #065f46;
}

.lsp-source-add .lsp-source-icon {
    background: transparent;
    border: 2px dashed var(--lsp-border);
}

.lsp-source-add .lsp-source-status {
    background: transparent;
    color: var(--lsp-subtext);
}

/* Auto-sync indicator dot on source tabs */
.lsp-autosync-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 10px;
    height: 10px;
    background: #22c55e;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    animation: lsp-pulse 2s ease-in-out infinite;
}

@keyframes lsp-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.9); }
}

.lsp-source-tab {
    position: relative;
}

/* Source Content Panels */
.lsp-source-content {
    display: none;
}

.lsp-source-content.active {
    display: block;
}

/* AI Tab Content Panels */
.lsp-ai-tab-content {
    display: none;
}

.lsp-ai-tab-content.active {
    display: block;
}

/* Canva Designs Grid */
.lsp-canva-designs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    max-height: 400px;
    overflow-y: auto;
    padding: 4px;
}

.lsp-canva-design-card {
    position: relative;
    background: #f8fafc;
    border: 2px solid var(--lsp-border);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lsp-canva-design-card:hover {
    border-color: var(--lsp-primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.lsp-canva-design-card.selected {
    border-color: var(--lsp-primary);
    background: #fff5f5;
}

.lsp-canva-design-card.selected::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: var(--lsp-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.lsp-canva-design-thumb {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: #e2e8f0;
}

.lsp-canva-design-info {
    padding: 12px;
}

.lsp-canva-design-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--lsp-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lsp-canva-design-meta {
    font-size: 11px;
    color: var(--lsp-subtext);
    margin-top: 4px;
}

/* Synced indicator */
.lsp-canva-design-card.synced {
    opacity: 0.7;
}

.lsp-canva-design-card.has-update {
    opacity: 1;
    border-color: #f59e0b;
}

.lsp-canva-synced-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 24px;
    height: 24px;
    background: #10b981;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    z-index: 1;
}

.lsp-canva-update-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 24px;
    height: 24px;
    background: #f59e0b;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    z-index: 1;
    animation: pulse-update 2s infinite;
}

@keyframes pulse-update {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.lsp-canva-design-card.synced:hover {
    opacity: 1;
}


/* ========= Destination Cards ========= */
.lsp-dest-cards {
    max-width: 400px;
}

.lsp-dest-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    background: rgba(0,0,0,.03);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    text-align: center;
}

.lsp-dest-card:hover:not(.disabled) {
    background: rgba(255, 87, 87, 0.08);
}

.lsp-dest-card.selected {
    background: rgba(255, 87, 87, 0.1);
    box-shadow: inset 0 0 0 2px var(--lsp-primary);
}

.lsp-dest-card svg:first-of-type {
    color: var(--lsp-subtext);
    margin-bottom: 8px;
    transition: color 0.2s ease;
}

.lsp-dest-card:hover:not(.disabled) svg:first-of-type,
.lsp-dest-card.selected svg:first-of-type {
    color: var(--lsp-primary);
}

.lsp-dest-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--lsp-text);
    line-height: 1.2;
}

.lsp-dest-sub {
    font-size: 11px;
    color: var(--lsp-subtext);
    margin-top: 2px;
}

.lsp-dest-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: var(--lsp-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease;
}

.lsp-dest-check svg {
    color: #fff;
    width: 12px;
    height: 12px;
}

.lsp-dest-card.selected .lsp-dest-check {
    opacity: 1;
    transform: scale(1);
}

.lsp-dest-card.disabled {
    pointer-events: none;
}

/* ===== Mobile Responsive Fixes ===== */
@media (max-width: 768px) {
    .wrap.lightsyncpro {
        padding: 0 10px !important;
    }
    
    .wrap.lightsyncpro .lsp-main {
        max-width: 100% !important;
    }
    
    /* Destination cards - 2 columns on tablet */
    .lsp-dest-cards {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    
    .lsp-dest-card {
        padding: 12px !important;
        min-width: 0 !important;
    }
    
    .lsp-dest-card .lsp-dest-icon {
        width: 32px !important;
        height: 32px !important;
    }
    
    .lsp-dest-card .lsp-dest-name {
        font-size: 12px !important;
    }
}

@media (max-width: 480px) {
    /* Very small screens - single column for destinations */
    .lsp-dest-cards {
        grid-template-columns: 1fr !important;
    }
}

/* ===== Segmented Buttons (AVIF Quality) ===== */
.lsp-segmented-buttons {
    display: inline-flex;
    background: #e5e7eb;
    border-radius: 6px;
    padding: 2px;
    gap: 2px;
}

.lsp-seg-btn {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.lsp-seg-btn:hover {
    color: #374151;
    background: rgba(255,255,255,0.5);
}

.lsp-seg-btn.active {
    background: #fff;
    color: #1d4ed8;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

/* AVIF Card responsive */
@media (max-width: 768px) {
    .lsp-avif-card > div {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px !important;
    }
    
    .lsp-avif-card > div > div:first-child {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
    }
    
    .lsp-avif-quality-row {
        width: 100%;
        order: 3;
    }
    
    .lsp-segmented-buttons {
        width: 100%;
        justify-content: stretch;
    }
    
    .lsp-seg-btn {
        flex: 1;
        padding: 8px 6px;
        text-align: center;
    }
    
    .lsp-avif-card .lsp-lock-wrap {
        position: absolute !important;
        top: 14px;
        right: 14px;
    }
    
    .lsp-avif-card {
        position: relative;
    }
}



/* AI Form Field Styles */
.lsp-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lsp-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.lsp-textarea {
    display: block;
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.15s;
}

.lsp-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#lsp-ai-generate-form .lsp-field-group {
    margin-bottom: 16px;
}

#lsp-ai-generate-form .lsp-label {
    margin-bottom: 6px;
}

.lsp-select {
    display: block;
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.lsp-select:focus {
    outline: none;
    border-color: #3b82f6;
}

