﻿/* ==========================================
   Essential Timeline Coverflow Styles
   Full-Width Responsive Implementation
   ========================================== */

.timeline-feature-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
  max-width: 100%;
  margin: 0;
  overflow-x: hidden;
}

/* Swiper Outer & Coverflow Container */
.swiper-container-outer {
  position: relative;
  width: 100%;
  padding: 0 8px; /* Minimal gutter to keep nav buttons on screen edges */
  overflow: hidden;
  box-sizing: border-box;
}

.timeline-swiper {
  width: 100%;
  padding-top: 20px;
  padding-bottom: 55px;
  overflow: hidden !important;
}

.swiper-slide {
  width: 380px;
  max-width: 78vw; /* Fluid width leaves room on sides for adjacent cards to peek */
  height: auto;
  box-sizing: border-box;
  transition: opacity 0.3s ease;
  opacity: 0.55;
}

.swiper-slide-active {
  opacity: 1;
}

/* Timeline Card */
.timeline-card {
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.8);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: all 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.swiper-slide-active .timeline-card {
  border-color: rgba(78, 115, 223, 0.4);
  box-shadow: 0 20px 40px -12px rgba(46, 89, 217, 0.25), 0 10px 20px -5px rgba(0, 0, 0, 0.08) !important;
}

/* Card Media Header */
.card-media-wrapper {
  position: relative;
  height: 170px;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  overflow: hidden;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.swiper-slide-active .card-img {
  transform: scale(1.04);
}

.card-img-fallback {
  display: none;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #2e59d9 0%, #17a2b8 100%);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.fallback-icon-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 6px;
}

.fallback-year {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0.9;
}

.card-year-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
  color: #ffffff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.775rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  z-index: 3;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Card Body & Text Content */
.card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-header-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.event-step-badge {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #4e73df;
  background: rgba(78, 115, 223, 0.1);
  padding: 2px 8px;
  border-radius: 6px;
}

.event-year-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.75rem;
  line-height: 1.35;
}

.card-text-container {
  max-height: 150px;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.card-text-container::-webkit-scrollbar {
  width: 4px;
}

.card-text-container::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.card-text {
  font-size: 0.885rem;
  color: #475569;
  line-height: 1.55;
  margin-bottom: 0;
}

/* Card Footer */
.card-footer-bar {
  padding: 0.85rem 1.25rem;
  background: #f8fafc;
  border-top: 1px solid #edf2f7;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-counter {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 600;
}

/* Custom Navigation Arrow Buttons docked to the far visible edges */
.custom-swiper-nav {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #ffffff;
  color: #4e73df;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 48%;
  transform: translateY(-50%);
  z-index: 20;
  cursor: pointer;
  transition: all 0.25s ease;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.custom-swiper-nav:after {
  display: none;
}

.custom-swiper-nav:hover {
  background: #4e73df;
  color: #ffffff;
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 6px 18px rgba(78, 115, 223, 0.35);
}

.swiper-button-prev.custom-swiper-nav {
  left: 4px;
}

.swiper-button-next.custom-swiper-nav {
  right: 4px;
}

/* Swiper Pagination Bullets */
.swiper-pagination-bullet {
  width: 8px;
  height: 8px;
  background: #cbd5e1;
  opacity: 1;
  transition: all 0.25s ease;
}

.swiper-pagination-bullet-active {
  background: #4e73df !important;
  width: 22px;
  border-radius: 6px;
}

/* Responsive Breakpoints for Full-Width Layout */
@media (max-width: 768px) {
  .swiper-container-outer {
    padding: 0 6px;
  }

  .swiper-slide {
    width: 76vw; /* Comfortably fits screen with balanced side margins for peeking */
    max-width: 290px;
  }

  .card-media-wrapper {
    height: 140px;
  }

  .card-title {
    font-size: 1.05rem;
  }

  .card-text {
    font-size: 0.835rem;
  }

  .custom-swiper-nav {
    width: 36px;
    height: 36px;
  }

  .swiper-button-prev.custom-swiper-nav {
    left: 2px;
  }

  .swiper-button-next.custom-swiper-nav {
    right: 2px;
  }
}

@media (max-width: 480px) {
  .swiper-container-outer {
    padding: 0 4px;
  }

  .swiper-slide {
    width: 80vw;
    max-width: 260px;
  }

  .custom-swiper-nav {
    width: 32px;
    height: 32px;
  }

  .swiper-button-prev.custom-swiper-nav {
    left: 2px;
  }

  .swiper-button-next.custom-swiper-nav {
    right: 2px;
  }
}