/* Home landing page
   - Layout/spacing: match the original Documents/Home/home.html + home.css
   - Palette: dashboard-like (light/dark)
   - This stylesheet is only loaded on Home/Index.
*/

/* Theme variables (copied from dashboard.css so Home can share the same palette
   without importing dashboard.css, avoiding selector conflicts).
*/
:root{
  /* Light theme (default) */
  --bg: #f6f8fc;
  --panel: #ffffff;
  --panel-2: #f3f6ff;
  --border: rgba(15,23,42,.10);
  --border-2: rgba(15,23,42,.18);
  --text: rgba(15,23,42,.92);
  --muted: rgba(15,23,42,.62);
  --muted-2: rgba(15,23,42,.45);
  --accent: #2f6bff;
  --accent-2: #16a34a;
  --danger: #dc2626;
  --shadow: 0 12px 30px rgba(2,6,23,.10);
  --radius: 14px;
  --radius-sm: 10px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans TC", Arial, "Apple Color Emoji","Segoe UI Emoji";
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
}

html[data-theme="dark"]{
  /* Dark theme */
  --bg: #0b0f17;
  --panel: #0f1624;
  --panel-2: #0c1320;
  --border: rgba(255,255,255,.10);
  --border-2: rgba(255,255,255,.14);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.62);
  --muted-2: rgba(255,255,255,.45);
  --accent: #7aa2ff;
  --accent-2: #61d4a3;
  --danger: #ff6b6b;
  --shadow: 0 12px 30px rgba(0,0,0,.35);
}

*{ box-sizing:border-box; }
body{
  margin:0;
  font-family: var(--font);
  background: radial-gradient(1000px 500px at 20% 0%, rgba(47,107,255,.10), transparent 60%),
              radial-gradient(1000px 500px at 80% 20%, rgba(22,163,74,.08), transparent 60%),
              var(--bg);
  color: var(--text);
}

html[data-theme="dark"] body{
  background: radial-gradient(1000px 500px at 20% 0%, rgba(122,162,255,.18), transparent 55%),
              radial-gradient(1000px 500px at 80% 20%, rgba(97,212,163,.10), transparent 55%),
              var(--bg);
}

/* Topbar + common UI (copied from dashboard.css) */
.topbar{
  height:56px;
  display:flex;
  align-items:center;
  justify-content:space-between;

  /* Home-only: emulate the original home.html container left/right whitespace
     (container width = 1180px, outer padding ~= 12px). */
  padding-left: max(12px, calc((100vw - 1180px) / 2));
  padding-right: max(12px, calc((100vw - 1180px) / 2));

  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(10px);
}
html[data-theme="dark"] .topbar{ background: rgba(15,22,36,.75); }

.nav a{
  color: var(--text);
  text-decoration:none;
  padding: 7px 10px;
  border-radius: 999px;
  border:1px solid transparent;
  background: rgba(255,255,255,.55);
  font-size: 12px;
}
.nav a:hover{ border-color: var(--border); background: rgba(255,255,255,.75); }
.nav a.active{ border-color: rgba(47,107,255,.55); background: rgba(47,107,255,.10); }
html[data-theme="dark"] .nav a{ background: rgba(12,19,32,.35); }
html[data-theme="dark"] .nav a:hover{ border-color: var(--border); background: rgba(12,19,32,.55); }
html[data-theme="dark"] .nav a.active{ border-color: rgba(122,162,255,.7); background: rgba(122,162,255,.12); }

.btn{
  appearance:none;
  border:1px solid var(--border);
  background: rgba(255,255,255,.70);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 12px;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap:8px;
  transition: transform .08s ease, border-color .12s ease, background .12s ease;
  user-select:none;
  text-decoration: none;
}
.btn:hover{ border-color: var(--border-2); background: rgba(255,255,255,.90); }
.btn:active{ transform: translateY(1px); }
.btn.primary{ border-color: rgba(47,107,255,.55); background: rgba(47,107,255,.12); }
.btn.primary:hover{ border-color: rgba(47,107,255,.85); background: rgba(47,107,255,.16); }
.btn.success{ border-color: rgba(22,163,74,.55); background: rgba(22,163,74,.12); }
.btn.ghost{ background: transparent; }
html[data-theme="dark"] .btn{ background: rgba(12,19,32,.7); }
html[data-theme="dark"] .btn:hover{ background: rgba(12,19,32,.9); }
html[data-theme="dark"] .btn.primary{ border-color: rgba(122,162,255,.55); background: rgba(122,162,255,.14); }
html[data-theme="dark"] .btn.primary:hover{ border-color: rgba(122,162,255,.85); background: rgba(122,162,255,.18); }
html[data-theme="dark"] .btn.success{ border-color: rgba(97,212,163,.55); background: rgba(97,212,163,.12); }


/* allow page scrolling (Dashboard/Task uses overflow hidden) */
body{ overflow:auto; }

.home .container{
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto;
}

/* ---------------------------
   Hero (match original)
--------------------------- */
.home .hero{ padding: 28px 0 16px; }
.home .heroGrid{
  display:grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 14px;
  align-items: stretch;
}

.home .card{
  border:1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow:hidden;
}
html[data-theme="dark"] .home .card{ background: var(--panel); }

.home .cardBody{ padding: 16px; }

.home .hTitle{ margin:0; font-size: 20px; letter-spacing:.2px; }
.home .hDesc{ margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }

.home .heroCtas{ margin-top: 14px; display:flex; gap: 10px; flex-wrap:wrap; align-items:center; }

.home .badges{ margin-top: 12px; display:flex; gap: 8px; flex-wrap:wrap; }
.home .badge{
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  background: rgba(255,255,255,.60);
  border:1px solid var(--border);
  padding: 2px 8px;
  border-radius: 999px;
}
html[data-theme="dark"] .home .badge{ color: rgba(255,255,255,.75); background: rgba(255,255,255,.06); }

