/**
 * Enhanced Events Listing Styles
 * Modern, responsive design with smooth animations
 */

/* ========================================
   Events Page Container
   ======================================== */
.view-events {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 20px;
}

.view-events .view-header {
  text-align: center;
  margin-bottom: 50px;
  position: relative;
}

.view-events .view-header h1 {
  color: #1B9C85;
  font-size: 42px;
  font-weight: 700;
  margin-bottom: 15px;
  position: relative;
  display: inline-block;
}

.view-events .view-header h1::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, #1B9C85, #D4F3D7);
  border-radius: 2px;
}

.view-events .view-header p {
  color: #64748B;
  font-size: 18px;
  max-width: 600px;
  margin: 25px auto 0;
  line-height: 1.6;
}

/* ========================================
   Events Grid Layout
   ======================================== */
.view-events .view-content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 32px;
  margin-bottom: 50px;
}

/* ========================================
   Event Card Base Styles
   ======================================== */
.node--type-event.node--view-mode-teaser {
  background: #FFFFFF !important;
  border-radius: 16px !important;
  overflow: hidden !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06) !important;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  position: relative !important;
  padding: 0 !important;
  border: 1px solid rgba(27, 156, 133, 0.1) !important;
}

.node--type-event.node--view-mode-teaser:hover {
  transform: translateY(-10px) !important;
  box-shadow: 0 20px 40px rgba(27, 156, 133, 0.15) !important;
  border-color: rgba(27, 156, 133, 0.3) !important;
}

.node--type-event.node--view-mode-teaser::after {
  display: none !important;
}

/* Olivero Theme Structure Fixes */
.node--type-event.node--view-mode-teaser .teaser__top {
  display: block !important;
  position: static !important;
  margin: 0 !important;
}

.node--type-event.node--view-mode-teaser header {
  display: contents;
}

.node--type-event.node--view-mode-teaser .teaser__meta {
  display: none !important;
}

.node--type-event.node--view-mode-teaser .teaser__content {
  padding: 24px !important;
  flex-grow: 1;
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
}

/* ========================================
   Event Image Styles
   ======================================== */
.node--type-event.node--view-mode-teaser .teaser__image,
.node--type-event.node--view-mode-teaser .field--name-field-event-image {
  position: relative !important;
  width: 100% !important;
  height: 220px !important;
  overflow: hidden !important;
  margin: 0 !important;
  background: linear-gradient(135deg, #1B9C85 0%, #178E79 50%, #0F766E 100%);
}

/* Event placeholder when no image */
.node--type-event.node--view-mode-teaser .teaser__image::before,
.node--type-event.node--view-mode-teaser .field--name-field-event-image:empty::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.3)' stroke-width='1.5'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.5;
}

.node--type-event.node--view-mode-teaser .teaser__image a,
.node--type-event.node--view-mode-teaser .field--name-field-event-image a {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
}

.node--type-event.node--view-mode-teaser .teaser__image img,
.node--type-event.node--view-mode-teaser .field--name-field-event-image img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 0 !important;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.node--type-event.node--view-mode-teaser:hover .teaser__image img,
.node--type-event.node--view-mode-teaser:hover .field--name-field-event-image img {
  transform: scale(1.08) !important;
}

/* ========================================
   Event Content Area
   ======================================== */
