/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Premium Event Cards - Responsive Design */

/* Премиальные карточки мероприятий - адаптивность */
@media (max-width: 768px) {
  /* Контейнеры с преимуществами */
  .benefits-container,
  .community-benefits-container {
    padding: 16px 20px !important;
    margin: 24px 0 !important;
  }
  
  /* Премиальные карточки мероприятий на мобильных */
  .event-card {
    padding: 0 !important;
    margin-bottom: 24px !important;
    border-radius: 16px !important;
  }
  
  .event-card > div {
    padding: 20px !important;
  }
  
  /* Адаптация заголовков */
  .event-card h3 {
    font-size: 18px !important;
    line-height: 1.4 !important;
    min-height: auto !important;
    margin-bottom: 16px !important;
  }
  
  /* Адаптация описаний */
  .event-card p {
    font-size: 14px !important;
    margin-bottom: 20px !important;
    min-height: auto !important;
  }
  
  /* Адаптация цен */
  .event-card .text-2xl {
    font-size: 20px !important;
  }
  
  /* Фильтры на мобильных */
  .filter-chip {
    padding: 8px 16px !important;
    font-size: 12px !important;
  }
  
  /* Grid адаптация для премиальных карточек */
  .grid.md\\:grid-cols-2.lg\\:grid-cols-3 {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  
  /* Модальное окно на мобильных */
  #eventModal .bg-secondary {
    margin: 16px !important;
    padding: 24px !important;
    border-radius: 16px !important;
  }
  
  /* Hover эффекты отключены на мобильных */
  .event-card:hover {
    transform: none !important;
    box-shadow: none !important;
  }
}

/* Tablet адаптация */
@media (min-width: 769px) and (max-width: 1024px) {
  .event-card {
    border-radius: 18px !important;
  }
  
  .event-card h3 {
    font-size: 19px !important;
  }
  
  .grid.md\\:grid-cols-2.lg\\:grid-cols-3 {
    gap: 28px !important;
  }
}

/* Дополнительные стили для повышенного контраста */
.event-card:hover {
  box-shadow: 0 8px 32px rgba(242, 105, 76, 0.15) !important;
}

/* Улучшение читаемости текста */
.benefits-mobile span,
.benefits-desktop span {
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Анимация для точек в мобильной версии */
.benefits-mobile .w-2.h-2 {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* === SUBSCRIPTION WIDGET === */
/* Sticky виджет подписки с премиальным дизайном */

.subscription-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 20000; /* Highest z-index to ensure clickability */
  transition: all 0.25s ease;
  pointer-events: auto; /* Ensure click events work */
}

/* Контекстная адаптация z-index для разных страниц */
.dashboard-index .subscription-widget {
  z-index: 1000; /* Ниже для dashboard страниц */
}

.blog-index .subscription-widget,
.blog-show .subscription-widget {
  z-index: 5000; /* Средний уровень для блог страниц */
}

.home-index .subscription-widget {
  z-index: 15000; /* Высокий для главной страницы */
}

/* Основная кнопка виджета */
.subscription-toggle {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #f2694c 0%, #ff8c42 100%);
  border-radius: 28px;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(242, 105, 76, 0.3);
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  position: relative;
  overflow: hidden;
  pointer-events: auto !important; /* Force click events to work */
  touch-action: manipulation; /* Optimize for touch */
  -webkit-touch-callout: none; /* Disable iOS context menu */
  -webkit-user-select: none; /* Disable text selection */
  user-select: none;
}

.subscription-toggle::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 28px;
  padding: 2px;
  background: linear-gradient(135deg, #f2694c, #ff8c42);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: xor;
  -webkit-mask-composite: xor;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.subscription-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(242, 105, 76, 0.4);
}

.subscription-toggle:hover::before {
  opacity: 1;
}

.subscription-toggle:active {
  transform: translateY(0) scale(0.98);
}

/* Иконка уведомления */
.subscription-toggle .notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 12px;
  height: 12px;
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid white;
  animation: pulse-notification 2s infinite;
}

@keyframes pulse-notification {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
}

/* Выпадающее меню - базовый стиль (десктоп) */
.subscription-menu {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 320px;
  background: rgba(26, 26, 26, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(242, 105, 76, 0.2);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.95);
  transition: all 0.25s ease;
  z-index: 10000;
}

