:root {
  --primary: #e2e8f0;
  --accent: #60a5fa;
  --bg: #1a1a2e;
  --text: #e2e8f0;
  --container-bg: #1e293b;
  --input-bg: #2c3e50;
  --input-border: #4a5568;
  --definition-border: #60a5fa;
  --error-color: #ef4444;
  --concept-btn: #fd6c3c;
  --concept-btn-hover: #e04c17;
  --concept-section: #2d1407;
  --concept-accent: #ffae68;
  --concept-bg: #251002;
  --compare-btn: #ef4444;
  --compare-btn-hover: #ca1f1f;
  --compare-section: #2b0c10;
  --compare-accent: #fb5858;
  --compare-bg: #22080b;
  --similar-btn: #e75480;
  --similar-btn-hover: #b02d5d;
  --similar-section: #2d0e1c;
  --similar-accent: #ffbfe9;
  --similar-bg: #251225;
  --slideout-bg: #26222e;
  --slideout-border: #a78bfa;
  --slideout-accent: #60a5fa;
  --slideout-width: 325px;
  --slideout-shadow: 0 4px 16px rgba(30,5,70,0.28);
  --slideout-btn: #a78bfa;
  --slideout-btn-hover: #7c3aed;
  --slideout-chip-bg: #343040;
  --slideout-chip-hover: #60a5fa;
  --slideout-chip-text: #fff;
  --slideout-word: var(--slideout-accent);
  --slideout-title: #f0eafc;
  --random-btn: #f59e0b;
  --random-btn-hover: #facc15;
}

body.similar-mode {
  background: var(--similar-bg);
  transition: background 0.5s;
  text-align: center;
}

body.similar-mode .container {
  background: var(--similar-section);
}

.quiz-btn {
  background: #000;
  color: #fff;
  border: 2px solid #a78bfa;
  box-shadow: 0 0 8px rgba(167, 139, 250, 0.4);
  border-radius: 8px;
  min-width: 48px;
  padding: 0.5rem 1rem;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.6em;
  cursor: pointer;
  transition: all 0.3s ease;
}

.quiz-btn:hover {
  background: #1a1a1a;
  box-shadow: 0 0 15px rgba(167, 139, 250, 0.8);
  transform: translateY(-2px);
}

.similar-btn {
  background: var(--similar-btn);
  color: #fff;
  border: none;
  border-radius: 8px;
  min-width: 48px;
  padding: 0.5rem 1rem;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.6em;
  cursor: pointer;
  transition: background 0.3s;
}
similar-btn:hover {
  background: var(--similar-btn-hover);
}

.magic-word-btn {
  background: linear-gradient(90deg, #d946ef 0%, #ec4899 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  min-width: 48px;
  padding: 0.5rem 1rem;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.6em;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3);
}

.magic-word-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(217, 70, 239, 0.4);
}

.magic-word-suggestion-container {
  background: linear-gradient(90deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
  border: 1px solid rgba(139, 131, 250, 0.3);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  margin-top: -1rem; /* Pulls it closer to the search bar */
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}
.magic-word-suggestion-container.visible {
  opacity: 1;
  max-height: 200px;
}

.magic-word-suggestion-container.fade-out {
  animation: fadeOutAndShrink 1s forwards;
}

@keyframes fadeOutAndShrink {
  from {
    opacity: 1;
    max-height: 200px;
    padding-top: 1rem;
    padding-bottom: 1rem;
    margin-top: -1rem;
  }
  to {
    opacity: 0;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
  }
}

.magic-word-suggestion-info {
  flex-grow: 1;
}
.magic-word-suggestion-info .suggestion-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #d8deff;
}
.magic-word-suggestion-info .suggestion-title b {
  color: #fff;
  font-size: 1.3rem;
}
.magic-word-suggestion-info .suggestion-source {
  font-size: 1rem;
  color: #b0c0ff;
  font-style: normal;
  margin-top: 0.25rem;
}

.magic-word-suggestion-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.magic-word-suggestion-controls .search-now-btn {
  background: #000;
  color: #fff;
  border: 1px solid #333;
  border-radius: 20px;
  padding: 0.5rem 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5em;
}
.magic-word-suggestion-controls .search-now-btn:hover {
  background: #222;
  transform: scale(1.05);
}

.magic-word-suggestion-controls .close-suggestion-btn {
  background: transparent;
  border: none;
  color: #b0c0ff;
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s, transform 0.2s;
}
.magic-word-suggestion-controls .close-suggestion-btn:hover {
  color: #fff;
  transform: scale(1.1);
}

.magic-word-loading {
  width: 100%;
  text-align: center;
  color: #d8deff;
  font-style: italic;
}

