.word-container {
  max-width: 800px;
  margin: 2rem auto;
  padding: 2.5rem;
  background-color: #ffffff;
  /* White background */
  border-radius: 1rem;
  /* More rounded corners */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  /* Softer, larger shadow */
  text-align: center;
  /* Center all content */
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  /* Modern font */
}

.word-container h1 {
  font-size: 3.5rem;
  /* Larger font for the word */
  color: #2c3e50;
  /* Darker, more prominent color */
  margin-bottom: 1.5rem;
  font-weight: 700;
  /* Bold */
  text-transform: capitalize;
  /* Capitalize the first letter */
  position: relative;
  display: inline-block;
  /* To make underline fit content */
}

.word-container h1::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -10px;
  transform: translateX(-50%);
  width: 80%;
  height: 4px;
  background-color: #3498db;
  /* A vibrant blue underline */
  border-radius: 2px;
}

.word-container p {
  font-size: 1.2rem;
  color: #34495e;
  /* Slightly lighter text for etymology */
  line-height: 1.8;
  margin-bottom: 1rem;
  padding: 0 1rem;
  /* Some horizontal padding */
}

.word-container p:last-of-type {
  margin-bottom: 0;
}

.word-container p.no-etymology {
  font-style: italic;
  color: #7f8c8d;
  /* Grey for no etymology message */
  margin-top: 2rem;
}

/* Known Words Page Styling */
.known-words-container {
  max-width: 900px;
  margin: 4rem auto;
  padding: 0 1.5rem;
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
}

.known-words-header {
  text-align: center;
  margin-bottom: 4rem;
}

.known-words-header .page-title {
  font-size: 2.75rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.5rem;
  letter-spacing: -0.025em;
}

.known-words-header .subtitle {
  color: #64748b;
  font-size: 1.15rem;
}

.known-words-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  list-style: none;
  padding: 0;
}

.word-card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.word-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
  border-color: #3b82f6;
}

.word-link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: #0f172a;
  text-decoration: none;
  text-transform: capitalize;
  height: 100%;
  flex: 1;
  word-break: break-word;
  text-align: center;
}

.word-link:hover {
  color: #3b82f6;
}

/* Empty State Card */
.empty-state-card {
  background-color: #ffffff;
  border-radius: 16px;
  padding: 4rem 2rem;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
  border: 2px dashed #cbd5e1;
  max-width: 650px;
  margin: 0 auto;
}

.empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem auto;
  color: #94a3b8;
  background: #f1f5f9;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-icon svg {
  width: 32px;
  height: 32px;
}

.empty-state-card h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 1rem;
}

.empty-state-card p {
  color: #64748b;
  font-size: 1.1rem;
  line-height: 1.6;
  max-width: 500px;
  margin: 0 auto;
}

/* ==== Known Words Card Body & Delete Button ==== */
.word-card-body {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
}

.btn-delete-known-word {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: transparent;
  border: none;
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.2s ease;
}

.word-card:hover .btn-delete-known-word {
  opacity: 1;
}

.btn-delete-known-word:hover {
  background-color: #fee2e2;
  color: #ef4444;
  transform: scale(1.1);
}

/* ==== Known Words Delete Modal ==== */
.known-word-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.known-word-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
}

.known-word-modal-card {
  position: relative;
  background: #ffffff;
  border-radius: 20px;
  max-width: 520px;
  width: 100%;
  padding: 2rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  border: 1px solid #e2e8f0;
  text-align: center;
  animation: modalFadeIn 0.2s ease-out;
  z-index: 1;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-close-icon {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #94a3b8;
  cursor: pointer;
  transition: color 0.15s;
}

.modal-close-icon:hover {
  color: #1e293b;
}

.modal-alert-icon {
  width: 54px;
  height: 54px;
  background: #fef2f2;
  color: #ef4444;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 1.25rem auto;
}

.modal-card-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.5rem;
}

.modal-word-highlight {
  color: #2563eb;
  text-transform: capitalize;
}

.modal-card-subtitle {
  color: #64748b;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.modal-actions-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.modal-option-form {
  margin: 0;
  width: 100%;
}

.btn-option {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.15rem;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  background: #ffffff;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-option:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.btn-option-keep:hover {
  border-color: #3b82f6;
  background: #f8fafc;
}

.btn-option-purge:hover {
  border-color: #ef4444;
  background: #fff5f5;
}

.btn-option-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
}

.btn-option-keep .btn-option-icon {
  background: #eff6ff;
  color: #2563eb;
}

.btn-option-purge .btn-option-icon {
  background: #fee2e2;
  color: #ef4444;
}

.btn-option-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.option-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
}

.option-description {
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.4;
}

.modal-card-footer {
  display: flex;
  justify-content: center;
}

.btn-modal-cancel {
  background: transparent;
  border: 1px solid #cbd5e1;
  color: #64748b;
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.btn-modal-cancel:hover {
  background: #f1f5f9;
  color: #1e293b;
}

/* ==========================================================================
   My Study List Page Styling (Consistent with Known Words and App Theme)
   ========================================================================== */

.study-words-container {
  max-width: 900px;
  margin: 3.5rem auto 5rem;
  padding: 0 1.5rem;
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
}

.study-words-nav-back {
  margin-bottom: 2rem;
}

.btn-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #07379d;
  background: #f1f5f9;
  padding: 0.55rem 1.15rem;
  border-radius: 9999px;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid #e2e8f0;
}

.btn-back-link:hover {
  background: #e2e8f0;
  color: #052870;
  transform: translateX(-3px);
}

.study-words-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.study-words-header .page-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 0.5rem;
  letter-spacing: -0.025em;
}

.study-words-header .subtitle {
  color: #64748b;
  font-size: 1.1rem;
}

/* Add Word Card */
.add-word-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.75rem 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
  margin-bottom: 2.5rem;
}

.add-word-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.add-word-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #eff6ff;
  color: #0284c7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.add-word-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.add-word-form {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.input-wrapper {
  position: relative;
  flex: 1;
}

.add-word-input {
  width: 100%;
  padding: 0.85rem 3.25rem 0.85rem 1.25rem;
  font-size: 1rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
  box-sizing: border-box;
  background: #f8fafc;
}

.add-word-input:focus {
  border-color: #0284c7;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.12);
}

.btn-voice-record {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #64748b;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.05rem;
}

.btn-voice-record:hover {
  color: #0284c7;
  background: #eff6ff;
}

.btn-add-word {
  background: linear-gradient(135deg, #07379d 0%, #0369a1 100%);
  color: #ffffff;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.85rem 1.75rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(7, 55, 157, 0.2);
  font-family: inherit;
  white-space: nowrap;
}

.btn-add-word:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(7, 55, 157, 0.35);
  background: linear-gradient(135deg, #052870 0%, #0284c7 100%);
}

.btn-add-word:active {
  transform: translateY(0);
}

/* Study Words Grid (Same as Known Words layout) */
.study-words-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.study-word-card {
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  border: 1px solid #e2e8f0;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
}

.study-word-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.07);
  border-color: #0284c7;
}

.study-word-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
}

.study-word-text {
  font-size: 1.15rem;
  font-weight: 600;
  color: #0f172a;
  text-transform: capitalize;
  word-break: break-word;
}

.btn-delete-study-word {
  background: transparent;
  border: none;
  color: #94a3b8;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-left: 0.5rem;
  padding: 0;
}

.btn-delete-study-word:hover {
  background: #fee2e2;
  color: #ef4444;
  transform: scale(1.08);
}

@media (max-width: 640px) {
  .add-word-form {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-add-word {
    width: 100%;
  }
}