@font-face {
  font-family: 'SiteFont';
  src: url("assets/fonts/Menlo-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'SiteFont', monospace, sans-serif;
  background-color: #202020;
  background-image: url("/assets/images/background.png");
  background-repeat: no-repeat;
  background-position: center center;
  background-attachment: fixed;
  background-size: cover;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #e0e0e0; 
}

.content-box {
  width: 85%;
  max-width: 900px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 25px;
  padding: 40px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(5px);
  margin: 40px 0;
  color: #333;
}

h1, h2, h3 {
  color: #121212;
  margin-top: 0;
  font-weight: 600;
  text-align: center;
}

p {
  line-height: 1.6;
  margin-bottom: 20px;
}

a {
  color: #216D2F;
  text-decoration: none;
  transition: color 0.3s;
}

a:hover {
  color: #2d8b3e;
  text-decoration: underline;
}

.button {
  display: inline-block;
  background: #216d2f;
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s;
  font-weight: 500;
}

.button:hover {
  background: #1a6127;
  color: #ffffff;
}

.button:active {
  background: #1a5d26;
  transform: scale(0.98);
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.3);
}

.delete-btn {
  background-color: #C62828;
  color: white;
  border: none;
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.delete-btn:hover:not(:disabled) {
  background-color: #a02020;
}

.delete-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.6;
}

.section {
  margin-bottom: 30px;
  padding: 20px;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.section h2 {
  color: #216D2F;
  margin-top: 0;
  margin-bottom: 20px;
  text-align: center;
}

.section button {
  display: inline-block;
  background: #216d2f;
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s;
  font-weight: 500;
}

.section button:hover {
  background: #1a6127;
  color: #ffffff;
}

.section button:active {
  background: #1a5d26;
  transform: scale(0.98);
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.3);
}

.section input[type="text"] {
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  width: calc(100% - 160px);
  max-width: 400px;
  margin-right: 10px;
}

.translation-result {
  margin-top: 20px;
  padding: 15px;
  background-color: #f8f8f8;
  border-radius: 8px;
  border-left: 4px solid #216D2F;
}

.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -10px;
  padding: 0 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  table-layout: fixed;
}

th, td {
  border: 1px solid #ddd;
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 200px;
}

th {
  background-color: #f5f5f5;
  font-weight: 600;
}

th:nth-child(1), td:nth-child(1) {
  width: 35%;
}

th:nth-child(2), td:nth-child(2) {
  width: 65%;
}

.status-message {
  padding: 12px;
  margin: 15px 0;
  border-radius: 6px;
  font-weight: 500;
}

.error {
  background-color: #ffebee;
  color: #C62828;
  border-left: 4px solid #C62828;
}

.success {
  background-color: #e8f5e9;
  color: #216D2F;
  border-left: 4px solid #216D2F;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 12px;
  margin: 8px 0 20px;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-sizing: border-box;
  font-size: 16px;
  transition: border-color 0.3s;
  background-color: white;
  font-family: inherit;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #216D2F;
  outline: none;
  box-shadow: 0 0 0 2px rgba(33, 109, 47, 0.2);
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
  gap: 15px;
}

.pagination button {
  padding: 8px 16px;
  background-color: #216D2F;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s;
  font-family: 'SiteFont', monospace, sans-serif;
}

.pagination button:hover:not(:disabled) {
  background-color: #1a6127;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: #cccccc;
}

.pagination #pageInfo {
  font-size: 14px;
  color: #555;
  min-width: 100px;
  text-align: center;
  font-weight: 500;
}

.login-page {
  font-family: 'SiteFont', monospace, sans-serif;
  background-color: #202020;
  background-image: url("/images/background.png");
  background-repeat: no-repeat;
  background-position: center center;
  background-attachment: fixed;
  background-size: cover;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #e0e0e0;
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 0 20px;
}

