/* ===== ПЕРЕМЕННЫЕ И ОБЩИЕ СТИЛИ ===== */
:root {
  --transition-default: all 0.3s ease;
  --transition-fast: all 0.2s ease;
  --modal-animation-duration: 0.3s;
}

/* ===== МОДАЛЬНЫЕ ОВЕРЛЕИ (УНИФИЦИРОВАННЫЕ) ===== */
.modal-overlay,
.form-modal-overlay,
.item-modal-overlay,
.tag-modal-overlay,
.participant-modal-overlay,
.place-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 20px;
  display: none;
  opacity: 0;
  transition: opacity var(--modal-animation-duration) ease, 
              background var(--modal-animation-duration) ease;
}

.modal-overlay.show,
.form-modal-overlay.show,
.item-modal-overlay.show,
.tag-modal-overlay.show,
.participant-modal-overlay.show,
.place-modal-overlay.show {
  display: flex;
  opacity: 1;
  background: rgba(0, 0, 0, 0.8);
}

/* ===== МОДАЛЬНЫЕ КОНТЕЙНЕРЫ (УНИФИЦИРОВАННЫЕ) ===== */
.modal-container,
.form-container,
.item-modal,
.tag-modal,
.participant-modal,
.place-modal {
  width: 50%;
  max-width: calc(100% - 40px);
  background: var(--background-color);
  border-radius: 10px;
  padding: 20px;
  box-shadow: var(--modal-shadow);
  color: var(--text-color);
  margin: auto;
  position: relative;
  transform: scale(0.7);
  opacity: 0;
  transition: transform var(--modal-animation-duration) ease, 
              opacity var(--modal-animation-duration) ease;
}

.item-modal--wide {
  width: 80%;
}

.item-modal--meeting {
  width: 80%;
  height: 100%;
}

.item-screen--meeting {
  height: 100%;
}

item-form--meeting {
  height: 100%;
}


.modal-overlay.show .modal-container,
.form-modal-overlay.show .form-container,
.item-modal-overlay.show .item-modal,
.tag-modal-overlay.show .tag-modal,
.participant-modal-overlay.show .participant-modal,
.place-modal-overlay.show .place-modal {
  transform: scale(1);
  opacity: 1;
}

/* ===== КНОПКА ЗАКРЫТИЯ (УНИФИЦИРОВАННАЯ) ===== */
.modal-close {
  position: absolute;
  right: 20px;
  top: -20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--menu-buttons-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  color: white;
  z-index: 1001;
  opacity: 1;
  transform: translateY(0);
  transition: var(--transition-fast);
  border: none;
}

.modal-close:hover {
  transform: translateY(-1px);
}

.participants-name, .hint{
  font-size: 0.8rem;
}


/* ===== ЭКРАНЫ И НАВИГАЦИЯ ===== */
.screen,
.registration-screen,
.verification-screen,
.item-screen {
  position: absolute;
  width: 100%;
  top: 0;
  left: 0;
  transition: transform var(--modal-animation-duration) ease;
}

#registrationScreensContainer,
#itemScreensContainer {
  position: relative;
  overflow: hidden;
  width: 100%;
}

/* ===== ФОРМА (ОБЩИЕ СТИЛИ) ===== */
.form,
.item-form,
.registration-form,
#registrationModalForm,
#itemMainForm,
#itemDetailsForm,
#pollOptionsForm {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ===== СТРОКИ И КОЛОНКИ ФОРМЫ ===== */
.form-row {
  display: flex;
  gap: 15px;
  margin-bottom: 0;
}

.form-col {
  flex: 1;
}

/* ===== МЕТКИ И ЛЕЙБЛЫ ===== */
.form-label,
.item-label,
.auth-label {
  display: block;
  margin-bottom: 2px;
  font-size: 13px;
  color: var(--label-color);
  font-weight: normal;
}

.auth-label {
  margin-bottom: 15px;
  font-size: 14px;
}

/* ===== ПОЛЯ ВВОДА (УНИФИЦИРОВАННЫЕ) ===== */
.form-input,
.form-select,
.item-input,
.item-select,
.form-textarea,
.item-textarea,
.tag-input,
.participant-input, 
.place-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  transition: var(--transition-default);
  box-sizing: border-box;
  background-color: var(--background-color);
}

.form-input:focus,
.form-select:focus,
.item-input:focus,
.item-select:focus,
.form-textarea:focus,
.item-textarea:focus,
.tag-input:focus,
.place-input:focus,
.participant-input:focus {
  outline: none;
  border-color: var(--focus-border-color);
  box-shadow: 0 0 0 3px var(--focus-shadow-color);
}

