/* Extracted CSS from trainer2.php */

:root{
  --bg:#020617;
  --panel:#0b1120;
  --accent:#0ea5e9;
  --text:#e5e7eb;
  --muted:#9ca3af;
  --good:#4ade80;
  --bad:#f97373;
  --whatsapp:#25D366;
}

*{
  box-sizing:border-box;
  -webkit-tap-highlight-color:transparent;
}

body{
  margin:0;
  min-height:100vh;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-start;
  background:radial-gradient(circle at top,#111827 0,#020617 55%,#000 100%);
  color:var(--text);
  font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
  padding:16px 16px 40px;
}

@media (min-height:900px){
  body{justify-content:center}
}

.card{
  background:var(--panel);
  padding:20px 18px 18px;
  border-radius:24px;
  width:100%;
  max-width:780px;
  text-align:center;
  box-shadow:0 24px 60px rgba(15,23,42,.85),0 0 0 1px rgba(148,163,184,.25);
  position:relative;
  z-index:2;
}

.header-row{
  display:flex;
  justify-content:center;
  align-items:center;
  margin-bottom:8px;
}

.trainer-header{text-align:center;margin-bottom:10px;}
.trainer-title{font-size:.8rem;letter-spacing:.12em;text-transform:uppercase;color:var(--muted);}
.trainer-subtitle{font-size:1.05rem;font-weight:600;}

/* NEW: pack title under AI Pronunciation Trainer */
.trainer-pack-title{
  font-size:.9rem;
  margin-top:2px;
  color:var(--text);
}

.translation{
  font-size:.86rem;
  color:var(--muted);
  margin-top:4px;
  min-height:1.1em;
}

.status-strip{
  margin-top:6px;
  font-size:.78rem;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  color:var(--muted);
}

.status-dot{
  width:8px;
  height:8px;
  border-radius:999px;
  background:#22c55e;
}

.status-strip.ready .status-dot{background:#22c55e;}
.status-strip.playing .status-dot{background:#38bdf8;}
.status-strip.recording .status-dot{background:#f97373;}
status-strip.evaluating .status-dot{background:#eab308;}

.phrase{
  font-size:2.1rem;
  margin:6px 0 4px;
  font-weight:600;
  transition:color .15s,text-shadow .15s;
}

.phrase.good{
  color:var(--good);
  text-shadow:0 0 18px rgba(74,222,128,.7);
}

.phrase.bad{
  color:var(--bad);
  text-shadow:0 0 12px rgba(248,113,113,.6);
}

/* Heard box */
.heard-box{
  margin-top:14px;
  text-align:left;
  padding:10px 12px;
  border-radius:16px;
  background:#020617;
  border:1px solid rgba(148,163,184,.4);
  font-size:.9rem;
}

.heard-label{
  font-size:.78rem;
  color:var(--muted);
  margin-bottom:4px;
  font-weight:600;
}

.heard-text{
  min-height:1.6em;
  padding:6px 8px;
  border-radius:10px;
  background:#020617;
  border:1px solid rgba(148,163,184,.25);
  font-size:.9rem;
}

/* ============================
   SCORE SECTION — CLEAN + FIXED
   ============================ */

.score{
  font-size:.8rem;
  margin-top:6px;
  color:var(--muted);
}

.score span{
  font-weight:600;
  color:var(--text);
}

.score span.good-score{
  color:var(--good);
}

.score span.bad-score{
  color:var(--bad);
}

/* Bar container */
.score-bar{
  margin-top:4px;
  height:4px;
  border-radius:999px;
  background:rgba(148,163,184,.3);
  overflow:hidden;
}

/* Bar fill — JS toggles .good / .bad */
#scoreBarFill{
  height:100%;
  width:0%;
  background:var(--bad);
  transition:width .18s ease-out, background-color .18s ease-out;
}

#scoreBarFill.good{
  background:var(--good) !important;
}

#scoreBarFill.bad{
  background:var(--bad) !important;
}

/* Round Scores */
.round-scores{
  margin-top:8px;
  font-size:.78rem;
  color:var(--muted);
  text-align:left;
}

.round-scores ul{
  margin:4px 0 0;
  padding-left:18px;
}

.round-scores .good-item{color:var(--good);}
.round-scores .bad-item{color:var(--bad);}

.heard-mistake{color:var(--bad);text-decoration:underline;}
.heard-repeat{color:var(--muted);font-style:italic;font-size:.8em;}

.buttons{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-top:14px;
}

.nav-row{
  display:flex;
  flex-direction:row;
  gap:10px;
  margin-top:10px;
}

.nav-row .small-nav{
  width:100%;
  flex:1 1 0;
  padding:14px;
  font-size:1rem;
}

.mode-toggle{
  display:flex;
  justify-content:center;
  gap:8px;
}

.mode-toggle button{
  flex:1;
  padding:12px;
  font-size:.9rem;
  border-radius:999px;
  border:1px solid rgba(148,163,184,.4);
  background:#111827;
  color:var(--text);
  box-shadow:none;
}

.mode-toggle button.active{
  background:var(--accent);
  color:#0b1120;
  border-color:var(--accent);
}

.mode-description{
  margin-top:4px;
  font-size:.78rem;
  color:var(--muted);
  text-align:left;
}

button{
  width:100%;
  border:none;
  border-radius:999px;
  padding:14px 16px;
  font-size:1rem;
  font-weight:500;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  background:var(--accent);
  color:#0b1120;
  box-shadow:0 14px 30px rgba(14,165,233,.4);
  transition:transform .06s,box-shadow .06s,opacity .1s;
}

button.tertiary{
  background:#111827;
  color:var(--text);
  box-shadow:none;
  border:1px solid rgba(148,163,184,.4);
}

button.small{
  font-size:.8rem;
  padding:10px 14px;
  width:auto;
}

button:active{
  transform:translateY(1px) scale(.99);
  box-shadow:0 6px 16px rgba(15,23,42,.8);
}

button[disabled]{
  opacity:.45;
  cursor:not-allowed;
  box-shadow:none;
}

.side-column-header{
  font-size:.8rem;
  color:var(--muted);
  margin-bottom:4px;
  text-align:left;
  text-transform:uppercase;
  letter-spacing:.08em;
}

.panel-buttons-row{
  display:flex;
  gap:0;
  border-bottom:1px solid rgba(148,163,184,.3);
  margin-bottom:4px;
}

.panel-buttons-row button.small{
  flex:1;
  border-radius:0;
  border:none;
  border-bottom:2px solid transparent;
  justify-content:center;
  font-size:.8rem;
  padding:8px 6px;
  background:#0b1120;
}

.panel-buttons-row button.small.tab-active{
  border-bottom-color:var(--accent);
  background:#020617;
}

.progress-panel{
  margin-top:6px;
  padding-top:6px;
  font-size:.78rem;
  text-align:left;
  display:none;
  max-height:260px;
  overflow:auto;
}

.progress-panel h2{
  margin:0 0 4px;
  font-size:.9rem;
}

.progress-summary{
  margin-bottom:6px;
  color:var(--muted);
}

.progress-summary strong{color:var(--text);}
.progress-list ul{margin:0;padding-left:18px;}
.progress-item.mastered{color:var(--good);}
.progress-item .label{font-weight:500;}

#settingsView{text-align:left;}
#settingsView h2{margin:6px 0 8px;font-size:1.1rem;}
#settingsBackBtn{margin-top:10px;}

.ad-container{
  width:100%;
  max-width:780px;
  margin:20px auto 10px;
  padding:8px 0 4px;
  text-align:center;
}

.ad-label{
  font-size:.75rem;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.12em;
  margin-bottom:4px;
}

#confettiCanvas{
  position:fixed;
  inset:0;
  width:100%;
  height:100%;
  pointer-events:none;
  z-index:9999;
}

#playError{
  display:none;
  margin-top:8px;
  font-size:.8rem;
  color:#fee2e2;
  background:#7f1d1d;
  padding:6px 10px;
  border-radius:999px;
  inline-size:max-content;
  margin-inline:auto;
}

