/**
 * Стили для страницы открытых игр VERSUS Арена
 */

/* Информационная карточка */
.open-games-info-card {
  margin-bottom: 32px;
  background: rgba(74, 168, 255, 0.1);
  border: 1px solid rgba(74, 168, 255, 0.3);
  padding: 20px 24px;
}

.open-games-info-card p {
  margin: 0;
  color: #4aa8ff;
  line-height: 1.6;
}

/* Фильтры */
.open-games-filters {
  background: rgba(10, 10, 25, 0.9);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 32px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.open-games-filters__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.open-games-filters__header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-main);
}

.open-games-results-count {
  color: var(--text-muted);
  font-size: 14px;
}

.open-games-results-count strong {
  color: var(--accent-blue);
  font-weight: 600;
}

.open-games-filters__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  align-items: end;
}

.open-games-filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.open-games-filter-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-soft);
}

.open-games-filter-select {
  padding: 10px 14px;
  background: rgba(5, 5, 20, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
}

.open-games-filter-select:hover {
  border-color: rgba(74, 168, 255, 0.4);
  background: rgba(5, 5, 20, 0.9);
}

.open-games-filter-select:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(74, 168, 255, 0.2);
}

/* Сетка расписания */
.open-games-schedule {
  margin-bottom: 32px;
}

.open-games-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Группа по дням */
.open-games-day-group {
  background: rgba(10, 10, 25, 0.9);
  border-radius: 12px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.open-games-day-group:hover {
  border-color: rgba(74, 168, 255, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.open-games-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid rgba(74, 168, 255, 0.2);
}

.open-games-day-header h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
}

.open-games-day-count {
  color: var(--text-muted);
  font-size: 14px;
  background: rgba(74, 168, 255, 0.1);
  padding: 6px 12px;
  border-radius: 12px;
  border: 1px solid rgba(74, 168, 255, 0.2);
}

.open-games-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

/* Карточка слота */
.open-games-card {
  background: rgba(5, 5, 20, 0.8);
  border-radius: 12px;
  padding: 20px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.open-games-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-blue), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.open-games-card:hover {
  transform: translateY(-4px);
  border-color: rgba(74, 168, 255, 0.4);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4),
              0 0 30px rgba(74, 168, 255, 0.2);
}

.open-games-card:hover::before {
  opacity: 1;
}

/* Статусы карточек */
.open-games-card--available {
  border-color: rgba(76, 175, 80, 0.3);
}

.open-games-card--available:hover {
  border-color: rgba(76, 175, 80, 0.6);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4),
              0 0 30px rgba(76, 175, 80, 0.2);
}

.open-games-card--few {
  border-color: rgba(255, 193, 7, 0.3);
}

.open-games-card--few:hover {
  border-color: rgba(255, 193, 7, 0.6);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4),
              0 0 30px rgba(255, 193, 7, 0.2);
}

.open-games-card--full {
  border-color: rgba(244, 67, 54, 0.3);
  opacity: 0.7;
}

.open-games-card--full:hover {
  transform: none;
  border-color: rgba(244, 67, 54, 0.5);
}

/* Заголовок карточки */
.open-games-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.open-games-card__time {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-blue);
}

.time-start,
.time-end {
  font-weight: 700;
}

.time-separator {
  color: var(--text-muted);
  font-weight: 400;
}

/* Тело карточки */
.open-games-card__body {
  flex: 1;
}

.open-games-card__format {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
}

/* Прогресс-бар */
.open-games-card__progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease, background 0.3s ease;
  position: relative;
}