.login-box {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-title {
  color: #000000;
  text-align: center;
  margin-bottom: 30px;
  font-size: 24px;
  font-weight: 600;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  color: #575757;
  font-size: 14px;
}

.form-input {
  padding: 12px 15px;
  border: 1px solid #444;
  border-radius: 8px;
  font-size: 16px;
  background-color: rgba(255, 255, 255, 0.1);
  color: #000000;
  transition: all 0.3s;
}

.form-input:focus {
  outline: none;
  border-color: #216D2F;
  background-color: rgba(255, 255, 255, 0.2);
}

.login-button {
  background: #216d2f;
  color: white;
  padding: 14px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: background 0.3s;
  margin-top: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.login-button:hover {
  background: #1a6127;
}

.error-message {
  color: #ff6b6b;
  padding: 12px;
  background-color: rgba(198, 40, 40, 0.1);
  border-radius: 8px;
  display: none;
  margin-top: 15px;
  border-left: 3px solid #C62828;
  font-size: 14px;
}

.loading-status {
  text-align: center;
  padding: 15px;
  color: #666;
  font-style: italic;
  display: none;
}

.error-status {
  text-align: center;
  padding: 15px;
  color: #d32f2f;
  background-color: #ffebee;
  border-radius: 8px;
  border-left: 4px solid #C62828;
}

.refresh-button {
  padding: 10px 20px;
  background-color: #216d2f;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  float: right;
}
        
.refresh-button:hover {
  background-color: #1a5725;
}

.passport-image {
  width: 200%;
  height: 200%;
  image-rendering: pixelated;
  float: left;
}

.menu-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 40px;
  height: 40px;
  background: #216D2F;
  border-radius: 8px;
  cursor: pointer;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}

.menu-toggle:hover {
  background: #1a6127;
  transform: scale(1.05);
}

.menu-toggle span {
  width: 24px;
  height: 3px;
  background: white;
  border-radius: 3px;
  transition: all 0.3s ease;
}

.menu-toggle.open span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.menu-toggle.open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

.side-menu {
  position: fixed;
  top: 0;
  left: -300px;
  width: 280px;
  height: 100vh;
  background: white;
  box-shadow: 2px 0 10px rgba(0,0,0,0.1);
  z-index: 999;
  transition: left 0.3s ease;
  display: flex;
  flex-direction: column;
}

.side-menu.open {
  left: 0;
}

.menu-header {
  padding: 30px 20px 20px;
  border-bottom: 2px solid #f0f0f0;
}

.menu-header h3 {
  margin: 0;
  color: #216D2F;
  font-size: 24px;
}

.menu-nav {
  flex: 1;
  padding: 20px 0;
  display: flex;
  flex-direction: column;
}

.menu-link {
  padding: 15px 25px;
  color: #333;
  text-decoration: none;
  font-size: 18px;
  transition: all 0.2s;
  display: block;
  border-left: 4px solid transparent;
}

.menu-link:hover {
  background: #f5f5f5;
  color: #216D2F;
}

.menu-link.active {
  border-left-color: #216D2F;
  background: rgba(33, 109, 47, 0.1);
  color: #216D2F;
  font-weight: 500;
}

.menu-link.logout {
  margin-top: auto;
  color: #C62828;
  border-top: 1px solid #f0f0f0;
  margin-top: 20px;
}

.menu-link.logout:hover {
  background: #ffebee;
  border-left-color: #C62828;
}

.menu-footer {
  padding: 20px;
  text-align: center;
  color: #999;
  font-size: 14px;
  border-top: 1px solid #f0f0f0;
}

.admin-section {
  border: 2px dashed #216D2F;
  background: rgba(33, 109, 47, 0.05);
}

.add-word-form {
  display: flex;
  gap: 10px;
  align-items: center;
}

.add-word-form input {
  flex: 1;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
}

.my-words-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.word-card {
  display: flex;
  gap: 15px;
  align-items: center;
  padding: 15px;
  background: #f8f8f8;
  border-radius: 10px;
  border-left: 4px solid #216D2F;
}

.word-card .word {
  font-size: 18px;
  font-weight: 600;
  min-width: 150px;
  color: #333;
}

.word-card .translation-input {
  flex: 1;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
}

.word-card .translation-input:focus {
  border-color: #216D2F;
  outline: none;
  box-shadow: 0 0 0 2px rgba(33, 109, 47, 0.2);
}

.claim-btn {
  background: #2196F3;
  padding: 8px 16px;
  font-size: 14px;
}

.claim-btn:hover {
  background: #1976D2;
}

.complete-btn {
  background: #216D2F;
  padding: 8px 16px;
  font-size: 14px;
  min-width: 100px;
}

.search-box {
  margin-bottom: 20px;
}

.search-box input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  box-sizing: border-box;
}

.search-box input:focus {
  border-color: #216D2F;
  outline: none;
  box-shadow: 0 0 0 2px rgba(33, 109, 47, 0.2);
}