.form-input.error,
.form-select.error,
.item-input.error,
.item-select.error,
.tag-input.error,
.place-input.error,
.participant-input.error {
  border-color: var(--error-border-color);
  box-shadow: 0 0 0 3px var(--error-shadow-color);
}

.form-input[readonly],
.form-input:disabled,
.form-select:disabled,
.item-input:disabled,
.item-select:disabled {
  background-color: var(--disabled-bg-color);
  cursor: not-allowed;
}

/* Специальные стили для textarea */
.form-textarea,
.item-textarea {
  resize: vertical;
  min-height: 100px;
}

/* ===== ГРУППЫ ФОРМЫ ===== */
.form-group {
  margin-bottom: 15px;
  width: 100%;
}



/* ===== ДЕЙСТВИЯ ФОРМЫ (КНОПКИ) ===== */
.form-actions,
.item-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.item-actions {
  margin-top: auto;
}

/* ===== КНОПКИ (УНИФИЦИРОВАННЫЕ) ===== */
.form-btn,
.item-btn,
.tag-btn,
.participant-btn, 
.place-btn {
  padding: 8px 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition-fast);
}

.form-btn-primary,
.item-btn-primary,
.tag-btn-add,
.participant-btn-add, 
.place-btn-add {
  background: var(--primary-btn-bg);
  color: var(--primary-btn-color);
}

.form-btn-primary:hover,
.item-btn-primary:hover,
.tag-btn-add:hover,
.participant-btn-add:hover, 
.place-btn-add:hover {
  transform: translateY(-1px);
}

.form-btn-secondary,
.item-btn-secondary,
.tag-btn-cancel,
.participant-btn-cancel {
  background: var(--secondary-btn-bg);
  color: var(--secondary-btn-color);
}

.form-btn-secondary:hover,
.item-btn-secondary:hover,
.tag-btn-cancel:hover,
.participant-btn-cancel:hover {
  transform: translateY(-1px);
}

.form-btn:disabled,
.item-btn:disabled,
.tag-btn:disabled,
.participant-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.tag-btn:active,
.participant-btn:active {
  transform: scale(0.98);
}

/* ===== ЧЕКБОКСЫ ===== */
input[type="checkbox"] {
  accent-color: var(--color-accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  margin: 0;
}

.checkbox-text {
  display: flex;
  align-items: center;
}

.policy-link {
  color: var(--color-accent);
  text-decoration: none;
}

.policy-link:hover {
  text-decoration: underline;
}

/* ===== АНИМАЦИЯ SHAKE ===== */
@keyframes shake-animation {
  0% { transform: translateX(0); }
  15% { transform: translateX(-8px); }
  30% { transform: translateX(8px); }
  45% { transform: translateX(-6px); }
  60% { transform: translateX(6px); }
  75% { transform: translateX(-3px); }
  100% { transform: translateX(0); }
}

.shake-anim {
  animation: shake-animation 0.45s ease;
}

.checkbox-error {
  outline: none;
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.12);
  border-color: #e74c3c !important;
}

/* ===== ЯЗЫКОВЫЕ ГРУППЫ ===== */
.language-group {
  margin-top: 0;
  padding-bottom: 0;
}

