/* ===== Self-hosted fonts (Google Fonts blocked in China → local assets) ===== */
@font-face {
  font-family: "Material Symbols Outlined";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url("material-symbols.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("inter.ttf") format("truetype");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("inter-500.ttf") format("truetype");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("inter-600.ttf") format("truetype");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("inter-700.ttf") format("truetype");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("inter-800.ttf") format("truetype");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url("inter-900.ttf") format("truetype");
}

/* ===== SnapTab Theme System — Light (blue-white) overrides ===== */
/* Dark theme = default Tailwind classes; Light theme = overrides below */

/* ===== Page background ===== */
html:not(.dark) body {
  background: linear-gradient(180deg, #f5f9ff 0%, #edf4ff 50%, #f5f9ff 100%) !important;
  color: #1e293b !important;
}

html.dark body {
  background: linear-gradient(180deg, #0f1c22 0%, #101e22 52%, #13242b 100%) !important;
  color: #e7f1f6 !important;
}

/* ===== Navigation / Header ===== */
html:not(.dark) .bg-background-dark\/80 {
  background-color: rgba(255, 255, 255, 0.88) !important;
}
html:not(.dark) .border-border-dark {
  border-color: #dde6f0 !important;
}
html:not(.dark) .border-border-dark\/30 {
  border-color: rgba(221, 230, 240, 0.5) !important;
}
html:not(.dark) .border-border-dark\/20 {
  border-color: rgba(221, 230, 240, 0.3) !important;
}
html:not(.dark) .border-border-dark\/50 {
  border-color: rgba(221, 230, 240, 0.6) !important;
}

/* ===== Background colors ===== */
html:not(.dark) .bg-border-dark {
  background-color: #dde6f0 !important;
}
html:not(.dark) .bg-background-dark {
  background-color: #f5f9ff !important;
}
html:not(.dark) .bg-background-dark\/50 {
  background-color: rgba(245, 249, 255, 0.5) !important;
}
html:not(.dark) .bg-surface-dark {
  background-color: #ffffff !important;
}
html:not(.dark) .bg-surface-dark\/50 {
  background-color: #f8fafc !important;
}
html:not(.dark) .bg-surface-dark\/30 {
  background-color: #fafbfd !important;
}
html:not(.dark) .bg-surface-dark\/20 {
  background-color: #fafcfe !important;
}
html:not(.dark) .bg-surface {
  background-color: #ffffff !important;
}
html:not(.dark) .bg-neutral-dark {
  background-color: #ffffff !important;
}
html:not(.dark) .bg-neutral-dark\/30 {
  background-color: #f8fafc !important;
}
html:not(.dark) .bg-neutral-dark\/40 {
  background-color: #f1f5f9 !important;
}
html:not(.dark) .bg-slate-900 {
  background-color: #ffffff !important;
}
html:not(.dark) .bg-slate-900\/50 {
  background-color: rgba(255, 255, 255, 0.7) !important;
}
html:not(.dark) .bg-slate-900\/30 {
  background-color: rgba(255, 255, 255, 0.5) !important;
}
html:not(.dark) .bg-slate-900\/20 {
  background-color: rgba(255, 255, 255, 0.3) !important;
}
html:not(.dark) .bg-slate-800 {
  background-color: #f1f5f9 !important;
}
html:not(.dark) .bg-slate-700 {
  background-color: #e2e8f0 !important;
}

/* ===== Text colors ===== */
html:not(.dark) .text-slate-100 {
  color: #1e293b !important;
}
html:not(.dark) .text-slate-200 {
  color: #334155 !important;
}
html:not(.dark) .text-slate-300 {
  color: #475569 !important;
}
html:not(.dark) .text-slate-400 {
  color: #64748b !important;
}
html:not(.dark) .text-slate-500 {
  color: #94a3b8 !important;
}
html:not(.dark) .text-slate-600 {
  color: #64748b !important;
}

/* ===== Border colors ===== */
html:not(.dark) .border-slate-800 {
  border-color: #e2e8f0 !important;
}
html:not(.dark) .border-slate-700 {
  border-color: #e2e8f0 !important;
}
html:not(.dark) .border-neutral-border {
  border-color: #dde6f0 !important;
}
html:not(.dark) .border-border-color {
  border-color: #dde6f0 !important;
}

/* ===== Shadows for light mode ===== */
html:not(.dark) .shadow-2xl {
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.08) !important;
}
html:not(.dark) .shadow-xl {
  box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.06) !important;
}

/* ===== Specific component overrides ===== */

/* Primary button text should stay dark on primary bg */
html:not(.dark) .bg-primary .text-background-dark,
html:not(.dark) .bg-primary.text-background-dark,
html:not(.dark) .text-background-dark {
  color: #101e22 !important;
}

/* Footer on light mode */
html:not(.dark) footer {
  background-color: #f8faff !important;
}

/* Hover states */
html:not(.dark) .hover\:bg-slate-700:hover {
  background-color: #e2e8f0 !important;
}
html:not(.dark) .hover\:bg-slate-900:hover {
  background-color: #f1f5f9 !important;
}
html:not(.dark) .hover\:bg-white\/5:hover {
  background-color: rgba(15, 23, 42, 0.03) !important;
}
html:not(.dark) .hover\:bg-white\/30:hover {
  background-color: rgba(15, 23, 42, 0.06) !important;
}

/* Download page hero gradient (from-surface-dark to-background-dark) */
html:not(.dark) .from-surface-dark {
  --tw-gradient-from: #ffffff !important;
  --tw-gradient-to: rgba(255, 255, 255, 0) !important;
}
html:not(.dark) .to-background-dark {
  --tw-gradient-to: #f5f9ff !important;
}

/* Gradient overlays */
html:not(.dark) .from-primary\/30 {
  --tw-gradient-from: rgba(13, 185, 242, 0.12) !important;
}

/* Focus ring for form inputs */
html:not(.dark) input,
html:not(.dark) select,
html:not(.dark) textarea {
  background-color: #f8fafc !important;
  border-color: #dde6f0 !important;
  color: #1e293b !important;
}
html:not(.dark) input::placeholder,
html:not(.dark) textarea::placeholder {
  color: #94a3b8 !important;
}

/* Window mockup dots */
html:not(.dark) .bg-red-500\/50 {
  background-color: rgba(239, 68, 68, 0.6) !important;
}
html:not(.dark) .bg-yellow-500\/50 {
  background-color: rgba(234, 179, 8, 0.6) !important;
}
html:not(.dark) .bg-green-500\/50 {
  background-color: rgba(34, 197, 94, 0.6) !important;
}

/* Theme toggle button */
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0 !important;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
  color: #94a3b8;
}
.theme-toggle-icon {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin: 0;
  line-height: 1;
  font-size: 20px !important;
  vertical-align: middle;
}
.theme-toggle .material-symbols-outlined::before {
  align-items: center;
  justify-content: center;
}
html.icon-font-ready .theme-toggle .material-symbols-outlined {
  line-height: 1;
}
html.dark .theme-toggle {
  color: #94a3b8;
  border-color: #223f49;
}
html.dark .theme-toggle:hover {
  background: #162a30;
  color: #0db9f2;
}
html:not(.dark) .theme-toggle {
  color: #64748b;
  border-color: #dde6f0;
}
html:not(.dark) .theme-toggle:hover {
  background: #f1f5f9;
  color: #0db9f2;
}