.loading-message {
  text-align: center;
  color: #666;
  font-style: italic;
  padding: 20px;
}

.empty-message {
  text-align: center;
  color: #999;
  padding: 20px;
}

.not-found {
  text-align: center;
  color: #C62828;
  padding: 10px;
}

.error-message {
  text-align: center;
  color: #C62828;
  background: #ffebee;
  padding: 10px;
  border-radius: 6px;
}

.actions-cell {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
}

.admin-container {
  max-width: 1000px;
  margin: 0 auto;
}

.user-form {
  background: #f5f5f5;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 30px;
}

.user-form h3 {
  margin-top: 0;
  color: #216D2F;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  color: #333;
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 16px;
  box-sizing: border-box;
}

.form-group input:focus {
  border-color: #216D2F;
  outline: none;
  box-shadow: 0 0 0 2px rgba(33, 109, 47, 0.2);
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  margin-top: 20px;
}

.users-table th {
  background: #216D2F;
  color: white;
  padding: 12px;
  text-align: left;
  font-weight: 500;
}

.users-table td {
  padding: 12px;
  border-bottom: 1px solid #ddd;
}

.users-table tr:hover {
  background: #f5f5f5;
}

.users-table .current-user-row {
  background: rgba(33, 109, 47, 0.1);
  font-weight: 500;
}

.action-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.edit-btn {
  background: #2196F3;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.edit-btn:hover {
  background: #1976D2;
}

.success-message {
  background: #4CAF50;
  color: white;
  padding: 12px 20px;
  border-radius: 6px;
  margin-bottom: 20px;
  animation: slideIn 0.3s ease;
}

.error-message {
  background: #C62828;
  color: white;
  padding: 12px 20px;
  border-radius: 6px;
  margin-bottom: 20px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.password-modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 5px 30px rgba(0,0,0,0.3);
  z-index: 2000;
  width: 400px;
  max-width: 90%;
}

.password-modal.active {
  display: block;
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -60%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.password-modal h3 {
  margin-top: 0;
  color: #333;
  margin-bottom: 20px;
}

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(3px);
  z-index: 1999;
}

.modal-overlay.active {
  display: block;
  animation: overlayFadeIn 0.3s ease;
}

