:root {
    --title-color: #66d9ef;
    
}

html {
    box-sizing: border-box;
    font-size: 62.5%;
}


*,
*::after,
*::before {
    box-sizing: inherit;
}

a {
    text-decoration: none;
}

ul {
    list-style-type: none;
    margin: 0;
}

/* 

light mode

*/


body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
  color: #f1f5f9;
  margin: 0;
  padding: 0;
  line-height: 1.6;
  min-height: 100vh;
  font-family: 'Poppins Regular';
  transition: background 0.4s ease, color 0.4s ease;
}
body, .dictionary__container, .header, .result-card, .phonetics__btn, .history, .search-box__input, .footer {
  transition: all 0.4s ease-in-out;
}

.dictionary__container {
  background: #1e293b;
  padding: 2rem;
  border-radius: 1.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  max-width: 700px;
}
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background-color: var(--header-bg);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  font-weight: 600;
  font-size: 1.5rem;
  user-select: none;
}

.dark-mode-toggle {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-primary);
  transition: all 0.3s ease;
}

.dark-mode-toggle:hover {
  color: var(--accent-color);
}

.main {
  margin-top: 5rem;
}

.dictionary__title {
  font-size: 2rem;
  color: #22c55e;
}

.search-box__input {
  font-size: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background-color: #334155;
  border: none;
  color: #f1f5f9;
}

.search-box__input::placeholder {
  color: #94a3b8;
}

.search-box__button {
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 600;
  background-color: #22c55e;
  color: #1e1e1e;
  border: none;
}
.phonetics__flag {
  border-radius: 3px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  margin-right: 0.5rem;
  vertical-align: middle;
}


.search-box__button:hover {
  background-color: #16a34a;
  color: #fff;
}

.result-card {
  background-color: #0f172a;
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.result-card__word {
  font-size: 1.8rem;
  color: #4ade80;
  margin-bottom: 0.5rem;
}

.result-card__definition {
  margin-bottom: 0.3rem;
  color: #e2e8f0;
}
.result-card__pos {
  font-style: italic;
  font-size: 1.2rem;
  color: #94a3b8;
  margin-bottom: 0.5rem;
}

.result-card__example {
  font-size: 1rem;
  background-color: #1e293b;
  border-left: 4px solid #22c55e;
  padding: 0.8rem 1rem;
  margin-top: 1rem;
  border-radius: 0.5rem;
  color: #cbd5e1;
  font-style: italic;
}

.result-card__translation {
  margin-top: .5rem;
  margin-bottom: 1rem;
  font-weight: bold;
  color: #22c55e;
  font-family: "Vazir";
}

.phonetics__btn {
  background-color: #334155;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #f1f5f9;
  transition: background 0.3s;
}

.phonetics__btn:hover {
  background-color: #475569;
}

.phonetics__ipa {
  font-style: italic;
  color: #a1a1aa;
  font-size: 1rem;
  
}

.history {
  background: #1e293b;
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid #334155;
}

.history__title {
  font-size: 1.2rem;
  color: #22c55e;
}

.history__item {
  background: #334155;
  padding: 0.4rem 0.8rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  color: #f1f5f9;
}

.footer {
  border-top: 1px solid var(--border-color);
  padding: 1rem 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 2rem;
}


/* 

Dark Mode

*/
body.light-mode {
  background: linear-gradient(135deg, #e0f7fa, #ffffff);
  color: #1a1a1a;
}

body.light-mode .dictionary__container {
  background: #ffffff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

body.light-mode .search-box__input {
  background-color: #f1f5f9;
  color: #1a1a1a;
}

body.light-mode .search-box__input::placeholder {
  color: #64748b;
}

body.light-mode .search-box__button {
  background-color: #22c55e;
  color: #ffffff;
}

body.light-mode .result-card {
  background-color: #f0fdfa;
  color: #1a1a1a;
}

body.light-mode .result-card__word {
  color: #16a34a;
}

body.light-mode .result-card__translation {
  color: #059669;
}

body.light-mode .phonetics__btn {
  background-color: #e2e8f0;
  color: #1a1a1a;
}

body.light-mode .phonetics__btn:hover {
  background-color: #cbd5e1;
}
body.light-mode .result-card__definition {
  color: #475569; 
}
body.light-mode .result-card__pos {
  color: #64748b;
}

body.light-mode .result-card__example {
  background-color: #f1f5f9;
  border-left: 4px solid #16a34a;
  color: #334155;
}


body.light-mode .phonetics__ipa {
  color: #334155;
}

body.light-mode .history {
  background: #f8fafc;
  border-color: #e2e8f0;
}

body.light-mode .history__item {
  background: #e2e8f0;
  color: #1a1a1a;
}

body.light-mode .history__title {
  color: #16a34a;
}
/* Modal */
.custom-toast {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  min-width: 340px;
  max-width: 420px;
  background: #f3fff3; 
  border: 1px solid #d4edd9; 
  border-left: 6px solid #28a745; 
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
  font-family: "Vazirmatn", "Segoe UI", sans-serif;
  color: #1e7e34;
  opacity: 0;
  visibility: hidden;
  transform: translateX(100%);
  transition: all 0.4s ease;
  z-index: 9999;
}

.custom-toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.toast-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background-color: #f0f9f0;
  border-bottom: 1px solid #e0f1e4;
  font-size: 1.2rem;
  font-weight: 700;
  color: #1e7e34;
}

.toast-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}


.toast-title::before {
  content: "❌";
  color: #28a745;
  font-size: 1.5rem;
}

.toast-close {
  background: none;
  border: none;
  font-size: 2rem;
  font-weight: 600;
  color: #999;
  cursor: pointer;
  transition: color 0.3s ease, transform 0.2s ease;
  padding-left: 0.75rem;
  padding-right: 0.25rem;
  line-height: 1;
}

.toast-close:hover {
  color: #28a745;
  transform: scale(1.25);
}

.toast-body {
  padding: 1.25rem 1.5rem;
  font-size: 1.1rem;
  color: #2f5033;
  text-align: center;
  background-color: #ffffff;
  line-height: 1.7;
}