.node--type-event.node--view-mode-teaser .node__content {
  padding: 24px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

/* ========================================
   Event Title
   ======================================== */
.node--type-event.node--view-mode-teaser h2,
.node--type-event.node--view-mode-teaser .node__title {
  margin: 0 0 16px 0 !important;
}

.node--type-event.node--view-mode-teaser h2 a,
.node--type-event.node--view-mode-teaser .node__title a {
  color: #0F172A !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  text-decoration: none !important;
  transition: color 0.3s ease !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.node--type-event.node--view-mode-teaser h2 a:hover,
.node--type-event.node--view-mode-teaser .node__title a:hover {
  color: #1B9C85 !important;
}

/* ========================================
   Event Summary
   ======================================== */
.node--type-event.node--view-mode-teaser .field--name-field-event-summary {
  color: #64748B;
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 20px;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========================================
   Event Meta Information
   ======================================== */
.node--type-event.node--view-mode-teaser .event-meta-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
  padding: 16px;
  background: #F8FAFC;
  border-radius: 12px;
}

.node--type-event.node--view-mode-teaser .field--name-field-event-date,
.node--type-event.node--view-mode-teaser .field--name-field-event-location {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #475569;
  font-size: 14px;
  line-height: 1.5;
}

.node--type-event.node--view-mode-teaser .field--name-field-event-date::before {
  content: "";
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231B9C85' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  flex-shrink: 0;
}

.node--type-event.node--view-mode-teaser .field--name-field-event-location::before {
  content: "";
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231B9C85' stroke-width='2'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'%3E%3C/path%3E%3Ccircle cx='12' cy='10' r='3'%3E%3C/circle%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  flex-shrink: 0;
}

/* ========================================
   Event Price
   ======================================== */
.node--type-event.node--view-mode-teaser .field--name-field-event-price {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
  color: #047857;
  padding: 8px 16px;
  border-radius: 24px;
  font-weight: 700;
  font-size: 16px;
  margin-top: auto;
  align-self: flex-start;
  border: 1px solid #A7F3D0;
}

.node--type-event.node--view-mode-teaser .field--name-field-event-price::before {
  content: "";
  width: 16px;
  height: 16px;
  margin-right: 6px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23047857' stroke-width='2'%3E%3Cline x1='12' y1='1' x2='12' y2='23'%3E%3C/line%3E%3Cpath d='M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
}

/* ========================================
   Event Action Buttons
   ======================================== */
.event-teaser-actions {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #E2E8F0;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.event-register-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  background: linear-gradient(135deg, #1B9C85 0%, #0F766E 100%);
  color: #FFFFFF !important;
  text-decoration: none !important;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(27, 156, 133, 0.25);
  flex: 1;
  min-width: 140px;
}

.event-register-btn:hover {
  background: linear-gradient(135deg, #178E79 0%, #0D9488 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(27, 156, 133, 0.35);
  color: #FFFFFF !important;
  text-decoration: none !important;
}

.event-register-btn:active {
  transform: translateY(0);
}

.event-register-btn.btn-secondary {
  background: #FFFFFF;
  color: #1B9C85 !important;
  border: 2px solid #1B9C85;
  box-shadow: none;
}

.event-register-btn.btn-secondary:hover {
  background: #ECFDF5;
  color: #0F766E !important;
  border-color: #0F766E;
  box-shadow: 0 4px 12px rgba(27, 156, 133, 0.15);
}

/* Read More Link */
.node--type-event.node--view-mode-teaser .node__links {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #E2E8F0;
}

.node--type-event.node--view-mode-teaser .node__links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1B9C85 0%, #0F766E 100%);
  color: #FFFFFF;
  padding: 12px 24px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.3s ease;
  text-align: center;
  width: 100%;
  box-shadow: 0 4px 14px rgba(27, 156, 133, 0.25);
}

.node--type-event.node--view-mode-teaser .node__links a:hover {
  background: linear-gradient(135deg, #178E79 0%, #0D9488 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(27, 156, 133, 0.35);
}

/* ========================================
   Status Badges
   ======================================== */
.event-status-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 6px 14px;
  border-radius: 24px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 2;
  backdrop-filter: blur(10px);
}

.event-status-badge.upcoming {
  background: rgba(27, 156, 133, 0.95);
  color: #FFFFFF;
  box-shadow: 0 2px 10px rgba(27, 156, 133, 0.3);
}

.event-status-badge.full,
.event-status-badge.sold-out {
  background: rgba(239, 68, 68, 0.95);
  color: #FFFFFF;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.3);
}

.event-status-badge.low-tickets {
  background: rgba(245, 158, 11, 0.95);
  color: #FFFFFF;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.3);
}

.event-status-badge.free {
  background: rgba(16, 185, 129, 0.95);
  color: #FFFFFF;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}

/* ========================================
   Empty State
   ======================================== */
.view-events .view-empty {
  text-align: center;
  padding: 100px 30px;
  background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
  border-radius: 20px;
  margin: 50px 0;
}

.view-events .view-empty::before {
  content: "";
  display: block;
  width: 100px;
  height: 100px;
  margin: 0 auto 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231B9C85' stroke-width='1.5'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.5;
}

.view-events .view-empty p {
  color: #64748B;
  font-size: 18px;
  margin: 0;
  line-height: 1.6;
}

/* ========================================
   Pagination
   ======================================== */
.view-events .pager {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 50px;
  flex-wrap: wrap;
}

.view-events .pager__item {
  list-style: none;
}

.view-events .pager__item a,
.view-events .pager__item.is-active span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 16px;
  background: #FFFFFF;
  border: 2px solid #E2E8F0;
  border-radius: 10px;
  color: #475569;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s ease;
}

.view-events .pager__item a:hover {
  background: #1B9C85;
  color: #FFFFFF;
  border-color: #1B9C85;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(27, 156, 133, 0.25);
}

.view-events .pager__item.is-active span {
  background: linear-gradient(135deg, #1B9C85 0%, #0F766E 100%);
  color: #FFFFFF;
  border-color: #1B9C85;
  box-shadow: 0 4px 12px rgba(27, 156, 133, 0.25);
}

/* ========================================
   Loading Animation
   ======================================== */
.view-events.ajax-loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.view-events.ajax-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50px;
  height: 50px;
  margin: -25px 0 0 -25px;
  border: 4px solid #E2E8F0;
  border-top-color: #1B9C85;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ========================================
   Featured Event
   ======================================== */
.node--type-event.node--view-mode-teaser.featured {
  border: 2px solid #1B9C85 !important;
  position: relative;
}

.node--type-event.node--view-mode-teaser.featured::before {
  content: "Featured";
  position: absolute;
  top: 16px;
  left: 16px;
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: #FFFFFF;
  padding: 6px 14px;
  border-radius: 24px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 2;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.3);
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1200px) {
  .view-events .view-content {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

@media (max-width: 768px) {
  .view-events {
    padding: 30px 16px;
  }

  .view-events .view-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .view-events .view-header {
    margin-bottom: 35px;
  }

  .view-events .view-header h1 {
    font-size: 28px;
  }

  .view-events .view-header p {
    font-size: 16px;
  }

  .node--type-event.node--view-mode-teaser .teaser__image,
  .node--type-event.node--view-mode-teaser .field--name-field-event-image {
    height: 180px !important;
  }

  .node--type-event.node--view-mode-teaser .teaser__content,
  .node--type-event.node--view-mode-teaser .node__content {
    padding: 20px !important;
  }

  .node--type-event.node--view-mode-teaser h2 a,
  .node--type-event.node--view-mode-teaser .node__title a {
    font-size: 18px !important;
  }

  .event-teaser-actions {
    flex-direction: column;
  }

  .event-register-btn {
    width: 100%;
  }

  .view-events .pager {
    gap: 6px;
  }

  .view-events .pager__item a,
  .view-events .pager__item.is-active span {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .view-events .view-header h1 {
    font-size: 24px;
  }

  .node--type-event.node--view-mode-teaser {
    border-radius: 12px !important;
  }

  .node--type-event.node--view-mode-teaser .teaser__image,
  .node--type-event.node--view-mode-teaser .field--name-field-event-image {
    height: 160px !important;
  }

  .node--type-event.node--view-mode-teaser .teaser__content,
  .node--type-event.node--view-mode-teaser .node__content {
    padding: 16px !important;
  }

  .event-status-badge {
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    font-size: 10px;
  }
}

/* ========================================
   Animation for Cards on Load
   ======================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.view-events .views-row {
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}

.view-events .views-row:nth-child(1) { animation-delay: 0.1s; }
.view-events .views-row:nth-child(2) { animation-delay: 0.15s; }
.view-events .views-row:nth-child(3) { animation-delay: 0.2s; }
.view-events .views-row:nth-child(4) { animation-delay: 0.25s; }
.view-events .views-row:nth-child(5) { animation-delay: 0.3s; }
.view-events .views-row:nth-child(6) { animation-delay: 0.35s; }
.view-events .views-row:nth-child(7) { animation-delay: 0.4s; }
.view-events .views-row:nth-child(8) { animation-delay: 0.45s; }
.view-events .views-row:nth-child(9) { animation-delay: 0.5s; }

/* ========================================
   Print Styles
   ======================================== */
@media print {
  .view-events .view-content {
    display: block;
  }

  .node--type-event.node--view-mode-teaser {
    break-inside: avoid;
    margin-bottom: 20px;
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }

  .event-teaser-actions,
  .event-status-badge {
    display: none !important;
  }
}
