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 {
  width: auto; 
  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: 12px 20px; 
  font-weight: bold;
  font-size: 1rem; 
  line-height: 1.2; 
  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;
  font-size: 1.4rem;
}

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

.delete-ok-btn {
  background-color: #b0b0b0;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.delete-ok-btn:hover {
  background-color: #999999;
}

.delete-cancel-btn {
  background-color: #1e90ff;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.delete-cancel-btn:hover {
  background-color: #187bcd;
}

.user-btn {
  background: none;
  border: none;
  color: #1e90ff;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  white-space: nowrap; 
  max-width: 100%; 
  overflow: hidden; 
  text-overflow: ellipsis;
}

.user-btn:hover {
  text-decoration: none;
}

.hamburger {
  font-size: 1.4rem;
}

.user-menu {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: white;
  min-width: 200px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  overflow: hidden;
  z-index: 2000;
  flex-direction: column;
}

.dropdown-item {
  padding: 12px 16px;
  text-decoration: none;
  color: #333;
  font-size: 16px;
  font-weight: 400;
  display: block;
  transition: background 0.2s;
}

.dropdown-item:hover {
  background-color: #f0f0f0;
}

.site-header .site-title {
  font-size: 1.4rem;
  line-height: 1.2;
  padding: 0;
}


.site-header .user-btn {
  font-size: 1.2rem;
  line-height: 1.2;
  padding: 0;
}

@media (max-width: 700px) {
  body {
    overflow-x: hidden;
  }

  .site-header {
    padding: 8px 12px; 
    font-size: 1rem;  
  }

  .settings-section {
    padding: 20px;  
  }

  .dropdown-menu {
    position: absolute;    
    top: calc(100% + 4px);
    right: 8px;
    left: auto;
    width: max-content;    
    min-width: unset;
    border-radius: 8px;
    max-width: 90vw;    
    overflow-x: auto;     
  }

  .dropdown-item {
    padding: 14px 16px;
    font-size: 0.95rem;
    white-space: nowrap; 
  }
}

.dropdown-menu a {
  text-decoration: none;
  color: black;
  display: block;
  padding: 8px 12px;
}

.dropdown-menu a:hover {
  text-decoration: none;
  background-color: #f0f0f0;
}

@media (max-width: 480px) {
  .user-btn {
    font-size: 0.9rem;
  }
}