.subscription-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.subscription-menu::before {
  content: '';
  position: absolute;
  bottom: -8px;
  /* Центрируем стрелку относительно кнопки */
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 16px;
  height: 16px;
  background: rgba(26, 26, 26, 0.95);
  border-right: 1px solid rgba(242, 105, 76, 0.2);
  border-bottom: 1px solid rgba(242, 105, 76, 0.2);
}

/* Заголовок меню */
.subscription-menu h3 {
  font-family: 'Unbounded', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 12px 0;
  text-align: center;
}

.subscription-menu p {
  font-family: 'Inter Tight', sans-serif;
  font-size: 12px;
  color: #b1b1b1;
  margin: 0 0 12px 0;
  text-align: center;
  line-height: 1.4;
}

/* Опции подписки */
.subscription-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.subscription-option {
  display: flex;
  align-items: center;
  padding: 16px;
  background: rgba(18, 18, 18, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
  color: inherit;
}

.subscription-option:hover {
  background: rgba(242, 105, 76, 0.1);
  border-color: rgba(242, 105, 76, 0.3);
  transform: translateY(-1px);
}

.subscription-option .icon {
  width: 24px;
  height: 24px;
  margin-right: 12px;
  color: #f2694c;
  flex-shrink: 0;
}

.subscription-option .content {
  flex: 1;
}

.subscription-option .title {
  font-family: 'Inter Tight', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: #ffffff;
  margin: 0 0 4px 0;
}

.subscription-option .description {
  font-family: 'Inter Tight', sans-serif;
  font-size: 12px;
  color: #b1b1b1;
  margin: 0;
  line-height: 1.4;
}

/* Email форма - всегда видимая */
.email-form {
  margin-top: 12px;
  opacity: 1;
  max-height: 200px;
  overflow: visible;
  transition: all 0.3s ease;
}

.email-form.active {
  opacity: 1;
  max-height: 200px;
}

.email-input-group {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.email-input {
  flex: 1;
  padding: 12px;
  background: rgba(18, 18, 18, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #ffffff;
  font-family: 'Inter Tight', sans-serif;
  font-size: 14px;
  transition: all 0.25s ease;
}

.email-input:focus {
  outline: none;
  border-color: #f2694c;
  box-shadow: 0 0 0 2px rgba(242, 105, 76, 0.2);
}

.email-input::placeholder {
  color: #666666;
}

.email-submit {
  padding: 12px 16px;
  background: linear-gradient(135deg, #f2694c 0%, #ff8c42 100%);
  border: none;
  border-radius: 8px;
  color: white;
  font-family: 'Inter Tight', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.email-submit:hover {
  background: linear-gradient(135deg, #ff7a5c 0%, #ff9c52 100%);
  transform: translateY(-1px);
}

.email-submit:active {
  transform: translateY(0) scale(0.98);
}

/* Кнопка закрытия */
.close-button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 24px;
  height: 24px;
  background: none;
  border: none;
  color: #b1b1b1;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}

.close-button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* Оверлей для закрытия */
.subscription-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.subscription-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* МОБИЛЬНАЯ АДАПТАЦИЯ - SLIDING SIDEWALK APPROACH */
@media (max-width: 768px) {
  .subscription-widget {
    bottom: 16px !important;
    right: 16px !important;
    z-index: 1000 !important;
  }

  .subscription-toggle {
    width: 48px;
    height: 48px;
    border-radius: 24px;
    box-shadow: 0 4px 16px rgba(242, 105, 76, 0.3);
  }

  .subscription-toggle:hover {
    transform: none;
    box-shadow: 0 4px 16px rgba(242, 105, 76, 0.3);
  }

  /* ПРОСТОЕ РЕШЕНИЕ - справа снизу с отступом */
  .subscription-widget .subscription-menu {
    position: fixed !important;
    bottom: 70px !important;
    right: 16px !important;
    left: auto !important;
    top: auto !important;
    width: 280px !important;
    max-width: calc(100vw - 32px) !important;
    margin: 0 !important;
    padding: 16px !important;
    background: rgba(26, 26, 26, 0.95) !important;
    backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(242, 105, 76, 0.2) !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important;
    z-index: 10000 !important;
    transform: none !important;
    transition: all 0.25s ease !important;
  }

  .subscription-widget .subscription-menu.active {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
  }

  .subscription-menu::before {
    display: none !important;
  }

  .subscription-menu h3 {
    font-size: 15px;
    margin: 0 0 10px 0;
  }

  .subscription-menu p {
    font-size: 11px;
    margin: 0 0 10px 0;
  }

  .email-input-group {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .email-submit {
    width: 100% !important;
    height: 44px !important;
    border-radius: 8px !important;
    flex-shrink: 1 !important;
  }
}

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

.subscription-widget {
  animation: slideInUp 0.5s ease-out 1s both;
}

/* Успешная подписка */
.success-message {
  padding: 16px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 12px;
  color: #22c55e;
  font-family: 'Inter Tight', sans-serif;
  font-size: 14px;
  text-align: center;
  margin-top: 12px;
}

/* Скрытие скроллбара в меню */
.subscription-menu::-webkit-scrollbar {
  display: none;
}

.subscription-menu {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ========== АНИМИРОВАННАЯ ИГРАЛЬНАЯ КОСТЬ ========== */

.dice-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  perspective: 100px;
  pointer-events: none; /* Let clicks pass through to parent button */
}

.dice {
  position: relative;
  width: 20px;
  height: 20px;
  transform-style: preserve-3d;
  animation: diceFloat 3s ease-in-out infinite;
  pointer-events: none; /* Let clicks pass through to parent button */
}

/* Анимация плавного покачивания кубика */
@keyframes diceFloat {
  0%, 100% {
    transform: rotateX(0deg) rotateY(0deg) translateY(0px);
  }
  25% {
    transform: rotateX(15deg) rotateY(90deg) translateY(-2px);
  }
  50% {
    transform: rotateX(0deg) rotateY(180deg) translateY(0px);
  }
  75% {
    transform: rotateX(-15deg) rotateY(270deg) translateY(-2px);
  }
}

/* Анимация вращения при ховере */
@keyframes diceRoll {
  0% {
    transform: rotateX(0deg) rotateY(0deg);
  }
  25% {
    transform: rotateX(90deg) rotateY(90deg);
  }
  50% {
    transform: rotateX(180deg) rotateY(180deg);
  }
  75% {
    transform: rotateX(270deg) rotateY(270deg);
  }
  100% {
    transform: rotateX(360deg) rotateY(360deg);
  }
}

/* При ховере на кнопку - быстрое вращение кубика */
.subscription-toggle:hover .dice {
  animation: diceRoll 0.6s ease-in-out;
}

/* Грани кубика */
.dice-face {
  position: absolute;
  width: 20px;
  height: 20px;
  background: #f2694c;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2px;
  padding: 2px;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.3);
  pointer-events: none; /* Let clicks pass through to parent button */
}

/* Позиционирование граней в 3D пространстве */
.dice-face-1 {
  transform: rotateY(0deg) translateZ(10px);
}

.dice-face-2 {
  transform: rotateY(90deg) translateZ(10px);
}

.dice-face-3 {
  transform: rotateY(180deg) translateZ(10px);
}

.dice-face-4 {
  transform: rotateY(-90deg) translateZ(10px);
}

.dice-face-5 {
  transform: rotateX(90deg) translateZ(10px);
}

.dice-face-6 {
  transform: rotateX(-90deg) translateZ(10px);
}

/* Точки на гранях */
.dice-face .dot {
  width: 3px;
  height: 3px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
  pointer-events: none; /* Let clicks pass through to parent button */
}

/* Расположение точек для каждой грани */

/* Грань 1 - одна точка по центру */
.dice-face-1 {
  align-items: center;
  justify-content: center;
}

.dice-face-1 .dot {
  width: 4px;
  height: 4px;
}

/* Грань 2 - две точки по диагонали */
.dice-face-2 {
  align-items: stretch;
  justify-content: space-between;
  flex-direction: column;
  padding: 3px;
}

.dice-face-2 .dot:first-child {
  align-self: flex-start;
}

.dice-face-2 .dot:last-child {
  align-self: flex-end;
}

/* Грань 3 - три точки по диагонали */
.dice-face-3 {
  align-items: stretch;
  justify-content: space-between;
  flex-direction: column;
  padding: 2px;
}

.dice-face-3 .dot:first-child {
  align-self: flex-start;
}

.dice-face-3 .dot:nth-child(2) {
  align-self: center;
}

.dice-face-3 .dot:last-child {
  align-self: flex-end;
}

/* Грань 4 - четыре точки по углам */
.dice-face-4 {
  align-content: space-between;
  justify-content: space-between;
  padding: 3px;
}

/* Грань 5 - пять точек (4 по углам + 1 по центру) */
.dice-face-5 {
  align-content: space-between;
  justify-content: space-between;
  padding: 2px;
}

.dice-face-5 .dot:nth-child(3) {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Грань 6 - шесть точек в два ряда */
.dice-face-6 {
  flex-direction: column;
  justify-content: space-between;
  padding: 2px;
}

.dice-face-6 .dot {
  width: 2.5px;
  height: 2.5px;
}

.dice-face-6 .dot:nth-child(1),
.dice-face-6 .dot:nth-child(2),
.dice-face-6 .dot:nth-child(3) {
  margin-bottom: 1px;
}

/* Мобильная адаптация кубика */
@media (max-width: 768px) {
  .dice-container {
    width: 20px;
    height: 20px;
  }
  
  .dice {
    width: 18px;
    height: 18px;
  }
  
  .dice-face {
    width: 18px;
    height: 18px;
  }
  
  .dice-face .dot {
    width: 2.5px;
    height: 2.5px;
  }
  
  .dice-face-1 .dot {
    width: 3px;
    height: 3px;
  }
}

/* === CONTACT WIDGET === */
/* Контактный виджет с исправленными стилями */

.contact-widget {
  position: fixed;
  bottom: 100px; /* Размещение выше подписного виджета */
  left: 24px;
  z-index: 9998; /* Ниже subscription widget */
  transition: all 0.25s ease;
}

/* Основная кнопка контактного виджета */
.contact-toggle {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #25D366 0%, #20BA5A 100%); /* WhatsApp зеленый */
  border-radius: 28px;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(37, 211, 102, 0.3);
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  position: relative;
  overflow: hidden;
}

.contact-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(37, 211, 102, 0.4);
}

.contact-toggle:active {
  transform: translateY(0) scale(0.98);
}

.contact-toggle .contact-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

/* Выпадающее меню контактов */
.contact-menu {
  position: absolute;
  bottom: 70px;
  left: 0;
  width: 280px;
  background: rgba(26, 26, 26, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(37, 211, 102, 0.2);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.95);
  transition: all 0.25s ease;
  z-index: 10000;
}

.contact-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.contact-menu::before {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 20px;
  width: 16px;
  height: 16px;
  background: rgba(26, 26, 26, 0.95);
  border-right: 1px solid rgba(37, 211, 102, 0.2);
  border-bottom: 1px solid rgba(37, 211, 102, 0.2);
  transform: rotate(45deg);
}

.contact-header h3 {
  font-family: 'Unbounded', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 16px 0;
  text-align: center;
}

/* Опции контактов */
.contact-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-option {
  display: flex;
  align-items: center;
  padding: 12px;
  background: rgba(18, 18, 18, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
  color: inherit;
}

.contact-option:hover {
  background: rgba(37, 211, 102, 0.1);
  border-color: rgba(37, 211, 102, 0.3);
  transform: translateY(-1px);
}

.contact-option .contact-icon {
  width: 20px;
  height: 20px;
  margin-right: 12px;
  flex-shrink: 0;
}

.contact-option .contact-content {
  flex: 1;
}

.contact-option .contact-title {
  font-family: 'Inter Tight', sans-serif;
  font-weight: 600;
  font-size: 13px;
  color: #ffffff;
  margin: 0 0 2px 0;
}

.contact-option .contact-description {
  font-family: 'Inter Tight', sans-serif;
  font-size: 11px;
  color: #b1b1b1;
  margin: 0;
  line-height: 1.3;
}

/* Мобильная адаптация контактного виджета */
@media (max-width: 768px) {
  .contact-widget {
    bottom: 80px; /* Выше subscription widget на мобильных */
    left: 16px;
  }
  
  .contact-toggle {
    width: 48px;
    height: 48px;
    border-radius: 24px;
  }
  
  .contact-menu {
    width: calc(100vw - 32px);
    left: -8px;
    bottom: 60px;
    padding: 16px;
  }
  
  .contact-menu::before {
    left: 16px;
  }
}

/* === PRIVACY CONSENT CHECKBOX FIX === */
/* Fix for clickable checkbox in subscription widget */

.privacy-consent-container {
  pointer-events: auto !important;
  position: relative;
  z-index: 10002 !important;
}

.privacy-consent-container input[type="checkbox"] {
  pointer-events: auto !important;
  cursor: pointer !important;
  position: relative;
  z-index: 10003 !important;
  appearance: auto; /* Ensure native checkbox appearance */
  -webkit-appearance: checkbox;
  -moz-appearance: checkbox;
}

.privacy-consent-container label {
  pointer-events: auto !important;
  cursor: pointer !important;
  position: relative;
  z-index: 10002 !important;
}

/* Ensure checkbox is accessible and visible */
.privacy-consent-container input[type="checkbox"]:focus {
  outline: 2px solid #f2694c;
  outline-offset: 2px;
}

.privacy-consent-container input[type="checkbox"]:hover {
  box-shadow: 0 0 0 2px rgba(242, 105, 76, 0.3);
}

/* === FIX FOR CENTERING ISSUES === */
/* Override Tailwind base styles for forms */
.completion-container,
.login-container {
  margin: 0 auto !important;
  text-align: center !important;
}

.completion-container form,
.login-container form {
  text-align: center !important;
}

/* Fix input field visibility */
.completion-container input[type="email"],
.completion-container input[type="tel"] {
  color: #1a1a1a !important;
  background-color: #ffffff !important;
}

/* Ensure body centering works */
/* Only apply centering to specific form pages */
body.sessions-new,
body.registrations-complete {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 100vh !important;
}

/* =====================================================
   MOBILE HORIZONTAL SCROLL FIX - Critical CSS
   ===================================================== */

/* Global box-sizing fix to prevent overflow */
*, *::before, *::after {
  box-sizing: border-box !important;
}

/* Prevent horizontal overflow on all elements */
html, body {
  max-width: 100% !important;
  overflow-x: hidden !important;
}

/* Container width fixes */
.container {
  max-width: 100% !important;
  padding-left: min(24px, 4vw) !important;
  padding-right: min(24px, 4vw) !important;
}

/* Mobile-first responsive design for event pages */
@media (max-width: 768px) {
  /* Force single column layout */
  div[style*="grid-template-columns: 2fr 1fr"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 24px !important;
  }

  /* Header responsive fixes */
  header > div {
    padding: 0 16px !important;
    max-width: calc(100vw - 32px) !important;
  }

  /* Container padding fixes */
  .container,
  div[style*="max-width: 1280px"],
  div[style*="max-width: 1200px"] {
    padding: 0 16px !important;
    max-width: 100vw !important;
    margin: 0 auto !important;
  }

  /* Content area padding fixes */
  div[style*="padding: 48px"] {
    padding: 24px 20px !important;
  }

  div[style*="padding: 0 32px"] {
    padding: 0 16px !important;
  }

  /* Grid fixes for small grids */
  div[style*="grid-template-columns: repeat(2, 1fr)"] {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* Button width fixes */
  button[style*="width: 100%"],
  a[style*="width: 100%"] {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Modal fixes */
  div[style*="width: 320px"] {
    width: calc(100vw - 32px) !important;
    max-width: 320px !important;
  }

  /* Text size adjustments for readability */
  h1 {
    font-size: min(28px, 6vw) !important;
  }

  /* Progress bar container fix */
  div[style*="gap: 64px"] {
    gap: 24px !important;
  }

  /* Fixed positioning adjustments */
  header[style*="position: fixed"] {
    left: 16px !important;
    right: 16px !important;
    top: 16px !important;
  }
}

/* Tablet responsive adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  /* Container adjustments for tablets */
  .container,
  div[style*="max-width: 1280px"] {
    padding: 0 32px !important;
    max-width: 100vw !important;
  }

  /* Reduce grid gap for tablets */
  div[style*="gap: 64px"] {
    gap: 40px !important;
  }

  /* Header padding for tablets */
  header > div {
    padding: 0 24px !important;
  }
}

/* Additional overflow prevention */
img, video, iframe, embed, object {
  max-width: 100% !important;
  height: auto !important;
}

/* Prevent text overflow */
p, span, div {
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
}

/* Дополнительные правила для очень маленьких экранов */
@media (max-width: 480px) {
  .subscription-widget {
    bottom: 12px;
    right: 12px;
    z-index: 900; /* Еще ниже на малых экранах */
  }

  .subscription-toggle {
    width: 44px;
    height: 44px;
    border-radius: 22px;
    /* Меньшая тень для экономии ресурсов */
    box-shadow: 0 2px 12px rgba(242, 105, 76, 0.25);
  }

  .subscription-menu {
    width: calc(100vw - 32px) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    bottom: 80px !important;
    padding: 16px !important;
    max-width: 320px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3) !important;
    margin: 0 auto !important;
    z-index: 9999 !important;
    position: fixed !important;
  }

  .subscription-menu h3 {
    font-size: 14px;
    margin: 0 0 8px 0;
  }

  .subscription-menu p {
    font-size: 10px;
    margin: 0 0 8px 0;
  }

  .subscription-option {
    padding: 12px;
    border-radius: 8px;
  }

  .email-input {
    padding: 10px;
    font-size: 14px;
  }

  .email-submit {
    height: 40px !important;
    font-size: 13px;
  }
}

/* Правило для предотвращения перекрытия контента на мобильных */
@media (max-width: 768px) {
  /* Добавляем нижний отступ для основного контента, чтобы избежать перекрытия */
  body:not(.dashboard-index) main,
  body:not(.dashboard-index) .main-content,
  body:not(.dashboard-index) article,
  body:not(.dashboard-index) section:last-child {
    padding-bottom: 80px !important;
  }

  /* Для страниц с фиксированными заголовками */
  body:has(.subscription-widget) {
    padding-bottom: 80px;
  }

  /* Улучшенная адаптация subscription menu */
  .subscription-menu {
    left: 50% !important;
    right: auto !important;
    width: calc(100vw - 32px) !important;
    max-width: 320px !important;
    transform: translateX(-50%) !important;
    transform-origin: bottom center !important;
    position: fixed !important;
    bottom: 80px !important;
    z-index: 9999 !important;
  }

  .subscription-menu::before {
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) rotate(45deg) !important;
  }
}

/* Дополнительные правила для landscape ориентации на мобильных */
@media (max-width: 768px) and (orientation: landscape) {
  .subscription-widget {
    bottom: 8px !important;
    right: 8px !important;
  }

  .subscription-toggle {
    width: 40px !important;
    height: 40px !important;
    border-radius: 20px !important;
  }

  .subscription-menu {
    bottom: 48px !important;
    max-height: calc(100vh - 60px) !important;
    overflow-y: auto !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: calc(100vw - 16px) !important;
    max-width: 280px !important;
  }
}

/* Умное скрытие виджета при прокрутке на мобильных для лучшего UX */
@media (max-width: 768px) {
  .subscription-widget.scroll-hidden {
    transform: translateY(100px) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: all 0.3s ease !important;
  }

  /* Автоматическое показывание при остановке прокрутки */
  .subscription-widget.scroll-visible {
    transform: translateY(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transition: all 0.3s ease 0.5s !important;
  }

  /* Улучшение для overlay */
  .subscription-overlay {
    z-index: 9998 !important;
  }

  /* Предотвращение прокрутки страницы при открытом меню */
  body.subscription-menu-open {
    position: fixed !important;
    width: 100% !important;
    overflow: hidden !important;
  }
}

/* Улучшение доступности для пользователей с ограниченными возможностями */
@media (prefers-reduced-motion: reduce) {
  .subscription-widget,
  .subscription-menu,
  .dice {
    animation: none !important;
    transition: none !important;
  }

  .subscription-toggle:hover {
    transform: none !important;
  }
}