/* ---------------------------
   Auth card (match original)
--------------------------- */
.home .authTabs{
  display:flex;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(15,23,42,.04);
}
html[data-theme="dark"] .home .authTabs{ background: rgba(255,255,255,.04); }

.home .authTabs .tab{
  padding: 7px 10px;
  border-radius: 999px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.70);
  color: var(--muted);
  font-size: 12px;
  cursor:pointer;
  user-select:none;
}
html[data-theme="dark"] .home .authTabs .tab{ background: rgba(12,19,32,.55); color: rgba(255,255,255,.75); border-color: rgba(255,255,255,.10); }

.home .authTabs .tab.active{
  color: var(--text);
  border-color: rgba(47,107,255,.55);
  background: rgba(47,107,255,.10);
}
html[data-theme="dark"] .home .authTabs .tab.active{
  border-color: rgba(122,162,255,.7);
  background: rgba(122,162,255,.12);
}

.home .form{ padding: 14px 16px 16px; }
.home .field{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin-bottom: 10px;
}
.home .field label{ font-size: 12px; color: var(--muted); }

.home .input{
  width:100%;
  padding: 10px 10px; /* original */
  border-radius: 12px;
  border:1px solid var(--border-2);
  background: rgba(255,255,255,.92);
  color: var(--text);
  outline:none;
  font-size: 12px;
}
.home .input:focus{ border-color: rgba(47,107,255,.45); box-shadow: 0 0 0 3px rgba(47,107,255,.10); }
html[data-theme="dark"] .home .input{ background: rgba(12,19,32,.60); border-color: rgba(255,255,255,.12); }
html[data-theme="dark"] .home .input:focus{ border-color: rgba(122,162,255,.55); box-shadow: 0 0 0 3px rgba(122,162,255,.14); }

.home .helper{ font-size: 11.5px; color: var(--muted-2); line-height: 1.35; }

.home .formRow{
  display:flex;
  gap: 8px;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
}

.home .smallLink{ font-size: 12px; color: var(--accent); }
.home .smallLink:hover{ text-decoration: underline; }

/* ---------------------------
   Sections (match original)
--------------------------- */
.home .section{ padding: 10px 0 22px; }

.home .sectionHead{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap: 12px;
  margin: 14px 0 10px;
}

.home .sectionHead h2{ margin:0; font-size: 14px; letter-spacing:.2px; }
.home .sectionHead p{ margin:0; color: var(--muted-2); font-size: 12px; }

/* Product grid */
.home .toolbar{ display:flex; gap: 8px; flex-wrap:wrap; align-items:center; }

.home .select{
  border:1px solid var(--border-2);
  background: rgba(255,255,255,.92);
  color: var(--text);
  border-radius: 12px;
  padding: 9px 10px;
  outline:none;
  font-size: 12px;
}
.home .select:focus{ border-color: rgba(47,107,255,.45); box-shadow: 0 0 0 3px rgba(47,107,255,.10); }
html[data-theme="dark"] .home .select{ background: rgba(12,19,32,.6); border-color: rgba(255,255,255,.12); }
html[data-theme="dark"] .home .select:focus{ border-color: rgba(122,162,255,.55); box-shadow: 0 0 0 3px rgba(122,162,255,.14); }

.home .products{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.home .product{
  border:1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  overflow:hidden;
  display:flex;
  flex-direction:column;
  box-shadow: var(--shadow);
}
html[data-theme="dark"] .home .product{ background: rgba(15,22,36,.62); }

.home .productTop{
  padding: 12px;
  display:flex;
  gap: 12px;
}

.home .thumb{
  width:44px;height:44px;border-radius: 12px;
  background: rgba(255,255,255,.08);
  border:1px solid var(--border);
  flex: 0 0 auto;
}

.home .pMeta{ min-width:0; flex:1; }
.home .pMeta strong{
  display:block;
  font-size: 13px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  margin-bottom: 4px;
}

.home .pMeta .sub{
  font-size: 12px;
  color: var(--muted-2);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.home .pTags{
  padding: 0 12px 10px;
  display:flex;
  gap:6px;
  flex-wrap:wrap;
}

.home .productActions{
  margin-top:auto;
  padding: 12px;
  border-top: 1px solid var(--border);
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

/* About */
.home .features{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px;
}

.home .feature{
  border:1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 14px;
  box-shadow: var(--shadow);
}
html[data-theme="dark"] .home .feature{ background: rgba(15,22,36,.62); }

.home .feature strong{ font-size: 13px; }
.home .feature p{
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.55;
}

/* Footer */
.home .footer{
  border-top: 1px solid var(--border);
  padding: 16px 0 20px;
  color: var(--muted-2);
  font-size: 12px;
}

/* Responsive (match original) */
@media (max-width: 1100px){
  .home .heroGrid{ grid-template-columns: 1fr; }
  .home .products{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .home .features{ grid-template-columns: 1fr; }
}
@media (max-width: 680px){
  /* keep topbar (layout) as-is; only adjust grids */
  .home .products{ grid-template-columns: 1fr; }
}

/* Toast (home.js appends to body; keep consistent & readable in light/dark) */
.toast{
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  padding: 10px 12px;
  border-radius: 999px;
  border:1px solid rgba(15,23,42,.14);
  background: rgba(255,255,255,.92);
  color: rgba(15,23,42,.92);
  font-size: 12px;
  box-shadow: var(--shadow);
  z-index: 9999;
}
html[data-theme="dark"] .toast{
  border:1px solid rgba(255,255,255,.12);
  background: rgba(12,19,32,.88);
  color: rgba(255,255,255,.92);
}