.language-group label {
  margin-top: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== КНОПКА ПЕРЕВОДА ===== */
.yandex-translate-btn,
.yandex-translate-btn-transcript,
.yandex-translate-poll-btn {
  margin-left: 8px;
  background-color: rgba(74, 137, 220, 0.4);
  border-radius: 16px;
  font-size: 0.7rem;
  padding: 4px 8px;
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
}

.yandex-translate-btn:hover,
.yandex-translate-btn-transcript:hover,
.yandex-translate-poll-btn:hover {
  background-color: rgba(74, 137, 220, 0.6);
}

/* ===== ПОДСКАЗКИ И ПРЕДЛОЖЕНИЯ ===== */
.places-list-overlay,
.tags-list-overlay {
  position: absolute;
  z-index: 9999;
  background: #fff;
  border: 1px solid #ddd;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  max-height: 260px;
  overflow: auto;
  display: none;
  padding: 6px 0;
  box-sizing: border-box;
  margin-top: 6px;
}

.places-list-overlay.visible,
.tags-list-overlay.visible {
  display: block;
}

.suggestion,
.participant-suggestion,
.tag-suggestion,
.place-suggestion {
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  transition: var(--transition-fast);
}

.suggestion:hover,
.participant-suggestion:hover,
.tag-suggestion:hover,
.place-suggestion:hover {
  background: #f5f7fb;
}

.name {
  font-size: 0.8rem;
  color: #333;
}

.lang {
  color: #666;
  font-size: 0.8rem;
}

/* ===== ВЫБРАННЫЕ ЭЛЕМЕНТЫ ===== */
.participants-selecteds,
.tags-selecteds {
  margin-top: 6px;
  overflow-y: auto;
  box-sizing: border-box;
  max-height: 130px;
}

.participants-selected,
.tags-selected {
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  padding: 4px 6px;
  margin-bottom: 4px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}

.tags-selected-row,
.participants-selected-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.remove {
  background: transparent;
  border: none;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  transition: var(--transition-fast);
}

.remove:hover {
  color: #e74c3c;
}

/* ===== СПЕЦСТИЛИ ДЛЯ МОДАЛЬНЫХ ОКОН ТЕГОВ И УЧАСТНИКОВ ===== */
.tag-modal,
.participant-modal, .place-modal {
  width: 400px;
  max-width: 90%;
  max-height: 80vh;
}

.tag-modal h3,
.participant-modal h3 {
  margin-bottom: 15px;
  text-align: center;
  font-size: 1.2rem;
  color: #333;
}

.tag-language-group,
.participant-language-group, .place-language-group {
  margin-bottom: 15px;
}

.tag-language-group label,
.participant-language-group label, .place-language-group {
  display: block;
  margin-bottom: 5px;
  font-size: 0.9rem;
  color: #666;
}

.tag-modal-actions,
.participant-modal-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

.participant-modal-actions {
  justify-content: flex-end;
  gap: 10px;
}

/* ===== ОБЩИЕ СТИЛИ ДЛЯ TOOLBAR И ТАБЛИЦ ===== */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-actions {
  display: flex;
  gap: 10px;
}

.toolbar-btn {
  background-color: var(--menu-buttons-color);
  color: var(--color-white);
  border: none;
  border-radius: 5px;
  padding: 10px 15px;
  cursor: pointer;
  transition: var(--transition-default);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
}

/* ===== ПОИСК ===== */
.search-container {
  position: relative;
  display: flex;
  align-items: center;
  width: 500px;
  min-width: 300px;
}

.search-container .fa-search {
  position: absolute;
  left: 12px;
  z-index: 10;
  color: var(--color-muted);
}

.search-container input {
  padding-left: 35px;
  width: 100%;
  height: 35px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  font-size: 1rem;
}

/* ===== ТАБЛИЦА ===== */
.table-container {
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  background: var(--color-white);
}

.table-responsive {
  overflow-x: auto;
  border-radius: 8px;
}

#report-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 0;
  --bs-table-border-color: transparent !important;
  border-color: transparent !important;
}

#report-table.table,
#report-table.table > :not(caption) > * > *,
#report-table.table > :not(caption) > * > th,
#report-table.table > :not(caption) > * > td {
  border: none !important;
  box-shadow: none !important;
  background-color: transparent !important;
  background-image: none !important;
}

#report-table th,
#report-table td {
  padding: 8px 6px !important;
  border: none !important;
  vertical-align: middle !important;
}

#report-table thead {
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 2px solid var(--color-accent) !important;
  background: var(--color-header-overlay);
}

#report-table thead tr {
  border-bottom: 2px solid var(--color-accent) !important;
  background: var(--color-header-overlay);
}

#report-table thead th {
  color: var(--text-header-color);
  font-size: 0.85rem !important;
  font-weight: var(--text-header-weight) !important;
  padding: 12px 8px !important;
  white-space: normal;
  word-wrap: break-word;
  line-height: 1.3;
  background: transparent;
  border: none !important;
  vertical-align: middle;
}

#report-table tbody tr:nth-child(even) {
  background-color: var(--color-row-even) !important;
  vertical-align: middle !important;
}

#report-table tbody tr:nth-child(odd) {
  background-color: var(--color-white) !important;
  vertical-align: middle !important;
}

#report-table tbody tr:hover {
  background-color: var(--color-hover) !important;
  cursor: pointer;
}

#report-table tbody td {
  padding: 8px 6px;
  vertical-align: top;
  line-height: 1.4;
  font-size: 0.8rem;
  word-wrap: break-word;
  border: none !important;
}

#report-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 8px;
}

