/**
 * Timeline Sidebar - Slides in from right when clicking right edge
 */

/* Right-side trigger area */
.timeline-trigger {
  position: fixed;
  top: 0;
  right: 0;
  width: 80px;
  height: 100vh;
  z-index: 998;
  cursor: pointer;
  transition: background-color 0.3s ease;
  pointer-events: auto;
}

.timeline-trigger:hover {
  background: linear-gradient(to left, rgba(255, 20, 147, 0.1), transparent);
}

/* Timeline sidebar overlay */
.timeline-sidebar-overlay {
  position: fixed;
  top: 0;
  right: -100%;
  width: 60vw;
  max-width: 1000px;
  height: 100vh;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(40px) saturate(180%) brightness(105%);
  -webkit-backdrop-filter: blur(40px) saturate(180%) brightness(105%);
  box-shadow: -4px 0 32px rgba(0, 0, 0, 0.15), 
              inset 1px 0 0 rgba(255, 255, 255, 0.8);
  border-left: 1px solid rgba(255, 255, 255, 0.3);
  z-index: 999;
  overflow-y: auto;
  overflow-x: hidden;
  transition: right 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  -webkit-overflow-scrolling: touch;
}

.timeline-sidebar-overlay.active {
  right: 0;
}

/* Close button */
.timeline-close-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.1);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 24px;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.timeline-close-btn:hover {
  background: rgba(255, 20, 147, 0.2);
  transform: scale(1.1);
  color: #ff1493;
}

/* Backdrop */
.timeline-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease, background 0.5s ease, backdrop-filter 0.5s ease;
}

.timeline-backdrop.active {
  opacity: 1;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: auto;
}

/* Content wrapper inside sidebar */
.timeline-sidebar-content {
  padding: 40px;
  min-height: 100vh;
}

/* Loading state */
.timeline-sidebar-overlay.loading .timeline-sidebar-content {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.timeline-loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 20, 147, 0.2);
  border-top-color: #ff1493;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Dark mode for bodyindex (creative view) */
body.bodyindex .timeline-sidebar-overlay {
  background: rgba(26, 26, 26, 0.55);
  backdrop-filter: blur(40px) saturate(150%) brightness(85%);
  -webkit-backdrop-filter: blur(40px) saturate(150%) brightness(85%);
  box-shadow: -4px 0 32px rgba(0, 0, 0, 0.5), 
              inset 1px 0 0 rgba(255, 255, 255, 0.1);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

body.bodyindex .timeline-close-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

body.bodyindex .timeline-close-btn:hover {
  background: rgba(255, 20, 147, 0.3);
}

/* Responsive */
@media screen and (max-width: 1200px) {
  .timeline-sidebar-overlay {
    width: 65vw;
  }
}

@media screen and (max-width: 767px) {
  .timeline-sidebar-overlay {
    width: 75vw;
  }
  
  .timeline-sidebar-content {
    padding: 20px;
  }
  
  .timeline-trigger {
    width: 60px;
  }
}

@media screen and (max-width: 480px) {
  .timeline-sidebar-overlay {
    width: 90vw;
  }
}

/* Hide trigger when sidebar is open */
.timeline-sidebar-overlay.active ~ .timeline-trigger {
  pointer-events: none;
  opacity: 0;
}

/* Smooth scrollbar */
.timeline-sidebar-overlay::-webkit-scrollbar {
  width: 8px;
}

.timeline-sidebar-overlay::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}

.timeline-sidebar-overlay::-webkit-scrollbar-thumb {
  background: rgba(255, 20, 147, 0.3);
  border-radius: 4px;
}

.timeline-sidebar-overlay::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 20, 147, 0.5);
}

body.bodyindex .timeline-sidebar-overlay::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

body.bodyindex .timeline-sidebar-overlay::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}

body.bodyindex .timeline-sidebar-overlay::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}

