/**
 * =====================================================
 * 2026 VIVEN 레벨디자인 해커톤
 * Timeline 슬라이드 스타일
 * =====================================================
 * 세로 타임라인 (왼쪽 선 + 원형 마커)
 * 현재 시간 하이라이트
 */

/*
  사용 예시 HTML:
  <section class="slide slide--timeline">
    <div class="slide__content">
      <header class="slide__header">
        <h2 class="slide__title">오늘의 일정</h2>
      </header>
      <div class="timeline">
        <div class="timeline__item timeline__item--past">
          <span class="timeline__time">09:00</span>
          <span class="timeline__icon">📋</span>
          <span class="timeline__label">등록</span>
        </div>
        <div class="timeline__item timeline__item--active">
          <span class="timeline__time">10:30</span>
          <span class="timeline__icon">💻</span>
          <span class="timeline__label">개발 시작</span>
        </div>
        <div class="timeline__item">
          <span class="timeline__time">12:00</span>
          <span class="timeline__icon">🍽️</span>
          <span class="timeline__label">점심</span>
        </div>
      </div>
    </div>
  </section>
*/

/* =====================================================
 * 타임라인 슬라이드 레이아웃
 * ===================================================== */

.slide--timeline .slide__content {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

/* =====================================================
 * 타임라인 컨테이너
 * ===================================================== */

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: var(--space-3xl);
  flex: 1;
}

/* 세로 선 */
.timeline::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    var(--bg-card) 5%,
    var(--bg-card) 95%,
    transparent 100%
  );
  border-radius: 2px;
}

/* =====================================================
 * 타임라인 아이템
 * ===================================================== */

.timeline__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-md) 0;
  transition: var(--transition-normal);
}

/* 원형 마커 */
.timeline__item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-3xl) + 10px);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 3px solid var(--accent-primary);
  z-index: 1;
  transition: var(--transition-normal);
}

/* =====================================================
 * 타임라인 요소
 * ===================================================== */

.timeline__time {
  font-size: var(--fs-heading);
  font-weight: var(--fw-bold);
  color: var(--accent-primary);
  min-width: 100px;
  font-variant-numeric: tabular-nums;
}

.timeline__icon {
  font-size: 28px;
  width: 40px;
  text-align: center;
  flex-shrink: 0;
}

.timeline__label {
  font-size: var(--fs-body);
  color: var(--text-secondary);
  flex: 1;
}

.timeline__description {
  font-size: var(--fs-caption);
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

/* =====================================================
 * 상태별 스타일
 * ===================================================== */

/* 지난 항목 */
.timeline__item--past {
  opacity: 0.5;
}

.timeline__item--past::before {
  background: var(--bg-card);
  border-color: var(--text-muted);
}

.timeline__item--past .timeline__time {
  color: var(--text-muted);
}

/* 현재 항목 (활성) */
.timeline__item--active {
  padding: var(--space-lg) var(--space-md);
  margin-left: calc(-1 * var(--space-md));
  background: rgba(106, 171, 191, 0.1);
  border-radius: var(--radius-lg);
}

.timeline__item--active::before {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  box-shadow: var(--glow-cyan);
  animation: activePulse 2s ease-in-out infinite;
}

@keyframes activePulse {
  0%, 100% {
    box-shadow: var(--glow-cyan);
  }
  50% {
    box-shadow: 0 0 25px rgba(106, 171, 191, 0.6);
  }
}

.timeline__item--active .timeline__time {
  color: var(--accent-primary);
  text-shadow: 0 0 20px rgba(106, 171, 191, 0.3);
}

.timeline__item--active .timeline__label {
  color: var(--text-primary);
  font-weight: var(--fw-medium);
}

/* 다음 항목 강조 */
.timeline__item--next::before {
  border-color: var(--accent-secondary);
  border-style: dashed;
}

/* =====================================================
 * 타임라인 타입별
 * ===================================================== */

/* 휴식 시간 */
.timeline__item--break .timeline__icon {
  animation: bounceIcon 1s ease-in-out infinite;
}

@keyframes bounceIcon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* 마감 */
.timeline__item--deadline::before {
  border-color: var(--color-danger);
  background: var(--color-danger);
}

.timeline__item--deadline .timeline__time {
  color: var(--color-danger);
}

/* =====================================================
 * 컴팩트 타임라인
 * ===================================================== */

.timeline--compact {
  gap: 0;
}

.timeline--compact .timeline__item {
  padding: var(--space-xs) 0;
}

.timeline--compact .timeline__time {
  font-size: var(--fs-body);
  min-width: 70px;
}

.timeline--compact .timeline__icon {
  font-size: 20px;
  width: 28px;
}

.timeline--compact .timeline__label {
  font-size: var(--fs-caption);
}

.timeline--compact .timeline__item::before {
  width: 14px;
  height: 14px;
  left: calc(-1 * var(--space-3xl) + 13px);
}

.timeline--compact::before {
  left: 18px;
}

/* =====================================================
 * 2열 그리드 타임라인 (많은 아이템용)
 * ===================================================== */

.timeline--grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md) var(--space-3xl);
  padding-left: 0;
}

.timeline--grid::before {
  display: none;
}

.timeline--grid .timeline__item {
  padding: var(--space-sm) var(--space-md);
  padding-left: var(--space-2xl);
  gap: var(--space-md);
}

