/* ============================
   Оптимизированный CSS для PhenixxStore
   (Интерфейс: глобальные сбросы, переменные, шапка, поиск, переключатель, док‑панель,
   анимации и переходы для переключателя (Android/iOS) и контейнера фильтров (хештегов))
   ============================ */

/* --- Глобальные сбросы и удаление выделения --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  /* Убираем синий эффект при нажатии на мобильных устройствах */
  -webkit-tap-highlight-color: transparent;
}

:focus {
  outline: none;
}

/* --- Переменные --- */
:root {
  --primary-bg: #000;
  --secondary-bg: rgba(30, 30, 30, 0.7);
  --glass-bg: rgba(30, 30, 30, 0.6);
  --overlay-bg: rgba(0, 0, 0, 0.85);
  --accent-color: #fff;
  --gray: #888;
  --light-gray: #bbb;
  --border-color: rgba(255, 255, 255, 0.2);
  --transition-speed: 0.3s;
  --animation-speed: 0.8s;
  --font-sans: 'Nunito Sans', sans-serif;
  --font-alt: 'Montserrat', sans-serif;
}

.dock-bar-inner {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
  width: 100%;
}

/* --- Базовые стили --- */
body {
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--primary-bg);
  color: var(--accent-color);
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
}

/* --- Аппаратное ускорение --- */
.animated,
.spinner,
.splash-content,
.fade-element {
  will-change: transform, opacity;
  backface-visibility: hidden;
}

/* --- Ключевые кадры --- */
@keyframes spin {
  0% { transform: rotate(0deg) translate3d(0,0,0); }
  100% { transform: rotate(360deg) translate3d(0,0,0); }
}

@keyframes fadeInSlide {
  0% { opacity: 0; transform: translate3d(0, -20px, 0); }
  100% { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes fadeOut {
  0% { opacity: 1; transform: translate3d(0, 0, 0); }
  100% { opacity: 0; transform: translate3d(0, -5%, 0); }
}

@keyframes glowEffect {
  0% { opacity: 0; transform: scale3d(0.8, 0.8, 1); background-color: rgba(30,60,100,0.5); }
  25% { opacity: 0.6; transform: scale3d(1.2,1.2,1); background-color: rgba(100,50,150,0.6); }
  50% { opacity: 0.8; transform: scale3d(1.5,1.5,1); background-color: rgba(50,150,100,0.7); }
  75% { opacity: 0.4; transform: scale3d(1.8,1.8,1); background-color: rgba(150,50,50,0.6); }
  100% { opacity: 0; transform: scale3d(2,2,1); background-color: rgba(30,60,100,0.5); }
}

@keyframes appAppear {
  0% { opacity: 0; transform: translate3d(0, 20px, 0); }
  100% { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* --- Спиннер и сплэш экран --- */
#loader {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate3d(-50%, -50%, 0);
  z-index: 9999;
  width: 100px;
  height: 100px;
  background: rgba(30,30,30,0.7);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.spinner {
  border: 6px solid rgba(255,255,255,0.3);
  border-top: 6px solid #483d8b;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 3s linear infinite;
  box-shadow: 0 0 10px rgba(72,61,139,0.5);
}

#splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--overlay-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 11000;
  transition: opacity 0.5s ease;
}

.splash-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(30,30,30,0.7);
  backdrop-filter: blur(10px);
  border-radius: 10px;
  animation: fadeInSlide 0.6s ease-in-out;
}

.splash-icon {
  width: 150px;
  height: 150px;
  border-radius: 10px;
  object-fit: cover;
  margin-bottom: 20px;
  border: 2px solid rgba(255,255,255,0.2);
}

.splash-spinner {
  border: 6px solid rgba(255,255,255,0.3);
  border-top: 6px solid #483d8b;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 3s linear infinite;
  box-shadow: 0 0 10px rgba(72,61,139,0.5);
  margin-top: 20px;
}

/* --- Док-бар --- */
.dock-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(30,30,30,0.9);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom)) 0;
  backdrop-filter: blur(10px);
  z-index: 1000;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.dock-link {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: color var(--transition-speed) ease;
  -webkit-tap-highlight-color: transparent;
}

.dock-link .material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
  font-size: 24px;
  line-height: 1;
  color: var(--gray);
}

.dock-link .label {
  font-size: 12px;
  color: var(--gray);
  margin-top: 2px;
  transition: color var(--transition-speed) ease;
}

.dock-link:active,
.dock-link:focus {
  outline: none;
}

.dock-link.active .material-symbols-outlined,
.dock-link:hover .material-symbols-outlined,
.dock-link.active .label,
.dock-link:hover .label {
  color: var(--accent-color);
}

/* --- Header и Поиск --- */
header {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(30,30,30,0.7);
  padding: 15px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  width: 100%;
  top: 0;
  box-sizing: border-box;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 20;
  animation: fadeInSlide 1s ease-out both;
}

.header-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}

.glow {
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  animation: glowEffect 30s infinite alternate;
  filter: blur(50px);
  pointer-events: none;
  z-index: -1;
}

.glow-1 { top: 10%; left: 20%; animation-delay: 0s; }
.glow-2 { top: 50%; left: 60%; animation-delay: 10s; }
.glow-3 { top: 70%; left: 30%; animation-delay: 20s; }