body.similar-mode .phonetic {
  color: var(--similar-accent);
}
body.similar-mode .part-of-speech,
body.similar-mode .relations-title {
  color: var(--similar-accent);
}
body.similar-mode .definition {
  border-color: var(--similar-accent);
}
body.similar-mode .loading {
  color: var(--similar-accent);
}
.similar-generated {
  border: 1px solid var(--similar-accent);
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
  background: rgba(231,84,128,0.14);
}
body.similar-mode .similar-generated {
  border-color: var(--similar-accent);
  background: rgba(255,191,233,0.14);
}
.similar-badge {
  background: var(--similar-btn);
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
  display: inline-block;
}
.similar-thesaurus-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--input-border);
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}
.similar-words-list,
.similar-comparisons-list {
  flex: 1;
  min-width: 230px;
}
.similar-words-list {
  background: rgba(231,84,128,0.09);
  border-radius: 12px;
  padding: 1.2rem;
}
.similar-comparisons-list {
  background: rgba(255,191,233,0.09);
  border-radius: 12px;
  padding: 1.2rem;
}

body.similar-mode .word-chip:hover {
  background: var(--similar-accent);
  color: #251225;
}

.similar-relations-title {
  color: var(--similar-accent);
  font-size: 1.2rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.similar-no-relations {
  color: var(--text);
  opacity: 0.7;
  font-style: italic;
}

.similar-example-sentences-section {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--input-border);
}
.similar-example-sentences-title {
  font-size: 1.3rem;
  color: var(--similar-accent);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.similar-example-sentences-list {
  list-style: none;
  padding-left: 0;
  max-height: 360px;
  overflow-y: auto;
  font-size: 1.06rem;
}
.similar-example-sentences-list li {
  background: rgba(231,84,128,0.09);
  margin-bottom: 0.6rem;
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  color: var(--text);
}
.similar-example-sentences-loading {
  color: var(--similar-accent);
  margin-bottom: 1.4rem;
  text-align: center;
}
.similar-example-sentences-error {
  color: var(--error-color);
  margin-bottom: 1.4rem;
  text-align: center;
}

/* original styles */
:root {
  --primary: #e2e8f0;
  --accent: #60a5fa;
  --bg: #1a1a2e;
  --text: #e2e8f0;
  --container-bg: #1e293b;
  --input-bg: #2c3e50;
  --input-border: #4a5568;
  --definition-border: #60a5fa;
  --error-color: #ef4444;
  --concept-btn: #fd6c3c;
  --concept-btn-hover: #e04c17;
  --concept-section: #2d1407;
  --concept-accent: #ffae68;
  --concept-bg: #251002;
  --compare-btn: #ef4444;
  --compare-btn-hover: #ca1f1f;
  --compare-section: #2b0c10;
  --compare-accent: #fb5858;
  --compare-bg: #22080b;
}

body {
  background: var(--bg);
  height: 100vh;
  overflow: hidden; /* Prevents body itself from scrolling */
  display: flex;
  justify-content: center;
  /* align-items: center; */ /* Default to vertically centered */
  padding: 2rem;
  color: var(--text);
  transition: background 0.5s; /*, align-items 0.4s ease-in-out; */
}

/* body.results-active {
  align-items: flex-start;
} */

body.concept-mode {
  background: var(--concept-bg);
  transition: background 0.5s;
}

body.compare-mode {
  background: var(--compare-bg);
  transition: background 0.5s;
}

.container-wrapper {
  width: 100%;
  height: 100%;
  max-width: 860px;
  overflow-y: auto;
  display: flex;
  align-items: center;
  transition: align-items 0.4s ease-in-out;
}

body.results-active .container-wrapper {
  align-items: flex-start;
}

.container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  background: var(--container-bg);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  transition: background 0.5s, padding-top 0.5s;
}

body.concept-mode .container {
  background: var(--concept-section);
}

body.compare-mode .container {
  background: var(--compare-section);
}

.search-container {
  position: relative;
  margin-bottom: 2rem;
  display: flex;
  gap: 0.8rem;
}

.search-input {
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 1.2rem;
  border: 2px solid var(--input-border);
  border-radius: 12px;
  transition: all 0.3s ease;
  background: var(--input-bg);
  color: var(--text);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(96,165,250,0.2);
}

.search-btn, .concept-btn, .compare-btn, .similar-btn, .random-btn, .video-btn, .magic-word-btn {
  position: static;
  right: auto;
  top: auto;
  transform: none;
  min-width: 48px;
  background: var(--accent);
  border: none;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.6em;
}

.search-btn {
  background: var(--accent);
  border: none;
}
.search-btn:hover {
  background: #4287f5;
}

.concept-btn, .compare-btn, .similar-btn {
  display: none;
}

.random-btn {
  background: var(--random-btn);
  color: #fff;
  border: none;
  border-radius: 8px;
  min-width: 48px;
  padding: 0.5rem 1rem;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.6em;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(245, 204, 11, 0.3);
}
.random-btn:hover {
  background: var(--random-btn-hover);
  box-shadow: 0 6px 20px rgba(250, 204, 21, 0.4);
  transform: translateY(-2px);
}

/* --- New Button Style --- */
.video-btn {
  background: linear-gradient(45deg, #00dbde, #fc00ff);
  color: #fff;
  border: none;
  border-radius: 8px;
  min-width: 48px;
  padding: 0.5rem 1rem;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.6em;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(252, 0, 255, 0.3);
}

.video-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 219, 222, 0.4);
}

