html {
  scrollbar-gutter: stable;
}

body {
  font-family: sans-serif;
  background-color: #f7f7f7;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 600px;
  margin: auto;
  padding: 20px;
}

h1 {
  text-align: center;
  color: #333;
}

form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

form input {
  flex: 1 1 45%;
  padding: 10px;
  font-size: 1em;
  border: 1px solid #ccc;
  border-radius: 6px;
}

form button {
  flex: 1 1 100%;
  padding: 10px;
  background-color: #1e90ff;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1em;
  cursor: pointer;
}

form button:hover {
  background-color: #187bcd;
}

#wordList {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.word-item {
  max-width: 700px;
  margin: 10px auto;
  background: #ffffff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  box-sizing: border-box;
}

.word {
  font-size: 1.5em;
  font-weight: bold;
  margin-bottom: 5px;
  color: #222;
}

.translation {
  font-size: 1em;
  color: #666;
  margin-bottom: 10px;
}

.word-actions {
  display: flex;
  gap: 8px;
}

.word-actions button {
  padding: 6px 12px;
  border-radius: 5px;
  border: none;
  background-color: #eee;
  cursor: pointer;
  transition: background-color 0.2s ease;
  color: black;
  -webkit-appearance: none;
  appearance: none;
}

.word-actions button:hover {
  background-color: #ddd;
}

.der { color: blue; }
.die { color: red; }
.das { color: green; }

.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.tabs button {
  flex: 1;
  padding: 10px;
  font-size: 1em;
  border: none;
  background-color: #eee;
  cursor: pointer;
  border-radius: 6px;
  color: black;
  -webkit-appearance: none;
  appearance: none;
}

.tabs button.active {
  background-color: #1e90ff;
  color: white;
}

.hidden {
  display: none;
}

.card-box {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  text-align: center;
  max-width: 400px;
  margin: auto;
}

#card-word {
  font-size: 1.8em;
  margin-bottom: 10px;
}

#card-translation {
  font-size: 1.4em;
  margin-bottom: 15px;
}

.card-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.card-controls button {
  padding: 10px;
  font-size: 1em;
  border: none;
  background-color: #eee;
  border-radius: 6px;
  cursor: pointer;
  color: black;
  -webkit-appearance: none;
  appearance: none;
}

.progress {
  font-size: 0.9em;
  color: #555;
  margin-top: 5px;
  margin-left: auto;
  font-weight: bold;
}

#data-tools button {
  margin-right: 10px;
  padding: 6px 10px;
  font-size: 0.9em;
  border-radius: 6px;
  border: none;
  background-color: #eee;
  cursor: pointer;
  color: black;
  -webkit-appearance: none;
  appearance: none;
}
#data-tools button:hover {
  background-color: #ccc;
}

#search-container {
  max-width: 700px;
  margin: 20px auto;
  padding: 0;
}

#search {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ccc;
  border-radius: 16px;
  font-size: 1em;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  box-sizing: border-box;
}

#search:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

#search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  margin-bottom: 15px;
  font-size: 1em;
  border: 1px solid #ccc;
  border-radius: 6px;
}

#sort-select {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  font-size: 1em;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
}

.word-counter {
  margin-top: 10px;
  font-size: 0.95em;
  color: #444;
  text-align: right;
}

.bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 5px;
}

.word-actions button {
  margin-right: 8px;
}

.word-item .word {
  font-size: 1.3em;
  margin-bottom: 5px;
}

.word-item .translation {
  margin-bottom: 4px;
}

.word-item .word-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.word-actions-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.progress-text {
  font-size: 0.9em;
  color: #444;
  white-space: nowrap;
}

#wordForm {
  max-width: 700px;
  margin: 20px auto 10px auto; /* сверху и снизу */
  padding: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0;
}

#wordForm .input-row {
  display: flex;
  gap: 12px; /* небольшой промежуток между полями */
  margin: 0 0 16px 0; /* отступ снизу между строками */
  width: 100%;
  box-sizing: border-box;
}

#wordForm .input-row input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #ccc;
  border-radius: 16px;
  font-size: 1em;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  background-color: white;
  box-sizing: border-box;
  width: 100%;
}

#plural {
  padding: 12px 16px;
  border: 1px solid #ccc;
  border-radius: 16px;
  font-size: 1em;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  background-color: white;
  box-sizing: border-box;
  width: 100%;
  margin-bottom: 16px;
}

#wordForm button {
  width: 100%;
  padding: 12px 16px;
  font-size: 1em;
  border-radius: 16px;
  background-color: #1e90ff;
  color: white;
  border: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: background-color 0.2s ease;
  margin: 0; 
  box-sizing: border-box;
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 15px;
}

.modal-primary {
  padding: 10px;
  background-color: #1e90ff;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1em;
  cursor: pointer;
}

.modal-secondary {
  padding: 10px;
  background-color: #ccc;
  color: black;
  border: none;
  border-radius: 6px;
  font-size: 1em;
  cursor: pointer;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

#modal-message {
  white-space: pre-line;
  text-align: center;
  margin-bottom: 1em;
}

.modal {
  background: white;
  padding: 20px;
  border-radius: 8px;
  max-width: 400px;
  width: 90%;
}

.hidden {
  display: none !important;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.logout-container {
  display: flex;
  justify-content: flex-end;
  margin: 10px 0 20px 0;
}

.logout-button {
  padding: 8px 16px;
  background-color: #1e90ff;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  white-space: nowrap;
}

.logout-button:hover {
  background-color: #187bcd;
}

.site-footer {
  position: relative;
  bottom: auto;
  left: auto;
  width: 100%;
  background-color: #1e90ff;
  padding: 20px 0;
  text-align: center;
  font-size: 0.9rem;
  color: white;
  opacity: 1; 
  pointer-events: auto;
  transition: none;
  display: flex;
  justify-content: center;
  gap: 40px;
  font-weight: 600;
  user-select: none;
  z-index: 10;
}

.site-footer .footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px 36px;
}

.site-footer a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
}

.site-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 600px) {
  .site-footer {
    font-size: 0.8rem;
    padding: 15px 0;
  }

  .site-footer .footer-content {
    flex-direction: column;
    gap: 8px 0;
    align-items: center;
  }

  .site-footer a {
    font-size: 0.9rem;
  }
}

.site-header {
  display: flex;
  align-items: center;
  background-color: white;
  justify-content: space-between;
  color: #1e90ff;
  padding: 16px 24px;
  font-weight: bold;
  font-size: 1.5rem;
  font-family: 'Inter', sans-serif;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  box-sizing: border-box;
}

.site-title {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.site-title:hover {
  text-decoration: none;
}