/* ==========================================================================
   EXPERIENCE SECTION STYLES (experience.css)
   Timeline Layout with Horizontal Scroll for Badges
   ========================================================================== */

#experience {
  position: relative;
  overflow: hidden;
  overflow-x: clip;
}

.timeline {
  position: relative;
  padding-left: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
  transform: translateX(-50%);
}

.timeline-item {
  display: grid;
  grid-template-columns: 1fr 60px 1fr;
  gap: 0;
  margin-bottom: 48px;
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.timeline-content {
  padding: 24px 28px;
  border-radius: var(--radius-lg);
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  transition: all var(--transition-base);
  position: relative;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.timeline-content:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-color);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

.timeline-item:nth-child(odd) .timeline-content {
  grid-column: 1;
  text-align: right;
}

.timeline-item:nth-child(odd) .timeline-dot {
  grid-column: 2;
}

.timeline-item:nth-child(odd) .timeline-empty {
  grid-column: 3;
}

.timeline-item:nth-child(even) .timeline-empty {
  grid-column: 1;
}

.timeline-item:nth-child(even) .timeline-dot {
  grid-column: 2;
}

.timeline-item:nth-child(even) .timeline-content {
  grid-column: 3;
}

.timeline-dot {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 28px;
}

.timeline-dot-inner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gradient-primary);
  box-shadow: 0 0 0 4px var(--bg-primary), 0 0 0 6px var(--accent-primary);
  flex-shrink: 0;
}

.timeline-empty {
  display: block;
}

.exp-company {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.timeline-item:nth-child(odd) .exp-company {
  justify-content: flex-end;
}

.exp-logo {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.exp-company-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-primary);
}

.exp-role {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.exp-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.timeline-item:nth-child(odd) .exp-meta {
  justify-content: flex-end;
}

.exp-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.exp-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.7;
  word-break: break-word;
}

/* ── Tags / Badges (Utamakan ke samping, baru ke bawah jika kurang lebar) ─ */
.exp-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-top: 14px;
  max-height: 86px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(108, 99, 255, 0.35) rgba(255, 255, 255, 0.04);
  -webkit-overflow-scrolling: touch;
  width: 100%;
  box-sizing: border-box;
}

.exp-tags::-webkit-scrollbar {
  width: 4px;
}

.exp-tags::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 2px;
}

.exp-tags::-webkit-scrollbar-thumb {
  background: rgba(108, 99, 255, 0.35);
  border-radius: 2px;
}

.exp-tags::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

.exp-tags .badge {
  font-size: 0.74rem;
  font-weight: 500;
  padding: 3px 12px;
  border-radius: var(--radius-full, 9999px);
  background: rgba(108, 99, 255, 0.08);
  border: 1px solid rgba(108, 99, 255, 0.22);
  color: var(--text-secondary, #cbd5e1);
  white-space: nowrap;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  height: 24px;
  box-sizing: border-box;
  letter-spacing: 0.015em;
  transition: all var(--transition-fast, 0.2s ease);
}

.exp-tags .badge:hover {
  background: rgba(108, 99, 255, 0.18);
  border-color: var(--accent-primary);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(108, 99, 255, 0.25);
}

.timeline-item:nth-child(odd) .exp-tags {
  justify-content: flex-end;
}

/* ── Responsive Queries ───────────────────────────────────── */
@media (max-width: 768px) {
  .timeline::before {
    left: 20px;
  }
  .timeline-item {
    grid-template-columns: 40px 1fr;
    grid-template-rows: auto;
    margin-bottom: 36px;
  }
  .timeline-item:nth-child(odd) .timeline-content,
  .timeline-item:nth-child(even) .timeline-content {
    grid-column: 2;
    text-align: left;
    padding: 20px 18px;
  }
  .timeline-item:nth-child(odd) .timeline-dot,
  .timeline-item:nth-child(even) .timeline-dot {
    grid-column: 1;
    grid-row: 1;
  }
  .timeline-empty {
    display: none;
  }
  .timeline-item:nth-child(odd) .exp-company,
  .timeline-item:nth-child(odd) .exp-meta {
    justify-content: flex-start;
  }

  /* Mobile: flow ke samping dulu, wrap ke bawah jika kurang lebar */
  .exp-tags {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
    max-height: 76px !important;
    gap: 6px 8px !important;
    padding-bottom: 2px !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    width: 100% !important;
    max-width: 100% !important;
  }
  .exp-tags .badge {
    flex-shrink: 0;
    padding: 3px 10px;
    font-size: 0.72rem;
  }
}