.result {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
}
.result.show {
  opacity: 1;
  transform: translateY(0);
}

.word {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.word h2 {
  font-size: 2.5rem;
  color: var(--text);
}

.phonetic {
  color: var(--accent);
  font-size: 1.2rem;
}

body.concept-mode .phonetic {
  color: var(--concept-accent);
}

body.compare-mode .phonetic {
  color: var(--compare-accent);
}

body.similar-mode .phonetic {
  color: var(--similar-accent);
}

.play-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--accent);
}

body.concept-mode .play-btn {
  color: var(--concept-accent);
}
body.compare-mode .play-btn {
  color: var(--compare-accent);
}
body.similar-mode .play-btn {
  color: var(--similar-accent);
}

.meanings {
  margin-top: 2rem;
}

.part-of-speech {
  color: var(--accent);
  font-style: italic;
  margin-bottom: 1rem;
}
body.concept-mode .part-of-speech,
body.concept-mode .relations-title {
  color: var(--concept-accent);
}
body.compare-mode .part-of-speech,
body.compare-mode .relations-title {
  color: var(--compare-accent);
}
body.similar-mode .part-of-speech,
body.similar-mode .relations-title {
  color: var(--similar-accent);
}

.definition {
  margin-bottom: 1.5rem;
  padding-left: 1rem;
  border-left: 3px solid var(--definition-border);
}
body.concept-mode .definition {
  border-color: var(--concept-accent);
}
body.compare-mode .definition {
  border-color: var(--compare-accent);
}
body.similar-mode .definition {
  border-color: var(--similar-accent);
}

.loading {
  display: none;
  text-align: center;
  color: var(--accent);
}
body.concept-mode .loading {
  color: var(--concept-accent);
}
body.compare-mode .loading {
  color: var(--compare-accent);
}
body.similar-mode .loading {
  color: var(--similar-accent);
}

.error {
  display: none;
  color: var(--error-color);
  text-align: center;
}

.ai-generated,
.concept-generated,
.compare-generated,
.similar-generated {
  border: 1px solid var(--accent);
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
  background: rgba(96,165,250,0.1);
}
.concept-generated {
  border-color: var(--concept-accent);
  background: rgba(253, 108, 60, 0.1);
}
body.concept-mode .concept-generated {
  border-color: var(--concept-accent);
  background: rgba(253, 108, 60, 0.12);
}
.compare-generated {
  border-color: var(--compare-accent);
  background: rgba(251,88,88,0.12);
}
body.compare-mode .compare-generated {
  border-color: var(--compare-accent);
  background: rgba(251,88,88,0.17);
}
.similar-generated {
  border: 1px solid var(--similar-accent);
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
  background: rgba(231,84,128,0.14);
}
body.similar-mode .similar-generated {
  border-color: var(--similar-accent);
  background: rgba(255,191,233,0.14);
}

.ai-badge,
.concept-badge,
.compare-badge,
.similar-badge {
  background: var(--accent);
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
  display: inline-block;
}
.concept-badge {
  background: var(--concept-btn);
}
.compare-badge {
  background: var(--compare-btn);
}
.similar-badge {
  background: var(--similar-btn);
}

.thesaurus-section, .concept-thesaurus-section, .compare-thesaurus-section, .similar-thesaurus-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--input-border);
}

.word-relations, .concept-relations, .compare-relations {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 1rem;
}

.synonyms, .antonyms, .similar-topics, .contrast-topics, .compare-synonyms, .compare-antonyms {
  background: rgba(96,165,250,0.05);
  border-radius: 12px;
  padding: 1.5rem;
}
body.concept-mode .similar-topics, 
body.concept-mode .contrast-topics {
  background: rgba(253, 108, 60, 0.08);
}
body.compare-mode .compare-synonyms,
body.compare-mode .compare-antonyms {
  background: rgba(251,88,88,0.08);
}