.progress-fill[data-status="available"] {
  background: linear-gradient(90deg, #4caf50, #66bb6a);
  box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.progress-fill[data-status="few"] {
  background: linear-gradient(90deg, #ffc107, #ffd54f);
  box-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
}

.progress-fill[data-status="full"] {
  background: linear-gradient(90deg, #f44336, #ef5350);
  box-shadow: 0 0 10px rgba(244, 67, 54, 0.5);
}

.progress-text {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

/* Футер карточки */
.open-games-card__footer {
  margin-top: auto;
}

.open-games-book-btn {
  width: 100%;
  justify-content: center;
}

.open-games-book-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Пустое состояние */
.open-games-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.open-games-empty p {
  font-size: 18px;
  margin-bottom: 24px;
}

/* Футер секции */
.open-games-footer {
  text-align: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.open-games-footer p {
  color: var(--text-muted);
  margin-bottom: 20px;
  font-size: 14px;
}

/* Бейджи */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-available {
  background: rgba(76, 175, 80, 0.2);
  color: #4caf50;
  border: 1px solid rgba(76, 175, 80, 0.4);
}

.badge-few {
  background: rgba(255, 193, 7, 0.2);
  color: #ffc107;
  border: 1px solid rgba(255, 193, 7, 0.4);
}

.badge-full {
  background: rgba(244, 67, 54, 0.2);
  color: #f44336;
  border: 1px solid rgba(244, 67, 54, 0.4);
}

.badge-discount {
  background: linear-gradient(135deg, #d81950, #ff6b9d);
  color: #fff;
}

/* Адаптивность */
@media (max-width: 1024px) {
  .open-games-slots {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  .open-games-filters__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .open-games-filters__grid {
    grid-template-columns: 1fr;
  }

  .open-games-slots {
    grid-template-columns: 1fr;
  }

  .open-games-day-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .open-games-day-header h3 {
    font-size: 20px;
  }

  .open-games-card__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .open-games-card__time {
    font-size: 16px;
  }

  .open-games-card__format {
    font-size: 15px;
  }

  .vs-form__row {
    flex-direction: column;
  }

  .vs-form__row .vs-form__group {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .open-games-info-card {
    padding: 16px;
  }

  .open-games-filters {
    padding: 16px;
  }

  .open-games-filters__header h3 {
    font-size: 18px;
  }

  .open-games-day-group {
    padding: 16px;
  }

  .open-games-day-header h3 {
    font-size: 18px;
  }

  .open-games-card {
    padding: 16px;
  }

  .open-games-card__time {
    font-size: 15px;
  }

  .open-games-booking-info {
    padding: 16px;
    flex-direction: column;
    text-align: center;
  }

  .open-games-booking-info__icon {
    font-size: 28px;
    margin: 0 auto;
  }

  .open-games-booking-info h4 {
    font-size: 16px;
  }

  .open-games-booking-info p {
    font-size: 13px;
  }

  .vs-form__label {
    font-size: 14px;
  }

  .vs-form__input {
    font-size: 14px;
    padding: 10px 12px;
  }

  .vs-form__hint {
    width: 16px;
    height: 16px;
    font-size: 11px;
  }

  .vs-tooltip {
    max-width: 200px;
    font-size: 11px;
    padding: 6px 10px;
  }
}

/* Улучшения для очень маленьких экранов */
@media (max-width: 360px) {
  .open-games-card__header {
    gap: 8px;
  }

  .open-games-card__time {
    font-size: 14px;
  }

  .badge {
    font-size: 11px;
    padding: 3px 10px;
  }
}

/* Анимации появления */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.open-games-day-group {
  animation: fadeInUp 0.5s ease-out;
}

.open-games-card {
  animation: fadeInUp 0.4s ease-out;
}

.open-games-day-group:nth-child(1) { animation-delay: 0.1s; }
.open-games-day-group:nth-child(2) { animation-delay: 0.2s; }
.open-games-day-group:nth-child(3) { animation-delay: 0.3s; }
.open-games-day-group:nth-child(4) { animation-delay: 0.4s; }
.open-games-day-group:nth-child(5) { animation-delay: 0.5s; }

/* Улучшение формы бронирования для открытых игр */
#open-games-booking-form .vs-form__group {
  margin-bottom: 20px;
}

#open-games-booking-form .vs-form__input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(74, 168, 255, 0.2);
}

/* Индикатор загрузки */
.open-games-loading {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.open-games-loading::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(74, 168, 255, 0.3);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Информационная карточка перед формой */
.open-games-booking-info {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 32px;
  background: rgba(74, 168, 255, 0.1);
  border: 1px solid rgba(74, 168, 255, 0.3);
  padding: 20px 24px;
}

.open-games-booking-info__icon {
  font-size: 32px;
  line-height: 1;
}

.open-games-booking-info h4 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
}

.open-games-booking-info p {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.5;
}

/* Улучшения формы */
.vs-form__label {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
}

.vs-form__hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(74, 168, 255, 0.2);
  color: var(--accent-blue);
  font-size: 12px;
  cursor: help;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.vs-form__hint:hover {
  background: rgba(74, 168, 255, 0.3);
  transform: scale(1.1);
}

.vs-form__help {
  display: block;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 12px;
}

.vs-form__error {
  display: none;
  margin-top: 6px;
  color: #f44336;
  font-size: 12px;
  font-weight: 500;
}

.vs-form__input--error {
  border-color: #f44336 !important;
  box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.2) !important;
}

.vs-form__input--error:focus {
  border-color: #f44336 !important;
  box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.3) !important;
}

.vs-form__submit-wrapper {
  position: relative;
  margin-bottom: 16px;
}

.vs-form__success {
  margin-top: 16px;
  padding: 16px 20px;
  background: rgba(76, 175, 80, 0.15);
  border: 1px solid rgba(76, 175, 80, 0.4);
  border-radius: 8px;
  color: #4caf50;
  font-weight: 500;
  text-align: center;
  animation: fadeInUp 0.3s ease-out;
}

/* Подсказки (tooltips) */
.vs-tooltip {
  position: absolute;
  background: rgba(10, 10, 25, 0.98);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 10000;
  pointer-events: none;
  border: 1px solid rgba(74, 168, 255, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(-4px);
  transition: all 0.2s ease;
  max-width: 250px;
  white-space: normal;
}

.vs-tooltip--visible {
  opacity: 1;
  transform: translateY(0);
}

.vs-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(10, 10, 25, 0.98);
}

/* Улучшение кнопки отправки */
#open-games-submit-btn {
  position: relative;
  min-height: 48px;
}

#open-games-submit-btn .btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#open-games-submit-btn .btn-loading::after {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Адаптивность для формы */
@media (max-width: 768px) {
  .open-games-booking-info {
    flex-direction: column;
    text-align: center;
  }

  .open-games-booking-info__icon {
    margin: 0 auto;
  }
}

.open-games-format-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