#report-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 8px;
}

.col-checkbox {
  width: 30px;
  text-align: center;
}

/* ===== TOOLTIP ===== */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltiptext {
  visibility: hidden;
  background-color: var(--header-bg-color-var);
  color: var(--color-white);
  text-align: center;
  border-radius: 4px;
  padding: 6px 10px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 0.8rem;
  white-space: nowrap;
}

.tooltip .tooltiptext::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: var(--header-bg-color-var) transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* ===== ГЛОБАЛЬНЫЙ СПИННЕР ===== */
.global-spinner {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  z-index: 3000;
  pointer-events: none;
  transition: opacity 0.18s ease;
  opacity: 0;
}

.global-spinner.show {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.spinner-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.7);
}

/* ===== ПЕРЕКЛЮЧАТЕЛИ ЯЗЫКА И ПОЛЬЗОВАТЕЛЯ ===== */
.language-switcher,
.user-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px 15px;

  border-radius: 25px;
  transition: var(--transition-default);
  position: relative;
  overflow: hidden;
  font-size: var(--text-header-size);
  font-weight: var(--text-header-weight);
  color: var(--text-header);
  white-space: nowrap;
  flex-shrink: 0;
  height: 40px;
  box-sizing: border-box;
  justify-content: center;
  border: none;
}

.current-user {
  display: inline-block;
  max-width: 5ch;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.user-switcher.menu-open {
  background-color: var(--title-hover-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ===== ПЛАВАЮЩИЕ КНОПКИ ===== */
.floating-btn-wrapper {
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.8) rotateX(-15deg);
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  pointer-events: none;
  filter: blur(5px);
  perspective: 1000px;
  z-index: 999;
}

.floating-btn-wrapper.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1) rotateX(0deg);
  filter: blur(0px);
  pointer-events: auto;
}

.floating-btn-wrapper:not(.show) {
  display: none !important;
}

.floating-btn-container {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(141, 142, 141, 0.7);
  border-radius: 30px;
  padding: 8px 15px;
  cursor: pointer;
  border: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  height: 40px;
  box-sizing: border-box;
  gap: 8px;
  backdrop-filter: blur(10px);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-style: preserve-3d;
}

.floating-btn-container:hover {
  background: var(--title-hover-color);
  transform: translateY(-2px);
}

.btn-tooltip,
.btn-icon {
  display: flex;
  align-items: center;
  line-height: 1;
}

/* ===== УТИЛИТЫ ===== */
.under-label {
  text-align: right;
  margin-bottom: 20px;
  margin-top: -15px;
}

.under-label-link {
  color: #6c757d;
  text-decoration: none;
  font-size: 0.8rem;
}

.under-label-link:hover {
  color: #0066cc;
}

/* ===== АДАПТИВНЫЙ ДИЗАЙН ===== */
@media (max-width: 1024px) {

  .search-container {
    width: 100%;
    min-width: unset;
    max-width: 100%;
  }

  .ms-auto {
    margin-left: 0 !important;
  }
}

@media (max-width: 768px) {
  .under-label {
    margin-top: 0px;
  }

  .form-group{
    margin-bottom: 0px;
  }

  .form-row {
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;

  }

  .modal-container,
  .form-container,
  .item-modal {
    width: calc(100% - 24px);
    padding: 16px;
    min-width: 100%;
  }

  .form-actions,
  .item-actions {
    flex-direction: column-reverse;
    gap: 8px;
  }

  .form-btn,
  .item-btn {
    min-width: unset;
  }

  .floating-btn-container {
    padding: 6px 12px;
    height: 36px;
  }

  .tag-modal,
  .participant-modal {
    width: 95%;
    margin: 0 10px;
    padding: 15px;
  }

  .tag-modal h3,
  .participant-modal h3 {
    font-size: 1rem;
  }

  .tag-input,
  .participant-input, .place-input {
    font-size: 0.8rem;
    padding: 8px;
  }

  .tag-btn,
  .participant-btn {
    padding: 8px 15px;
    font-size: 0.8rem;
  }

  .item-modal--meeting {
    width: 80%;
    height: 700px;
  }
}

@media (max-width: 480px) {
  .floating-btn-container {
    height: 32px;
    padding: 4px 10px;
  }

  .modal-close {
    right: 10px;
    top: -15px;
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
}

/* Стили для тряски и ошибок логина */
.shake-animation {
    animation: shake 0.5s ease-in-out;
}

.error-field {
    border: 1px solid #ff4444 !important;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}


