/* ==================================================
   Root Variables & Global Styles
================================================== */
:root {
  --primary-color: #0a3c0e;
  --secondary-color: #134a1a;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --bg-blur: rgba(255, 255, 255, 0.989);
  --transition-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --navigation-width: 260px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ==================================================
   Order ID Badge (Top Right of the Card)
================================================== */
.my-timeline-order-id-top {
  position: absolute;
  top: 10px;
  right: 10px;
  color: var(--primary-color);
  padding: 4px 8px;
  border: 1px solid var(--primary-color);
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: normal;
  z-index: 10;
}

/* ==================================================
   Base Timeline Container & Date Header
================================================== */
.my-timeline-container {
  width: 100%;
  margin: 0 auto;
  padding: 2rem calc(var(--navigation-width) + 3rem) 2rem 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 2rem;
  position: relative;
}

.my-timeline-date-header {
  grid-column: 1 / -1;
  padding: 1rem 2rem;
  margin: 1rem 0;
  background: linear-gradient(95deg, #f8fafc 0%, #f1f5f9 100%);
  border-left: 4px solid var(--primary-color);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.my-timeline-date-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 200%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 25%,
    rgba(255, 255, 255, 0.2) 50%,
    transparent 75%
  );
  animation: shine 2.5s infinite;
}

@keyframes shine {
  100% {
    left: 100%;
  }
}

/* ==================================================
   Highlight Animation for Specific Reviews
================================================== */
.highlight-review {
  animation: blink 1s infinite;
  border: 4px solid #FF0000;
  background-color: rgba(255, 0, 0, 0.1);
}

@keyframes blink {
  0% { background-color: rgba(255, 0, 0, 0.1); }
  50% { background-color: rgba(255, 0, 0, 0.3); }
  100% { background-color: rgba(255, 0, 0, 0.1); }
}

/* ==================================================
   Timeline Items
================================================== */
.my-timeline-item {
  position: relative;
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  transition: all 0.3s var(--transition-ease);
  display: flex;
  flex-direction: column;
  min-height: 360px;
  border: 1px solid rgba(241, 245, 249, 0.6);
  overflow: hidden;
  cursor: pointer;
}

.my-timeline-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.my-timeline-item::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  border: 2px solid transparent;
  background: linear-gradient(145deg,
    rgba(59, 130, 246, 0.1) 0%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(59, 130, 246, 0.1) 100%
  ) border-box;
  mask:
    linear-gradient(#fff 0 0) padding-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  transition: all 0.4s var(--transition-ease);
}

/* ==================================================
   Content Elements (Date, Image, Title, Text)
================================================== */
.my-timeline-date {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.my-timeline-image {
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.25rem;
  flex-shrink: 0;
  position: relative;
}

.my-timeline-image.loading {
  position: relative;
  background-color: #f1f5f9;
}

.my-timeline-image.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  z-index: 2;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.my-timeline-image.loading img {
  opacity: 0;
}

.my-timeline-image img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.4s var(--transition-ease), opacity 0.4s ease;
}

.my-timeline-image:hover img {
  transform: scale(1.05);
}

.my-timeline-image.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f1f5f9;
  height: 200px;
  border-radius: 12px;
  margin-bottom: 1.25rem;
}

.my-timeline-image.placeholder .placeholder-text {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.my-timeline-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  line-height: 1.4;
  position: relative;
  display: inline-block;
}

.my-timeline-title::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--primary-color);
  transition: width 0.3s var(--transition-ease);
}

.my-timeline-item:hover .my-timeline-title::after {
  width: 80px;
}

.my-timeline-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==================================================
   Tags Slider (with Advanced Left/Right Arrows)
================================================== */
.tags-slider {
  position: relative;
  overflow: hidden;
  margin-bottom: 1rem;
}
.tags-container {
  white-space: nowrap;
  transition: transform 0.3s ease;
}
.timeline-tag {
  display: inline-block;
  background-color: var(--secondary-color);
  color: #fff;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  margin-right: 4px;
}
.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #e0e0e0;
  color: var(--primary-color);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: background 0.3s ease, transform 0.3s ease;
}
.slider-arrow:hover {
  background: var(--primary-color);
  color: #fff;
  transform: scale(1.1);
}
.slider-arrow.left {
  left: 4px;
}
.slider-arrow.right {
  right: 4px;
}

/* ==================================================
   Social Share Buttons on Card (Circular with Font Awesome)
================================================== */
.my-timeline-share a,
.popup-share a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
  color: var(--primary-color);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  text-decoration: none;
  font-size: 1.2rem;
  transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
}
.my-timeline-share a:hover,
.popup-share a:hover {
  background: var(--primary-color);
  color: #fff;
  transform: scale(1.1);
}

/* ==================================================
   Navigation Sidebar / Bar
================================================== */
.my-timeline-navigation {
  position: fixed;
  top: 70%;
  right: 2rem;
  transform: translateY(-50%);
  background: var(--bg-blur);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  width: var(--navigation-width);
  max-height: 60vh;
  overflow-y: auto;
  border: 1px solid rgba(241, 245, 249, 0.3);
}