.site-nav-shell {
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

html:not(.dark) .site-nav-shell {
  background: rgba(255, 255, 255, 0.84) !important;
  border-bottom-color: rgba(148, 163, 184, 0.18) !important;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
}

html.dark .site-nav-shell {
  background: rgba(15, 31, 37, 0.86) !important;
  border-bottom-color: rgba(82, 113, 124, 0.42) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

.site-theme-toggle,
.site-trial-cta {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.site-trial-cta {
  background: linear-gradient(135deg, #49d8ff 0%, #18b0f1 58%, #1292df 100%) !important;
  color: #082031 !important;
  font-weight: 800 !important;
  border: 1px solid rgba(10, 34, 49, 0.06);
  box-shadow: 0 14px 34px rgba(13, 185, 242, 0.2);
}

.site-trial-cta:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #60e0ff 0%, #22bcf4 58%, #1499e4 100%) !important;
  color: #082031 !important;
}

body.home-page .site-nav-shell {
  background: rgba(255, 255, 255, 0.72) !important;
  border-bottom-color: rgba(186, 211, 224, 0.4) !important;
  box-shadow: 0 16px 38px rgba(60, 117, 152, 0.08);
}

body.home-page .site-nav-shell .text-gray-600,
body.home-page .site-nav-shell .text-gray-500 {
  color: #58718b !important;
}

body.home-page .site-nav-shell .text-primary {
  color: #16acee !important;
}

body.home-page .site-nav-shell .hover\:text-primary:hover {
  color: #0d9ad9 !important;
}

body.home-page .site-nav-shell .hover\:bg-gray-100:hover {
  background: rgba(19, 149, 214, 0.08) !important;
}

body.home-page .site-theme-toggle,
body.home-page .theme-toggle {
  border-color: rgba(197, 219, 230, 0.86) !important;
  background: rgba(255, 255, 255, 0.78) !important;
  color: #58718b !important;
  box-shadow: 0 10px 20px rgba(60, 117, 152, 0.08);
}

body.home-page .site-theme-toggle:hover,
body.home-page .theme-toggle:hover {
  background: rgba(244, 251, 255, 0.96) !important;
  color: #16acee !important;
}

body.home-page .site-nav-shell #mobile-menu {
  margin-top: 1px;
  border-top: 1px solid rgba(197, 219, 230, 0.72);
  background: linear-gradient(180deg, rgba(253, 254, 255, 0.98), rgba(243, 249, 255, 0.98));
}

body.home-page .site-nav-shell #mobile-menu a:not(.site-trial-cta) {
  color: #58718b !important;
}

html.dark body.home-page .site-nav-shell {
  background: rgba(8, 25, 31, 0.74) !important;
  border-bottom-color: rgba(112, 156, 174, 0.18) !important;
  box-shadow: 0 18px 48px rgba(4, 12, 18, 0.18);
}

html.dark body.home-page .site-nav-shell .text-gray-600,
html.dark body.home-page .site-nav-shell .text-gray-500 {
  color: rgba(223, 236, 243, 0.78) !important;
}

html.dark body.home-page .site-nav-shell .text-primary {
  color: #2dc8ff !important;
}

html.dark body.home-page .site-nav-shell .hover\:text-primary:hover {
  color: #5ad7ff !important;
}

html.dark body.home-page .site-nav-shell .hover\:bg-gray-100:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

html.dark body.home-page .site-theme-toggle,
html.dark body.home-page .theme-toggle {
  border-color: rgba(118, 165, 183, 0.18) !important;
  background: rgba(255, 255, 255, 0.06) !important;
  color: #d9eaf2 !important;
}

html.dark body.home-page .site-theme-toggle:hover,
html.dark body.home-page .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #5cdcff !important;
}