#playCurrentBtn.playing{
  background:#22c55e;
  color:#0b1120;
  box-shadow:0 0 0 2px rgba(34,197,94,.5);
}

.mastered-toggle{
  margin-top:4px;
  display:flex;
  align-items:center;
  gap:8px;
  font-size:.8rem;
  color:var(--muted);
  justify-content:center;
}

.mastered-toggle input{
  accent-color:var(--accent);
}

#settingsView .lang-row{
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px 12px;
  margin:10px 0;
  background:#0b1120;
  border:1px solid rgba(148,163,184,.35);
  border-radius:16px;
}

#settingsView .lang-row > span{
  flex:0 0 auto;
  font-size:.9rem;
  color:var(--muted);
}

#settingsView select{
  flex:1 1 auto;
  min-width:180px;
  padding:10px 40px 10px 12px;
  font-size:.95rem;
  color:var(--text);
  background:linear-gradient(#0b1120,#0b1120) padding-box,
             linear-gradient(to right,rgba(148,163,184,.45),rgba(148,163,184,.15)) border-box;
  border:1px solid rgba(148,163,184,.35);
  border-radius:12px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04);
  outline:none;
  appearance:none;
  -webkit-appearance:none;
  cursor:pointer;
  transition:border-color .15s,box-shadow .15s,background-color .15s;
  background-repeat:no-repeat;
  background-position:right 12px center;
}

#settingsView select:hover{
  border-color:rgba(148,163,184,.6);
}

#settingsView select:focus{
  border-color:var(--accent);
  box-shadow:0 0 0 3px rgba(14,165,233,.22);
}

#settingsView select:disabled{
  opacity:.6;
  cursor:not-allowed;
}

