/* style.css - Военный стиль */

/* Общие сбросы и фон */
body {
  margin: 0;
  padding: 0 0 60px;
  font-family: 'Roboto Condensed', sans-serif;
  background: #2b2b2b;
  color: #cfcfcf;
}

.container {
  max-width: 960px;
  margin: auto;
  padding: 0 10px;
}

/* Шапка */
.page-header {
  display: flex;
  align-items: center;
  justify-content: center;
  position: sticky;
  top: 0;
  background: #1a1a1a;
  border-bottom: 2px solid #6b8e23;
  padding: 16px;
  z-index: 100;
}
.page-header h1 {
  margin: 0;
  font-size: 1.5rem;
  color: #6b8e23;
  font-family: monospace;
  letter-spacing: 2px;
  text-transform: uppercase;
}
/* Унифицированные стили для кнопок переключения и фильтра */
.view-toggle,
.filter-toggle {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #6b8e23;
  cursor: pointer;

  /* Центрируем иконки внутри кнопок */
  display: flex;
  align-items: center;
  justify-content: center;

  /* Одинаковая «кликабельная» площадь */
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
}

/*ховер/активное состояние для всех*/
.view-toggle:hover,
.view-toggle.active,
.filter-toggle:hover {
  color: #8fae47;
}

/* Карточки */
.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  padding: 20px 0;
}
.no-games {
  width: 100%;
  text-align: center;
  color: #8f8f8f;
  font-family: monospace;
  text-transform: uppercase;
}

/* Карточка в военном стиле */
.card {
  background: #1a1a1a;
  border: 2px dashed #6b8e23;
  border-radius: 2px;
  width: 280px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: monospace;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.5s forwards;
}
@keyframes fadeInUp {
  to { opacity: 1; transform: translateY(0); }
}

/* Изображение */
.card-image {
  position: relative;
}
.card-image img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

/* Статус-бейдж */
.badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 6px;
  background: #6b8e23;
  color: #1a1a1a;
  font-size: 0.7rem;
  text-transform: uppercase;
  font-family: monospace;
  border: 1px solid #1a1a1a;
}
.badge.status-closed {
  background: #444;
  color: #cfcfcf;
}

/* Оверлей */
.image-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(26,26,26,0.8);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.card-hero-title {
  margin: 0;
  color: #cfcfcf;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.overlay-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.overlay-date {
  font-size: 0.8rem;
  color: #cfcfcf;
}
.overlay-date i {
  color: #6b8e23;
}
.overlay-participants {
  position: relative;
  width: 80px;
  height: 5px;
  background: #444;
  border: 1px solid #6b8e23;
  border-radius: 2px;
}
.overlay-participants::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--progress, 0%);
  background: #6b8e23;
}
.overlay-participants::after {
  content: attr(data-count);
  position: absolute;
  top: -1.2em;
  right: 0;
  font-size: 0.7rem;
  color: #cfcfcf;
}

/* Детали карточки */
.card-details {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #2b2b2b;
}
.card-title {
  margin: 0;
  font-size: 1rem;
  color: #6b8e23;
  text-transform: uppercase;
}

/* Метрики */
.metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.metric {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: #cfcfcf;
}
.metric i {
  color: #6b8e23;
}

/* Кнопка записи */
.signup-btn {
  margin-top: 8px;
  padding: 8px;
  background: #6b8e23;
  color: #1a1a1a;
  border: 1px solid #1a1a1a;
  font-size: 0.85rem;
  text-transform: uppercase;
  font-family: monospace;
  cursor: pointer;
  align-self: flex-start;
}
.signup-btn:hover {
  background: #8fae47;
}

/* История игр */
.history-item a:hover {
  text-decoration: underline;
}

/* Пагинация истории */
#history-pagination {
  margin-top: 15px;
  display: flex;
  gap: 8px;
  justify-content: center;
}
#history-pagination button {
  padding: 4px 8px;
  border: 1px solid #6b8e23;
  background: #1a1a1a;
  color: #cfcfcf;
  cursor: pointer;
}
#history-pagination button:disabled {
  background: #6b8e23;
  color: #1a1a1a;
  cursor: default;
}

/* Футер */
.footer-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #1a1a1a;
  border-top: 2px solid #6b8e23;
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 50px;
}
.nav-btn {
  background: none;
  border: none;
  color: #cfcfcf;
  font-family: monospace;
  font-size: 0.8rem;
  text-transform: uppercase;
  cursor: pointer;
}
.nav-btn.active {
  background: #6b8e23;
  color: #1a1a1a;
  padding: 6px 10px;
  border: 1px dashed #6b8e23;
  border-radius: 2px;
}

