/*
 Theme Name:   GeneratePress Child
 Theme URI:    https://generatepress.com
 Description:  Mobile First GeneratePress Child Theme with Bottom Bar
 Author:       Tom Usborne
 Author URI:   https://tomusborne.com
 Template:     generatepress
 Version:      0.1
*/

/* =====================
   1. Базовые стили для мобильного (Mobile First)
===================== */
body {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  margin: 0;
  padding: 0;
  background-color: #ffffff;
  color: #333333;
}

a {
  color: #0073e6;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Контейнеры */
.container {
  width: 100%;
  padding: 10px;
  margin: 0 auto;
}

/* Карточки */
.card {
  background-color: #f5f5f5;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 15px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Кнопки */
.button {
  display: inline-block;
  background-color: #0073e6;
  color: #ffffff;
  padding: 10px 15px;
  border-radius: 8px;
  text-align: center;
  transition: background 0.3s;
}

.button:hover {
  background-color: #005bb5;
}

/* Формы */
input,
textarea,
select,
button {
  font-size: 16px;
  width: 100%;
  margin-bottom: 10px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  box-sizing: border-box;
}

/* Заголовки */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 10px 0;
  font-weight: 500;
  line-height: 1.2;
}

/* Текстовые блоки */
p {
  margin: 0 0 10px 0;
}

/* =====================
   2. CSS-переменные
===================== */
:root {
  --primary-color: #0073e6;
  --secondary-color: #f5f5f5;
  --text-color: #333333;
  --font-base: 16px;
  --radius-base: 8px;
}

/* =====================
   3. Логотип (Mobile First)
===================== */
.site-logo img {
  max-height: 56px;
  width: auto;
}

@media (max-width: 768px) {
  .site-logo img {
    max-height: 40px;
  }
}

/* =====================
   4. Нижняя панель (Bottom Bar)
===================== */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: env(safe-area-inset-bottom, 10px) 0;
  background-color: #ffffff;
  border-top: 1px solid #ddd;
  z-index: 9999;
  box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
  font-family: 'Inter', sans-serif;
  transition: transform 0.3s ease;
}

.bottom-bar-item {
  flex: 1;
  text-align: center;
  text-decoration: none;
  color: #555555;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: color 0.3s;
}

.bottom-bar-item:hover {
  color: var(--primary-color);
}

.bottom-bar-item .icon {
  width: 24px;
  height: 24px;
  margin-bottom: 2px;
}

.bottom-bar-item.fab {
  position: relative;
  top: -25px;
  background: var(--primary-color);
  color: #ffffff;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 10000;
  transition: transform 0.2s;
}

.bottom-bar-item.fab:hover {
  transform: scale(1.1);
}

.bottom-bar-item.active {
  color: var(--primary-color);
}

.bottom-bar.hide {
  transform: translateY(100%);
}

/* =====================
   5. Скрытие Bottom Bar на планшетах и десктопах
===================== */
@media (min-width: 768px) {
  .bottom-bar {
    display: none;
  }
}

/* =====================
   6. Skeleton Loading + Shimmer (AJAX)
   Mobile First
===================== */

/* Сетка карточек */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