.relations-title {
  color: var(--accent);
  font-size: 1.2rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.word-chip {
  display: inline-block;
  background: var(--input-bg);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  margin: 0.3rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.word-chip:hover {
  background: var(--accent);
  transform: translateY(-2px);
  color: white;
}
body.concept-mode .word-chip:hover {
  background: var(--concept-accent);
  color: #251002;
}
body.compare-mode .word-chip:hover {
  background: var(--compare-accent);
  color: #22080b;
}
body.similar-mode .word-chip:hover {
  background: var(--similar-accent);
  color: #251225;
}

.no-relations {
  color: var(--text);
  opacity: 0.7;
  font-style: italic;
}

.example-sentences-section,
.concept-example-sentences-section,
.compare-example-sentences-section,
.similar-example-sentences-section {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--input-border);
}
.example-sentences-title,
.concept-example-sentences-title,
.compare-example-sentences-title,
.similar-example-sentences-title {
  font-size: 1.3rem;
  color: var(--accent);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
body.concept-mode .concept-example-sentences-title {
  color: var(--concept-accent);
}
body.compare-mode .compare-example-sentences-title {
  color: var(--compare-accent);
}
body.similar-mode .similar-example-sentences-title {
  color: var(--similar-accent);
}
.example-sentences-list,
.concept-example-sentences-list,
.compare-example-sentences-list,
.similar-example-sentences-list {
  list-style: none;
  padding-left: 0;
  max-height: 360px;
  overflow-y: auto;
  font-size: 1.06rem;
}
.example-sentences-list li,
.concept-example-sentences-list li,
.compare-example-sentences-list li,
.similar-example-sentences-list li {
  background: rgba(96,165,250,0.05);
  margin-bottom: 0.6rem;
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  color: var(--text);
}
body.concept-mode .concept-example-sentences-list li {
  background: rgba(253, 108, 60, 0.08);
}
body.compare-mode .compare-example-sentences-list li {
  background: rgba(251,88,88,0.08);
}
body.similar-mode .similar-example-sentences-list li {
  background: rgba(231,84,128,0.09);
}
.example-sentences-loading,
.concept-example-sentences-loading,
.compare-example-sentences-loading,
.similar-example-sentences-loading {
  color: var(--accent);
  margin-bottom: 1.4rem;
  text-align: center;
}
body.concept-mode .concept-example-sentences-loading {
  color: var(--concept-accent);
}
body.compare-mode .compare-example-sentences-loading {
  color: var(--compare-accent);
}
body.similar-mode .similar-example-sentences-loading {
  color: var(--similar-accent);
}
.example-sentences-error,
.concept-example-sentences-error,
.compare-example-sentences-error,
.similar-example-sentences-error {
  color: var(--error-color);
  margin-bottom: 1.4rem;
  text-align: center;
}

/* Slide-out synonyms panel styles */
#slideout-synonyms-panel {
  width: var(--slideout-width);
  max-width: 90vw;
  background: var(--slideout-bg);
  border-left: 4px solid var(--slideout-border);
  box-shadow: var(--slideout-shadow);
  position: fixed;
  top: 0;
  right: -400px;
  height: 100vh;
  z-index: 99;
  transition: right 0.36s cubic-bezier(0.57,0.22,0.25,1);
  display: flex;
  flex-direction: column;
  padding: 0;
  color: var(--slideout-title);
  font-family: 'Inter', system-ui,sans-serif;
}

#slideout-synonyms-panel.open {
  right: 0;
  transition: right 0.42s cubic-bezier(.2,1.12,.55,0.97);
}

.slideout-synonyms-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.3rem 1.2rem 1.1rem 1.5rem;
  background: #2b2436;
  border-bottom: 1px solid #3c3350;
}

.history-header-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.history-header-controls button {
    background: transparent;
    border: none;
    color: var(--slideout-btn);
    cursor: pointer;
    font-size: 1.6rem;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    width: 36px;
}
.history-header-controls button:hover {
    background: #4c377d;
    color: #fff;
}
.history-header-controls .history-copy-toggle-def-btn {
    font-size: 1.3rem;
    color: #a395ce;
}
.history-header-controls .history-copy-toggle-def-btn.active {
    color: #fff;
    background: var(--slideout-btn);
}
.history-header-controls .history-copy-btn {
    font-size: 1.3rem;
}

.slideout-synonyms-close {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  color: var(--slideout-btn);
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  margin-left: 0.7em;
  border-radius: 3px;
  transition: background 0.2s;
}
.slideout-synonyms-close:hover {
  background: #4c377d;
  color: #fff;
}

.slideout-synonyms-content {
  padding: 1.5rem 2rem 1.6rem 1.5rem;
  overflow-y: auto;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.slideout-current-word {
  font-size: 1.18rem;
  color: var(--slideout-word);
  letter-spacing: 0.01em;
  font-weight: 600;
  margin-bottom: 1.25rem;
  word-break: break-word;
  display: flex;
  align-items: center;
  gap: 0.6em;
}

.slideout-synonyms-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.slideout-synonym-chip {
  display: inline-block;
  background: var(--slideout-chip-bg);
  color: var(--slideout-chip-text);
  padding: 0.47em 1.12em 0.4em 1.12em;
  border-radius: 22px;
  margin-bottom: 2px;
  font-size: 1.02rem;
  cursor: pointer;
  transition: background 0.23s, color 0.19s, box-shadow 0.22s;
  border: none;
  outline: none;
  text-align: left;
  font-family: inherit;
  box-shadow: none;
  border: 1px solid #363251;
  min-width: 0;
}
.slideout-synonym-chip:hover {
  background: var(--slideout-chip-hover);
  color: #1e293b;
  box-shadow: 0 1px 8px rgba(80, 170, 255, 0.16);
}

.slideout-empty {
  color: #bbb7ca;
  font-style: italic;
  opacity: 0.83;
  margin-top: 1.1rem;
}

/* Show/Hide synonyms toggle button (fixed floating) */
#slideout-synonyms-toggle {
  position: fixed;
  right: 14px;
  bottom: 30px;
  z-index: 101;
  border: none;
  background: var(--slideout-btn);
  color: #fff;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  box-shadow: 0 6px 40px rgba(119,76,255,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.0rem;
  cursor: pointer;
  transition: background 0.25s, box-shadow 0.18s, transform 0.13s;
}
#slideout-synonyms-toggle:hover {
  background: var(--slideout-btn-hover);
  box-shadow: 0 1px 24px #8557fc7c;
  transform: translateY(-2px) scale(1.06);
}

