/* Tigule Events browse page */
.events-page {
  --ev-primary: #c8102e;
  --ev-primary-dark: #8b0d20;
  --ev-ink: #0f172a;
  --ev-muted: #64748b;
  --ev-border: rgba(15, 23, 42, 0.08);
  --ev-radius: 18px;
  padding-bottom: 2.5rem;
  overflow-x: clip;
}

/* Hero */
.events-hero {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: clamp(1.25rem, 3vw, 2rem) clamp(1rem, 3vw, 1.75rem);
  margin: 0.75rem 0 1.25rem;
  color: #fff;
  background:
    radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.18) 0%, transparent 45%),
    radial-gradient(circle at 10% 90%, rgba(0, 0, 0, 0.25) 0%, transparent 50%),
    linear-gradient(135deg, #c8102e 0%, #9a1028 45%, #5a0815 100%);
  box-shadow: 0 18px 40px rgba(200, 16, 46, 0.22);
}

.events-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent);
  pointer-events: none;
}

.events-hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.events-hero__brand {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  min-width: 0;
}

.events-hero__icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
  flex-shrink: 0;
}

.events-hero h1.events-hero__title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.35rem, 3.5vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #fff;
}

.events-hero__subtitle {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(0.85rem, 2vw, 0.98rem);
  max-width: 36rem;
}

.events-hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.events-hero__stat {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.events-hero__stat strong {
  color: #fff;
}

.events-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.ev-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 1.1rem;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  border: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

.ev-btn--light {
  background: #fff;
  color: var(--ev-primary);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.ev-btn--light:hover {
  transform: translateY(-2px);
  color: var(--ev-primary-dark);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.16);
}

.ev-btn--ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.ev-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* Toolbar */
.events-toolbar {
  background: #fff;
  border: 1px solid var(--ev-border);
  border-radius: var(--ev-radius);
  padding: 1rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.events-toolbar__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
}

.events-search {
  position: relative;
}

.events-search input {
  width: 100%;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 0.75rem 2.75rem 0.75rem 1rem;
  font-size: 0.92rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.events-search input:focus {
  outline: none;
  border-color: rgba(200, 16, 46, 0.45);
  box-shadow: 0 0 0 4px rgba(200, 16, 46, 0.1);
}

.events-search__icon {
  position: absolute;
  right: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ev-muted);
  pointer-events: none;
}

.events-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.events-quick-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ev-primary);
  background: #fff5f7;
  border: 1px solid rgba(200, 16, 46, 0.18);
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease;
}

.events-quick-link:hover {
  background: #ffe8ec;
  color: var(--ev-primary-dark);
  transform: translateY(-1px);
}

.events-categories {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.85rem 0 0.15rem;
  margin-top: 0.65rem;
  -webkit-overflow-scrolling: touch;
  /* Keep swipe/scroll, hide the scrollbar track */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge legacy */
}

.events-categories::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Android WebView */
  width: 0;
  height: 0;
}

.events-cat {
  flex-shrink: 0;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ev-ink);
  background: #f1f5f9;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all 0.15s ease;
}

.events-cat:hover {
  background: #e2e8f0;
  color: var(--ev-ink);
}

.events-cat.is-active {
  background: linear-gradient(135deg, var(--ev-primary), var(--ev-primary-dark));
  color: #fff;
  box-shadow: 0 6px 16px rgba(200, 16, 46, 0.25);
}

/* Grid */
.events-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

@media (min-width: 768px) {
  .events-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }
}

@media (min-width: 1200px) {
  .events-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.15rem;
  }
}

/* Event card */
.ev-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--ev-border);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  min-width: 0;
}

.ev-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
  border-color: rgba(200, 16, 46, 0.22);
  color: inherit;
}

.ev-card.is-cancelled {
  opacity: 0.88;
  border-color: rgba(220, 53, 69, 0.35);
}

.ev-card.is-ended {
  opacity: 0.92;
}

.ev-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  background-size: cover;
  background-position: center;
  background-color: #f1f5f9;
}

.ev-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(15, 23, 42, 0.55) 100%);
}

.ev-card__date {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  z-index: 2;
  min-width: 52px;
  text-align: center;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  padding: 0.35rem 0.45rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.ev-card__date-day {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ev-primary);
  line-height: 1;
}

.ev-card__date-mon {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ev-muted);
  letter-spacing: 0.04em;
}

.ev-card__category {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 2;
  max-width: calc(100% - 4.5rem);
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #fff;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(4px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ev-card__status {
  position: absolute;
  bottom: 0.65rem;
  right: 0.65rem;
  z-index: 2;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #fff;
}

