/*
 * Word Counter Tool UI
 * Clean, modern, premium light theme.
 */

:root{
  /* Match the Maminur site palette (soft mint bg + emerald accent) */
  --wct-bg: #EAF8F0;
  --wct-bg2: #F3FEF8;
  --wct-surface: #FFFFFF;
  --wct-border: #DDEDE3;
  --wct-text: #111827;
  --wct-muted: #6B7280;
  --wct-primary: #60D586;
  --wct-primary-2: #4DAA6B;
  --wct-black: #0B0F19;
  --wct-shadow: 0 18px 40px rgba(15, 23, 42, 0.10);
  --wct-shadow-sm: 0 10px 28px rgba(15, 23, 42, 0.08);
  --wct-radius: 18px;
}

.wct-shell{
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Arial, "Noto Sans";
  color: var(--wct-text);
}

.wct-shell, .wct-shell *{ box-sizing: border-box; }

.wct-shell{
  width: 100%;
  background: linear-gradient(135deg, var(--wct-bg) 0%, var(--wct-bg2) 100%);
  border: 1px solid var(--wct-border);
  border-radius: calc(var(--wct-radius) + 10px);
  padding: 18px;
  box-shadow: var(--wct-shadow-sm);
}

.wct-layout{
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 18px;
  align-items: stretch;
}

.wct-editor{
  background-color: var(--wct-surface);
  border: 1px solid var(--wct-border);
  border-radius: var(--wct-radius);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.wct-editorInner{
  position: relative;
  padding: 14px;
}

.wct-textarea{
  width: 100%;
  min-height: 430px;
  border: 1px solid rgba(221, 237, 227, 0.0);
  outline: none;
  resize: none;
  /* Extra room so the floating icon buttons never clash with the scrollbar */
  padding: 16px 78px 16px 16px;
  border-radius: 14px;
  font-size: 16px;
  line-height: 1.75;
  color: var(--wct-text);
  background: #fff;
}

.wct-textarea:focus{
  box-shadow: 0 0 0 4px rgba(96, 213, 134, 0.18);
  border-color: rgba(96, 213, 134, 0.42);
}

.wct-textarea::placeholder{ color: #9CA3AF; }

.wct-iconBtn{
  appearance: none;
  border: 1px solid var(--wct-border);
  background-color: var(--wct-surface);
  color: #111827;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
  transition: transform .08s ease, box-shadow .12s ease, border-color .12s ease;
}

/* Icon visibility fix (theme-agnostic): force our icons to render even if the theme overrides SVG/pseudo elements) */
.wct-shell .wct-iconBtn::before,
.wct-shell .wct-iconBtn::after{
  content: none !important;
}

.wct-shell .wct-iconBtn svg{
  display: none !important;
}

.wct-shell .wct-iconBtn{
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
}

.wct-shell .wct-iconBtn--top{
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20fill='%23111827'%20d='M9%203h6l1%202h4v2H4V5h4l1-2Zm1%207h2v9h-2v-9Zm4%200h2v9h-2v-9ZM7%2010h2v9H7v-9Zm-1%2011h12a2%202%200%200%200%202-2V9H4v10a2%202%200%200%200%202%202Z'/%3E%3C/svg%3E") !important;
}

.wct-shell .wct-iconBtn--bottom{
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20fill='%23111827'%20d='M16%201H6a2%202%200%200%200-2%202v12h2V3h10V1Zm2%204H10a2%202%200%200%200-2%202v14a2%202%200%200%200%202%202h8a2%202%200%200%200%202-2V7a2%202%200%200%200-2-2Zm0%2016H10V7h8v14Z'/%3E%3C/svg%3E") !important;
}


/*
 * Important: do NOT use `background:` shorthand here.
 * Shorthand resets background-image and would hide our theme-proof icons on hover.
 */
.wct-shell .wct-iconBtn:hover,
.wct-shell .wct-iconBtn:focus,
.wct-shell .wct-iconBtn:focus-visible{
  border-color: rgba(96, 213, 134, 0.55) !important;
  background-color: rgba(96, 213, 134, 0.10) !important;
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.10) !important;
  outline: none !important;
}

.wct-shell .wct-iconBtn:active{
  transform: translateY(1px);
  border-color: rgba(96, 213, 134, 0.65) !important;
  background-color: rgba(96, 213, 134, 0.16) !important;
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.10) !important;
}

