/**
 * Language Modal Styles
 * Стили для модального окна выбора языка
 */

/* Modal overlay */
.modal {
  display: none;
}

.modal.is-open {
  display: block;
}

.modal__overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  backdrop-filter: blur(4px);
}

.modal__container {
  background-color: #1a1f3a;
  padding: 0;
  max-width: 500px;
  width: 90%;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal__header {
  background: linear-gradient(135deg, #2a2f5a 0%, #1a1f3a 100%);
  padding: 24px;
  position: relative;
  border-bottom: 2px solid rgba(255, 215, 0, 0.2);
}

.modal__title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  text-align: center;
}

.modal__close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  width: 32px;
  height: 32px;
  cursor: pointer;
  color: #fff;
  border-radius: 50%;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal__close:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: rotate(90deg);
}

.modal__content {
  padding: 24px;
}

/* Language list */
.lang-modal__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lang-modal__item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 16px;
  font-weight: 500;
  color: #fff;
  text-align: left;
  width: 100%;
}

.lang-modal__item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 215, 0, 0.5);
  transform: translateX(8px);
}

.lang-modal__item:focus {
  outline: 2px solid #ffd700;
  outline-offset: 2px;
}

.lang-modal__item--active {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 215, 0, 0.1) 100%);
  border-color: #ffd700;
}

.lang-modal__item--active::after {
  content: '✓';
  margin-left: auto;
  font-size: 20px;
  color: #ffd700;
  font-weight: bold;
}

.lang-modal__item img {
  flex-shrink: 0;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.lang-modal__item span {
  flex: 1;
}

/* Mobile styles */
@media (max-width: 600px) {
  .modal__container {
    width: 95%;
  }

  .modal__title {
    font-size: 18px;
  }

  .lang-modal__item {
    padding: 14px 16px;
    font-size: 15px;
  }

  .lang-modal__item img {
    width: 28px !important;
    height: 28px !important;
  }
}

/* Animation for language change */
@keyframes langFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

[data-i18n] {
  animation: langFadeIn 0.3s ease-in-out;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .modal__container {
    animation: none;
  }

  .lang-modal__item:hover {
    transform: none;
  }

  [data-i18n] {
    animation: none;
  }
}