/* Планшеты */
@media (min-width: 768px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Десктоп */
@media (min-width: 1024px) {
  .cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Skeleton карточка */
.card-skeleton {
  background-color: #e0e0e0;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

/* Skeleton элементы */
.skeleton-image,
.skeleton-title,
.skeleton-text {
  position: relative;
  overflow: hidden;
  background-color: #cccccc;
  border-radius: 6px;
}

/* Изображение */
.skeleton-image {
  width: 100%;
  height: 150px;
}

/* Заголовок */
.skeleton-title {
  width: 60%;
  height: 20px;
}

/* Текст */
.skeleton-text {
  width: 100%;
  height: 14px;
}

/* Shimmer эффект */
.skeleton-image::before,
.skeleton-title::before,
.skeleton-text::before {
  content: "";
  position: absolute;
  top: 0;
  left: -150px;
  width: 150px;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.45),
    transparent
  );
  animation: shimmer 1.4s infinite;
}

/* Анимация */
@keyframes shimmer {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Общий контейнер для группы переключателей */
.custom-controls-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Обертка контрола */
.custom-control {
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
    font-size: 16px;
    user-select: none;
    padding: 5px 0;
}

/* Скрываем реальный инпут */
.custom-control input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* Создаем кастомный индикатор (квадрат или круг) */
.control-indicator {
    height: 24px;
    width: 24px;
    background-color: #fff;
    border: 2px solid #ddd;
    margin-right: 12px;
    flex-shrink: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Для радиокнопок — круг */
input[type="radio"] + .control-indicator {
    border-radius: 50%;
}

/* Для чекбоксов — скругленные углы */
input[type="checkbox"] + .control-indicator {
    border-radius: 4px;
}

/* Состояние при наведении или фокусе */
.custom-control:hover input ~ .control-indicator {
    border-color: #007bff;
}

/* Цвет при активации */
.custom-control input:checked ~ .control-indicator {
    background-color: #007bff;
    border-color: #007bff;
}

/* Рисуем "галочку" или "точку" внутри */
.control-indicator:after {
    content: "";
    display: none;
    border: solid white;
}

/* Специфика галочки для чекбокса */
input[type="checkbox"]:checked ~ .control-indicator:after {
    display: block;
    width: 6px;
    height: 12px;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

/* Специфика точки для радио */
input[type="radio"]:checked ~ .control-indicator:after {
    display: block;
    width: 8px;
    height: 8px;
    background: white;
    border: none;
    border-radius: 50%;
}

/* Оформление текста */
.control-label {
    line-height: 24px;
}

/* Стиль для BOOST */
.boost-control .control-label {
    font-weight: bold;
    color: #333;
}

.btn-submit {
    display: block;
    width: 100%;
    background: #007bff; /* Ваш синий цвет */
    color: #ffffff;
    border: none;
    border-radius: 12px; /* Современное скругление как в iOS/Android */
    padding: 16px 20px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
    transition: transform 0.1s ease, background 0.2s ease;
    margin-top: 30px;
}

.btn-submit:active {
    transform: scale(0.98); /* Эффект нажатия пальцем */
    background: #0069d9;
}

.btn-submit:disabled {
    background: #ccc;
    box-shadow: none;
    cursor: not-allowed;
}

/* Статусы в карточках */
.status-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    padding: 4px;
}

/* Кнопка создания в меню */
.btn-create img {
    width: 30px;
    height: 30px;
}

/* Аватар в меню */
.nav-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

/* Буст-иконка на фото */
.boost-sticker {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 32px;
}

#global-unread-badge {
    display: none; /* По умолчанию скрыт */
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#global-unread-badge.is-visible {
    display: flex;
    opacity: 1;
    transform: scale(1);
}

/* Эффект пульсации для критических уведомлений */
.unread-dot {
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(0, 123, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 123, 255, 0); }
}

/* Современный Toggle в стиле iOS [cite: 2026-01-23] */
.ios-switch {
    position: relative;
    display: inline-block;
    width: 51px;
    height: 31px;
    flex-shrink: 0;
}

.ios-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #e3e3e8;
    transition: .4s;
    border-radius: 31px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 27px;
    width: 27px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

input:checked + .slider {
    background-color: #34c759; /* Фирменный зеленый Apple для вкл [cite: 2026-01-23] */
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* =====================
   7. Новая визуальная логика (iOS-inspired)
===================== */

:root {
  --ios-blue: #007aff;
  --ios-green: #34c759;
  --ios-red: #ff3b30;
  --ios-gray: #8e8e93;
  --ios-bg: #f2f2f7;
  --ios-card-bg: #ffffff;
}

/* Статусы мероприятий (для фильтрации в "Мои точки") */
.status-active { display: block; }
.status-archive { display: block; }

/* Улучшенные табы (Segmented Control) */
.points-tabs {
  display: flex;
  background: #e3e3e8;
  padding: 2px;
  border-radius: 12px;
  margin: 10px 0;
}

.tab-btn {
  flex: 1;
  border: none;
  background: none;
  padding: 8px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ios-gray);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-btn.active {
  background: #ffffff;
  color: #000000;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* =====================
   8. Профиль и Рейтинг
===================== */

/* Контейнер прогресса рейтинга */
.rating-progress-wrapper {
  width: 100%;
  background: #e5e5ea;
  border-radius: 10px;
  height: 6px;
  overflow: hidden;
  margin: 8px 0;
}

.rating-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffcc00, #ff9500);
  border-radius: 10px;
  transition: width 1s ease-out;
}

/* Бейджи достижений */
.achievement-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(0, 122, 255, 0.1);
  color: var(--ios-blue);
  border: 1px solid rgba(0, 122, 255, 0.2);
}

/* =====================
   9. Модальные окна и уведомления
===================== */

.modal-system {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(10px); /* Эффект матового стекла Apple */
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: #ffffff;
  padding: 25px;
  border-radius: 25px;
  text-align: center;
  max-width: 350px;
  width: 100%;
  box-shadow: 0 15px 30px rgba(0,0,0,0.2);
  animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* =====================
   10. Вспомогательные классы
===================== */

/* Тень для карточек в стиле iOS 17 */
.ios-shadow {
  box-shadow: 0 4px 14px 0 rgba(0,0,0,0.06);
}

/* Кнопка "Создать" (Floating Action Button) доп. стили */
.bottom-bar-item.fab {
  box-shadow: 0 8px 16px rgba(0, 122, 255, 0.4);
}

/* Эффект нажатия для всех интерактивных элементов */
.btn-submit:active, 
.tab-btn:active, 
.mini-card:active {
  transform: scale(0.96);
  transition: transform 0.1s;
}

/* =====================
   11. Категории точек (Color Coding)
===================== */

/* Переменные цветов категорий */
:root {
  --cat-sport: #007AFF;    /* Синий */
  --cat-food: #FF9500;     /* Оранжевый */
  --cat-party: #AF52DE;    /* Фиолетовый */
  --cat-study: #5856D6;    /* Индиго */
  --cat-relax: #34C759;    /* Зеленый */
  --cat-game: #FF2D55;     /* Розовый */
}

/* Применение цветов к элементам */

/* Спорт */
.tochka-cat-sport .status-badge, 
.tochka-cat-sport .category-tag { background-color: var(--cat-sport); color: #fff; }
.tochka-cat-sport .mini-card { border-left: 4px solid var(--cat-sport); }

/* Еда / Гастрономия */
.tochka-cat-food .status-badge, 
.tochka-cat-food .category-tag { background-color: var(--cat-food); color: #fff; }
.tochka-cat-food .mini-card { border-left: 4px solid var(--cat-food); }

/* Тусовки / Вечеринки */
.tochka-cat-party .status-badge, 
.tochka-cat-party .category-tag { background-color: var(--cat-party); color: #fff; }
.tochka-cat-party .mini-card { border-left: 4px solid var(--cat-party); }

/* Обучение / Воркаут */
.tochka-cat-study .status-badge, 
.tochka-cat-study .category-tag { background-color: var(--cat-study); color: #fff; }
.tochka-cat-study .mini-card { border-left: 4px solid var(--cat-study); }

/* Игры / IT */
.tochka-cat-game .status-badge, 
.tochka-cat-game .category-tag { background-color: var(--cat-game); color: #fff; }
.tochka-cat-game .mini-card { border-left: 4px solid var(--cat-game); }

/* Универсальный тег категории (чипсы) */
.category-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

/* Стиль для иконок категорий на Яндекс.Карте */
.map-icon-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  color: white;
  font-size: 20px;
}