/* Paintings Timeline - Treatment 3 (Dynamic Quiet) Design System */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Work Sans', -apple-system, sans-serif;
  background: #2a2a28;
  color: #f8f8f6;
  overflow: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  padding: 1.5rem 2rem;
  background: #f8f8f6;
  color: #2a2a28;
  border-bottom: 1px solid #e8e8e4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.header h1 {
  font-size: 1.5rem;
  font-weight: 400;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.02em;
}

.back-btn {
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid #e8e8e4;
  color: #7a7a76;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.back-btn:hover {
  background: rgba(45, 212, 191, 0.08);
  border-color: #14b8a6;
  color: #2a2a28;
}

/* Main Content */
.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Featured Painting View */
.featured-view {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.featured-painting {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 3px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
}

.featured-painting:hover {
  transform: scale(1.01);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Visual affordance - expand icon on hover */
.featured-view::after {
  content: '';
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 32px;
  height: 32px;
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: all;
  cursor: pointer;
  z-index: 10;
  
  /* Draw expand/fullscreen icon with borders */
  border: 2px solid #14b8a6;
  border-radius: 2px;
  box-shadow: 
    0 2px 8px rgba(20, 184, 166, 0.3),
    inset 0 0 0 6px #2a2a28;
  
  /* Corner arrows */
  background: 
    linear-gradient(135deg, #14b8a6 0%, #14b8a6 2px, transparent 2px),
    linear-gradient(-135deg, #14b8a6 0%, #14b8a6 2px, transparent 2px),
    linear-gradient(-45deg, #14b8a6 0%, #14b8a6 2px, transparent 2px),
    linear-gradient(45deg, #14b8a6 0%, #14b8a6 2px, transparent 2px);
  background-size: 8px 8px;
  background-position: 
    top 4px left 4px,
    top 4px right 4px,
    bottom 4px right 4px,
    bottom 4px left 4px;
  background-repeat: no-repeat;
}

.featured-view:hover::after {
  opacity: 1;
  transform: scale(1);
}

/* Loading State */
.loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'IBM Plex Mono', monospace;
  color: #7a7a76;
  font-size: 1.1rem;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* Painting Info Card */
.painting-info {
  position: absolute;
  bottom: 3rem;
  left: 3rem;
  max-width: 500px;
  background: rgba(248, 248, 246, 0.95);
  backdrop-filter: blur(30px);
  color: #2a2a28;
  padding: 1.5rem 2rem;
  border-radius: 3px;
  border: 1px solid rgba(42, 42, 40, 0.1);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.painting-info.visible {
  opacity: 1;
  transform: translateY(0);
}

.painting-info .title {
  font-size: 1.3rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
  color: #2a2a28;
}

.painting-info .meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  color: #0d9488;
  margin-bottom: 1rem;
}

.painting-info .separator {
  color: #7a7a76;
  margin: 0 0.5rem;
}

.detail-btn {
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid #2a2a28;
  color: #2a2a28;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.detail-btn:hover {
  background: #2a2a28;
  color: #f8f8f6;
}

.detail-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: rgba(20, 184, 166, 0.15);
  border: 1px solid rgba(20, 184, 166, 0.3);
  border-radius: 2px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  color: #14b8a6;
  margin-top: 0.5rem;
}

/* Timeline Container */
.timeline-container {
  background: #1a1a18;
  padding: 1.2rem 2rem 1.5rem 2rem;
  border-top: 1px solid #3a3a38;
  flex-shrink: 0;
  position: relative;
}

/* Series Filter */
.series-filter {
  position: absolute;
  top: 1.2rem;
  left: 2rem;
  z-index: 10;
}

.series-filter-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(248, 248, 246, 0.08);
  border: 1px solid rgba(248, 248, 246, 0.2);
  border-radius: 2px;
  color: #7a7a76;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.series-filter-btn:hover {
  background: rgba(248, 248, 246, 0.12);
  border-color: rgba(20, 184, 166, 0.3);
  color: #14b8a6;
}

.series-filter-btn.active {
  background: rgba(20, 184, 166, 0.15);
  border-color: #14b8a6;
  color: #14b8a6;
}

.filter-icon {
  font-size: 1rem;
  line-height: 1;
}

.filter-text {
  font-size: 0.75rem;
}

#activeSeriesName {
  color: #14b8a6;
  font-weight: 500;
}

.series-filter-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  min-width: 200px;
  background: rgba(26, 26, 24, 0.98);
  border: 1px solid rgba(248, 248, 246, 0.2);
  border-radius: 2px;
  padding: 0.5rem;
  display: none;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  backdrop-filter: blur(10px);
}

.series-filter-menu.visible {
  display: flex;
}

.series-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.75rem;
  background: transparent;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.series-option:hover {
  background: rgba(248, 248, 246, 0.08);
}

.series-option.active {
  background: rgba(20, 184, 166, 0.15);
}

.series-name {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  color: #b8b8b6;
}

.series-option.active .series-name {
  color: #14b8a6;
  font-weight: 500;
}

.series-count {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: #5a5a58;
}

.series-option.active .series-count {
  color: #0d9488;
}

.instructions {
  text-align: center;
  color: #7a7a76;
  font-size: 0.8rem;
  margin-bottom: 0.8rem;
  font-family: 'IBM Plex Mono', monospace;
}

/* Timeline Track */
.timeline-track {
  position: relative;
  height: 50px;
  margin-bottom: 0.6rem;
  cursor: pointer;
}

.timeline-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: #3a3a38;
  transform: translateY(-50%);
}

.timeline-density {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  transform: translateY(-50%);
  display: flex;
  gap: 1px;
}

.density-bar {
  flex: 1;
  background: #3a3a38;
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  position: relative;
  height: 2px;
  margin-top: -1px;
  transform-origin: bottom;
}

.density-bar.has-work {
  background: linear-gradient(180deg, #2dd4bf 0%, #0d9488 100%);
  box-shadow: 0 0 12px rgba(45, 212, 191, 0.25);
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 30px rgba(94, 234, 212, 0.5); }
  50% { box-shadow: 0 0 40px rgba(94, 234, 212, 0.7); }
}

@keyframes bar-grow {
  0% {
    transform: scaleY(0);
    opacity: 0;
  }
  100% {
    transform: scaleY(1);
    opacity: 1;
  }
}

.density-bar.animating {
  animation: bar-grow 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.density-bar.active {
  background: linear-gradient(180deg, #5eead4 0%, #14b8a6 50%, #0d9488 100%);
  transform: scaleY(1.2);
  box-shadow: 0 0 30px rgba(94, 234, 212, 0.6);
  z-index: 5;
  animation: pulse-glow 3s ease-in-out infinite;
}

.density-bar:hover.has-work {
  background: linear-gradient(180deg, #5eead4 0%, #2dd4bf 100%);
  transform: scaleY(1.15);
  box-shadow: 0 0 18px rgba(94, 234, 212, 0.4);
}

/* Density bar tooltip */
.density-bar::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: rgba(26, 26, 24, 0.95);
  color: #f8f8f6;
  padding: 0.5rem 0.75rem;
  border-radius: 3px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(45, 212, 191, 0.3);
}

.density-bar:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-12px);
}

/* Timeline Cursor */
.timeline-cursor {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 40px;
  background: #6a6af8;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-cursor.visible {
  opacity: 1;
}

/* Year Markers */
.timeline-years {
  display: flex;
  justify-content: space-between;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: #7a7a76;
  margin-bottom: 0.8rem;
}

.year-marker {
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0.25rem 0.5rem;
  border-radius: 2px;
}

.year-marker:hover {
  color: #f8f8f6;
  background: rgba(45, 212, 191, 0.08);
}

.year-marker.active {
  color: #14b8a6;
  font-weight: 500;
}

/* Current Year Display */
.current-year-display {
  text-align: center;
  margin-bottom: 0.8rem;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.5rem;
}

.year-large {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.5rem;
  font-weight: 400;
  color: #14b8a6;
  letter-spacing: 0.05em;
  text-shadow: 0 0 10px rgba(20, 184, 166, 0.2);
}

.current-year-display .separator {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.2rem;
  color: #4a4a48;
  font-weight: 300;
}

.count {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.9rem;
  color: #7a7a76;
  font-weight: 300;
}

/* Thumbnail Strip Container */
.thumbnail-strip-container {
  position: relative;
}

/* Thumbnail Strip */
.thumbnail-strip {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.6rem 0;
  scrollbar-width: thin;
  scrollbar-color: #4a4a48 transparent;
  min-height: 100px;
  
  /* Pure native scrolling - like Photos app */
  -webkit-overflow-scrolling: touch;
  scroll-behavior: auto;
  overscroll-behavior-x: contain;
}

.thumbnail-strip::-webkit-scrollbar {
  height: 6px;
}

.thumbnail-strip::-webkit-scrollbar-track {
  background: transparent;
}

.thumbnail-strip::-webkit-scrollbar-thumb {
  background: #4a4a48;
  border-radius: 3px;
}

.thumbnail-strip::-webkit-scrollbar-thumb:hover {
  background: #14b8a6;
}

.loading-thumbnails {
  width: 100%;
  text-align: center;
  color: #7a7a76;
  font-family: 'IBM Plex Mono', monospace;
  padding: 2rem;
  font-size: 0.9rem;
}

.thumbnail {
  flex-shrink: 0;
  width: 90px;
  height: 90px;
  background: #2a2a28;
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
}

.thumbnail:hover {
  transform: scale(1.05) translateY(-4px);
  border-color: #14b8a6;
  box-shadow: 0 8px 24px rgba(20, 184, 166, 0.3);
}

.thumbnail.active {
  border-color: #2dd4bf;
  box-shadow: 0 8px 24px rgba(45, 212, 191, 0.5);
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumbnail-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #2a2a28;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: #7a7a76;
  font-family: 'IBM Plex Mono', monospace;
}

.thumbnail-placeholder {
  background: #3a3a38;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.5rem;
  color: #5a5a58;
  font-size: 0.75rem;
  font-family: 'IBM Plex Mono', monospace;
}

/* Thumbnail Navigation Arrows */
.thumbnail-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: rgba(26, 26, 24, 0.9);
  border: 1px solid rgba(248, 248, 246, 0.3);
  border-radius: 50%;
  color: #f8f8f6;
  font-size: 2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1;
  padding: 0;
}

