/* Elite Typing — Style v3.0.0 */

/* ══ LIGHT THEME ══ */
.itt-wrap[data-theme="light"] {
  --bg:      #f0f4f9;
  --surface: #ffffff;
  --surface2:#f1f5f9;
  --text:    rgba(19,52,59,1);
  --muted:   rgba(75,85,99,1);
  --accent:  rgba(33,128,141,1);
  --accent-h:rgba(29,116,128,1);
  --accent-lt:rgba(33,128,141,.12);
  --border:  rgba(156,163,175,.4);
  --btn-bg:  #ffffff;
  --btn-hover:rgba(241,245,249,1);
  --focus:   rgba(33,128,141,.4);
  --shadow:  0 4px 16px rgba(0,0,0,.10);
  --modal-ov:rgba(0,0,0,.5);
}

/* ══ DARK THEME ══ */
.itt-wrap[data-theme="dark"] {
  --bg:      rgba(31,33,33,1);
  --surface: rgba(38,40,40,1);
  --surface2:rgba(119,124,124,.15);
  --text:    rgba(245,245,245,1);
  --muted:   rgba(167,169,169,.7);
  --accent:  rgba(50,184,198,1);
  --accent-h:rgba(45,166,178,1);
  --accent-lt:rgba(50,184,198,.12);
  --border:  rgba(119,124,124,.3);
  --btn-bg:  rgba(38,40,40,1);
  --btn-hover:rgba(119,124,124,.2);
  --focus:   rgba(50,184,198,.4);
  --shadow:  0 4px 20px rgba(0,0,0,.4);
  --modal-ov:rgba(0,0,0,.7);
}

/* ══ BASE ══ */
.itt-wrap {
  all: unset;
  display: block;
  background: var(--bg);
  color: var(--text);
  font-family: 'Arial', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: background .3s, color .3s;
}
.itt-wrap *, .itt-wrap *::before, .itt-wrap *::after { box-sizing: border-box; }

/* ══ THEME TOGGLE (toolbar) ══ */
.itt-theme-toggle {
  all: unset; cursor: pointer;
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 5px;
  color: var(--text);
  font-size: 1.1rem;
  transition: background .15s;
}
.itt-theme-toggle:hover { background: var(--btn-hover); }

/* ══ TOOLBAR ══ */
.itt-toolbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  position: relative;
}
.itt-toolbar-scroll { display: contents; }
.itt-toolbar-static { display: contents; }
.itt-tb-group { display: flex; gap: 5px; align-items: center; }

.itt-tb-btn {
  all: unset; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
  font-family: inherit;
  transition: background .15s, color .15s, border-color .15s;
}
.itt-tb-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.itt-tb-btn:active { transform: scale(.97); }

.itt-tb-select {
  all: unset; cursor: pointer;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}
.itt-tb-select-sm { width: 70px; }

.itt-scroll-hint { display: none; }

.itt-lang-wrapper {
  border-left: 1px solid var(--border);
  padding-left: 10px;
  margin-left: 5px;
}
.itt-lang-indicator {
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  display: none;
  padding: 2px 6px;
  border: 1px solid var(--accent);
  border-radius: 4px;
}
.itt-lang-indicator.active { display: block; }

/* ══ EDITOR ══ */
.itt-editor-container { position: relative; }
.itt-editor {
  all: unset;
  display: block; width: 100%;
  padding: 20px;
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--surface);
  resize: vertical;
  min-height: 400px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-y: auto;
  caret-color: var(--accent);
  border-bottom: 1px solid var(--border);
}
.itt-editor::placeholder { color: var(--muted); opacity: .8; }
.itt-editor:focus { outline: none; box-shadow: 0 0 0 2px var(--focus) inset; }

/* ══ SUGGESTION BOX ══ */
.itt-suggestion-box {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 4px;
  box-shadow: var(--shadow);
  z-index: 99999;
  display: none;
  min-width: 150px;
  overflow: hidden;
  font-family: inherit;
}
.itt-sug-item {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
  font-size: 15px;
  transition: background .1s;
}
.itt-sug-item:last-child { border-bottom: none; }
.itt-sug-item.selected,
.itt-sug-item:hover { background: var(--accent); color: #fff; }
.itt-sug-num {
  font-size: 11px;
  opacity: .6;
  margin-left: 10px;
}

/* ══ STATUS BAR ══ */
.itt-statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}
.itt-statusbar-left { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.itt-statusbar-right { display: flex; gap: 5px; flex-wrap: wrap; }
.itt-autosave { opacity: .7; }
.itt-case-btn {
  all: unset; cursor: pointer;
  padding: 4px 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
  color: var(--muted);
  font-family: inherit;
  white-space: nowrap;
  transition: background .12s, color .12s;
}
.itt-case-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ══ READING TIME ══ */
.itt-reading-time {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 14px 16px;
}
.itt-rt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.itt-rt-header h3 { margin: 0; font-size: 14px; color: var(--text); font-weight: 600; }
.itt-rt-display {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--surface2);
  padding: 4px 12px;
  border-radius: 6px;
}
.itt-rt-label { display: block; margin-bottom: 6px; color: var(--text); font-size: 13px; }
.itt-rt-slider { width: 100%; cursor: pointer; accent-color: var(--accent); }
.itt-rt-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* ══ FEATURES ══ */
.itt-features {
  background: var(--surface2);
  border-top: 1px solid var(--border);
}
.itt-features-inner { padding: 32px 20px 28px; }
.itt-features h2 {
  text-align: center;
  margin: 0 0 24px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
.itt-feat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.itt-feat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 16px;
  text-align: center;
  transition: box-shadow .2s;
}
.itt-feat-card:hover { box-shadow: var(--shadow); }
.itt-feat-icon { font-size: 1.8rem; color: var(--accent); display: block; margin-bottom: 8px; }
.itt-feat-card h3 { margin: 0 0 6px; font-size: 14px; color: var(--text); }
.itt-feat-card p  { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }

