/* ViaVi Skills — Cursor-inspired design system */

/* ===================================================
   TYPOGRAPHY HELPERS
   =================================================== */
.font-display { font-family: 'Space Grotesk', system-ui, sans-serif; }
.font-serif   { font-family: 'Lora', Georgia, ui-serif, serif; }
.font-mono    { font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace; }

/* ===================================================
   BORDER HELPERS (oklab-compatible warm brown)
   =================================================== */
.border-cs      { border-color: rgba(38,37,30,0.10); }
.border-cs-md   { border-color: rgba(38,37,30,0.20); }
.border-cs-strong { border-color: rgba(38,37,30,0.55); }

/* ===================================================
   INTERACTIVE ELEMENTS
   =================================================== */
button[type="submit"]:not(:disabled),
button[type="button"]:not(:disabled),
a.cs-btn {
  transition: color 150ms ease, background-color 150ms ease,
              box-shadow 150ms ease, transform 80ms ease, border-color 150ms ease;
}
button[type="submit"]:active:not(:disabled),
button[type="button"]:active:not(:disabled) {
  transform: scale(0.97);
}
button:disabled, input:disabled, select:disabled, textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===================================================
   FORM INPUTS
   =================================================== */
input, textarea, select {
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  border-color: rgba(38,37,30,0.35) !important;
  box-shadow: rgba(0,0,0,0.08) 0px 0px 0px 3px;
}

/* ===================================================
   LOADING SPINNER
   =================================================== */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.55s linear infinite;
  vertical-align: -2px;
  margin-right: 5px;
}

/* ===================================================
   TOAST NOTIFICATIONS
   =================================================== */
#toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  max-width: calc(100vw - 2rem);
}
@keyframes toastIn  {
  from { transform: translateX(calc(100% + 1rem)); opacity: 0; }
  to   { transform: translateX(0);                 opacity: 1; }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0);                  max-height: 64px; }
  to   { opacity: 0; transform: translateX(calc(100% + 1rem)); max-height: 0; }
}
.toast {
  animation: toastIn 240ms cubic-bezier(0.16,1,0.3,1) forwards;
  pointer-events: auto;
  cursor: pointer;
  background: #f7f7f4;
  border: 1px solid rgba(38,37,30,0.12);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.8125rem;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  color: #26251e;
  box-shadow: rgba(0,0,0,0.12) 0px 8px 24px, rgba(38,37,30,0.10) 0px 0px 0px 1px;
  max-width: 320px;
}
.toast.dismissing {
  animation: toastOut 180ms ease forwards;
  overflow: hidden;
}
.toast-success { border-left: 3px solid #1f8a65; }
.toast-info    { border-left: 3px solid rgba(38,37,30,0.3); }
.toast-error   { border-left: 3px solid #cf2d56; }

/* ===================================================
   FLASH MESSAGES
   =================================================== */
@keyframes slideDown {
  from { transform: translateY(-6px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.flash-msg { animation: slideDown 200ms ease forwards; }

/* ===================================================
   STAT CARDS
   =================================================== */
.stat-card {
  transition: transform 150ms ease, box-shadow 200ms ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: rgba(0,0,0,0.14) 0px 28px 70px, rgba(0,0,0,0.10) 0px 14px 32px, rgba(38,37,30,0.10) 0px 0px 0px 1px;
}

/* ===================================================
   SIDEBAR NAV
   =================================================== */
#sidebar nav a {
  transition: color 150ms ease, background-color 150ms ease;
  position: relative;
}
#sidebar nav a.nav-active {
  background-color: rgba(38,37,30,0.08);
  color: #26251e;
  font-weight: 500;
}
#sidebar nav a.nav-active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 2px;
  background: #26251e;
  border-radius: 1px;
}

/* ===================================================
   TABLES
   =================================================== */
tbody tr {
  transition: background-color 100ms ease;
  border-bottom: 1px solid rgba(38,37,30,0.07);
}
tbody tr:hover { background-color: rgba(38,37,30,0.025); }
thead tr { border-bottom: 1px solid rgba(38,37,30,0.20); }

/* ===================================================
   FILE DROP ZONE
   =================================================== */
.drop-zone {
  transition: border-color 150ms ease, background-color 150ms ease;
  border: 2px dashed rgba(38,37,30,0.20);
  border-radius: 8px;
}
.drop-zone:hover { border-color: rgba(38,37,30,0.40); }
.drop-zone.drag-over {
  border-color: #26251e !important;
  background-color: rgba(38,37,30,0.04) !important;
}

/* ===================================================
   TOKEN BOX
   =================================================== */
#token-display {
  user-select: all;
  cursor: text;
}
@keyframes pulseWarm {
  0%, 100% { box-shadow: 0 0 0 0   rgba(197,135,50,0); }
  50%       { box-shadow: 0 0 0 4px rgba(197,135,50,0.25); }
}
.token-box { animation: pulseWarm 1.4s ease 0.2s 2; }

/* ===================================================
   MARKDOWN PREVIEW
   =================================================== */
.md-preview {
  font-family: 'Lora', Georgia, ui-serif, serif;
  font-size: 0.875rem;
  line-height: 1.75;
  color: #26251e;
  min-height: 16rem;
  padding: 1rem 1.25rem;
  border: 1px solid rgba(38,37,30,0.12);
  border-radius: 8px;
  background: #f7f7f4;
  overflow-x: auto;
}
.md-preview > *:first-child { margin-top: 0; }
.md-preview > *:last-child  { margin-bottom: 0; }
.md-preview h1 { font-family: 'Space Grotesk', sans-serif; font-size: 1.15rem; font-weight: 600; color: #26251e; margin: 1.4rem 0 0.5rem; border-bottom: 1px solid rgba(38,37,30,0.10); padding-bottom: 0.3rem; letter-spacing: -0.01em; }
.md-preview h2 { font-family: 'Space Grotesk', sans-serif; font-size: 1.0rem; font-weight: 600; color: #26251e; margin: 1.2rem 0 0.4rem; letter-spacing: -0.005em; }
.md-preview h3 { font-family: 'Space Grotesk', sans-serif; font-size: 0.9rem; font-weight: 500; color: #26251e; margin: 1rem 0 0.35rem; }
.md-preview h4, .md-preview h5, .md-preview h6 { font-family: 'Space Grotesk', sans-serif; font-size: 0.875rem; font-weight: 500; margin: 0.9rem 0 0.3rem; }
.md-preview p { margin: 0.6rem 0; }
.md-preview ul { list-style-type: disc;    padding-left: 1.5rem; margin: 0.6rem 0; }
.md-preview ol { list-style-type: decimal; padding-left: 1.5rem; margin: 0.6rem 0; }
.md-preview li { margin: 0.2rem 0; }
.md-preview li > ul, .md-preview li > ol { margin: 0.1rem 0; }
.md-preview code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  background: rgba(38,37,30,0.07);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-size: 0.75rem;
  color: #26251e;
}
.md-preview pre {
  background: rgba(38,37,30,0.05);
  padding: 1rem 1.1rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 0.75rem 0;
  border: 1px solid rgba(38,37,30,0.10);
}
.md-preview pre code { background: none; padding: 0; font-size: 0.75rem; }
.md-preview blockquote {
  border-left: 2px solid rgba(38,37,30,0.25);
  padding: 0.25rem 0 0.25rem 1rem;
  margin: 0.75rem 0;
  color: rgba(38,37,30,0.65);
  font-style: italic;
}
.md-preview blockquote p { margin: 0.2rem 0; }
.md-preview hr { border: none; border-top: 1px solid rgba(38,37,30,0.12); margin: 1rem 0; }
.md-preview a { color: #f54e00; text-decoration: underline; text-underline-offset: 2px; }
.md-preview a:hover { color: #cf2d56; }
.md-preview strong { font-weight: 600; color: #26251e; }
.md-preview em     { font-style: italic; }
.md-preview table { width: 100%; border-collapse: collapse; margin: 0.75rem 0; font-family: 'Space Grotesk', sans-serif; font-size: 0.8rem; }
.md-preview th { background: rgba(38,37,30,0.05); font-weight: 500; text-align: left; padding: 0.45rem 0.75rem; border: 1px solid rgba(38,37,30,0.12); }
.md-preview td { padding: 0.45rem 0.75rem; border: 1px solid rgba(38,37,30,0.10); vertical-align: top; }
.md-preview tr:nth-child(even) td { background: rgba(38,37,30,0.02); }
.md-preview-empty {
  color: rgba(38,37,30,0.40);
  font-family: 'Space Grotesk', sans-serif;
  font-style: normal;
  font-size: 0.8rem;
  text-align: center;
  padding: 3rem 1rem;
  border: 1px dashed rgba(38,37,30,0.18);
  border-radius: 8px;
}

/* ===================================================
   DESCRIPTION COUNTER / VALIDATION
   =================================================== */
textarea#description:focus-visible {
  outline: none;
}

/* ===================================================
   LANGUAGE TOGGLE BUTTONS
   =================================================== */
.lang-btn { transition: color 150ms ease; }
.lang-btn[aria-current="true"]  { color: #26251e; font-weight: 500; }
.lang-btn[aria-current="false"] { color: rgba(38,37,30,0.40); }
.lang-btn:hover                 { color: #26251e; }