html.dark body.home-page .site-nav-shell #mobile-menu {
  border-top: 1px solid rgba(112, 156, 174, 0.14);
  background: linear-gradient(180deg, rgba(8, 25, 31, 0.98), rgba(10, 28, 35, 0.96));
}

html.dark body.home-page .site-nav-shell #mobile-menu a:not(.site-trial-cta) {
  color: rgba(224, 236, 243, 0.82) !important;
}

/* Smooth transition for theme switch */
body,
header,
footer,
main,
section,
div,
a,
p,
h1, h2, h3, h4, h5, h6,
span,
button,
input, select, textarea {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* App mockup styles for hero section */
.app-mockup {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 0;
  font-size: 11px;
  line-height: 1.4;
}
.app-mockup-sidebar {
  padding: 12px;
  border-right: 1px solid;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
html.dark .app-mockup-sidebar {
  background: #0f1a1f;
  border-color: #223f49;
}
html:not(.dark) .app-mockup-sidebar {
  background: #f1f5f9;
  border-color: #e2e8f0;
}
.app-mockup-main {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}
.mock-label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.5;
}
.mock-line {
  height: 8px;
  border-radius: 4px;
  background: currentColor;
  opacity: 0.12;
}
.mock-line.short { width: 60%; }
.mock-line.medium { width: 80%; }
.mock-btn {
  padding: 4px 10px;
  border-radius: 6px;
  background: #0db9f2;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  text-align: center;
  width: fit-content;
}
.mock-table {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 1px;
  font-size: 9px;
  border-radius: 6px;
  overflow: hidden;
  flex: 1;
}
.mock-table-header {
  font-weight: 700;
  padding: 4px 6px;
}
.mock-table-cell {
  padding: 4px 6px;
}
html.dark .mock-table-header {
  background: #162a30;
  color: #94a3b8;
}
html.dark .mock-table-cell {
  background: #0f1a1f;
  color: #64748b;
}
html:not(.dark) .mock-table-header {
  background: #edf2f7;
  color: #475569;
}
html:not(.dark) .mock-table-cell {
  background: #f8fafc;
  color: #64748b;
}

@media (max-width: 640px) {
  .app-mockup {
    grid-template-columns: 1fr;
  }
  .app-mockup-sidebar {
    display: none;
  }
}

/* Material Symbols — ensure ligature icons render (not raw text) */
.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-feature-settings: "liga";
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
}
