/* Minimal reset */
* { box-sizing: border-box; }
html,body,#root { height: 100%; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial; }

/* Theme variables - these will be updated dynamically by theme-from-favicon.js to match assets/favicon.jpg */
:root {
  --theme-bg-from: #6d28d9; /* fallback primary */
  --theme-bg-to: #06b6d4;   /* fallback secondary */
  --theme-accent: #f59e0b;  /* accent (e.g., buttons) */
  --theme-on-primary: #ffffff; /* text color on primary */
  --toast-bg: #10b981; /* fallback toast */
}

/* Use the theme for page background so it matches favicon colors */
body {
  background: linear-gradient(180deg,var(--theme-bg-from),var(--theme-bg-to));
}

/* Custom styles to approximate solo.to aesthetics */
.link-item { text-decoration: none; color: inherit; }

/* Dark mode fallback: slightly darken the theme colors when user prefers dark */
@media (prefers-color-scheme: dark) {
  body { background: linear-gradient(180deg,color-mix(in srgb, var(--theme-bg-from) 70%, black), color-mix(in srgb, var(--theme-bg-to) 70%, black)); }
}

/* Footer small adjustments */
footer a { color: inherit; }

/* Toast notification (bottom-right) */
.toast-container {
  position: fixed;
  right: 6px; /* flush to the right edge */
  bottom: 6px; /* flush to the bottom edge */
  z-index: 2147483647; /* very high to ensure visible */
  pointer-events: none; /* allow clicks pass-through unless on toast */
  transform: translateZ(0); /* promote to its own layer for consistent rendering */
}
.toast {
  pointer-events: auto; /* allow interaction with the toast itself */
  min-width: 260px;
  max-width: 380px;
  background: var(--toast-bg, #10b981); /* themed toast background */
  color: var(--theme-on-primary, #ffffff);
  padding: 12px 14px 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 10px 30px rgba(2,6,23,0.35);
  position: relative;
  overflow: hidden;
  font-weight: 600;
  backdrop-filter: none;
}
.toast .close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.95);
  font-size: 16px;
  cursor: pointer;
}
.toast .progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 5px;
  background: color-mix(in srgb, var(--toast-bg, #10b981) 70%, black);
  width: 100%;
  transform-origin: left center;
}
.toast .message { padding-right: 28px; }

/* Toast enter/leave animations */
.toast-enter {
  transform: translateY(12px);
  opacity: 0;
  animation: toastIn 280ms ease forwards;
}
.toast-leave {
  animation: toastOut 260ms ease forwards;
}
@keyframes toastIn {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes toastOut {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(12px); opacity: 0; }
}

.app-root { opacity: 0; transition: opacity 0.35s ease 0.05s; }
.app-root.visible { opacity: 1; }
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes float {
  0% { transform: translateY(0) rotate(0deg) scale(1); }
  50% { transform: translateY(-6px) rotate(8deg) scale(1.03); }
  100% { transform: translateY(0) rotate(0deg) scale(1); }
}

/* Respect user preference for reduced motion (kept globally if used elsewhere) */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
}

/* Cube-card styles for policy pages */
.cube-wrap {
  perspective: 1100px;
  -webkit-perspective: 1100px;
}
.cube-card {
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transform: rotateX(-6deg) rotateY(8deg) translateZ(0);
  transition: transform 400ms cubic-bezier(.2,.9,.2,1), box-shadow 200ms;
  will-change: transform;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.86));
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(2,6,23,0.18), 0 6px 18px rgba(2,6,23,0.06);
}
.cube-card:hover {
  transform: rotateX(0deg) rotateY(0deg) translateY(-8px) translateZ(0);
  box-shadow: 0 28px 60px rgba(2,6,23,0.22), 0 10px 30px rgba(2,6,23,0.08);
}
.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: .5rem .9rem;
  border-radius: 999px;
  font-weight: 600;
}
.btn-primary {
  background: linear-gradient(90deg,var(--theme-bg-from),var(--theme-bg-to));
  color: var(--theme-on-primary, #ffffff);
}
.btn-outline {
  background: transparent;
  border: 1px solid rgba(0,0,0,0.06);
  color: inherit;
}

/* Documentation / Setup page styles */
.docs {
  max-width: 920px;
  margin: 24px auto;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,255,255,0.96));
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 10px 28px rgba(2,6,23,0.10);
  color: #0b1220;
}
.docs header h1 {
  margin: 0 0 6px 0;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.docs header p {
  margin: 0 0 12px 0;
  color: rgba(11,18,32,0.72);
}
.hero-badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  background: linear-gradient(90deg, rgba(0,0,0,0.06), rgba(0,0,0,0.03));
  color: inherit;
  margin-bottom: 12px;
}
.docs h2 { margin-top: 16px; color: #071023; }
.docs pre { background: #0b1220; color: #e6eef6; padding: 10px; border-radius: 8px; overflow:auto; font-size:13px; white-space: pre; }
.docs code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", monospace; font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: 1fr 300px; gap: 18px; }
.sidebar { background: rgba(2,6,23,0.02); padding: 12px; border-radius: 10px; position: sticky; top: 18px; height: fit-content; }
.card { background: white; border-radius: 10px; padding: 18px; box-shadow: 0 8px 20px rgba(2,6,23,0.06); }
.checklist li { margin: 8px 0; }
.muted { color: rgba(11,18,32,0.6); }
.accent { color: var(--theme-accent); font-weight:700; }
.kbd { background:#f3f4f6; border-radius:6px; padding:4px 8px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", monospace; font-size:13px; }

@media (max-width: 880px) {
  .grid-2 { grid-template-columns: 1fr; }
  .docs { margin: 20px; padding: 18px; }
}

/* Setup index specific styles */
.setup-hero { text-align: center; padding-bottom: 6px; }
.setup-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; margin-top: 14px; }
.setup-card { text-align: center; padding: 20px; border-radius: 12px; background: linear-gradient(180deg, #fff, #fbfdff); box-shadow: 0 6px 24px rgba(2,6,23,0.06); }
.setup-card h2 { margin: 0 0 6px 0; font-size: 18px; }
.setup-card p { margin: 0 0 10px 0; color: rgba(11,18,32,0.66); font-size:13px; }
.btn-large { display: inline-block; padding: 12px 18px; border-radius: 999px; font-weight: 700; background: linear-gradient(90deg,var(--theme-bg-from),var(--theme-bg-to)); color: var(--theme-on-primary); text-decoration: none; box-shadow: 0 8px 24px rgba(2,6,23,0.12); }

@media (max-width: 720px) {
  .setup-grid { grid-template-columns: 1fr; }
  .setup-card { padding: 22px; }
}

@media (max-width: 480px) {
  .docs { padding: 12px; }
  .card { padding: 12px; }
  .docs pre { font-size: 12px; }
  .setup-card { padding: 14px; }
}

/* Icon styles for setup cards */
.setup-icon { font-size: 46px; color: var(--theme-bg-from); display:block; margin: 0 auto 12px; }
.btn-large i { margin-right: 8px; }
