* {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  outline: none;
}

html {
  scroll-behavior: smooth;
}

body {
  margin-left: 92px; /* Space for navbar on desktop */
  transition: margin-left 0.3s ease;
}

/* Override global header styles for timeline page */
.header {
  background: #ffffff !important;
  background-image: none !important;
  height: auto !important;
  min-height: auto !important;
  overflow: visible !important;
  padding: 3rem 0 !important;
  position: relative;
}

.header::before {
  display: none !important;
}

/* Add subtle gradient overlay for depth */
.header::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(79, 193, 233, 0.05) 0%, rgba(16, 42, 63, 0) 50%);
  pointer-events: none;
}

h1 {
  text-align: center;
  color: #163149;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 40px;
  position: relative;
  z-index: 1;
  display: inline-block;
  width: 100%;
}

h1::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 3px;
  background: linear-gradient(90deg, #6649b8, #00d4ff);
  border-radius: 2px;
}

h1 span {
  font-weight: 600;
  background: linear-gradient(135deg, #4fc1e9 0%, #5fb3db 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: none;
}

.container {
  width: 80%;
  padding: 50px 0;
  margin: 50px auto;
  position: relative;
  overflow: hidden;
}

/* Enhanced timeline center line with gradient */
.container:before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  margin-left: -2px;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, 
    rgba(79, 193, 233, 0.3) 0%,
    rgba(79, 193, 233, 0.8) 50%,
    rgba(79, 193, 233, 0.3) 100%);
  border-radius: 2px;
  z-index: 1;
  box-shadow: 0 0 20px rgba(79, 193, 233, 0.3);
}

.timeline-block {
  width: -webkit-calc(50% + 8px);
  width: -moz-calc(50% + 8px);
  width: calc(50% + 8px);
  display: -webkit-box;
  display: -webkit-flex;
  display: -moz-box;
  display: flex;
  -webkit-box-pack: justify;
  -webkit-justify-content: space-between;
  -moz-box-pack: justify;
  justify-content: space-between;
  clear: both;
  opacity: 0;
  animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger animation for timeline blocks */
.timeline-block:nth-child(1) { animation-delay: 0.1s; }
.timeline-block:nth-child(2) { animation-delay: 0.2s; }
.timeline-block:nth-child(3) { animation-delay: 0.3s; }
.timeline-block:nth-child(4) { animation-delay: 0.4s; }
.timeline-block:nth-child(5) { animation-delay: 0.5s; }

.timeline-block-right {
  float: right;
}

.timeline-block-left {
  float: left;
  direction: rtl;
}

/* Enhanced marker with pulse animation */
.marker {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 3px solid #f5f7fa;
  background: linear-gradient(135deg, #4fc1e9 0%, #3ba3c7 100%);
  margin-top: 10px;
  z-index: 9999;
  position: relative;
  box-shadow: 0 0 0 0 rgba(79, 193, 233, 0.7);
  animation: pulse 2s infinite;
  transition: all 0.3s ease;
  cursor: pointer;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(79, 193, 233, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(79, 193, 233, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(79, 193, 233, 0);
  }
}

.marker:hover {
  transform: scale(1.3);
  background: linear-gradient(135deg, #5fd3ff 0%, #4fc1e9 100%);
  box-shadow: 0 0 20px rgba(79, 193, 233, 0.8);
}

/* Enhanced timeline content cards */
.timeline-content {
  width: 95%;
  padding: 25px;
  color: #2c3e50;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  border: 1px solid rgba(79, 193, 233, 0.2);
  backdrop-filter: blur(10px);
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* Gradient overlay on hover */
.timeline-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(79, 193, 233, 0.1) 0%, rgba(79, 193, 233, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.timeline-content:hover::before {
  opacity: 1;
}

.timeline-content:hover {
  transform: translateY(-5px);
  border-color: rgba(79, 193, 233, 0.5);
  box-shadow: 0 10px 30px rgba(79, 193, 233, 0.2);
  background: rgba(255, 255, 255, 1);
}

/* Company/Institution logo */
.timeline-logo {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  margin-bottom: 15px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.9);
  padding: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.timeline-content:hover .timeline-logo {
  transform: scale(1.1) rotate(5deg);
}

/* Icon for academics */
.timeline-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4fc1e9 0%, #3ba3c7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
  font-size: 24px;
  color: white;
  box-shadow: 0 4px 12px rgba(79, 193, 233, 0.3);
  transition: all 0.3s ease;
}

.timeline-content:hover .timeline-icon {
  transform: scale(1.1) rotate(-5deg);
  box-shadow: 0 6px 20px rgba(79, 193, 233, 0.5);
}

.timeline-content h3 {
  margin-top: 5px;
  margin-bottom: 10px;
  font-size: 1.4rem;
  font-weight: 600;
  color: #2c3e50;
  letter-spacing: 0.5px;
}

.timeline-title {
  font-size: 1.1rem;
  color: #34495e;
  font-weight: 500;
  margin-bottom: 8px;
  display: block;
}

.timeline-company {
  font-size: 1rem;
  color: #5a6c7d;
  margin-bottom: 8px;
  display: block;
}

.timeline-location {
  font-size: 0.9rem;
  color: #7f8c8d;
  display: inline-flex;
  align-items: center;
  margin-bottom: 12px;
}

.timeline-location::before {
  content: '📍';
  margin-right: 5px;
}

.timeline-description {
  font-size: 0.95rem;
  line-height: 1.6em;
  color: #5a6c7d;
  margin: 12px 0;
  padding-top: 12px;
  border-top: 1px solid rgba(79, 193, 233, 0.15);
}

/* Technology tags */
.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.timeline-tag {
  background: rgba(79, 193, 233, 0.15);
  color: #4fc1e9;
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid rgba(79, 193, 233, 0.3);
  transition: all 0.3s ease;
}

.timeline-tag:hover {
  background: rgba(79, 193, 233, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(79, 193, 233, 0.3);
}

/* Achievements list */
.timeline-achievements {
  margin-top: 12px;
  padding-left: 0;
  list-style: none;
}

.timeline-achievements li {
  font-size: 0.9rem;
  color: #5a6c7d;
  margin-bottom: 6px;
  padding-left: 20px;
  position: relative;
}

.timeline-achievements li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #4fc1e9;
  font-weight: bold;
  font-size: 1rem;
}

@media screen and (max-width: 768px) {
  body {
    margin-left: 0;
    padding-bottom: 96px; /* Space for bottom navbar */
  }
  
  .navbar {
    z-index: +10000;
  }
  
  h1 {
    font-size: 1.8rem;
  }
  
  .container {
    width: 95%;
    padding: 30px 0;
  }
  
  .container:before {
    left: 20px;
    width: 3px;
  }
  
  .timeline-block {
    width: 100%;
    margin-bottom: 30px;
  }
  
  .timeline-block-right {
    float: none;
  }
  
  .timeline-block-left {
    float: none;
    direction: ltr;
  }
  
  .marker {
    margin-left: 13px;
  }
  
  .timeline-content {
    padding: 20px;
    margin-left: 40px;
  }
  
  .timeline-logo,
  .timeline-icon {
    width: 40px;
    height: 40px;
  }
  
  .timeline-tags {
    gap: 6px;
  }
  
  .timeline-tag {
    font-size: 0.75rem;
    padding: 3px 10px;
  }
}

/* Animation for header */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