/* ══ MODALS ══ */
.itt-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--modal-ov);
  z-index: 99999;
  align-items: center;
  justify-content: center;
}
.itt-modal.open { display: flex; }
.itt-modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 90%;
  max-width: 480px;
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
  overflow: hidden;
}
.itt-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}
.itt-modal-close {
  all: unset; cursor: pointer;
  font-size: 1.4rem;
  color: var(--muted);
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}
.itt-modal-close:hover { background: var(--btn-hover); }
.itt-modal-body { padding: 16px 18px; }
.itt-modal-body label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; margin-top: 12px; }
.itt-modal-body label:first-child { margin-top: 0; }
.itt-modal-body p { margin: 0 0 8px; color: var(--text); font-size: 14px; }
.itt-modal-foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
}
.itt-inp {
  all: unset;
  display: block; width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
.itt-inp:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.itt-hint { margin-top: 5px; font-size: 12px; color: var(--muted); }
.itt-btn {
  all: unset; cursor: pointer;
  display: inline-flex; align-items: center;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface2);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  transition: background .13s;
}
.itt-btn:hover { background: var(--btn-hover); }
.itt-btn-primary { background: var(--accent); border-color: var(--accent-h); color: #fff; }
.itt-btn-primary:hover { background: var(--accent-h); }

/* ══ TELEPROMPTER ══ */
.itt-tele-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: #000;
  color: #fff;
  z-index: 999999;
  flex-direction: column;
}
.itt-tele-overlay.active { display: flex; }
.itt-tele-content {
  flex: 1;
  overflow-y: hidden;
  padding: 120px 100px 200px;
  font-size: 32px;
  line-height: 1.6;
  font-family: 'Noto Sans Devanagari', Arial, sans-serif;
  white-space: pre-wrap;
  word-break: break-word;
}
.itt-tele-content.mirror { transform: scaleX(-1); }
.itt-tele-controls {
  background: rgba(25,25,25,.95);
  padding: 14px 20px;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  border-top: 1px solid #333;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 999999;
}
.itt-tele-progress { width: 200px; accent-color: var(--accent,#21808d); }
.itt-tele-btn {
  all: unset; cursor: pointer;
  background: #333; border: 1px solid #555;
  color: #fff; padding: 7px 14px;
  border-radius: 5px; font-size: 14px;
}
.itt-tele-btn:hover { background: #444; }
.itt-tele-slider-group { display: flex; align-items: center; gap: 8px; color: #ccc; font-size: 13px; }
.itt-tele-slider { width: 120px; cursor: pointer; }

/* ══ TOAST ══ */
.itt-toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--accent);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0; transform: translateY(8px);
  transition: opacity .25s, transform .25s;
  pointer-events: none;
  z-index: 999999;
}
.itt-toast.show { opacity: 1; transform: translateY(0); }

/* ══ RESPONSIVE — TABLET ══ */
@media (max-width: 900px) {
  .itt-toolbar { padding: 6px 8px; gap: 5px; }
}

/* ══ RESPONSIVE — MOBILE ══ */
@media (max-width: 768px) {
  /* Toolbar scrolls horizontally */
  .itt-toolbar {
    display: block;
    padding: 0;
    overflow: hidden;
    position: relative;
  }
  .itt-toolbar-scroll {
    display: flex;
    overflow-x: auto;
    padding: 8px 10px;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    height: 50px;
    align-items: center;
    padding-right: 32px;
  }
  .itt-toolbar-scroll::-webkit-scrollbar { display: none; }
  .itt-scroll-hint {
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 13px; right: 0;
    width: 26px; height: 26px;
    background: rgba(255,255,255,.95);
    border: 1px solid var(--border);
    border-right: none;
    border-radius: 4px 0 0 4px;
    box-shadow: -2px 0 6px rgba(0,0,0,.1);
    color: var(--accent);
    font-size: 14px;
    cursor: pointer;
    z-index: 10;
    transition: opacity .3s;
  }
  .itt-wrap[data-theme="dark"] .itt-scroll-hint { background: rgba(50,50,50,.95); }
  @keyframes itt-pulse {
    0%   { opacity:.7; transform:translateX(0); }
    50%  { opacity:1;  transform:translateX(3px); }
    100% { opacity:.7; transform:translateX(0); }
  }
  .itt-scroll-hint span { animation: itt-pulse 2s infinite; display: block; }

  .itt-toolbar-static {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: var(--surface);
  }
  .itt-tb-text { display: none; }
  .itt-lang-wrapper { border-left: none; margin-left: 0; padding-left: 0; }

  /* Editor */
  .itt-editor { padding: 14px; font-size: 15px; }

  /* Status bar */
  .itt-statusbar { flex-direction: column; align-items: flex-start; }

  /* Features */
  .itt-feat-grid { grid-template-columns: 1fr 1fr; }

  /* Modal */
  .itt-modal-box { width: 95%; }

  /* Teleprompter */
  .itt-tele-content { padding: 80px 20px 200px; font-size: 24px; }
  .itt-tele-controls { gap: 8px; padding: 10px; }
  .itt-tele-slider { width: 80px; }
  .itt-tele-progress { width: 100%; order: -1; }
}

@media (max-width: 480px) {
  .itt-feat-grid { grid-template-columns: 1fr; }
  .itt-statusbar-right { display: none; }
}
