/** @format */

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1a1a;
  color: white;
  font-family: system-ui, sans-serif;
  overflow: hidden;
}

.logo-container {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 100;
}

.logo {
  height: 15rem;
  width: auto;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.logo:hover {
  opacity: 1;
}

.deck-container {
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.timeline-deck {
  position: relative;
  height: 80vh;
  display: flex;
  align-items: center;
  margin-left: 50px;
  perspective: 1000px;
  contain: layout style;
  content-visibility: auto;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 20px;
  gap: 20px;
  mask-image: linear-gradient(
    to right,
    transparent,
    black 100px,
    black calc(100% - 100px),
    transparent
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    black 100px,
    black calc(100% - 100px),
    transparent
  );
}

/* Smooth scrollbar styling */
.timeline-deck::-webkit-scrollbar {
  height: 8px;
}

.timeline-deck::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  margin: 0 100px;
}

.timeline-deck::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.timeline-deck::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}

.timeline-card {
  position: relative;
  width: 300px;
  min-width: 300px;
  height: 400px;
  border-radius: 4px;
  background: #2c3e50;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center center;
  backface-visibility: hidden;
  transform-style: preserve-3d;
  opacity: 0;
  animation: cardAppear 0.5s ease forwards;
}

/* Color variations for cards */
.timeline-card:nth-child(6n + 1) {
  background: #3498db; /* Blue */
}

.timeline-card:nth-child(6n + 2) {
  background: #e74c3c; /* Red */
}

.timeline-card:nth-child(6n + 3) {
  background: #2ecc71; /* Green */
}

.timeline-card:nth-child(6n + 4) {
  background: #f39c12; /* Orange */
}

.timeline-card:nth-child(6n + 5) {
  background: #9b59b6; /* Purple */
}

.timeline-card:nth-child(6n + 6) {
  background: #1abc9c; /* Turquoise */
}

.timeline-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

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

.card-content {
  height: 100%;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.2));
}

.card-date {
  font-weight: bold;
  font-size: 1.1em;
  color: rgba(255, 255, 255, 0.95);
}

.card-description {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.1);
  padding: 10px;
  border-radius: 2px;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  flex: 1;
  overflow-y: auto;
}

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

.card-description::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

.media-container {
  position: relative;
  width: 100%;
  height: 200px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 2px;
  overflow: hidden;
  transition: transform 0.3s ease;
}

.media-container:hover {
  transform: scale(1.02);
}

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

.media-fallback {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(44, 62, 80, 0.8); /* Dark blue overlay */
  color: white;
  font-size: 0.9em;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.media-error .media-fallback {
  opacity: 1;
}

.error-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(231, 76, 60, 0.95); /* Red with slight transparency */
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: errorAppear 0.3s ease;
}

@keyframes errorAppear {
  from {
    opacity: 0;
    transform: translate(-50%, -40%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.error-message button {
  margin-top: 10px;
  padding: 8px 16px;
  border: none;
  border-radius: 5px;
  background: #fff;
  color: #e74c3c;
  cursor: pointer;
  transition: all 0.3s ease;
}

.error-message button:hover {
  background: #f8f9fa;
  color: #c0392b;
  transform: scale(1.05);
}

.nav-button {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(52, 152, 219, 0.2); /* Light blue tint */
  border: none;
  color: white;
  font-size: 24px;
  width: 50px;
  height: 50px;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.nav-button:hover {
  background: rgba(52, 152, 219, 0.3);
  transform: translateY(-50%) scale(1.1);
}

.nav-button:active {
  transform: translateY(-50%) scale(0.95);
}

.nav-button.prev {
  left: 20px;
}

.nav-button.next {
  right: 20px;
}

/* Add keyboard shortcut hints */
.timeline-card::after {
  content: "Space to play/pause";
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.timeline-card:hover::after {
  opacity: 1;
}

/* Highlight current card */
.timeline-card.current {
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

/* Scrollbar styling */
.timeline-deck::-webkit-scrollbar-thumb {
  background: rgba(52, 152, 219, 0.3); /* Light blue */
}

.timeline-deck::-webkit-scrollbar-thumb:hover {
  background: rgba(52, 152, 219, 0.4);
}
