/* =====================================================================
   ListBuilder — global stylesheet
   Type: Poppins (display) + Inter (body)
   Themes: white (default), dark, darkblue — set via [data-theme] on <html>
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root{
  /* white theme (default) */
  --bg:            #F7F8FC;
  --surface:       #FFFFFF;
  --surface-alt:   #F1F2FA;
  --text:          #16192E;
  --text-muted:    #6B7086;
  --border:        #E7E8F2;
  --accent:        #4F46E5;
  --accent-2:      #7C3AED;
  --accent-soft:   #EEF0FD;
  --success:       #059669;
  --danger:        #DC2626;
  --radius:        16px;
  --radius-sm:     10px;
  --shadow-card:   0 1px 2px rgba(22,25,46,.04), 0 8px 24px rgba(22,25,46,.06);
  --shadow-hover:  0 4px 10px rgba(79,70,229,.10), 0 20px 40px rgba(79,70,229,.16);
}

html[data-theme="dark"]{
  --bg:            #0E1120;
  --surface:       #171A2E;
  --surface-alt:   #1F2338;
  --text:          #F1F2FA;
  --text-muted:    #9297B5;
  --border:        #2A2E48;
  --accent:        #818CF8;
  --accent-2:      #A78BFA;
  --accent-soft:   #232746;
  --shadow-card:   0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  --shadow-hover:  0 4px 10px rgba(129,140,248,.18), 0 20px 40px rgba(129,140,248,.22);
}

html[data-theme="darkblue"]{
  --bg:            #081226;
  --surface:       #0E1F3D;
  --surface-alt:   #122a4d;
  --text:          #EAF1FF;
  --text-muted:    #8FA6C9;
  --border:        #1D3A5C;
  --accent:        #3B82F6;
  --accent-2:      #22D3EE;
  --accent-soft:   #123457;
  --shadow-card:   0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.4);
  --shadow-hover:  0 4px 10px rgba(59,130,246,.20), 0 20px 40px rgba(59,130,246,.25);
}

