/* ============================================================
   PRATIQUER — app UI mockups (CSS recreations of the real app)
   Material-style toolbar (primary blue), study cards, editor,
   library, games, analytics. Reused across marketing pages.
   ============================================================ */

/* ---------- browser frame ---------- */
.frame {
  background: #fff; border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow-lg); border: 1px solid var(--line);
}
.frame-bar {
  display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 14px; background: #f1f4f9; border-bottom: 1px solid var(--line);
}
.frame-dots { display: flex; gap: 7px; }
.frame-dots i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.frame-dots i:nth-child(1) { background: #ff5f57; }
.frame-dots i:nth-child(2) { background: #febc2e; }
.frame-dots i:nth-child(3) { background: #28c840; }
.frame-url {
  flex: 1; max-width: 320px; margin: 0 auto; height: 24px; border-radius: 7px;
  background: #fff; border: 1px solid #e1e7f0; display: flex; align-items: center; gap: 6px;
  padding: 0 10px; font-size: 12px; color: var(--faint); font-family: var(--font-body);
}
.frame-url .material-icons { font-size: 13px; color: #2faf6a; }

/* ---------- app toolbar (matches mat-toolbar primary) ---------- */
.app-tb {
  display: flex; align-items: center; gap: 12px;
  height: 52px; padding: 0 16px;
  background: linear-gradient(100deg, var(--blue-deep), var(--blue));
  color: #fff;
}
.app-tb .logo { display: flex; align-items: center; gap: 9px; }
.app-tb .logo .badge { width: 28px; height: 28px; border-radius: 8px; background: #fff; overflow: hidden; }
.app-tb .logo .badge img { width: 100%; height: 100%; object-fit: cover; }
.app-tb .logo b { font-family: var(--font-display); font-weight: 800; font-size: 16px; letter-spacing: -.02em; }
.app-tb .sp { flex: 1; }
.app-tb .tb-ico { width: 32px; height: 32px; border-radius: 8px; background: rgba(255,255,255,.14); display: grid; place-items: center; position: relative; }
.app-tb .tb-ico .material-icons { font-size: 18px; }
.app-tb .tb-ico .bdg { position: absolute; top: -4px; right: -4px; background: var(--orange); color: #fff; font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; font-family: var(--font-body); }
.app-tb .who { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.app-tb .who b { font-size: 13px; font-weight: 500; }
.app-tb .who span { font-size: 10.5px; opacity: .7; }
.app-tb .avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(140deg,#ff8a52,#e85d22); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 13px; }

/* ---------- STUDY VIEW ---------- */
.study {
  background: radial-gradient(120% 100% at 50% -10%, #eaf1fc 0%, #f6f8fc 55%);
  padding: 26px 22px 24px; display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.study-top { width: 100%; display: flex; align-items: center; justify-content: space-between; }
.study-deck { display: flex; align-items: center; gap: 9px; }
.study-deck .material-icons { color: var(--blue); font-size: 19px; }
.study-deck b { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.study-deck .dir { font-size: 11px; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; font-weight: 500; }
.study-prog { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); font-weight: 500; }
.study-prog .bar { width: 120px; height: 6px; border-radius: 6px; background: #e0e8f3; overflow: hidden; }
.study-prog .bar i { display: block; height: 100%; width: 64%; border-radius: 6px; background: linear-gradient(90deg, var(--cyan), var(--blue)); }

/* 3D flip card */
.flip { perspective: 1600px; width: min(340px, 78%); }
.flip-inner {
  position: relative; width: 100%; aspect-ratio: 5/3.2; transform-style: preserve-3d;
  transition: transform .9s var(--ease); transform: rotateY(0deg);
}
.flip.flipped .flip-inner { transform: rotateY(180deg); }
.flip-face {
  position: absolute; inset: 0; backface-visibility: hidden; border-radius: 18px;
  background: #fff; border: 1px solid #e3e9f2; box-shadow: 0 18px 40px rgba(20,40,90,.16);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 22px;
}
.flip-face .tag { position: absolute; top: 12px; left: 14px; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.flip-face .speak { position: absolute; top: 10px; right: 12px; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--cyan-wash); color: var(--cyan); }
.flip-face .speak .material-icons { font-size: 17px; }
.flip-front .word { font-family: var(--font-display); font-weight: 700; font-size: 34px; color: var(--ink); letter-spacing: -.02em; }
.flip-front .pos { font-size: 12.5px; color: var(--orange); font-weight: 600; }
.flip-back { transform: rotateY(180deg); background: linear-gradient(160deg,#fff, #f4f8ff); }
.flip-back .word { font-family: var(--font-display); font-weight: 700; font-size: 30px; color: var(--blue-deep); }
.flip-back .ex { font-size: 12.5px; color: var(--muted); text-align: center; font-style: italic; max-width: 230px; }
.flip-hint { font-size: 11.5px; color: var(--faint); display: flex; align-items: center; gap: 5px; }
.flip-hint .material-icons { font-size: 14px; }

/* FSRS rating row */
.fsrs { display: flex; gap: 9px; width: min(360px, 84%); }
.fsrs button {
  flex: 1; border: none; border-radius: 11px; padding: 9px 4px 8px; cursor: default;
  display: flex; flex-direction: column; align-items: center; gap: 1px; font-family: var(--font-display);
}
.fsrs button b { font-size: 13.5px; font-weight: 700; }
.fsrs button span { font-size: 10px; opacity: .85; font-family: var(--font-body); }
.fsrs .again { background: #fdecec; color: #c0392b; }
.fsrs .hard  { background: #fdf1e3; color: #cf7a16; }
.fsrs .good  { background: #e8f6ee; color: #1e8f54; }
.fsrs .easy  { background: var(--blue-wash); color: var(--blue); }

/* ---------- EDITOR (symmetric Side A / Side B) ---------- */
.editor { background: var(--mist); padding: 16px; }
.editor-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.editor-head .ttl { font-family: var(--font-display); font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.editor-head .ttl .material-icons { color: var(--blue); font-size: 19px; }
.saved { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: #1e8f54; font-weight: 600; background: #e8f6ee; padding: 4px 10px; border-radius: 999px; }
.saved .material-icons { font-size: 14px; }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.side { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 13px; }
.side-lbl { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 9px; display: flex; align-items: center; gap: 6px; }
.side-lbl.a { color: var(--blue); }
.side-lbl.b { color: var(--cyan); }
.side-lbl .chip { font-family: var(--font-body); font-weight: 600; }
.mini-tools { display: flex; gap: 5px; margin-bottom: 9px; }
.mini-tools i { width: 25px; height: 25px; border-radius: 7px; background: var(--mist); display: grid; place-items: center; color: var(--muted); }
.mini-tools i .material-icons { font-size: 15px; }
.field { font-size: 18px; font-family: var(--font-display); font-weight: 600; color: var(--ink); }
.field.sub { font-size: 13px; font-family: var(--font-body); font-weight: 400; color: var(--muted); margin-top: 6px; }
.cloze { background: linear-gradient(transparent 60%, #ffe6b3 60%); padding: 0 2px; border-radius: 3px; color: var(--ink); }
.editor-foot { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.efoot-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; color: var(--ink-2); background: #fff; border: 1px solid var(--line); padding: 6px 11px; border-radius: 999px; }
.efoot-chip .material-icons { font-size: 14px; color: var(--blue); }

/* ---------- LIBRARY (folders) ---------- */
.lib { background: #fff; padding: 16px; }
.lib-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.lib-head .ttl { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.lib-modes { display: flex; background: var(--mist); border-radius: 9px; padding: 3px; gap: 2px; }
.lib-modes span { font-size: 11.5px; font-weight: 600; padding: 5px 12px; border-radius: 7px; color: var(--muted); }
.lib-modes span.on { background: #fff; color: var(--blue); box-shadow: var(--shadow-sm); }
.lib-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.folder { border: 1px solid var(--line); border-radius: 13px; padding: 13px; background: #fff; transition: transform .18s var(--ease), box-shadow .18s; }
.folder:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.folder-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #fff; margin-bottom: 10px; }
.folder-ic .material-icons { font-size: 24px; }
.folder b { display: block; font-family: var(--font-display); font-weight: 600; font-size: 14px; }
.folder span { font-size: 11.5px; color: var(--faint); }
.folder .meter { height: 5px; border-radius: 5px; background: #eef2f8; margin-top: 9px; overflow: hidden; }
.folder .meter i { display: block; height: 100%; border-radius: 5px; }

/* ---------- WORD MATCHER game ---------- */
.game { background: linear-gradient(160deg,#10204a,#1f2f63); padding: 18px; color: #fff; }
.game-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.game-head .ttl { font-family: var(--font-display); font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.game-head .ttl .material-icons { color: var(--cyan-soft); }
.game-score { font-size: 12px; background: rgba(255,255,255,.12); padding: 4px 12px; border-radius: 999px; font-weight: 600; }
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 38px; position: relative; }
.match .tile {
  background: rgba(255,255,255,.08); border: 1.5px solid rgba(255,255,255,.16); border-radius: 11px;
  padding: 12px 14px; font-family: var(--font-display); font-weight: 600; font-size: 14px;
  display: flex; align-items: center; justify-content: space-between;
}
.match .tile.matched { border-color: #36d39e; background: rgba(54,211,158,.16); }
.match .tile.sel { border-color: var(--cyan-soft); background: rgba(111,208,234,.18); }
.match .tile .material-icons { font-size: 16px; color: #36d39e; }
.match .tile.sel .material-icons { color: var(--cyan-soft); }

/* ---------- AI LINGUISTIC breakdown ---------- */
.ling { background: #fff; padding: 18px; }
.ling-card { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.ling-top { background: linear-gradient(120deg, var(--blue-wash), var(--cyan-wash)); padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.ling-top .w { font-family: var(--font-display); font-weight: 700; font-size: 24px; }
.ling-top .gender { font-size: 11px; font-weight: 700; background: var(--orange); color: #fff; padding: 3px 9px; border-radius: 999px; }
.ling-top .ai { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--blue); }
.ling-top .ai .material-icons { font-size: 15px; }
.ling-rows { padding: 6px 16px 14px; }
.ling-row { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.ling-row:last-child { border-bottom: 0; }
.ling-row .k { width: 96px; color: var(--faint); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; flex: none; padding-top: 1px; }
.ling-row .v { color: var(--ink-2); }
.ling-row .v .pos-tag { background: var(--blue-wash); color: var(--blue); font-weight: 600; padding: 1px 7px; border-radius: 6px; font-size: 12px; }

/* ---------- ANALYTICS ---------- */
.analytics { background: #fff; padding: 18px; }
.an-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 14px; }
.an-stat { background: var(--mist); border-radius: 12px; padding: 12px 14px; }
.an-stat b { font-family: var(--font-display); font-size: 22px; font-weight: 700; display: block; letter-spacing: -.02em; }
.an-stat span { font-size: 11px; color: var(--muted); font-weight: 500; }
.an-chart { border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.an-chart .lg { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.an-chart .lg b { font-family: var(--font-display); font-size: 13px; }
.an-chart .lg span { font-size: 11px; color: var(--faint); }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 92px; }
.bars .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; height: 100%; }
.bars .col i { width: 100%; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, var(--cyan), var(--blue)); display: block; }
.bars .col em { font-size: 9.5px; color: var(--faint); text-align: center; font-style: normal; }

@media (max-width: 560px) {
  .sides { grid-template-columns: 1fr; }
  .lib-grid { grid-template-columns: 1fr 1fr; }
}
