/* === SCROLLOWANY TIMELINE === */

.timeline-section {
  max-width: 1000px;
  padding-top: 620px;
  height: auto;
  margin-top: 3rem;
  margin-bottom: 3rem;
  padding: 20px;
  text-align: center;
  overflow: visible !important;
  position: relative;
  z-index: 10;
}

.timeline-title {
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent-color);
}

.timeline-scroll-wrapper {
  overflow-x: auto;
  overflow-y: visible;
  position: relative;
  padding: 50px 0 30px;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  z-index: 10;
}

.timeline-scroll {
  display: flex;
  gap: 60px;
  padding: 30px 20px;
  position: relative;
  min-width: max-content;
}

.timeline-scroll::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: var(--accent-color);
  opacity: 0.2;
  transform: translateY(-50%);
  z-index: 0;
}

.timeline-item {
  position: relative;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 120px;
  z-index: 1;
  cursor: pointer; /* pomocne na mobilkach */
}

.timeline-dot {
  width: 20px;
  height: 20px;
  background-color: var(--accent-color);
  border-radius: 50%;
  margin: 10px 0;
  position: relative;
  z-index: 2;
  transition: transform 0.3s ease;
}

.timeline-dot:hover {
  transform: scale(1.15);
}

.timeline-date {
  margin-top: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-color);
}

/* === Tooltip === */
.tooltip-bubble {
  position: absolute;
  bottom: 100%;
  background-color: var(--nav-bg);
  color: var(--text-color);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.95rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.95);
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 9999;
}

.tooltip-bubble.visible,
.timeline-item:hover .tooltip-bubble {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-5px) scale(1);
}

.tooltip-bubble small {
  display: block;
  font-size: 0.8rem;
  opacity: 0.75;
  margin-top: 4px;
}

/* Ogonek */
.tooltip-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: var(--nav-bg) transparent transparent transparent;
}

/* Ciemny tryb */
body.dark .tooltip-bubble {
  background-color: #1e1e1e;
  color: #f1f1f1;
}

body.dark .tooltip-bubble::after {
  border-color: #1e1e1e transparent transparent transparent;
}

/* Scrollbar */
.timeline-scroll-wrapper::-webkit-scrollbar {
  height: 6px;
}

.timeline-scroll-wrapper::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border-radius: 3px;
}

.timeline-scroll-wrapper::-webkit-scrollbar-track {
  background: transparent;
}

/* RWD */
@media (max-width: 768px) {
  .timeline-scroll {
    gap: 40px;
    padding: 30px 10px;
  }

  .timeline-item {
    width: 100px;
  }

  .tooltip-bubble {
    font-size: 0.85rem;
    padding: 8px 12px;
  }

  .tooltip-bubble small {
    font-size: 0.75rem;
  }

  .timeline-title {
    font-size: 1.8rem;
  }
}

html, body {
  min-height: 100%;
  overflow-y: visible !important;
}


/* Pokaż tooltip NAD kropką */
.tooltip-top {
  bottom: 100%;
  top: auto;
  transform: translateY(-5px) scale(1);
}

.tooltip-top::after {
  top: 100%;
  bottom: auto;
  transform: translateX(-50%);
}

/* Pokaż tooltip POD kropką */
.tooltip-bottom {
  top: 100%;
  bottom: auto;
  transform: translateY(5px) scale(1);
}

.tooltip-bottom::after {
  top: -6px;
  bottom: auto;
  transform: rotate(180deg) translateX(-50%);
}
