/* =======================================================
   TicketsFest.EU Frontend Styles (European Version 2026)
   Matches new PHP structure: .tfe-* classes
   Multilang Safe (No hardcoded content strings)
   ======================================================= */

/* Tokens */
:root {
  --tfe-bg: #f6f7fb;
  --tfe-text: #0f172a;
  --tfe-muted: #6b7280;
  --tfe-line: #dbeafe;
  --tfe-primary: #1d4ed8;       /* Brand Blue */
  --tfe-primary-hover: #1e40af;
  --tfe-accent-yellow: #ffcc00; /* Accent */
  --tfe-red: #d73149;           /* Sold Out */
  --tfe-green: #10b981;         /* Sale */
  --tfe-radius: 24px;
  --tfe-font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --tfe-shadow: 0 10px 26px rgba(15,23,42,0.08);
  --tfe-shadow-strong: 0 26px 70px rgba(15,23,42,0.16);
}

/* Base */
.tfe-wrap {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 20px;
  font-family: var(--tfe-font-main);
  box-sizing: border-box;
}

.tfe-wrap * { box-sizing: border-box; }

/* ------------------------------------------------
   1. Toolbar & Filters
   ------------------------------------------------ */
.tfe-toolbar-compact {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  margin: 0 0 26px 0;
  justify-content: center;
  align-items: center;
}

.tfe-select-chip {
  appearance: none; -webkit-appearance: none;
  background: #fff;
  border: 1px solid var(--tfe-line);
  border-radius: 999px;
  padding: 10px 38px 10px 18px;
  font-size: 14px;
  font-weight: 700;
  color: #1e3a8a;
  cursor: pointer;
  width: 200px;
  flex: 0 0 auto;
  box-shadow: 0 10px 24px rgba(15,23,42,0.06);
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%233b82f6%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 10px;
  transition: border-color .2s ease;
}

