/* =====================================================================
   LexLearn — COMMON
   Everything both surfaces use: skip link, form states, toasts, the
   confirm dialog, empty/loading/error states. Loaded first on every
   page, student and admin alike.
   ===================================================================== */

/* =====================================================================
   LexLearn — shared state & utility components
   ---------------------------------------------------------------------
   Additive only. Nothing here overrides a template rule; these classes
   provide the loading / empty / error / success / lock vocabulary that
   neither purchased template ships with. Loaded AFTER the template CSS
   on both the Student (Citytours) and Admin (Listeo) sides.
   ===================================================================== */

:root {
  --lex-navy: #2f4f7f;
  --lex-navy-dark: #24406a;
  --lex-navy-soft: #eef2f8;
  --lex-ink: #23303f;
  --lex-muted: #6b7a8d;
  --lex-line: #e3e8ef;
  --lex-success: #00796b;   /* teal (2026-10-09; was #2e7d5b) */
  --lex-success-soft: #e6f2f0;
  --lex-warning: #9a6a00;
  --lex-danger: #b03636;
  --lex-radius: 4px;
}

/* ---------- States ------------------------------------------------ */
.lex-state {
  text-align: center;
  padding: 46px 24px;
  border: 1px dashed var(--lex-line);
  border-radius: var(--lex-radius);
  background: #fcfdfe;
  color: var(--lex-muted);
}
.lex-state i { font-size: 38px; display: block; margin-bottom: 14px; color: #b9c4d2; }
.lex-state h4 { margin: 0 0 6px; font-size: 17px; color: var(--lex-ink); }
.lex-state p { margin: 0 auto; max-width: 440px; font-size: 14px; line-height: 1.6; }
.lex-state--error { border-color: #f0d2d2; background: #fdf7f7; }
.lex-state--error i { color: #d99b9b; }
.lex-state--loading { border-style: solid; border-color: var(--lex-line); }
.lex-state-action {
  display: inline-block; margin-top: 18px; padding: 9px 20px;
  background: var(--lex-navy); color: #fff !important; border: 0;
  border-radius: var(--lex-radius); font-size: 13px; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.lex-state-action:hover, .lex-state-action:focus { background: var(--lex-navy-dark); color: #fff !important; }

/* ---------- Spinner ----------------------------------------------- */
.lex-spinner { display: inline-block; margin-bottom: 12px; }
.lex-spinner span {
  display: inline-block; width: 8px; height: 8px; margin: 0 3px;
  background: var(--lex-navy); border-radius: 50%;
  animation: lex-bounce 1.2s infinite ease-in-out both;
}
.lex-spinner span:nth-child(1) { animation-delay: -0.24s; }
.lex-spinner span:nth-child(2) { animation-delay: -0.12s; }
@keyframes lex-bounce { 0%, 80%, 100% { transform: scale(0.6); opacity: .5; } 40% { transform: scale(1); opacity: 1; } }

/* ---------- Skeleton ---------------------------------------------- */
.lex-skeleton-row { padding: 16px 0; border-bottom: 1px solid var(--lex-line); }
.lex-skeleton-bar {
  display: block; height: 11px; margin-bottom: 9px; border-radius: 3px;
  background: linear-gradient(90deg, #eef1f5 25%, #f7f9fb 37%, #eef1f5 63%);
  background-size: 400% 100%; animation: lex-shimmer 1.4s ease infinite;
}
.lex-skeleton-bar.w-90 { width: 90%; } .lex-skeleton-bar.w-70 { width: 70%; } .lex-skeleton-bar.w-40 { width: 40%; }
@keyframes lex-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- Banner ------------------------------------------------ */
.lex-banner {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 12px 14px; margin-bottom: 18px;
  border-radius: var(--lex-radius); font-size: 14px; line-height: 1.5;
  border-left: 3px solid var(--lex-navy); background: var(--lex-navy-soft); color: var(--lex-ink);
}
.lex-banner--success { border-left-color: var(--lex-success); background: var(--lex-success-soft); }
.lex-banner--error   { border-left-color: var(--lex-danger);  background: #fdf1f1; }
.lex-banner--warning { border-left-color: var(--lex-warning); background: #fdf6e7; }
.lex-banner-close { background: none; border: 0; font-size: 20px; line-height: 1; color: inherit; opacity: .55; cursor: pointer; }
.lex-banner-close:hover, .lex-banner-close:focus { opacity: 1; }

/* ---------- Field-level validation -------------------------------- */
.lex-field-error { margin: 6px 0 0; font-size: 12.5px; color: var(--lex-danger); }
.has-error input, .has-error select, .has-error textarea { border-color: #d98b8b !important; }

/* ---------- Toast -------------------------------------------------- */
.lex-toast-host { position: fixed; right: 20px; bottom: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.lex-toast {
  min-width: 240px; max-width: 340px; padding: 12px 16px;
  background: var(--lex-ink); color: #fff; font-size: 13.5px; line-height: 1.45;
  border-radius: var(--lex-radius); box-shadow: 0 8px 24px rgba(20, 32, 48, .22);
  animation: lex-toast-in .22s ease-out; border-left: 3px solid var(--lex-success);
}
.lex-toast--error   { border-left-color: #e08080; }
.lex-toast--warning { border-left-color: #e0b95f; }
.lex-toast--info    { border-left-color: #7fa6d9; }
.lex-toast.is-out { opacity: 0; transform: translateY(6px); transition: all .45s ease; }
@keyframes lex-toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Modal / confirmation ---------------------------------- */
.lex-modal-backdrop {
  position: fixed; inset: 0; background: rgba(24, 34, 48, .55);
  display: flex; align-items: center; justify-content: center; z-index: 10000; padding: 20px;
}
.lex-modal {
  background: #fff; border-radius: 6px; padding: 26px 28px;
  max-width: 440px; width: 100%; box-shadow: 0 18px 50px rgba(15, 25, 40, .3);
}
.lex-modal h3 { margin: 0 0 10px; font-size: 19px; color: var(--lex-ink); }
.lex-modal p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--lex-muted); }
.lex-modal-actions { margin-top: 22px; display: flex; gap: 10px; justify-content: flex-end; }
.lex-btn, .lex-btn-ghost {
  padding: 9px 18px; border-radius: var(--lex-radius); font-size: 13px;
  font-weight: 600; cursor: pointer; border: 1px solid transparent;
}
.lex-btn { background: var(--lex-navy); color: #fff; }
.lex-btn:hover, .lex-btn:focus { background: var(--lex-navy-dark); }
.lex-btn--danger { background: var(--lex-danger); }
.lex-btn--danger:hover, .lex-btn--danger:focus { background: #8e2b2b; }
.lex-btn-ghost { background: #fff; border-color: var(--lex-line); color: var(--lex-muted); }
.lex-btn-ghost:hover, .lex-btn-ghost:focus { border-color: #c6cfdb; color: var(--lex-ink); }

/* ---------- Free / locked vocabulary ------------------------------ */
.lex-badge {
  display: inline-block; padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  vertical-align: middle;
}
.lex-badge--free    { background: var(--lex-success-soft); color: var(--lex-success); }
.lex-badge--locked  { background: #f1f3f6; color: #7b8798; }
.lex-badge--read    { background: var(--lex-navy-soft); color: var(--lex-navy); }
.lex-badge--online  { background: #e8f0fa; color: var(--lex-navy); }
.lex-badge--manual  { background: #fdf6e7; color: var(--lex-warning); }
.lex-badge--active  { background: var(--lex-success-soft); color: var(--lex-success); }
.lex-badge--none    { background: #f1f3f6; color: #7b8798; }
.lex-badge--failed  { background: #fdf1f1; color: var(--lex-danger); }
.lex-badge--pending { background: #fdf6e7; color: var(--lex-warning); }

/* ---------- Progress ---------------------------------------------- */
.lex-progress { height: 6px; background: #eceff4; border-radius: 4px; overflow: hidden; }
.lex-progress > span { display: block; height: 100%; background: var(--lex-navy); border-radius: 4px; transition: width .4s ease; }
.lex-progress--thin { height: 4px; }

/* ---------- Focus visibility (accessibility) ---------------------- */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid rgba(47, 79, 127, .45);
  outline-offset: 2px;
}
.lex-skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 10001;
  background: var(--lex-navy); color: #fff; padding: 10px 16px; border-radius: 0 0 4px 0;
}
.lex-skip-link:focus { left: 0; color: #fff; }
.lex-visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}

/* ---------- Sample-content flag ----------------------------------- */
.sample-flag {
  background: #fdf6e7; border-left: 3px solid var(--lex-warning);
  padding: 10px 14px; font-size: 13px; color: #6d5010; border-radius: 0 3px 3px 0;
}

/* ---------- Demo control strip (removed before production) -------- */
.lex-demo-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9998;
  background: #23303f; color: #cfd8e3; font-size: 12px;
  padding: 7px 14px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
}
.lex-demo-bar strong { color: #fff; font-weight: 600; letter-spacing: .03em; }
.lex-demo-bar button {
  background: #3c4c61; border: 0; color: #fff; padding: 4px 11px;
  border-radius: 3px; font-size: 11.5px; cursor: pointer;
}
.lex-demo-bar button:hover, .lex-demo-bar button:focus { background: var(--lex-navy); }
.lex-demo-bar .lex-demo-close { margin-left: auto; background: transparent; font-size: 15px; }
body.has-demo-bar { padding-bottom: 42px; }

@media print {
  .lex-demo-bar, .lex-toast-host, header, footer, .dashboard-nav, #header-container { display: none !important; }
}

/* ---------- Demo strip: select control ---------------------------- */
.lex-demo-bar select {
  background: #3c4c61; border: 0; color: #fff; padding: 4px 8px;
  border-radius: 3px; font-size: 11.5px;
}
.lex-demo-bar label { font-size: 11.5px; opacity: .8; }
