/*
 * Ferbeatz Events v14.0.3.3
 * Brand colors, background image, improved mobile UX
 */

/* ===== SECTION WRAPPER ===== */
.fbz-events-section {
  width: 100%;
  padding: 80px 0;
  position: relative;
  /* Background image with gradient overlay 
   * To use a custom image, replace the url() below with your image path:
   * url('/wp-content/uploads/2026/02/events-bg.jpg')
   */
  background-image: 
    linear-gradient(180deg, rgba(25, 29, 49, 0.95) 0%, rgba(59, 69, 116, 0.9) 100%),
    url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkyMCIgaGVpZ2h0PSIxMDgwIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxkZWZzPjxwYXR0ZXJuIGlkPSJncmlkIiB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiPjxwYXRoIGQ9Ik0gNDAgMCBMIDAgMCAwIDQwIiBmaWxsPSJub25lIiBzdHJva2U9InJnYmEoMjUzLCAyMzUsIDI1LCAwLjA1KSIgc3Ryb2tlLXdpZHRoPSIxIi8+PC9wYXR0ZXJuPjwvZGVmcz48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSJ1cmwoI2dyaWQpIi8+PC9zdmc+');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

/* ===== HEADER ===== */
.fbz-events-head {
  text-align: center;
  margin-bottom: 48px;
  animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fbz-events-kicker {
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 13px;
  opacity: 0.7;
  color: #fdeb19;
  margin-bottom: 12px;
  display: inline-block;
}

.fbz-events-title {
  margin: 0;
  font-size: 56px;
  line-height: 1.1;
  font-weight: 900;
  background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.fbz-events-divider {
  width: 60px;
  height: 4px;
  margin: 20px auto 0;
  background: linear-gradient(90deg, #fdeb19 0%, #dccb02 100%);
  border-radius: 2px;
  box-shadow: 0 0 20px rgba(253, 235, 25, 0.3);
}

/* ===== EVENTS LIST ===== */
.fbz-events-list {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* v14.0.3.4: Full-width layout for archive page */
body.post-type-archive-event .fbz-events-section {
  padding: 0; /* No padding, let sections handle it */
  background: transparent; /* Handled by wrapper */
}

body.post-type-archive-event .fbz-events-list {
  max-width: 100%;
  padding: 0 60px;
}

body.post-type-archive-event .fbz-events-head {
  display: none; /* Hero already shows title */
}

/* Different backgrounds for upcoming vs past on archive */
body.post-type-archive-event .fbz-events-section {
  background: linear-gradient(180deg, #191d31 0%, #3b4574 100%);
  padding: 60px 0;
}

body.post-type-archive-event .fbz-events-past {
  background: #1a2139;  /* Azul medio, contrasta con upcoming y footer */
  margin-top: 0;
  padding-top: 60px;
}

@media (max-width: 1024px) {
  body.post-type-archive-event .fbz-events-list {
    padding: 0 40px;
  }
}

@media (max-width: 768px) {
  body.post-type-archive-event .fbz-events-list {
    padding: 0 24px;
  }
}

/* ===== SINGLE EVENT ITEM ===== */
.fbz-event-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.fbz-event-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #fdeb19 0%, #dccb02 100%);
  transform: scaleY(0);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Desktop hover */
@media (hover: hover) {
  .fbz-event-item:hover {
    background: rgba(30, 41, 59, 0.6);
    transform: translateX(4px);
  }

  .fbz-event-item:hover::before {
    transform: scaleY(1);
  }
}

.fbz-event-item:last-child {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.fbz-event-item--next {
  background: rgba(253, 235, 25, 0.08);
  border-color: rgba(253, 235, 25, 0.2);
}

.fbz-event-item--next::before {
  background: linear-gradient(180deg, #fdeb19 0%, #dccb02 100%);
  transform: scaleY(1);
}

/* ===== EVENT LINK ===== */
.fbz-event-link {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 20px;
  text-decoration: none;
  color: inherit;
  position: relative;
  z-index: 1;
}

/* ===== DATE BLOCK ===== */
.fbz-event-date {
  width: 90px;
  min-width: 90px;
  text-align: center;
  padding: 12px 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

@media (hover: hover) {
  .fbz-event-item:hover .fbz-event-date {
    background: rgba(253, 235, 25, 0.1);
    border-color: rgba(253, 235, 25, 0.3);
    transform: scale(1.05);
  }
}

.fbz-event-day {
  font-size: 42px;
  font-weight: 900;
  line-height: 1;
  color: #fdeb19;
  text-shadow: 0 0 20px rgba(253, 235, 25, 0.3);
}

.fbz-event-mon-year {
  font-size: 13px;
  text-transform: uppercase;
  opacity: 0.8;
  margin-top: 6px;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* ===== EVENT MAIN CONTENT ===== */
.fbz-event-main {
  flex: 1;
  padding-left: 24px;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.fbz-event-title h3 {
  font-size: 28px;
  line-height: 1.2;
  margin: 0 0 8px 0;
  font-weight: 800;
  color: #fff;
  transition: color 0.3s ease;
}

@media (hover: hover) {
  .fbz-event-item:hover .fbz-event-title h3 {
    color: #fdeb19;
  }
}

.fbz-event-info {
  margin-top: 8px;
  font-size: 14px;
  opacity: 0.85;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.fbz-event-cat {
  padding: 4px 12px;
  background: rgba(253, 235, 25, 0.15);
  border-radius: 12px;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fdeb19;
}

.fbz-event-loc,
.fbz-event-time {
  opacity: 0.9;
}

/* ===== EVENT ACTIONS ===== */
.fbz-event-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 15; /* Above countdown overlay */
}

.fbz-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 24px;
  border: 2px solid #fdeb19;
  text-decoration: none;
  color: #fdeb19;
  font-weight: 700;
  font-size: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(253, 235, 25, 0.05);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* v14.0.3.4: When event has hover, Buy Tickets becomes blue outline */
@media (hover: hover) {
  .fbz-event-item:hover .fbz-btn {
    border-color: #191d31;
    color: #191d31;
    background: transparent;
  }
  
  .fbz-event-item:hover .fbz-btn:hover {
    background: #191d31;
    color: #fdeb19;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(25, 29, 49, 0.3);
  }
}

.fbz-btn:hover {
  background: #fdeb19;
  color: #191d31;
  border-color: #fdeb19;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(253, 235, 25, 0.3);
}

/* v14.0.3.4: Buy Tickets button contrast on hover overlay */
@media (hover: hover) {
  .fbz-event-item:hover .fbz-btn {
    background: transparent;
    border-color: #191d31;
    color: #191d31;
    box-shadow: 0 4px 12px rgba(25, 29, 49, 0.2);
  }
  
  .fbz-event-item:hover .fbz-btn:hover {
    background: #191d31;
    color: #fdeb19;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 16px rgba(25, 29, 49, 0.4);
  }
}

.fbz-event-ticket {
  white-space: nowrap;
}

/* v14.0.3.8: View Details button (mobile only) */
.fbz-mobile-btn {
  display: none;  /* Hidden on desktop */
}

.fbz-events-actions {
  text-align: center;
  margin-top: 32px;
}

/* ===== DESKTOP COUNTDOWN OVERLAY (with View Details button) ===== */
.fbz-event-countdown {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(135deg, rgba(253, 235, 25, 0.95) 0%, rgba(220, 203, 2, 0.95) 100%);
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
}

.fbz-event-countdown-content {
  text-align: center;
}

.fbz-event-countdown-timer {
  font-size: 32px;
  font-weight: 900;
  color: #191d31;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.fbz-event-countdown-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 32px;
  background: #191d31;
  color: #fdeb19;
  border-radius: 24px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  pointer-events: auto;
  transition: all 0.3s ease;
  border: 2px solid #191d31;
}

.fbz-event-countdown-btn:hover {
  background: #3b4574;
  border-color: #3b4574;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Show countdown on desktop hover */
@media (hover: hover) {
  .fbz-event-item:hover .fbz-event-countdown {
    opacity: 1;
  }
}

/* ===== MOBILE COUNTDOWN (subtle, below date) ===== */
.fbz-event-countdown-mobile {
  display: none;  /* Hidden by default */
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #fdeb19;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  opacity: 0.9;
  text-align: center;
}

/* Hide desktop countdown on mobile/touch devices + disable all hovers */
@media (hover: none) {
  /* v14.0.3.10: Deshabilitar completamente hover en touch */
  .fbz-event-item {
    pointer-events: auto !important;
  }
  
  .fbz-event-item:hover {
    transform: none !important;
    border-color: rgba(253, 235, 25, 0.1) !important;
    box-shadow: none !important;
  }
  
  .fbz-event-item:hover .fbz-event-date {
    transform: none !important;
  }
  
  .fbz-event-item:hover .fbz-event-title h3 {
    color: inherit !important;
  }
  
  .fbz-event-item:hover .fbz-btn {
    background: rgba(253, 235, 25, 0.05) !important;
    border-color: #fdeb19 !important;
    color: #fdeb19 !important;
    transform: none !important;
    box-shadow: none !important;
  }
  
  .fbz-btn:hover {
    background: rgba(253, 235, 25, 0.05) !important;
    color: #fdeb19 !important;
    border-color: #fdeb19 !important;
    transform: none !important;
    box-shadow: none !important;
  }
  
  /* Desktop countdown MUST be hidden */
  .fbz-event-countdown {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
  
  /* Deshabilitar el link principal en mobile - solo botones clickeables */
  .fbz-event-link {
    pointer-events: none !important;
  }
  
  /* Habilitar solo los botones */
  .fbz-event-actions {
    pointer-events: auto !important;
  }
  
  .fbz-btn {
    pointer-events: auto !important;
  }
  
  /* Show mobile countdown only for next event */
  .fbz-event-item--next .fbz-event-countdown-mobile {
    display: block !important;
  }
}

/* ===== MOBILE LAYOUT (centered, no hover) ===== */
@media (max-width: 768px) {
  .fbz-events-section {
    padding: 60px 0;
  }
  
  .fbz-events-title {
    font-size: 42px;
  }
  
  .fbz-event-item {
    flex-direction: column;
    text-align: center;
    padding: 32px 20px;
    gap: 16px;
  }
  
  .fbz-event-link {
    flex-direction: column;
    gap: 16px;
    width: 100%;
  }
  
  .fbz-event-date {
    width: 100px;
    margin: 0 auto;
  }
  
  .fbz-event-main {
    border-left: none;
    padding-left: 0;
    width: 100%;
  }
  
  .fbz-event-info {
    justify-content: center;
  }
  
  .fbz-event-actions {
    justify-content: center;
    width: 100%;
    flex-direction: column;  /* Stack buttons vertically */
    gap: 12px;
    pointer-events: auto !important;  /* Botones clickeables */
  }
  
  /* v14.0.3.10: Deshabilitar hover y countdown overlay en mobile */
  .fbz-event-countdown {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
  }
  
  .fbz-event-link {
    pointer-events: none !important;  /* Link principal NO clickeable */
  }
  
  .fbz-btn {
    pointer-events: auto !important;  /* Solo botones clickeables */
  }
  
  /* v14.0.3.8: Show View Details in mobile */
  .fbz-mobile-btn {
    display: inline-flex;
    width: 100%;  /* Full width */
    padding: 14px 24px;  /* Slightly larger */
  }
  
  .fbz-event-ticket {
    width: 100%;  /* Full width */
    padding: 14px 24px;  /* Match View Details */
  }
  
  /* Mobile countdown visible debajo de fecha */
  .fbz-event-item--next .fbz-event-countdown-mobile {
    display: block;
  }
  
  .fbz-event-countdown-mobile {
    margin-top: 10px;
    text-align: center;
  }
}

/* ===== CTA (when no events) ===== */
.fbz-events-cta {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 24px;
  text-align: center;
  background: rgba(253, 235, 25, 0.08);
  border-radius: 16px;
  border: 1px solid rgba(253, 235, 25, 0.2);
}

.fbz-events-cta-title {
  font-size: 32px;
  font-weight: 900;
  color: #fdeb19;
  margin-bottom: 24px;
  line-height: 1.3;
}

.fbz-events-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 40px;
  background: linear-gradient(135deg, #fdeb19 0%, #dccb02 100%);
  color: #191d31;
  border-radius: 30px;
  font-weight: 900;
  font-size: 16px;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(253, 235, 25, 0.3);
}

.fbz-events-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(253, 235, 25, 0.4);
}

/* ===== PAST EVENTS TOGGLE ===== */
.fbz-events-past {
  max-width: 1200px;
  margin: 48px auto 0;
  padding: 0 24px;
}

.fbz-events-past-head {
  text-align: center;
  margin-bottom: 24px;
}

.fbz-events-toggle {
  padding: 14px 32px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(253, 235, 25, 0.3);
  border-radius: 24px;
  color: #fdeb19;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.3s ease;
}

.fbz-events-toggle:hover {
  background: rgba(253, 235, 25, 0.1);
  border-color: #fdeb19;
}

.fbz-events-past-list {
  display: none;
  margin-top: 24px;
}

.fbz-events-past-list.fbz-show {
  display: block;
  animation: fadeInUp 0.4s ease-out;
}

/* ===== PAST EVENTS CARDS ===== */
.fbz-past-events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.fbz-past-event-card {
  background: rgba(25, 29, 49, 0.6);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(253, 235, 25, 0.1);
  transition: all 0.3s ease;
}

.fbz-past-event-card:hover {
  transform: translateY(-4px);
  border-color: rgba(253, 235, 25, 0.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.fbz-past-event-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.fbz-past-event-image {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
}

.fbz-past-event-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.fbz-past-event-card:hover .fbz-past-event-image img {
  transform: scale(1.05);
}

.fbz-past-event-info {
  padding: 20px;
}

.fbz-past-event-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 8px;
  line-height: 1.3;
}

.fbz-past-event-location {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 6px;
}

.fbz-past-event-date {
  font-size: 13px;
  color: #fdeb19;
  font-weight: 600;
  opacity: 0.8;
}

@media (max-width: 768px) {
  .fbz-past-events-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
  }
  
  .fbz-past-event-info {
    padding: 16px;
  }
  
  .fbz-past-event-title {
    font-size: 16px;
  }
}

/* ===== VIEW MORE BUTTON ===== */
.fbz-events-more {
  padding: 14px 32px;
  font-size: 15px;
  border: 2px solid #fdeb19;
  background: transparent;
}

.fbz-events-more:hover {
  background: #fdeb19;
  color: #191d31;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(253, 235, 25, 0.3);
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 640px) {
  .fbz-events-title {
    font-size: 36px;
  }
  
  .fbz-event-day {
    font-size: 36px;
  }
  
  .fbz-event-title h3 {
    font-size: 22px;
  }
  
  .fbz-event-info {
    font-size: 13px;
  }
  
  .fbz-events-cta-title {
    font-size: 24px;
  }
}