@keyframes overlayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-buttons {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.modal-buttons button {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.2s;
}

.save-btn {
  background: #216D2F;
  color: white;
}

.save-btn:hover {
  background: #1a6127;
  transform: translateY(-1px);
}

.save-btn:active {
  transform: translateY(0);
}

.cancel-btn {
  background: #999;
  color: white;
}

.cancel-btn:hover {
  background: #777;
  transform: translateY(-1px);
}

.cancel-btn:active {
  transform: translateY(0);
}

.notepad {
  position: fixed;
  width: 250px;
  min-width: 150px;
  min-height: 150px;
  background: rgba(255, 255, 240, 0.95);
  backdrop-filter: blur(5px);
  border: 2px solid #216D2F;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.2);
  z-index: 10000;
  resize: both;
  overflow: hidden;
  display: none;
  font-family: 'SiteFont', monospace, sans-serif;
}

.notepad.visible {
  display: block;
}

.notepad-header {
  padding: 8px 12px;
  background: #216D2F;
  color: white;
  cursor: move;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  border-radius: 10px 10px 0 0;
}

.notepad-title {
  font-weight: 500;
  letter-spacing: 0.5px;
}

.notepad-close {
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  padding: 0 5px;
  line-height: 1;
}

.notepad-close:hover {
  opacity: 0.8;
}

.notepad-content {
  padding: 12px;
  height: calc(100% - 40px);
  box-sizing: border-box;
}

.notepad-textarea {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  resize: none;
  font-family: 'SiteFont', monospace, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
  outline: none;
  padding: 0;
}

.notepad-textarea::placeholder {
  color: #aaa;
  font-style: italic;
}

.notepad-toggle {
  position: fixed;
  bottom: 45px;
  right: 15px;
  width: 50px;
  height: 50px;
  background: #216D2F;
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.notepad-toggle:hover {
  background: #1a6127;
  transform: scale(1.1);
}

.notepad-toggle:active {
  transform: scale(0.95);
}

.notepad .resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 15px;
  height: 15px;
  cursor: se-resize;
  background: linear-gradient(135deg, transparent 50%, #216D2F 50%);
  border-radius: 0 0 8px 0;
}

.site-version {
  position: fixed;
  bottom: 10px;
  right: 15px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 10px;
  border-radius: 12px;
  backdrop-filter: blur(4px);
  font-family: 'SiteFont', monospace;
  z-index: 9998;
  user-select: none;
  pointer-events: none;
}

.site-copyright {
  position: fixed;
  bottom: 10px;
  left: 15px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 12px;
  border-radius: 12px;
  backdrop-filter: blur(4px);
  font-family: 'SiteFont', monospace;
  z-index: 9998;
  user-select: none;
  pointer-events: none;
  white-space: nowrap;
}

.hint-message {
  margin-top: 10px;
  font-size: 14px;
  color: #666;
  font-style: italic;
}

/* ===== АДАПТАЦИЯ ДЛЯ МОБИЛЬНЫХ ===== */
@media (max-width: 768px) {
  .content-box {
    width: 95%;
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
  }

  body {
    font-size: 14px;
  }

  .button {
    padding: 10px 18px;
    font-size: 14px;
  }

  th, td {
    padding: 8px 6px;
    font-size: 14px;
  }

  .table-container {
    margin: 0 -15px;
    padding: 0 15px;
  }

  .section {
    padding: 15px;
  }

  .section input[type="text"] {
    width: 100%;
    max-width: none;
    margin-bottom: 10px;
    margin-right: 0;
  }

  .section button {
    width: 100%;
    margin-left: 0;
    margin-top: 10px;
  }

  .side-menu {
    width: 250px;
  }

  .menu-link {
    padding: 12px 20px;
    font-size: 16px;
  }

  .word-card {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .word-card .word {
    min-width: auto;
  }

  .add-word-form {
    flex-direction: column;
  }

  .add-word-form input,
  .add-word-form button {
    width: 100%;
  }

  .actions-cell {
    flex-direction: column;
    gap: 5px;
  }

  .actions-cell button {
    width: 100%;
  }

  .users-table {
    font-size: 14px;
  }

  .users-table th,
  .users-table td {
    padding: 8px;
  }

  .action-buttons {
    flex-direction: column;
    gap: 5px;
  }

  .edit-btn,
  .delete-btn {
    width: 100%;
    padding: 8px;
  }

  .password-modal {
    padding: 20px;
    width: 90%;
  }

  .modal-buttons {
    flex-direction: column;
  }

  .notepad {
    width: 200px;
  }

  /* --- Кнопка блокнота --- */
  .notepad-toggle {
    width: 50px !important;
    height: 50px !important;
    font-size: 40px !important;
    bottom: 45px !important;  /* Подняли повыше, чтобы не перекрывала версию */
    right: 15px !important;
  }

  /* --- Версия сайта --- */
  .site-version {
    bottom: 15px !important;
    right: 15px !important;
    font-size: 12px !important;
    padding: 4px 10px !important;
    z-index: 9999 !important;
  }

  /* --- Копирайт --- */
  .site-copyright {
    bottom: 15px !important;
    left: 15px !important;
    font-size: 12px !important;
    padding: 4px 12px !important;
    z-index: 9999 !important;
  }

  /* Уменьшаем шрифт и элементы на телефонах */
  body,
  .content-box,
  .content-box *,
  .button,
  .delete-btn,
  input,
  textarea,
  select,
  .menu-link,
  .pagination button {
    font-size: 0.97em;
  }

  .button,
  .delete-btn,
  .edit-btn,
  .save-btn,
  .cancel-btn,
  .claim-btn,
  .complete-btn,
  .login-button,
  .pagination button,
  .refresh-button,
  .notepad-toggle {
    font-size: 14px !important;
    padding: 8px 14px !important;
    min-height: 38px;
  }

  input[type="text"],
  input[type="password"],
  input[type="email"],
  textarea,
  select,
  .search-box input,
  .add-word-form input,
  .word-card .translation-input,
  .form-input {
    font-size: 14px !important;
    padding: 8px 12px !important;
    min-height: 38px;
  }

  .delete-btn {
    font-size: 14px !important;
    padding: 4px 10px !important;
  }
}

@media (max-width: 480px) {
  .login-box {
    padding: 25px;
    border-radius: 12px;
  }

  .login-title {
    font-size: 20px;
    margin-bottom: 20px;
  }

  .form-input {
    padding: 10px 12px;
  }

  .login-button {
    padding: 12px;
    font-size: 15px;
  }
}