.my-timeline-years-months {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.my-timeline-month-link {
  font-size: 0.95rem;
  color: var(--primary-color);
  padding: 0.5rem 1rem;
  border-radius: 10px;
  transition: all 0.25s var(--transition-ease);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  background: rgba(241, 245, 249, 0.4);
}

.my-timeline-month-link:hover {
  background: rgba(59, 130, 246, 0.1);
  transform: translateX(6px);
}

.my-timeline-month-link::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 0;
  background: var(--primary-color);
  border-radius: 2px;
  transition: height 0.3s var(--transition-ease);
}

.my-timeline-month-link:hover::before {
  height: 60%;
}

/* ==================================================
   Popup Modal Styles
================================================== */
.my-timeline-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: rgba(211, 211, 211, 0.955);
  border-radius: 24px;
  padding: 2rem;
  width: 90%;
  max-width: 880px;
  max-height: 90vh;
  overflow: auto;
  display: none;
  z-index: 9999;
  animation: popupIn 0.4s var(--transition-ease) forwards;
}

@keyframes popupIn {
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

.popup-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.my-timeline-popup img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.popup-title {
  font-size: 1.8rem;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.popup-description {
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre-wrap;
}

.popup-order-id {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(241, 245, 249, 0.6);
  color: var(--text-primary);
}

.popup-order-id strong {
  font-weight: bold;
}

.popup-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: 0;
  font-size: 3rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.popup-close:hover {
  color: var(--primary-color);
}

/* ==================================================
   Responsive Design
================================================== */
@media (min-width: 1600px) {
  .my-timeline-container {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .popup-content {
    grid-template-columns: 40% 60%;
  }
}

@media (max-width: 1200px) {
  .my-timeline-container {
    padding-right: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  }
  
  .my-timeline-navigation {
    bottom: 1.5rem;
    top: auto;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-height: 64px;
    overflow-x: auto;
    padding: 0.75rem;
  }
  
  .my-timeline-years-months {
    flex-direction: row;
    gap: 0.5rem;
  }
}

@media (max-width: 768px) {
  .my-timeline-container {
    padding: 1.5rem;
    gap: 1.5rem;
  }
  
  .my-timeline-item {
    min-height: auto;
  }
  
  .my-timeline-image img {
    height: 160px;
  }
  
  .popup-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .my-timeline-popup {
    padding: 1rem;
  }
  
  .popup-title {
    font-size: 1.5rem;
  }
}

/* ==================================================
   Scrollbar Styling
================================================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(241, 245, 249, 0.4);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

/* ==================================================
   Load More Button
================================================== */
.load-more-container {
  text-align: center;
  margin: 2rem 0;
}

.beautiful-load-more {
  background: linear-gradient(135deg, #f6d365, #fda085);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border-radius: 25px;
  cursor: pointer;
  transition: transform 0.3s var(--transition-ease);
}

.beautiful-load-more:hover {
  transform: translateY(-4px);
}

/* ==================================================
   Toast Notification
================================================== */
.toast-notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #0a3c0e;
  color: #fff;
  padding: 12px 20px;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-size: 0.9rem;
  z-index: 99999;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast-notification.show {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Enhanced Search Form Styles ===== */
.my-timeline-search {
    margin-bottom: 1rem;
    text-align: left;
    padding-left: 1rem;
}

.search-input-wrapper {
    position: relative;
    width: 100%;  /* full width */
    margin: 0;
}

.search-input-wrapper input {
    width: 100%;
    padding: 0.6rem 2.5rem 0.6rem 3rem;  /* increased left padding */
    border: 1px solid #ccc;
    border-radius: 25px;
    font-size: 1rem;
    transition: box-shadow 0.3s ease;
}

.search-input-wrapper input:focus {
    outline: none;
    box-shadow: 0 0 5px rgba(10, 60, 14, 0.5);
}

.search-input-wrapper .search-icon {
    position: absolute;
    top: 50%;
    right: 2.5rem;  /* moved to the right side */
    transform: translateY(-50%);
    color: #888;
    font-size: 1.2rem;
}

.search-input-wrapper .clear-search {
    position: absolute;
    top: 50%;
    right: 0.8rem;
    transform: translateY(-50%);
    color: #888;
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.search-input-wrapper .clear-search:hover {
    color: var(--primary-color);
}


/* ==========================================================================
   Multi-image reviews
   A review can carry several screenshots. The card shows the first with a
   count badge; the popup shows a selectable strip underneath the main image.
   ========================================================================== */

.my-timeline-image-count {
  position: absolute;
  right: 0.6rem;
  bottom: 0.6rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.68);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  pointer-events: none;
}

.popup-media {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.popup-gallery {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.popup-gallery-thumb {
  width: 68px;
  height: 68px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.6;
  border: 2px solid transparent;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

.popup-gallery-thumb:hover,
.popup-gallery-thumb.is-active {
  opacity: 1;
  border-color: var(--primary-color);
}

.my-timeline-rating {
  color: #f5a623;
  letter-spacing: 0.1em;
  font-size: 1rem;
  margin: 0.25rem 0 0.5rem;
}