/* --- History Panel --- */
#history-panel {
  width: 360px;
  max-width: 90vw;
  background: var(--slideout-bg);
  border-right: 4px solid var(--slideout-border);
  box-shadow: var(--slideout-shadow);
  position: fixed;
  top: 0;
  left: -420px;
  height: 100vh;
  z-index: 99;
  transition: left 0.36s cubic-bezier(0.57,0.22,0.25,1);
  display: flex;
  flex-direction: column;
  color: var(--slideout-title);
  font-family: 'Inter', system-ui, sans-serif;
}
#history-panel.open {
  left: 0;
  transition: left 0.42s cubic-bezier(.2,1.12,.55,0.97);
}
.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.3rem 1.2rem 1.1rem 1.5rem;
  background: #2b2436;
  border-bottom: 1px solid #3c3350;
}

.history-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.history-title {
  font-size: 1.28rem;
  font-weight: 600;
  color: var(--slideout-title);
  display: flex;
  align-items: center;
  gap: 0.7em;
  letter-spacing: 0.04em;
}

.history-header-actions .history-close,
.history-header-actions .upload-list-btn {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  color: var(--slideout-btn);
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  margin-left: 0.7em;
  border-radius: 3px;
  transition: background 0.2s, color 0.2s;
  height: 38px;
  width: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.history-header-actions .upload-list-btn {
    font-size: 1.3rem;
    margin-left: 0;
}
.history-header-actions .history-close:hover,
.history-header-actions .upload-list-btn:hover {
  background: #4c377d;
  color: #fff;
}

.history-close {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  color: var(--slideout-btn);
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  margin-left: 0.7em;
  border-radius: 3px;
  transition: background 0.2s;
}
.history-close:hover {
  background: #4c377d;
  color: #fff;
}

.history-controls {
  display: flex;
  justify-content: space-around;
  padding: 0.7rem 1rem;
  background: rgba(0,0,0,0.1);
  border-bottom: 1px solid #3c3350;
}
.history-sort-btn {
  background: transparent;
  border: none;
  color: #a395ce;
  font-size: 1.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.history-sort-btn:hover {
  color: #fff;
  background: #413364;
}
.history-sort-btn.active {
  color: #fff;
  background: var(--slideout-btn);
  box-shadow: 0 0 10px rgba(167, 139, 250, 0.4);
}
.history-fullscreen-control-area {
  padding: 0.5rem 1rem 0.7rem;
  text-align: center;
  border-bottom: 1px solid #3c3350;
}
.history-fullscreen-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid #5a4b8c;
  color: #c4b5fd;
  width: 100%;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
}
.history-fullscreen-btn:hover {
  background: #413364;
  color: #fff;
  border-color: #a78bfa;
}

.history-copy-area {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 1.2rem;
  background: #2b2436;
  border-bottom: 1px solid #3c3350;
}

.history-copy-toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.history-copy-toggle-label {
  font-size: 0.95rem;
  font-weight: 500;
  color: #c4b5fd;
}

.history-copy-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.history-copy-switch .history-copy-toggle-checkbox {
  opacity: 0;
  width: 0;
  height: 0;
}

.history-copy-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #4a4a68;
  transition: .4s;
  border-radius: 24px;
}

.history-copy-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

.history-copy-toggle-checkbox:checked + .history-copy-slider {
  background-color: var(--slideout-btn);
}

.history-copy-toggle-checkbox:checked + .history-copy-slider:before {
  transform: translateX(20px);
}

.history-copy-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid #5a4b8c;
    color: #c4b5fd;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.history-copy-btn:hover {
    background: #413364;
    color: #fff;
    border-color: #a78bfa;
}