/* ---- 20 selectable accent/text colors for public list pages ---- */
.tc-white{color:#FFFFFF}
.tc-black{color:#0B0B0F}
.tc-slate{color:#475569}
.tc-red{color:#EF4444}
.tc-orange{color:#F97316}
.tc-amber{color:#F59E0B}
.tc-yellow{color:#EAB308}
.tc-lime{color:#84CC16}
.tc-green{color:#22C55E}
.tc-emerald{color:#10B981}
.tc-teal{color:#14B8A6}
.tc-cyan{color:#06B6D4}
.tc-sky{color:#0EA5E9}
.tc-blue{color:#3B82F6}
.tc-indigo{color:#6366F1}
.tc-violet{color:#8B5CF6}
.tc-purple{color:#A855F7}
.tc-fuchsia{color:#D946EF}
.tc-pink{color:#EC4899}
.tc-rose{color:#F43F5E}

*,*::before,*::after{box-sizing:border-box}
html,body{margin:0;padding:0;overflow-x:hidden}
body{
  background:var(--bg);
  color:var(--text);
  font-family:'Inter',system-ui,-apple-system,sans-serif;
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
  display:flex;flex-direction:column;min-height:100vh;
}
.auth-wrap{flex:1 0 auto}
.app-main{flex:1 0 auto}
h1,h2,h3,h4,.font-display{
  font-family:'Poppins',system-ui,sans-serif;
  font-weight:700;
  line-height:1.2;
  margin:0 0 .5em;
}
a{color:var(--accent);text-decoration:none}
a:hover{text-decoration:underline}
img{max-width:100%;display:block}
.container{width:100%;max-width:1200px;margin:0 auto;padding:0 20px}

/* ---- Buttons ---- */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  border:none;border-radius:var(--radius-sm);
  padding:11px 22px;font-weight:600;font-size:.95rem;font-family:inherit;
  cursor:pointer;transition:transform .15s ease,box-shadow .15s ease,opacity .15s ease;
  text-decoration:none;
}
.btn:hover{text-decoration:none}
.btn-primary{background:linear-gradient(135deg,var(--accent),var(--accent-2));color:#fff;box-shadow:0 6px 16px rgba(79,70,229,.28)}
.btn-primary:hover{transform:translateY(-2px);box-shadow:0 10px 22px rgba(79,70,229,.36)}
.btn-outline{background:transparent;border:1.5px solid var(--border);color:var(--text)}
.btn-outline:hover{border-color:var(--accent);color:var(--accent);transform:translateY(-1px)}
.btn-danger{background:var(--danger);color:#fff}
.btn-sm{padding:7px 14px;font-size:.85rem;border-radius:8px}
.btn-block{width:100%}

/* ---- Forms ---- */
.field{margin-bottom:18px}
.field label{display:block;font-weight:600;font-size:.88rem;margin-bottom:6px;color:var(--text)}
.field .hint{font-size:.78rem;color:var(--text-muted);margin-top:4px}
input[type=text],input[type=email],input[type=password],input[type=url],
input[type=number],textarea,select{
  width:100%;padding:11px 14px;border-radius:var(--radius-sm);
  border:1.5px solid var(--border);background:var(--surface);color:var(--text);
  font-family:inherit;font-size:.95rem;transition:border-color .15s ease,box-shadow .15s ease;
}
input:focus,textarea:focus,select:focus{
  outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft);
}
textarea{resize:vertical;min-height:90px}

/* ---- Cards (shared "zoom" signature effect) ---- */
.card{
  background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);
  box-shadow:var(--shadow-card);padding:24px;
  transition:transform .22s cubic-bezier(.2,.8,.2,1),box-shadow .22s ease,border-color .22s ease;
}
.card-zoom:hover{transform:translateY(-6px) scale(1.015);box-shadow:var(--shadow-hover);border-color:var(--accent)}

/* ---- Auth pages ---- */
.auth-wrap{display:flex;align-items:center;justify-content:center;padding:40px 20px;background:var(--bg)}
.auth-card{width:100%;max-width:420px}
.auth-logo{text-align:center;margin-bottom:22px;font-size:1.4rem}
.auth-logo span{color:var(--accent)}
.auth-footer-link{text-align:center;margin-top:16px;font-size:.9rem;color:var(--text-muted)}

/* ---- Flash messages ---- */
.flash{padding:12px 16px;border-radius:var(--radius-sm);margin-bottom:16px;font-size:.9rem;font-weight:500}
.flash-success{background:#DCFCE7;color:#166534}
.flash-error{background:#FEE2E2;color:#991B1B}
html[data-theme="dark"] .flash-success,html[data-theme="darkblue"] .flash-success{background:#0f2e20;color:#4ade80}
html[data-theme="dark"] .flash-error,html[data-theme="darkblue"] .flash-error{background:#3a1414;color:#f87171}

/* ---- App shell (user dashboard + admin) ---- */
.app-nav{
  background:var(--surface);border-bottom:1px solid var(--border);
  position:sticky;top:0;z-index:40;
}
.app-nav-inner{display:flex;align-items:center;justify-content:space-between;padding:14px 20px;max-width:1200px;margin:0 auto}
.app-nav-brand{font-family:'Poppins',sans-serif;font-weight:700;font-size:1.2rem}
.app-nav-brand span{color:var(--accent)}
.app-nav-links{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.app-nav-links a{
  color:var(--text-muted);font-weight:600;font-size:.9rem;padding:8px 14px;border-radius:999px;
  transition:background .15s ease,color .15s ease;
}
.app-nav-links a:hover,.app-nav-links a.active{background:var(--accent-soft);color:var(--accent);text-decoration:none}
.app-main{max-width:1200px;margin:0 auto;padding:32px 20px 60px}

/* ---- Dashboard grid buttons ---- */
.action-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:18px;margin-top:24px;justify-content:center}
.action-grid > .card{max-width:320px;width:100%;margin:0 auto}
@media (min-width:1025px){
  .action-grid > .site-card{max-width:480px}
  .create-website-card{max-width:900px !important}
}
.action-card{text-align:left;color:var(--text);text-decoration:none}
a.action-card:hover,a.action-card:visited,a.action-card:active,a.action-card:focus{color:var(--text);text-decoration:none}
.action-card h3{color:var(--text)}
.action-card .icon{
  width:46px;height:46px;border-radius:12px;display:flex;align-items:center;justify-content:center;
  background:var(--accent-soft);color:var(--accent);margin-bottom:14px;font-size:1.3rem;
}
.action-arrow{float:right;color:var(--accent);opacity:0;transition:opacity .15s ease,transform .15s ease;transform:translateX(-4px)}
.action-card:hover .action-arrow{opacity:1;transform:translateX(0)}

/* ---- Stat cards (admin dashboard) ---- */
.stat-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:18px}
.stat-card .value{font-family:'Poppins',sans-serif;font-size:2rem;font-weight:800;color:var(--accent)}
.stat-card .label{color:var(--text-muted);font-size:.88rem;font-weight:600;margin-top:4px}
.stat-icon{
  width:46px;height:46px;border-radius:12px;display:flex;align-items:center;justify-content:center;
  margin-bottom:12px;
}
.stat-icon-indigo{background:var(--accent-soft);color:var(--accent)}
.stat-icon-green{background:#DCFCE7;color:#16A34A}
.stat-icon-red{background:#FEE2E2;color:#DC2626}
.stat-icon-orange{background:#FFEDD5;color:#EA580C}
.site-card-icon{
  width:44px;height:44px;border-radius:12px;display:flex;align-items:center;justify-content:center;
  background:var(--accent-soft);color:var(--accent);margin-bottom:12px;
}

/* ---- Tables ---- */
table.data-table{width:100%;border-collapse:collapse;background:var(--surface);border-radius:var(--radius);overflow:hidden}
table.data-table th,table.data-table td{padding:13px 16px;text-align:left;border-bottom:1px solid var(--border);font-size:.9rem}
table.data-table th{color:var(--text-muted);font-weight:600;font-size:.78rem;text-transform:uppercase;letter-spacing:.04em;background:var(--surface-alt)}
table.data-table tr:last-child td{border-bottom:none}
.badge{display:inline-block;padding:3px 10px;border-radius:999px;font-size:.75rem;font-weight:700}
.badge-green{background:#DCFCE7;color:#166534}
.badge-red{background:#FEE2E2;color:#991B1B}
.badge-gray{background:var(--surface-alt);color:var(--text-muted)}

/* ---- Suspended list banner (site_status = suspended) ---- */
.suspended-screen{
  min-height:100vh;background:#B91C1C;color:#fff;display:flex;align-items:center;justify-content:center;
  text-align:center;padding:40px 20px;
}
.suspended-screen h1{color:#fff;font-size:1.8rem}
.suspended-screen p{color:#FEE2E2;max-width:480px;margin:0 auto}

.maintenance-screen{
  min-height:100vh;background:var(--bg);color:var(--text);display:flex;align-items:center;justify-content:center;
  text-align:center;padding:40px 20px;
}

/* =====================================================================
   PUBLIC LIST WEBSITE (domain.top/{slug})
   ===================================================================== */
.pub-nav{background:var(--surface);border-bottom:1px solid var(--border);position:sticky;top:0;z-index:50}
.pub-nav-inner{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;max-width:1200px;margin:0 auto;position:relative}
.pub-nav-brand{font-family:'Poppins',sans-serif;font-weight:700;font-size:1.15rem;display:inline-flex;align-items:center;gap:8px}
.pub-nav-brand:hover{text-decoration:none}
.pub-nav-brand-icon{font-size:1.1rem;display:inline-flex;align-items:center}
.pub-nav-brand-favicon{width:22px;height:22px;border-radius:5px;object-fit:cover}
.pub-nav-links{display:flex;gap:4px;align-items:center}
.pub-nav-links a{color:var(--text);font-weight:600;font-size:.92rem;padding:8px 14px;border-radius:8px;display:inline-flex;align-items:center;gap:6px}
.pub-nav-count{
  display:inline-flex;align-items:center;justify-content:center;
  min-width:18px;height:18px;padding:0 5px;border-radius:999px;
  background:var(--surface-alt);color:var(--text-muted);
  font-size:.72rem;font-weight:700;line-height:1;
}
.pub-nav-links a.active .pub-nav-count,.pub-nav-links a:hover .pub-nav-count{background:var(--accent-soft);color:var(--accent)}
.pub-nav-links a:hover,.pub-nav-links a.active{background:var(--surface-alt);text-decoration:none}
.pub-nav-links a.active{color:var(--accent)}
.pub-nav-toggle{display:none;background:none;border:none;font-size:1.5rem;color:var(--text);cursor:pointer;padding:6px}

.pub-hero{padding:64px 20px 48px;text-align:center}
.pub-hero h1{font-size:2.4rem;margin-bottom:.3em}
.pub-hero p{color:var(--text-muted);font-size:1.05rem;max-width:600px;margin:0 auto}
.pub-hero .breadcrumb{color:var(--text-muted);font-size:.85rem;margin-bottom:10px}
.pub-hero .breadcrumb a{color:var(--accent)}

.pub-grid{
  display:grid;grid-template-columns:repeat(var(--cols,4),1fr);gap:22px;
  max-width:1200px;margin:0 auto;padding:0 20px 60px;
}
.pub-item-card{
  display:flex;flex-direction:column;gap:16px;width:100%;align-items:center;
  padding:32px;border:2px solid var(--accent-soft);border-radius:22px;
  transition:transform .22s cubic-bezier(.2,.8,.2,1),box-shadow .22s ease,border-color .22s ease;
  user-select:none;
}
.pub-item-card img,.pub-nav-brand-favicon{
  -webkit-user-drag:none;user-drag:none;
  -webkit-touch-callout:none;pointer-events:auto;
}
.pub-item-card:hover{border-color:var(--accent)}
.pub-item-header{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%}
.pub-item-card img{width:72px;height:72px;border-radius:18px;object-fit:cover;flex-shrink:0;border:1px solid silver;order:2}
.pub-item-card .name{font-weight:800;font-size:1.5rem;font-family:'Poppins',sans-serif;text-align:left;min-width:0;order:1}
.pub-item-divider{width:50px;height:1px;background:silver;border:none;margin:0}
.pub-item-card .desc{color:var(--text-muted);font-size:.95rem;line-height:1.6;text-align:center;min-height:2.6em}
.pub-item-card .btn{width:auto;margin-top:auto;padding:15px 26px;border-radius:16px;font-size:1.02rem}

/* Compact sizing when 5-6 columns are packed onto a desktop row */
@media (min-width:1025px){
  .pub-grid[data-cols="5"] .pub-item-card,
  .pub-grid[data-cols="6"] .pub-item-card{padding:18px;gap:14px;border-radius:16px}
  .pub-grid[data-cols="5"] .pub-item-card img,
  .pub-grid[data-cols="6"] .pub-item-card img{width:46px;height:46px;border-radius:12px}
  .pub-grid[data-cols="5"] .pub-item-card .name,
  .pub-grid[data-cols="6"] .pub-item-card .name{font-size:1.02rem}
  .pub-grid[data-cols="5"] .pub-item-card .desc,
  .pub-grid[data-cols="6"] .pub-item-card .desc{font-size:.85rem;min-height:2.2em}
  .pub-grid[data-cols="5"] .pub-item-card .btn,
  .pub-grid[data-cols="6"] .pub-item-card .btn{padding:10px 14px;font-size:.88rem;border-radius:10px}
}

/* ---- Icon library page ---- */
.icon-grid{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(135px,1fr));gap:14px;
}
.icon-tile{
  display:flex;flex-direction:column;align-items:center;gap:8px;text-align:center;
  padding:16px 10px;border:1px solid var(--border);border-radius:14px;background:var(--surface);
  min-width:0;
  transition:border-color .15s ease,box-shadow .15s ease;
}
.icon-tile:hover{border-color:var(--accent);box-shadow:var(--shadow-card)}
.icon-tile-preview{
  width:56px;height:56px;border-radius:12px;background:var(--accent-soft);color:var(--accent);
  display:flex;align-items:center;justify-content:center;flex-shrink:0;
}
.icon-tile-label{font-size:.78rem;font-weight:600;color:var(--text-muted);word-break:break-word}
.icon-download-btn{width:100%;font-size:.72rem;padding:6px 8px}

@media (max-width:767px){
  .icon-grid{grid-template-columns:repeat(auto-fit,minmax(90px,1fr))}
}

.pub-footer{border-top:1px solid var(--border);padding:40px 24px;background:var(--surface)}
.pub-footer-inner{
  max-width:1200px;margin:0 auto;display:flex;align-items:flex-start;justify-content:space-between;
  gap:36px;flex-wrap:wrap;font-size:.85rem;color:var(--text-muted);
}
.pub-footer-left,.pub-footer-right{display:flex;flex-direction:column;gap:16px}
.pub-footer-right{align-items:flex-end}
.pub-footer-desc{max-width:360px}
.pub-footer-pages{display:flex;gap:24px;flex-wrap:wrap}
.pub-footer-pages a{display:inline-flex;align-items:center;gap:7px;color:var(--text-muted);font-weight:600;font-size:.85rem}
.pub-footer-pages a:hover{color:var(--accent);text-decoration:none}
.pub-footer-social{display:flex;gap:16px;align-items:center}
.pub-footer-social a{
  display:flex;align-items:center;justify-content:center;
  transition:transform .15s ease,opacity .15s ease;
}
.pub-footer-social a:hover{transform:translateY(-2px);opacity:.85;text-decoration:none}
.pub-cta-btn{
  display:inline-flex;align-items:center;gap:7px;
  padding:9px 16px;border-radius:999px;
  background:linear-gradient(135deg,var(--accent),var(--accent-2));color:#fff;
  font-size:.82rem;font-weight:600;
  box-shadow:0 4px 12px rgba(79,70,229,.22);
  transition:transform .15s ease,box-shadow .15s ease;
}
.pub-cta-btn:hover{transform:translateY(-2px);box-shadow:0 8px 18px rgba(79,70,229,.3);color:#fff;text-decoration:none}

/* ---- particles.js background container ---- */
#lb-particles{position:fixed;inset:0;z-index:0;pointer-events:none}
.pub-hero,.pub-grid,.pub-footer,.app-main{position:relative;z-index:1}

@media (max-width:1024px){
  .pub-grid{grid-template-columns:repeat(2,1fr)}
}
@media (min-width:1920px){
  .container,.app-nav-inner,.app-main,.pub-nav-inner,.pub-grid,.pub-footer-inner{max-width:1500px}
}
@media (min-width:768px){
  #pub-show-more{display:none}
}
@media (max-width:700px){
  table.data-table{display:block;overflow-x:auto;-webkit-overflow-scrolling:touch}
}
@media (max-width:767px){
  .pub-grid{grid-template-columns:1fr}
  .pub-item-extra{display:none}
  .pub-item-extra.pub-item-extra-shown{display:flex}
  .pub-nav-links{
    display:none;position:absolute;top:100%;left:0;right:0;background:var(--surface);
    flex-direction:column;border-bottom:1px solid var(--border);padding:10px 20px 16px;gap:2px;
  }
  .pub-nav-links.open{display:flex}
  .pub-nav-toggle{display:block}
  .pub-footer-inner{flex-direction:column;text-align:left}
  .pub-footer-right{align-items:flex-start}
  .app-nav-links{width:100%;justify-content:center}
  .action-grid{grid-template-columns:1fr}
  .action-grid > .card,.pub-item-card{max-width:100%}
  .pub-hero{padding:44px 16px 32px}
  .pub-hero h1{font-size:1.7rem}
  .pub-hero p{font-size:.95rem}
  .app-main{padding:24px 14px 40px}
  .auth-card{max-width:100%}
  table.data-table th,table.data-table td{padding:10px 12px;font-size:.85rem}
  .btn{padding:10px 16px;font-size:.9rem}
}