.thumbnail-nav-left {
  left: -20px;
}

.thumbnail-nav-right {
  right: -20px;
}

.thumbnail-nav:hover {
  background: #14b8a6;
  border-color: #14b8a6;
  transform: translateY(-50%) scale(1.1);
}

.thumbnail-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.thumbnail-nav:disabled:hover {
  background: rgba(26, 26, 24, 0.9);
  transform: translateY(-50%);
}

/* Detail Modal */
.detail-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: none;
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.detail-modal.visible {
  display: block;
  opacity: 1;
}

.detail-modal.loading .modal-main img {
  opacity: 0.3;
}

.detail-modal.loading::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px solid rgba(20, 184, 166, 0.2);
  border-top-color: #14b8a6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  z-index: 1001;
}

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

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 1400px;
  max-height: 90vh;
  background: #1a1a18;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(0,0,0,0.8);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  background: rgba(248, 248, 246, 0.1);
  border: 1px solid rgba(248, 248, 246, 0.2);
  border-radius: 50%;
  color: #f8f8f6;
  font-size: 2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
  line-height: 1;
  padding: 0;
}

.modal-close:hover {
  background: #14b8a6;
  border-color: #14b8a6;
  transform: rotate(90deg);
}

.modal-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  padding: 2rem;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-main img {
  width: 100%;
  height: auto;
  border-radius: 3px;
  margin-bottom: 1.5rem;
}