.ev-card__status--cancelled {
  background: linear-gradient(135deg, #dc3545, #c8102e);
}

.ev-card__status--ended {
  background: linear-gradient(135deg, #64748b, #475569);
}

.ev-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.85rem;
  flex: 1;
}

.ev-card__title {
  margin: 0;
  font-size: clamp(0.92rem, 2.2vw, 1.02rem);
  font-weight: 800;
  line-height: 1.35;
  color: var(--ev-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ev-card__meta {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.ev-card__meta li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.76rem;
  color: var(--ev-muted);
  min-width: 0;
}

.ev-card__meta i {
  width: 14px;
  color: var(--ev-primary);
  flex-shrink: 0;
}

.ev-card__meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ev-card__footer {
  margin-top: auto;
  padding-top: 0.65rem;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.ev-card__price {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ev-primary);
  min-width: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 0.2rem;
  white-space: nowrap;
  flex-shrink: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ev-card__price-label {
  font-weight: 600;
  color: var(--ev-muted);
  font-size: 0.72rem;
}

.ev-card__price-value {
  font-size: 0.92rem;
  white-space: nowrap;
}

.ev-card__cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.38rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--ev-primary), var(--ev-primary-dark));
  box-shadow: 0 4px 12px rgba(200, 16, 46, 0.25);
}

.ev-card__cta.is-muted {
  background: #94a3b8;
  box-shadow: none;
}

/* Empty + loader */
.events-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1.25rem;
  border-radius: var(--ev-radius);
  background: linear-gradient(180deg, #fff, #f8fafc);
  border: 1px dashed #cbd5e1;
}

.events-empty__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.75rem;
  color: #94a3b8;
  background: #f1f5f9;
}

.events-empty h3 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ev-ink);
}

.events-empty p {
  margin: 0;
  color: var(--ev-muted);
  font-size: 0.9rem;
}

.events-loader {
  grid-column: 1 / -1;
  text-align: center;
  padding: 1.5rem 0 0.5rem;
}

.events-loader__ring {
  width: 36px;
  height: 36px;
  margin: 0 auto;
  border: 3px solid rgba(200, 16, 46, 0.15);
  border-top-color: var(--ev-primary);
  border-radius: 50%;
  animation: evSpin 0.8s linear infinite;
}

@keyframes evSpin {
  to { transform: rotate(360deg); }
}

/* Mobile-only: hero + 1-column horizontal cards */
@media (max-width: 767px) {
  .events-page {
    padding-bottom: 1.5rem;
  }

  .events-hero {
    border-radius: 0 0 22px 22px;
    margin: 0 calc(50% - 50vw) 1rem;
    width: 100vw;
    max-width: 100vw;
    padding: 1.15rem 1rem 1.25rem;
    box-shadow: 0 14px 32px rgba(200, 16, 46, 0.28);
  }

  .events-hero__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }

  .events-hero__brand {
    gap: 0.85rem;
    align-items: center;
  }

  .events-hero__icon {
    width: 52px;
    height: 52px;
    font-size: 1.25rem;
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  }

  .events-hero h1.events-hero__title {
    font-size: 1.45rem;
    margin-bottom: 0.25rem;
  }

  .events-hero__subtitle {
    font-size: 0.82rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .events-hero__stats {
    display: flex;
    margin-top: 0.65rem;
    gap: 0.4rem;
  }

  .events-hero__stat {
    font-size: 0.72rem;
    padding: 0.3rem 0.6rem;
  }

  .events-hero__actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.5rem;
  }

  .ev-btn {
    width: 100%;
    height: auto;
    min-height: 42px;
    padding: 0.55rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
  }

  .ev-btn span.ev-btn__label {
    display: inline;
  }

  .events-toolbar {
    padding: 0.85rem;
    border-radius: 16px;
    margin-bottom: 1rem;
  }

  .events-toolbar__row {
    grid-template-columns: 1fr;
  }

  .events-quick-links {
    width: 100%;
  }

  .events-quick-link {
    flex: 1;
    justify-content: center;
    min-width: 0;
    font-size: 0.75rem;
    padding: 0.5rem 0.6rem;
  }

  /* 1 event per row */
  .events-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  /* Horizontal card layout */
  .ev-card {
    flex-direction: row;
    align-items: stretch;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  }

  .ev-card:active {
    transform: scale(0.99);
  }

  .ev-card__media {
    flex: 0 0 118px;
    width: 118px;
    min-height: 118px;
    aspect-ratio: auto;
    border-radius: 14px 0 0 14px;
  }

  .ev-card__date {
    top: 0.45rem;
    left: 0.45rem;
    min-width: 44px;
    padding: 0.25rem 0.35rem;
    border-radius: 10px;
  }

  .ev-card__date-day {
    font-size: 0.9rem;
  }

  .ev-card__date-mon {
    font-size: 0.58rem;
  }

  .ev-card__category {
    display: none;
  }

  .ev-card__status {
    bottom: 0.45rem;
    right: 0.45rem;
    left: 0.45rem;
    text-align: center;
    font-size: 0.58rem;
    padding: 0.22rem 0.4rem;
  }

  .ev-card__body {
    flex: 1;
    min-width: 0;
    padding: 0.7rem 0.75rem 0.7rem 0.65rem;
    justify-content: space-between;
    gap: 0.35rem;
  }

  .ev-card__title {
    font-size: 0.92rem;
    line-height: 1.3;
    -webkit-line-clamp: 2;
  }

  .ev-card__meta {
    gap: 0.25rem;
  }

  .ev-card__meta li {
    font-size: 0.7rem;
  }

  .ev-card__footer {
    padding-top: 0.45rem;
    gap: 0.4rem;
    flex-wrap: nowrap;
  }

  .ev-card__price {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.72rem;
  }

  .ev-card__price-value {
    font-size: 0.82rem;
  }

  .ev-card__cta {
    flex-shrink: 0;
    font-size: 0.68rem;
    padding: 0.35rem 0.6rem;
  }
}

@media (max-width: 380px) {
  .ev-card__media {
    flex: 0 0 100px;
    width: 100px;
    min-height: 100px;
  }

  .events-hero h1.events-hero__title {
    font-size: 1.3rem;
  }
}
