/**
* Nutrition Expo 16 - Timeline Styles
* Modern responsive timeline design
*/

:root {
  --white: #ffffff;
  --black: #2D2A4A;
  --blue: #6C63FF;
  --gray: #e0e0e0;
  --grey: #F7F7FC;
  --box-shadow1: 0px 0px 20px 2px rgba(108, 99, 255, 0.15);
}

body {
  font-family: "Viga", "Open Sans", sans-serif;
  font-weight: 400;
  color: #2D2A4A;
  -moz-user-select: none;
  -webkit-user-select: none;
  user-select: none;
}

:focus {
  outline: 0px solid transparent !important;
}

.timeline {
  padding: 50px 0;
  position: relative;
}

.timeline-nodes {
  padding-bottom: 25px;
  position: relative;
}

.timeline-nodes:nth-child(even) {
  flex-direction: row-reverse;
}

.timeline h3,
.timeline p {
  padding: 8px 20px;
  font-size: 16px;
}

.timeline h3 {
  font-weight: 600;
  background: var(--black);
  color: var(--white) !important;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.timeline h3:hover {
  transform: scale(1.02);
}

.timeline p,
.timeline time {
  color: var(--black);
  line-height: 1.8;
}

.timeline::after {
  content: "";
  display: block;
  position: absolute;
  top: 0;
  left: 50%;
  width: 0;
  border-left: 3px dashed var(--blue);
  height: 100%;
  z-index: 1;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #6C63FF 0%, #00D9A5 100%);
}

.timeline-content {
  border: 1px solid rgba(108, 99, 255, 0.2);
  position: relative;
  border-radius: 0 0 16px 16px;
  box-shadow: var(--box-shadow1);
  background: var(--white);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.timeline-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #6C63FF, #00D9A5);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.timeline-content:hover::before {
  transform: scaleX(1);
}

.timeline-content:hover {
  transform: translateY(-5px);
  box-shadow: 0px 10px 30px 5px rgba(108, 99, 255, 0.2);
}

.timeline-nodes:nth-child(odd) h3,
.timeline-nodes:nth-child(odd) p {
  text-align: right;
}

.timeline-nodes:nth-child(odd) .timeline-date {
  text-align: left;
}

.timeline-nodes:nth-child(even) .timeline-date {
  text-align: right;
}

.timeline-nodes:nth-child(odd) .timeline-content::after {
  content: "";
  position: absolute;
  top: 10%;
  left: 100%;
  width: 0;
  border-left: 12px solid var(--grey);
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  transition: all 0.3s ease;
}

.timeline-nodes:nth-child(even) .timeline-content::after {
  content: "";
  position: absolute;
  top: 10%;
  right: 100%;
  width: 0;
  border-right: 12px solid var(--grey);
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  transition: all 0.3s ease;
}

.timeline-image {
  position: relative;
  z-index: 100;
}

.timeline-image::before {
  content: "";
  width: 70px;
  height: 70px;
  border: 3px dashed var(--blue);
  border-radius: 50%;
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #fff;
  z-index: 1;
  animation: rotate 20s linear infinite;
}

@keyframes rotate {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.timeline-image img {
  position: relative;
  z-index: 100;
  width: 45px;
  transition: transform 0.3s ease;
}

.timeline-image:hover img {
  transform: scale(1.1);
}

/* Small device style */
@media (max-width: 767px) {
  .timeline-nodes:nth-child(odd) h3,
  .timeline-nodes:nth-child(odd) p {
    text-align: left;
  }

  .timeline-nodes:nth-child(even) {
    flex-direction: row;
  }

  /* Hide all decorative lines in responsive mode */
  .timeline::before {
    display: none !important;
  }

  .timeline::after {
    display: none !important;
  }

  .timeline-image::before {
    display: none !important;
  }

  .timeline-content::after {
    display: none !important;
  }

  /* Hide calendar logo in responsive mode */
  .timeline-image {
    display: none !important;
  }

  /* Center content boxes in responsive mode */
  .timeline-content {
    margin: 0 auto 20px auto;
    text-align: center;
    max-width: 90%;
  }

  .timeline-content h3,
  .timeline-content p {
    text-align: center;
  }

  .timeline h3 {
    font-size: 15px;
    text-align: center !important;
  }

  .timeline p {
    font-size: 14px;
    text-align: center !important;
  }

  .timeline-nodes:nth-child(even) .timeline-date {
    text-align: left;
  }
}

/* Extra small device style */
@media (max-width: 575px) {
  /* Hide all decorative lines in responsive mode */
  .timeline::before {
    display: none !important;
  }

  .timeline::after {
    display: none !important;
  }

  .timeline-image::before {
    display: none !important;
  }

  .timeline-content::after {
    display: none !important;
  }

  /* Hide calendar logo in responsive mode */
  .timeline-image {
    display: none !important;
  }

  /* Center content boxes in responsive mode */
  .timeline-content {
    margin: 0 auto 20px auto;
    text-align: center;
    max-width: 95%;
  }

  .timeline-content h3,
  .timeline-content p {
    text-align: center;
  }

  .timeline h3,
  .timeline p {
    font-size: 14px;
    padding: 6px 15px;
  }
}