.modal-info h2 {
  font-size: 1.8rem;
  font-weight: 400;
  color: #f8f8f6;
  margin-bottom: 0.5rem;
}

.modal-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.9rem;
  color: #14b8a6;
  margin-bottom: 1rem;
}

.modal-info p {
  color: #b8b8b6;
  line-height: 1.6;
  font-size: 0.95rem;
}

.modal-gallery {
  overflow-y: auto;
}

.gallery-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  color: #7a7a76;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.gallery-item {
  margin-bottom: 1rem;
  cursor: pointer;
  border-radius: 3px;
  overflow: hidden;
  border: 2px solid transparent;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover {
  border-color: #14b8a6;
}

.gallery-item img {
  width: 100%;
  display: block;
}

.gallery-item video {
  width: 100%;
  display: block;
}

/* Process Viewer */
.process-viewer {
  margin-bottom: 2rem;
  padding: 1rem;
  background: rgba(248, 248, 246, 0.03);
  border-radius: 3px;
  border: 1px solid rgba(248, 248, 246, 0.1);
}

.process-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.process-stage {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: rgba(248, 248, 246, 0.05);
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
}

.process-stage-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(248, 248, 246, 0.1);
}

.process-stage:hover .process-stage-thumb {
  border-color: rgba(20, 184, 166, 0.3);
}

.process-stage.active .process-stage-thumb {
  border-color: #14b8a6;
  box-shadow: 0 0 8px rgba(20, 184, 166, 0.4);
}

.process-stage:hover {
  background: rgba(248, 248, 246, 0.08);
  border-color: rgba(20, 184, 166, 0.2);
}

.process-stage.active {
  background: rgba(20, 184, 166, 0.12);
  border-color: #14b8a6;
}

.process-stage-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4a4a48;
  flex-shrink: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.process-stage.active .process-stage-indicator {
  background: #14b8a6;
  box-shadow: 0 0 8px rgba(20, 184, 166, 0.6);
}

.process-stage-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  color: #b8b8b6;
}

.process-stage.active .process-stage-label {
  color: #14b8a6;
  font-weight: 500;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .header {
    padding: 1rem;
  }
  
  .header h1 {
    font-size: 1.1rem;
  }
  
  .featured-view {
    padding: 1rem;
  }
  
  /* Show expand icon on mobile without hover */
  .featured-view::after {
    opacity: 0.8;
  }
  
  .painting-info {
    bottom: 1.5rem;
    left: 1rem;
    right: 1rem;
    max-width: none;
    padding: 1rem;
  }
  
  .painting-info .title {
    font-size: 1.1rem;
  }
  
  .timeline-container {
    padding: 1rem 1rem 1.2rem 1rem;
  }
  
  .timeline-years {
    font-size: 0.65rem;
  }
  
  .year-large {
    font-size: 1.2rem;
  }
  
  .current-year-display .separator {
    font-size: 1rem;
  }
  
  .count {
    font-size: 0.8rem;
  }
  
  .thumbnail {
    width: 70px;
    height: 70px;
  }
  
  .thumbnail-nav {
    width: 32px;
    height: 32px;
    font-size: 1.5rem;
  }
  
  .instructions {
    font-size: 0.75rem;
  }
  
  .modal-grid {
    grid-template-columns: 1fr;
    padding: 1rem;
  }
  
  .modal-close {
    width: 36px;
    height: 36px;
    font-size: 1.5rem;
  }
}