#settingsView .settings-section{
  margin-top:12px;
  padding-top:8px;
  border-top:1px dashed rgba(148,163,184,.25);
}

#settingsView .setting-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px;
  margin:10px 0;
  background:#0b1120;
  border:1px solid rgba(148,163,184,.35);
  border-radius:16px;
}

#settingsView .setting-item > div > div{
  font-weight:600;
  font-size:.95rem;
}

#settingsView .setting-item small{
  color:var(--muted);
}

#settingsView .switch{
  position:relative;
  display:inline-flex;
  width:54px;
  height:30px;
  flex:0 0 auto;
}

#settingsView .switch input{
  opacity:0;
  width:0;
  height:0;
}

#settingsView .switch .slider{
  position:absolute;
  inset:0;
  background:#111827;
  border:1px solid rgba(148,163,184,.35);
  border-radius:999px;
  transition:background-color .2s,border-color .2s,box-shadow .2s;
}

#settingsView .switch .slider::before{
  content:"";
  position:absolute;
  width:22px;
  height:22px;
  left:4px;
  top:50%;
  transform:translateY(-50%);
  background:#9ca3af;
  border-radius:50%;
  box-shadow:0 1px 2px rgba(0,0,0,.35);
  transition:transform .22s cubic-bezier(.4,0,.2,1),
             background-color .2s;
}

#settingsView .switch input:checked + .slider{
  background:var(--accent);
  border-color:var(--accent);
  box-shadow:inset 0 0 0 2px rgba(11,17,32,.35);
}

#settingsView .switch input:checked + .slider::before{
  transform:translate(24px,-50%);
  background:#0b1120;
}

#settingsBackBtn{width:100%;margin-top:12px;}

@media (max-width:420px){
  #settingsView .lang-row{flex-direction:column;align-items:stretch;}
  #settingsView .lang-row > span{font-size:.85rem;}
}

/* Device links */
.device-links{
  display:flex;
  gap:10px;
  justify-content:center;
  flex-wrap:wrap;
  margin:6px 0 12px;
}

.device-btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 14px;
  border-radius:999px;
  font-weight:600;
  text-decoration:none;
  border:1px solid rgba(148,163,184,.35);
}

.device-btn.android{
  background:var(--accent);
  color:#0b1120;
}

.device-btn.ios{
  background:#111827;
  color:var(--text);
}

.device-note{
  color:var(--muted);
  font-size:.8rem;
  margin-top:4px;
}

.device-btn:focus{
  outline:2px solid var(--accent);
  outline-offset:2px;
}

/* How-to pill */
.help-wrap{
  display:flex;
  justify-content:center;
  margin-bottom:6px;
}

.help-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  background:#111827;
  color:var(--text);
  border:1px solid rgba(148,163,184,.35);
  font-weight:600;
  font-size:.9rem;
  text-decoration:none;
}

.help-pill:focus{
  outline:2px solid var(--accent);
  outline-offset:2px;
}

/* Hold Record Button */
#holdRecordBtn.recording-ready{
  background:#ef4444;
  color:#ffffff;
  box-shadow:0 0 0 2px rgba(248,113,113,.55);
}

.clip-container{
  margin-top:10px;
  display:flex;
  flex-direction:column;
  gap:6px;
  align-items:stretch;
}

.clip-container video{
  width:100%;
  max-height:200px;
  border-radius:16px;
  background:#000;
  display:block;
}

.clip-controls{
  display:flex;
  gap:8px;
  justify-content:flex-end;
}

.clip-controls .active{
  box-shadow:0 0 0 2px rgba(14,165,233,.6);
}

/* Hide buttons for now while JS still uses them internally */
#wordModeBtn{display:none !important;}
#sentenceModeBtn{display:none !important;}
#random5Btn{display:none !important;}

:root{
  --bg:#020617;
  --accent:#0ea5e9;
  --text:#e5e7eb;
  --whatsapp:#25D366;
}

.tlc-footer{
  margin:60px auto 40px;
  display:grid;
  gap:12px;
  justify-items:center;
  text-align:center;
  max-width:720px;
}

.tlc-footer a, .tlc-footer button{
  font:600 16px/1.1 system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
  text-decoration:none;
  color:var(--text);
}

.tlc-btn{
  width:100%;
  max-width:400px;
  text-align:center;
  padding:12px 16px;
  border-radius:14px;
  border:none;
  cursor:pointer;
}

.tlc-btn.whatsapp{
  background:var(--whatsapp);
  color:#001b08;
}

.tlc-btn.email,
.tlc-btn.home{
  background:var(--accent);
  color:#001018;
}

.tlc-link{
  text-align:center;
  opacity:.9;
}

.tlc-link a{
  color:var(--accent);
}

.site-copyright{
  margin-top:40px;
  text-align:center;
  color:#9ca3af;
  font-size:0.8rem;
}