/* Prevent theme active/visited colors from bleeding in */
.wct-shell .wct-iconBtn{
  filter: none !important;
}

.wct-iconBtn--top{
  position: absolute;
  top: 22px;
  right: 32px;
}

.wct-iconBtn--bottom{
  position: absolute;
  right: 32px;
  bottom: 22px;
}

.wct-toast{
  position: absolute;
  right: 70px;
  bottom: 28px;
  background: #111827;
  color: #fff;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity .14s ease, transform .14s ease;
}

.wct-toast.is-visible{ opacity: 1; transform: translateY(0); }

.wct-stats{
  background-color: var(--wct-surface);
  border: 1px solid var(--wct-border);
  border-radius: var(--wct-radius);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.wct-statsTop{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: 16px 16px 12px;
}

.wct-metric{
  padding: 6px 8px;
}

.wct-metricValue{
  font-size: 26px;
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--wct-black);
}

.wct-metricLabel{
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--wct-muted);
}

.wct-divider{
  height: 1px;
  background: var(--wct-border);
}

.wct-kv{
  padding: 14px 16px 6px;
}

.wct-kvRow{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
}

.wct-kvKey{
  font-size: 14px;
  font-weight: 600;
  color: var(--wct-text);
}

.wct-kvVal{
  font-size: 14px;
  font-weight: 800;
  color: var(--wct-black);
}

.wct-settings{
  margin-top: auto;
  border-top: 1px solid var(--wct-border);
  padding: 14px 16px 16px;
  background: linear-gradient(180deg, #FFFFFF 0%, #FBFFFD 100%);
}

.wct-formRow{ margin-bottom: 12px; }

.wct-formRow--inline{
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 10px;
  align-items: center;
}

.wct-label{ font-size: 13px; font-weight: 700; color: var(--wct-text); }

.wct-input{
  width: 100%;
  border: 1px solid var(--wct-border);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 700;
  color: var(--wct-text);
  background: #fff;
}

.wct-input:focus{
  outline: none;
  box-shadow: 0 0 0 4px rgba(96, 213, 134, 0.16);
  border-color: rgba(96, 213, 134, 0.42);
}

.wct-note{ display:block; margin-top: 6px; font-size: 12px; color: var(--wct-muted); }

.wct-switch{
  display: inline-flex;
  align-items: center;
  gap: 12px;
  user-select: none;
}

.wct-switch input{ position: absolute; opacity: 0; }

.wct-switchUi{
  width: 44px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--wct-border);
  background: #F3F4F6;
  position: relative;
  transition: background .14s ease, border-color .14s ease;
}

.wct-switchUi:after{
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  position: absolute;
  top: 50%;
  left: 3px;
  transform: translateY(-50%);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.10);
  transition: left .14s ease;
}

.wct-switch input:checked + .wct-switchUi{
  background: rgba(96, 213, 134, 0.18);
  border-color: rgba(96, 213, 134, 0.48);
}

.wct-switch input:checked + .wct-switchUi:after{ left: 23px; }

.wct-switchText{ font-size: 13px; font-weight: 700; color: var(--wct-text); }

.wct-saveBtn.button{
  background: #111827;
  border-color: #111827;
  color: #fff;
  font-weight: 800;
  border-radius: 999px;
  padding: 10px 18px;
  box-shadow: 0 16px 30px rgba(17, 24, 39, 0.18);
}

.wct-saveBtn.button:hover{ background: #0B1220; border-color: #0B1220; }

.wct-miniNote{
  padding: 12px 16px 16px;
  color: var(--wct-muted);
  font-size: 12px;
}

.wct-admin .wct-shell{ max-width: 1200px; }

.wct-footnote{ margin: 10px 0 0; color: var(--wct-muted); }

@media (max-width: 980px){
  .wct-layout{ grid-template-columns: 1fr; }
  .wct-textarea{ min-height: 260px; }
}

@media (max-width: 560px){
  .wct-shell{ padding: 14px; }
  .wct-statsTop{ grid-template-columns: repeat(2, 1fr); row-gap: 10px; }
  .wct-metricValue{ font-size: 24px; }
  /* Keep icons away from textarea scrollbar on mobile */
  .wct-iconBtn--top{ top: 18px; right: 26px; }
  .wct-iconBtn--bottom{ right: 26px; bottom: 18px; }
  .wct-textarea{ padding-right: 70px; }
}