.history-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 0.5rem;
}
.history-date-header {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #a395ce;
  padding: 0.8rem 1rem;
  margin-top: 0.5rem;
  background: #2b2436;
  border-radius: 4px;
}
.history-item {
  background: #343040;
  border-radius: 8px;
  margin: 0.5rem;
  padding: 0.8rem 1rem;
  border-left: 5px solid transparent;
  transition: background 0.2s, border-color 0.2s;
}
.history-item[data-type="dictionary"] { border-color: var(--accent); }
.history-item[data-type="explanation"] { border-color: #fd6c3c; }
.history-item[data-type="comparison"] { border-color: #ef4444; }
.history-item[data-type="thematic"] { border-color: #e75480; }
.history-item[data-type="custom_list"] { border-color: #4ade80; }

.history-item-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.history-item-word {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
}
.history-item-actions {
  display: flex;
  gap: 0.3rem;
}
.history-item-actions button {
  background: none;
  border: none;
  color: #a395ce;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  transition: all 0.2s;
}
.history-item-actions button:hover {
  background: #413364;
  color: #fff;
  transform: scale(1.1);
}
.history-item-actions .fav-btn.favorited {
  color: #facc15;
}
.history-item-actions .fav-btn.favorited:hover {
  color: #fde047;
}
.history-item-actions .delete-btn:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.2);
}
.history-item-actions .image-btn {
    color: #a395ce;
    font-size: 1rem;
}
.history-item-actions .image-btn.has-image {
    color: #4ade80; /* Green if image exists */
}
.history-item-actions .image-btn.eligible {
    color: #a395ce; /* Default color if eligible but no image */
}
.history-item-actions .image-btn.eligible:hover {
    color: #fff;
}
.history-item-actions .image-btn.generating {
    color: #facc15; /* Yellow while generating */
}
.history-item-actions .image-btn:disabled {
    cursor: not-allowed;
}
.history-item-image-preview {
    margin-top: 0.75rem;
    border-radius: 8px;
    overflow: hidden;
    max-height: 500px;
    transition: max-height 0.3s ease-in-out;
    background: #2b2436; /* Add background for when caption is visible without image */
}
.history-item-image-preview img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 1/1;
    object-fit: cover;
}

.history-item-caption-container {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    background: #2b2436;
}

.history-item-image-caption {
    flex-grow: 1;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #d8b4fe;
    margin: 0;
    padding: 0;
    font-style: italic;
}
.history-item-image-caption b {
    color: #fff;
    font-style: normal;
}

.caption-tts-btn {
    background: transparent;
    border: 1px solid #7c3aed;
    color: #c4b5fd;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    min-width: 32px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.caption-tts-btn:hover {
    background-color: #7c3aed;
    color: white;
    transform: scale(1.1);
}
.caption-tts-btn.fullscreen {
    width: 100%;
    border-radius: 8px;
    padding: 0.6rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    justify-content: center;
    gap: 0.5em;
    border-color: #d8b4fe;
}
.caption-tts-btn.fullscreen:hover {
     background-color: #d8b4fe;
     color: #110f1c;
     transform: scale(1.02);
}

.history-item-image-preview .history-item-image-caption {
    flex-grow: 1;
    margin: 0;
    padding: 0;
}

.history-item-def {
  font-size: 0.9rem;
  color: #c5b9e8;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #413364;
}
.history-item-def em {
    color: #a395ce;
    font-style: italic;
}
.history-empty {
  color: #bbb7ca;
  font-style: italic;
  opacity: 0.83;
  margin-top: 1.1rem;
  text-align: center;
  padding: 2rem;
}

/* --- Upload List Panel --- */
#upload-list-panel {
    position: fixed;
    top: 50%;
    left: 375px; /* Next to history panel */
    transform: translateY(-50%) scale(0.95);
    width: 380px;
    background: #2b2436;
    border: 1px solid #4c377d;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    z-index: 100;
    color: #f0eafc;
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s 0.3s;
}

#upload-list-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) scale(1);
}

.upload-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #3c3350;
}
.upload-list-header h4 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.upload-list-header h4 i {
    color: #d8b4fe;
}
.upload-list-close-btn {
    background: transparent;
    border: none;
    color: var(--slideout-btn);
    font-size: 1.6rem;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.upload-list-close-btn:hover {
    color: #fff;
    transform: rotate(90deg);
    background-color: rgba(255,255,255,0.1);
}
.upload-list-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background-color: #1e1b2e;
    flex-grow: 1;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
}
.upload-list-content p {
    font-size: 1rem;
    color: #c4b5fd;
    margin: 0;
    text-align: center;
}
.upload-list-textarea {
    width: 100%;
    height: 300px;
    background: #12101c;
    border: 2px solid #4c377d;
    border-radius: 12px;
    color: #f0eafc;
    padding: 1rem;
    font-family: inherit;
    font-size: 1.1rem;
    line-height: 1.5;
    resize: none;
    box-sizing: border-box; /* Ensures padding is inside the element's width/height */
}
.upload-list-textarea:focus {
    outline: none;
    border-color: var(--slideout-btn);
    box-shadow: 0 0 15px rgba(167, 139, 250, 0.3);
}

