/* Hamburger menu */

.hamburger-menu {
  position: fixed;
  top: 5px;
  right: 10px;
  cursor: pointer;
  font-size: 24px;
  z-index: 1500;
}

.hamburger-menu i {
  color: #777;
}

.hamburger-content {
  position: fixed;
  z-index: 2000;
  top: 40px;
  right: 10px;
  padding: 10px;
  background-color: var(--color-surface);
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.hamburger-content.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.hamburger-content a,
.hamburger-content label {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  color: var(--color-text);
  border-radius: 4px;
  text-decoration: none;
}

.hamburger-content a:hover,
.hamburger-content label:hover {
  background-color: var(--color-bg);
  cursor: pointer;
}

/* Modal */

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 3000;
  background-color: rgba(0, 0, 0, 0.6);
  justify-content: center;
  align-items: center;
}

.modal.visible {
  display: flex;
}

@media (min-width: 1024px) {
  .hamburger-menu,
  .hamburger-content {
    display: none !important;
  }
}

.modal-content {
  position: relative;
  background-color: var(--color-surface);
  padding: var(--space-md);
  border-radius: 8px;
  max-width: 90%;
  width: 400px;
}

.modal--ng-source .modal-content {
  width: min(720px, 90vw);
  max-height: 85vh;
}

.ng-source-modal__content {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  height: 100%;
}

.ng-source-modal__header {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.ng-source-modal__headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

.ng-source-modal__title {
  margin: 0;
  font-size: 1.25rem;
}

.ng-source-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background-color: #fff;
  color: var(--color-text);
  font-size: 1.25rem;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.ng-source-modal__close:hover {
  background-color: rgba(60, 79, 171, 0.08);
  color: var(--color-primary);
}

.ng-source-modal__actions {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 599px) {
  .ng-source-modal__actions {
    justify-content: flex-start;
  }
}

@media (min-width: 600px) {
  .ng-source-modal__header {
    align-items: stretch;
  }

  .ng-source-modal__headline {
    align-items: center;
  }
}

.ng-source-modal__button {
  padding: 0.5rem 1rem;
  border-radius: 4px;
  border: none;
  background-color: var(--color-primary);
  color: #fff;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.ng-source-modal__button:hover {
  background-color: #3c4fab;
}

.ng-source-modal__button--ghost {
  background-color: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.ng-source-modal__button--ghost:hover {
  background-color: rgba(60, 79, 171, 0.08);
}

.ng-source-modal__lists {
  flex: 1;
  display: grid;
  gap: var(--space-md);
  overflow-y: auto;
  padding-right: 4px;
}

@media (min-width: 768px) {
  .ng-source-modal__lists {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

.ng-source-modal__section {
  background-color: #f8f9ff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-height: clamp(220px, 45vh, 360px);
  overflow: hidden;
}

.ng-source-modal__section--official {
  max-height: none;
  overflow: auto;
}

.ng-source-modal__section-title {
  margin: 0;
  font-size: 1rem;
  color: var(--color-primary);
}

.ng-source-modal__list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  overflow-y: auto;
  padding-right: 4px;
}

.ng-source-modal__list--nested {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.ng-source-modal__official-groups {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.ng-source-modal__official-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-sm);
  border-radius: 6px;
  background-color: #fff;
  border: 1px solid #e1e5ff;
}

.ng-source-modal__official-group-title {
  margin: 0;
  font-size: 1rem;
  color: var(--color-primary);
}

.ng-source-modal__official-category {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.ng-source-modal__official-category-title {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-text);
}

@media (max-width: 599px) {
  .ng-source-modal__section {
    max-height: clamp(200px, 50vh, 320px);
  }
}

.ng-source-modal__item {
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-xs);
}

.ng-source-modal__item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.ng-source-modal__label {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.875rem;
  color: var(--color-text);
}

.ng-source-modal__source {
  flex: 1;
  line-height: 1.5;
}

.close-button {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 24px;
  color: #666;
  cursor: pointer;
}

.ng-word-input {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}

.ng-word-input input {
  flex: 1;
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: 4px;
}

.ng-word-input button {
  padding: var(--space-xs) var(--space-sm);
  background-color: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.ng-word-list {
  max-height: 200px;
  overflow-y: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ng-word-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--color-border);
}

.delete-ng-word {
  background: none;
  border: none;
  color: #c00;
  cursor: pointer;
}