.timeline--grid .timeline__item::before {
  left: 8px;
  width: 14px;
  height: 14px;
}

.timeline--grid .timeline__time {
  font-size: var(--fs-body);
  min-width: 60px;
}

.timeline--grid .timeline__icon {
  font-size: 22px;
  width: 32px;
}

.timeline--grid .timeline__label {
  font-size: var(--fs-caption);
}

/* 2열 그리드 활성 아이템 */
.timeline--grid .timeline__item--active {
  padding: var(--space-sm) var(--space-md);
  padding-left: var(--space-2xl);
  margin-left: 0;
  background: rgba(106, 171, 191, 0.12);
  border: 1px solid rgba(106, 171, 191, 0.3);
}

.timeline--grid .timeline__item--active::before {
  left: 8px;
}

/* =====================================================
 * 가로 타임라인 (선택)
 * ===================================================== */

.timeline--horizontal {
  flex-direction: row;
  padding-left: 0;
  padding-top: var(--space-3xl);
  overflow-x: auto;
  gap: var(--space-xl);
}

.timeline--horizontal::before {
  left: 0;
  right: 0;
  top: 18px;
  bottom: auto;
  width: auto;
  height: 3px;
  background: linear-gradient(
    to right,
    transparent 0%,
    var(--bg-card) 5%,
    var(--bg-card) 95%,
    transparent 100%
  );
}

.timeline--horizontal .timeline__item {
  flex-direction: column;
  text-align: center;
  min-width: 120px;
}

.timeline--horizontal .timeline__item::before {
  left: 50%;
  top: calc(-1 * var(--space-3xl) + 8px);
  transform: translateX(-50%);
}

/* =====================================================
 * 애니메이션
 * ===================================================== */

.timeline__item {
  animation: timelineItemReveal 0.4s ease-out both;
}

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

@keyframes timelineItemReveal {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* =====================================================
 * 테이블형 타임라인 (시간표 스타일)
 * =====================================================
 * 발표용으로 크고 직관적인 레이아웃
 */

.timeline--table {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  max-width: 900px;
  margin: 0 auto;
}

/* 세로선 제거 */
.timeline--table::before {
  display: none;
}

/* 테이블 아이템 */
.timeline--table .timeline__item {
  display: grid;
  grid-template-columns: 100px 1fr;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  animation: none;
}

.timeline--table .timeline__item:last-child {
  border-bottom: none;
}

/* 원형 마커 제거 */
.timeline--table .timeline__item::before {
  display: none;
}

/* 시간 - 크고 굵게 */
.timeline--table .timeline__time {
  font-size: var(--fs-heading);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  min-width: auto;
  text-align: right;
}

/* 이벤트 내용 */
.timeline--table .timeline__content {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.timeline--table .timeline__icon {
  font-size: 24px;
  width: 32px;
  flex-shrink: 0;
}

.timeline--table .timeline__label {
  font-size: var(--fs-body);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
}

/* 활성 상태 - 미니멀하게 */
.timeline--table .timeline__item--active {
  background: rgba(106, 171, 191, 0.08);
}

.timeline--table .timeline__item--active .timeline__time {
  color: var(--accent-primary);
}

.timeline--table .timeline__item--active .timeline__label {
  color: var(--text-primary);
}

/* 지난 항목 */
.timeline--table .timeline__item--past {
  opacity: 0.5;
}

/* 마감/중요 항목 */
.timeline--table .timeline__item--deadline .timeline__time {
  color: var(--color-danger);
}

/* 휴식 시간 */
.timeline--table .timeline__item--break {
  background: rgba(132, 204, 22, 0.05);
}

.timeline--table .timeline__item--break .timeline__time {
  color: var(--color-success);
}

/* =====================================================
 * 테이블형 - 2열 레이아웃 (발표용, 10개 항목)
 * ===================================================== */

.timeline--table-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md) var(--space-3xl);
  padding: 0;
  max-width: 1400px;
  margin: 0 auto;
}

.timeline--table-2col::before {
  display: none;
}

.timeline--table-2col .timeline__item {
  display: grid;
  grid-template-columns: 90px 1fr;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.timeline--table-2col .timeline__item:nth-child(5),
.timeline--table-2col .timeline__item:nth-child(10) {
  border-bottom: none;
}

.timeline--table-2col .timeline__item::before {
  display: none;
}

.timeline--table-2col .timeline__time {
  font-size: var(--fs-heading);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  text-align: right;
}

.timeline--table-2col .timeline__content {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.timeline--table-2col .timeline__icon {
  font-size: 24px;
  width: 32px;
  flex-shrink: 0;
}

.timeline--table-2col .timeline__label {
  font-size: var(--fs-body);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
}

/* 2열 상태 스타일 - 통일된 모서리 */
.timeline--table-2col .timeline__item--active {
  background: rgba(106, 171, 191, 0.08);
}

.timeline--table-2col .timeline__item--active .timeline__time {
  color: var(--accent-primary);
}

.timeline--table-2col .timeline__item--active .timeline__label {
  color: var(--text-primary);
}

.timeline--table-2col .timeline__item--past {
  opacity: 0.5;
}

.timeline--table-2col .timeline__item--break {
  background: rgba(132, 204, 22, 0.05);
}

.timeline--table-2col .timeline__item--break .timeline__time {
  color: var(--color-success);
}

.timeline--table-2col .timeline__item--deadline .timeline__time {
  color: var(--color-danger);
}