.upload-list-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}
.upload-list-word-count {
    font-size: 1rem;
    color: #a395ce;
    font-weight: 500;
}
.upload-list-add-btn {
    background: linear-gradient(45deg, #a855f7, #d946ef);
    color: #fff;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.6em;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}
.upload-list-add-btn:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 6px 20px rgba(217, 70, 239, 0.4);
}
.upload-list-add-btn:disabled {
    background: #4a4a68;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* --- History Fullscreen View --- */
#history-fullscreen-view {
  position: fixed;
  inset: 0;
  z-index: 4500;
  background: #110f1c;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0s 0.4s;
  overflow-y: auto;
  overflow-x: hidden; /* Prevent horizontal scrollbar */
  padding: 2rem;
  color: #e2e8f0;
  box-sizing: border-box; /* Ensure padding is included in width/height */
}
#history-fullscreen-view.open {
    opacity: 1;
    visibility: visible;
}
.history-fullscreen-close-btn {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: transparent;
    border: none;
    font-size: 2.5rem;
    color: #a78bfa;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    z-index: 10;
}
.history-fullscreen-close-btn:hover {
    color: #c4b5fd;
    transform: rotate(90deg);
}
.history-fullscreen-header {
    text-align: center;
    margin-bottom: 2rem;
}
.history-fullscreen-header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}
.history-fullscreen-controls {
    display: inline-flex;
    background: #1e1b2e;
    border-radius: 12px;
    padding: 0.5rem;
    gap: 0.5rem;
}
.history-fullscreen-controls .history-sort-btn {
    font-size: 1.5rem;
    padding: 0.5rem 1rem;
}
.history-fullscreen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
}
.history-fullscreen-date {
    grid-column: 1 / -1;
    font-size: 1.5rem;
    color: #a78bfa;
    border-bottom: 2px solid #3c3350;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
    text-align: left;
}
.history-fullscreen-card {
    background: #1e1b2e;
    color: #e2e8f0;
    border: 2px solid;
    padding: 0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    word-break: break-word;
    display: flex;
    flex-direction: column;
    text-align: left;
    overflow: hidden; /* To contain the image and rounded corners */
}
.history-fullscreen-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    border-color: #fff !important;
}
.history-fullscreen-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}
.history-fullscreen-card-content {
    padding: 1.2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.history-fullscreen-word {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #fff;
}
.history-fullscreen-def {
    font-size: 0.95rem;
    color: #c4b5fd;
    line-height: 1.4;
    margin: 0;
    flex-grow: 1;
}
.history-fullscreen-caption-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #3c3350;
}
.history-fullscreen-caption {
    font-size: 0.95rem;
    color: #e2e8f0;
    line-height: 1.5;
    margin: 0;
    font-style: italic;
    flex-grow: 1;
}
.history-fullscreen-caption b {
    color: #f59e0b;
    font-style: normal;
}
.history-fullscreen-card[data-type="dictionary"] { border-color: var(--accent); }
.history-fullscreen-card[data-type="explanation"] { border-color: #fd6c3c; }
.history-fullscreen-card[data-type="comparison"] { border-color: #ef4444; }
.history-fullscreen-card[data-type="thematic"] { border-color: #e75480; }
.history-fullscreen-empty {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 1.2rem;
    color: #a395ce;
    padding: 3rem;
}

#history-toggle {
  position: fixed;
  left: 14px;
  bottom: 30px;
  z-index: 101;
  border: none;
  background: var(--slideout-btn);
  color: #fff;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  box-shadow: 0 6px 40px rgba(119,76,255,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  cursor: pointer;
  transition: all 0.25s;
}
#history-toggle:hover {
  background: var(--slideout-btn-hover);
  box-shadow: 0 1px 24px #8557fc7c;
  transform: translateY(-2px) scale(1.06);
}

#learn-today-toggle {
  position: fixed;
  left: 14px;
  bottom: 92px; /* Positioned above the history button */
  z-index: 101;
  border: none;
  background: #14b8a6; /* Turquoise */
  color: #fff;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  box-shadow: 0 6px 40px rgba(20, 184, 166, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  cursor: pointer;
  transition: all 0.25s;
}
#learn-today-toggle:hover {
  background: #0d9488;
  box-shadow: 0 1px 24px rgba(20, 184, 166, 0.4);
  transform: translateY(-2px) scale(1.06);
}

/* Responsive: hide panel on below 650px screens */
@media (max-width: 650px) {
  #slideout-synonyms-panel {
    width: 97vw;
    min-width: 0;
    border-left: none;
    border-top: 4px solid var(--slideout-border);
    top: auto;
    bottom: 0;
    right: -120vw;
    height: 74vh;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -4px 24px rgba(50,10,70,0.18);
    padding-left: 0.7em;
    padding-right: 0.2em;
    transition: right 0.41s cubic-bezier(0.74,0.06,0.2,1.01);
  }
  #slideout-synonyms-panel.open {
    right: 0;
  }
  .slideout-synonyms-header {
    padding: 1.05rem 1rem 0.9rem 1.1rem;
  }
  .slideout-synonyms-content {
    padding: 1rem 1.15rem 1.25rem 1.05rem;
  }
  #slideout-synonyms-toggle {
    bottom: 16px;
    right: 8px;
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
  }
  #history-panel {
    width: 97vw;
    min-width: 0;
    border-right: none;
    border-top: 4px solid var(--slideout-border);
    top: auto;
    bottom: 0;
    left: -120vw;
    height: 74vh;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -4px 24px rgba(50,10,70,0.18);
    padding-left: 0.7em;
    padding-right: 0.2em;
    transition: left 0.41s cubic-bezier(0.74,0.06,0.2,1.01);
  }
  #history-panel.open {
    left: 0;
  }
  #history-toggle {
    bottom: 16px;
    left: 8px;
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
  }
  #learn-today-toggle {
    bottom: 74px; /* Stacked on mobile */
    left: 8px;
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
  }
  .random-btn {
    padding: 0.42rem 0.7rem;
    min-width: 42px;
    font-size: 1rem;
  }
}