.tfe-select-chip:hover { border-color: var(--tfe-primary); }
.tfe-select-chip:disabled { opacity: 0.6; cursor: not-allowed; background-color: #f8fafc; }

.tfe-btn-reset {
  background: none;
  color: var(--tfe-muted);
  border: none;
  text-decoration: underline;
  font-size: 13px;
  cursor: pointer;
  padding: 0 10px;
  flex-shrink: 0;
  font-weight: 700;
}

@media (max-width: 520px) {
  .tfe-toolbar-compact { flex-direction: column; align-items: stretch; }
  .tfe-select-chip { width: 100%; }
}

/* ------------------------------------------------
   2. Grid & Cards
   ------------------------------------------------ */
.tfe-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 768px) { .tfe-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
@media (min-width: 1200px) { .tfe-grid { grid-template-columns: repeat(5, 1fr); gap: 24px; } }

/* Mobile Horizontal Scroll */
@media (max-width: 768px) {
  .tfe-grid {
    display: flex !important;
    flex-direction: row;
    overflow-x: auto;
    gap: 16px;
    padding-bottom: 24px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    margin-right: -20px; padding-right: 20px; /* Bleed effect */
    grid-template-columns: none !important;
  }
  .tfe-grid .tfe-card-item {
    min-width: 260px; max-width: 260px;
    scroll-snap-align: center;
    flex-shrink: 0;
  }
}

/* Card Item */
.tfe-card-item {
  position: relative;
  aspect-ratio: 4/5;
  border-radius: var(--tfe-radius);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 20px rgba(0,0,0,.06);
  transition: transform .25s ease, box-shadow .25s ease;
  transform: translateZ(0); /* Hardware accel */
}

/* Hover effects only for devices with mouse/pointer */
@media (hover: hover) {
  .tfe-card-item:hover {
    transform: translateY(-6px);
    box-shadow: var(--tfe-shadow-strong);
  }
}

/* Full card link area */
.tfe-card-link {
  position: absolute; inset: 0; z-index: 20;
}

.tfe-card-inner {
  width: 100%; height: 100%; position: relative;
}

.tfe-poster {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  display: block;
  background: #e2e8f0; /* Placeholder color */
}

/* ------------------------------------------------
   3. Overlay & Content
   ------------------------------------------------ */
.tfe-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(165deg, #3b82f6 0%, var(--tfe-primary) 100%);
  padding: 18px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s ease, visibility .28s ease;
  color: #fff;
  z-index: 5;
  pointer-events: none; /* Allows click through to .tfe-card-link */
}

.tfe-card-item:hover .tfe-overlay,
.tfe-card-item.active .tfe-overlay { /* Mobile tap support */
  opacity: 1;
  visibility: visible;
}

/* Date Badge */
.tfe-date-badge {
  background: #fff;
  color: var(--tfe-primary);
  font-size: 11px;
  font-weight: 900;
  padding: 5px 11px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  box-shadow: 0 10px 22px rgba(0,0,0,0.10);
  margin-bottom: auto; /* Push content down */
}

.tfe-ov-center {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.tfe-title {
  color: #fff;
  font-size: 16px;
  font-weight: 950;
  text-transform: uppercase;
  margin: 10px 0 8px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  
  /* Clamp text */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tfe-meta {
  font-size: 12px;
  opacity: .96;
  line-height: 1.35;
}

.tfe-price {
  font-weight: 900;
  font-size: 14px;
  margin-top: 6px;
}

.tfe-ov-bottom {
  margin-top: auto;
  z-index: 10;
}

.tfe-btn-details {
  background: #fff;
  color: var(--tfe-primary) !important;
  text-align: center;
  padding: 11px 12px;
  border-radius: 16px;
  font-weight: 950;
  text-decoration: none;
  display: block;
  font-size: 13px;
  box-shadow: 0 14px 30px rgba(15,23,42,0.12);
  transition: transform .18s ease;
}

/* ------------------------------------------------
   4. Slider (Swiper) Specifics
   ------------------------------------------------ */
.tfe-slider-shell {
  width: 100%;
  position: relative;
}

.tfe-slider-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin: -6px 0 14px 0;
}

.tfe-slider-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tfe-nav-btn {
  width: 46px; height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(191,219,254,0.95);
  background: linear-gradient(180deg, rgba(255,255,255,0.92) 0%, rgba(248,251,255,0.95) 100%);
  box-shadow: 0 14px 30px rgba(15,23,42,0.10);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  color: var(--tfe-primary);
}

.tfe-nav-btn:hover {
  transform: translateY(-3px);
  background: var(--tfe-primary);
  color: #fff;
  border-color: var(--tfe-primary);
}

.tfe-nav-btn svg { width: 18px; height: 18px; display: block; }

.tfe-nav-btn.swiper-button-disabled {
  opacity: .35 !important;
  pointer-events: none !important;
  filter: grayscale(1);
}

.tfe-swiper {
  width: 100%;
  overflow: visible !important; /* Allow shadow overflow */
  padding-bottom: 20px !important;
}

/* ------------------------------------------------
   5. Extras (Load More, Empty State, Badges)
   ------------------------------------------------ */

.tfe-load-more-wrap {
  text-align: center;
  margin-top: 34px;
}

.tfe-btn-load-more {
  display: inline-block;
  background: var(--tfe-primary);
  color: #fff;
  border: none;
  padding: 12px 34px;
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 18px 40px rgba(15,23,42,0.12);
  transition: transform .15s ease;
}
.tfe-btn-load-more:hover { transform: translateY(-2px); }

.tfe-no-events {
  grid-column: 1/-1;
  text-align: center;
  padding: 40px 20px;
  color: var(--tfe-muted);
  font-size: 16px;
  background: #fff;
  border-radius: var(--tfe-radius);
  border: 1px dashed var(--tfe-line);
}

/* --- Multilang Safe Badges Logic --- */

/* We use attr(data-badge-text) so the actual translated word 
   ("SOLD OUT", "WYPRZEDANE", "AGOTADO") is passed from PHP/HTML.
*/
.tfe-card-item[data-soldout="1"]::after,
.tfe-card-item[data-onsale="1"]:not([data-soldout="1"])::after {
  content: attr(data-badge-text);
  position: absolute; right: 12px; top: 12px;
  padding: 6px 10px; border-radius: 10px;
  color: #fff; font-weight: 900; font-size: 11px;
  box-shadow: 0 4px 10px rgba(0,0,0,.15);
  z-index: 15;
  pointer-events: none;
}

/* Sold Out Color */
.tfe-card-item[data-soldout="1"]::after {
  background: var(--tfe-red);
}

/* Sale Color (if not sold out) */
.tfe-card-item[data-onsale="1"]:not([data-soldout="1"])::after {
  background: var(--tfe-green);
}

/* Price highlighting for sale */
.tfe-card-item[data-onsale="1"] .tfe-price {
  color: var(--tfe-accent-yellow);
}