h1 {
  font-size: 18px;
  font-weight: bold;
  color: var(--accent-color);
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* --- Кнопка пожертвования --- */
.donate-link {
  color: #4caf50;
  text-decoration: none;
  font-size: 12px;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  background: rgba(30,30,30,0.4);
  display: inline-block;
  transition: opacity var(--transition-speed) ease, transform var(--transition-speed) ease;
  z-index: 100;
  position: relative;
  max-width: fit-content;
  backdrop-filter: blur(10px);
  -webkit-tap-highlight-color: transparent;
}

.donate-link:hover {
  background: rgba(50,50,50,0.6);
  transform: scale(1.05);
  color: var(--accent-color);
}

/* --- Поисковая строка и Фильтры --- */
.header-search {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

#search-bar {
  width: 100%;
  padding: 10px 15px;
  font-size: 14px;
  color: var(--accent-color);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  background: rgba(30,30,30,0.6);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 0 6px rgba(255,255,255,0.2), 0 4px 10px rgba(0,0,0,0.3);
  transition: all var(--transition-speed) ease;
  animation: fadeInSlide 0.8s ease-out both;
}

#search-bar:focus {
  background: rgba(50,50,50,0.7);
  box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}

#search-bar::placeholder {
  color: rgba(255,255,255,0.7);
}

.reset-btn {
  display: block;
  margin: 15px auto;
  padding: 8px 16px;
  font-size: 12px;
  color: var(--accent-color);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  background: rgba(255,69,58,0.6);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 10px rgba(255,69,58,0.3);
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  animation: fadeInSlide 0.8s ease-out both;
  animation-delay: 0.3s;
}

.reset-btn:hover {
  background: rgba(255,69,58,0.8);
  box-shadow: 0 6px 12px rgba(255,69,58,0.4);
}

/* --- Фильтр-кнопки (Android/iOS переключатель) --- */
.filter-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 15px;
}

.filter-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: bold;
  color: var(--accent-color);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  background: rgba(30,30,30,0.6);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  transition: all var(--transition-speed) ease;
}

.filter-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(50,50,50,0.5), rgba(30,30,30,0.3));
  z-index: -1;
  transition: background var(--transition-speed) ease;
}

.filter-btn:hover::before {
  background: linear-gradient(145deg, rgba(70,70,70,0.8), rgba(50,50,50,0.6));
}

.filter-btn:hover {
  background: rgba(50,50,50,0.8);
  box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}

.filter-btn.active {
  background: rgba(50,50,50,0.7);
  box-shadow: inset 0 0 6px rgba(255,255,255,0.3), 0 4px 10px rgba(0,0,0,0.4);
  transform: scale(1.02);
}

/* --- Стили переключателя (Toggle) --- */
.switch-container {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 340px;
  height: 36px;
  background: rgba(20,20,20,0.9);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 3px;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 4px 6px rgba(0,0,0,0.4);
  margin: 15px auto;
  overflow: hidden;
  animation: fadeInSlide 0.8s ease-out both;
}

.toggle-input {
  display: none;
}

.toggle-label {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  line-height: 32px;
  cursor: pointer;
  color: rgba(200,200,200,0.9);
  z-index: 2;
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.3s ease;
  padding: 0 10px;
  -webkit-tap-highlight-color: transparent;
}

.toggle-highlight {
  position: absolute;
  width: calc(50% - 6px);
  height: calc(100% - 6px);
  background: linear-gradient(145deg, rgba(60,60,60,0.8), rgba(90,90,90,0.8));
  border-radius: 16px;
  top: 3px;
  left: 3px;
  transform: translateX(0);
  transition: transform 0.3s ease, background 0.3s ease;
  box-shadow: 0 2px 4px rgba(255,255,255,0.1), 0 2px 6px rgba(0,0,0,0.3);
}

#categories-toggle:checked ~ .toggle-highlight {
  transform: translateX(3px);
}

#labels-toggle:checked ~ .toggle-highlight {
  transform: translateX(calc(100% + 3px));
}

#categories-toggle:checked + .toggle-label,
#labels-toggle:checked + .toggle-label {
  color: rgba(255,255,255,1);
}

/* --- Стили для контейнера фильтров (хештегов) --- */
.categories {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px auto;
  justify-content: center;
}

.categories span {
  display: inline-block;
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 20px;
  background: rgba(30, 30, 30, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
}

.categories span:hover {
  background: rgba(13, 71, 161, 0.8);
  transform: scale(1.02);
}

.categories span.active {
  background: rgba(21, 101, 192, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transform: scale(1.02);
}

/* --- Пасхалка --- */
.easter-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 10000;
}

.easter-modal.show {
  opacity: 1;
  pointer-events: all;
}

.easter-modal-content {
  background: rgba(30,30,30,0.9);
  backdrop-filter: blur(10px);
  border-radius: 10px;
  padding: 20px;
  position: relative;
  max-width: 90%;
  max-height: 90%;
  overflow: auto;
  animation: fadeInSlide 0.5s ease-out both;
}

.easter-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--accent-color);
  cursor: pointer;
}