/* Allow scrolling behind panel */
body.synonyms-panel-open {
  overflow-y: hidden !important;
}

/* Add a little section margin for forms */
.word-forms-section {
  margin-top: 0.2em;
  margin-bottom: 1.1em;
  padding: 0.7em 1.2em 0.5em 0.9em;
  border-radius: 9px;
  background: rgba(131,143,217,0.08);
  border: 1.5px solid var(--accent);
}
.word-forms-section .word-chip {
  background: var(--input-bg);
  color: var(--accent);
  border-radius: 1.2em;
  cursor: pointer;
  font-size: 1.07em;
}
.word-forms-section .word-chip:hover {
  background: var(--accent);
  color: var(--bg);
}
body.concept-mode .word-forms-section {
  border-color: var(--concept-accent);
}
body.compare-mode .word-forms-section {
  border-color: var(--compare-accent);
}
body.similar-mode .word-forms-section {
  border-color: var(--similar-accent);
}

/* Custom Scrollbar Styles */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--scrollbar-track-bg);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb-bg);
  border-radius: 10px;
  border: 3px solid var(--scrollbar-track-bg);
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--scrollbar-thumb-hover-bg);
}

/* For Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb-bg) var(--scrollbar-track-bg);
}

/* TTS (Read aloud) Button styles for sections */
.tts-btn { 
  background: none; 
  border: none; 
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: left;
  margin-top: 1.3em;
  font-size: 1.18rem;
  color: var(--accent);
  transition: color 0.15s;
  padding: 0.18em 0.7em 0.22em 0;
  border-radius: 5px;
}
.tts-btn-accent { color: var(--accent); }
.tts-btn-accent:hover { color: #388dcf; background: rgba(96,165,250,0.05);}
.tts-btn-concept-accent { color: var(--concept-accent);}
.tts-btn-concept-accent:hover { color: #e47e2c; background: rgba(253,108,60,0.07);}
.tts-btn-compare-accent { color: var(--compare-accent);}
.tts-btn-compare-accent:hover { color: #ff6067; background: rgba(251,88,88,0.08);}
.tts-btn-similar-accent { color: var(--similar-accent);}
.tts-btn-similar-accent:hover { color: #f577b2; background: rgba(255,191,233,0.18);}
.tts-btn i { margin-right: 0.55em; opacity: 0.82;}
.tts-li-speakable:hover, .tts-li-speakable:focus {
  background: rgba(96,165,250,0.18)!important;
  box-shadow: 0 0 0 2px var(--accent);
  outline: none;
}
.concept-example-sentences-list .tts-li-speakable:hover, .concept-example-sentences-list .tts-li-speakable:focus {
  background: rgba(253, 108, 60, 0.12)!important;
  box-shadow: 0 0 0 2px var(--concept-accent);
}
.compare-example-sentences-list .tts-li-speakable:hover, .compare-example-sentences-list .tts-li-speakable:focus {
  background: rgba(251,88,88,0.13)!important;
  box-shadow: 0 0 0 2px var(--compare-accent);
}
.similar-example-sentences-list .tts-li-speakable:hover, .similar-example-sentences-list .tts-li-speakable:focus {
  background: rgba(231,84,128,0.16)!important;
  box-shadow: 0 0 0 2px var(--similar-accent);
}

.quiz-modal-continue {
    display: none;
    margin: 1.15em auto 0 auto;
    padding: 0.5em 1.2em;
    color: #f4f5fa;
    background: linear-gradient(90deg,#6667ee 10%,#a78bfa 80%);
    border-radius: 13px;
    font-size: 1.09rem;
    font-weight: bold;
    border: none;
    cursor: pointer;
}

.quiz-tts-btn {
    background: none;
    border: none;
    cursor: pointer;
    margin-left: 1.15em;
    font-size: 1.25rem;
    color: var(--slideout-accent);
    display: none; /* Hidden for now, but can be re-enabled */
    align-items: center;
    justify-content: center;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-5px); }
}/* M
odel Selector Styles */
.model-selector-container {
  display: flex;
  justify-content: center;
  margin: 1rem 0;
}

.model-selector {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.model-selector:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(96, 165, 250, 0.15);
}

.model-selector-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.model-selector-header i {
  color: var(--accent);
}

.model-select {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.model-select:hover {
  background: rgba(96, 165, 250, 0.1);
}

.model-select option {
  background: var(--card-bg);
  color: var(--text);
}

/* Dark mode adjustments */
body.dark-mode .model-select option {
  background: var(--card-bg);
  color: var(--text);
}