/* Переключатели вида (список ↔ календарь) */
.view-toggle-group {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 8px;
  /* отступ справа теперь совпадает с отступом слева контейнера */
  right: 20px;
}


/* Утилита: скрыть любой элемент по классу */
.hidden {
  display: none !important;
}

/* Календарь */
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 8px;
}
.calendar-header button {
  background: none;
  border: 1px solid #6b8e23;
  color: #6b8e23;
  padding: 4px 8px;
  cursor: pointer;
}
.calendar-header h3 {
  margin: 0;
  font-family: monospace;
  color: #cfcfcf;
  text-transform: uppercase;
}

.calendar-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}
.calendar-table th,
.calendar-table td {
  width: 14.28%;
  height: 60px;
  text-align: center;
  vertical-align: top;
  border: 1px solid #444;
  position: relative;
  cursor: pointer;
  font-family: monospace;
}
.calendar-table td:hover {
  background: rgba(107,142,35,0.2);
}
.calendar-table td.disabled {
  color: #555;
  cursor: default;
}
.calendar-table td .count {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: #c12;
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 4px;
  border-radius: 2px;
}

/* Список событий */

.calendar-events .event-item {
  padding: 6px 0;
  border-bottom: 1px solid #444;
}
.calendar-events .event-item:last-child {
  border-bottom: none;
}
.calendar-events .event-time {
  color: #6b8e23;
  margin-right: 8px;
}
.calendar-events .no-events {
  color: #8f8f8f;
}

.calendar-table th,
.calendar-table td {
  height: 40px;        /* раньше было 60px */
  font-size: 0.85rem;  /* чуть мелче цифры */
}
.white-text {
  color: #cfcfcf;
}

/* —————————————————————————————————————
   Выровнять заголовок влево, иконки вправо
   ————————————————————————————————————— */

/* Меняем выравнивание flex-контейнера */
.page-header {
  justify-content: flex-start !important;
}



/* Иконки в футере — того же размера, что и в тулбаре */
.footer-nav .nav-btn i {
  font-size: 1.2rem;
  margin-right: 6px;
  vertical-align: middle;
}

/* Размер текста кнопок в футере */
.footer-nav .nav-btn {
  font-size: 0.9rem;
}

/* Счётчик фильтров: точно как в красных квадратиках календаря */
#filter-count-badge {
  position: absolute;
  top: 0;
  right: 0;
  transform: translate(50%, -50%);
  background: #c12;            /* тот же красный */
  color: #fff;                 /* тот же белый */
  font-family: monospace;      /* как в календаре */
  font-size: 0.7rem;           /* совпадает */
  padding: 2px 4px;            /* совпадает */
  border-radius: 2px;          /* мягкий угол, как в .count */
  display: none;               /* JS сам показывает/скрывает */
}
/* ==========================================================================
   Фильтры: селекты + текстовое поле “Выберите дату” + нативный picker

/* ==========================================================================
   Фильтры: селекты + текстовое поле «Выберите дату» + нативный picker
   ========================================================================== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  background: #1a1a1a;
  border-bottom: 2px solid #6b8e23;
  padding: 8px 10px;
  position: sticky;
  top: 60px;
  z-index: 90;
}
.filter-bar.hidden {
  display: none !important;
}

/* общий стиль для селекта и контейнера date */
.filter-bar select,
.filter-bar .date-wrapper {
  flex: 1 1 45%;
  min-width: 0;
  box-sizing: border-box;
  padding: 6px;
  background: #2b2b2b;
  border: 1px dashed #6b8e23;
  color: #cfcfcf;
  font-family: monospace;
  text-transform: uppercase;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  position: relative;
}

/* возвращаем стрелку у селекта */
.filter-bar select {
  appearance: auto;
  border-radius: 0 !important;    /* убрать скругление */
  height: 2.4rem;
}

/* видимое текстовое поле вместо date */
.filter-bar .date-wrapper input#filter-date-text {
  flex: 1 1 auto;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: #cfcfcf;
  font-family: monospace;
  text-transform: uppercase;
  font-size: 0.85rem;
  cursor: pointer;
  outline: none;
}
/* placeholder того же цвета */
.filter-bar .date-wrapper input#filter-date-text::placeholder {
  color: #cfcfcf;
  opacity: 1;
}

/* прозрачный native date-input поверх — ловит все клики */
.filter-bar .date-wrapper input#filter-date-native {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  margin: 0; padding: 0;
  border: none; background: transparent;
  opacity: 0; cursor: pointer;
  font: inherit;      /* для корректного picker’а */
  appearance: auto;
  z-index: 2;
}

.card {
    width: 100%;
  }

