/* Activity Blocks & Spotify Styling */

.activity-list {
  display: flex; flex-direction: column;
  max-height: 220px; overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.14) transparent;
}
.activity-list::-webkit-scrollbar { width: 3px; }
.activity-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 2px; }
.activity-list::-webkit-scrollbar-track { background: transparent; }

.activity-block {
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
  border: 1px solid rgba(255,255,255,0.07);
  transition: all 0.28s ease;
  position: relative; overflow: hidden;
}
.activity-block::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg,transparent,rgba(255,255,255,0.09) 30%,rgba(255,255,255,0.09) 70%,transparent);
  opacity: 0.5;
}
.activity-block:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.14);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.22);
}

.activity-title {
  font-size: 0.67rem; font-weight: 700;
  color: rgba(255,255,255,0.42);
  text-transform: uppercase; letter-spacing: 0.07em;
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 5px;
}
.activity-pause-icon { font-size: 0.8em; margin-left: 6px; opacity: 0.8; color: #ff6b6b; }

.activity-content { display: flex; align-items: flex-start; gap: 10px; }
.activity-details { flex: 1; min-width: 0; }

.activity-detail {
  font-size: 0.80rem; color: rgba(255,255,255,0.70);
  margin-bottom: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.activity-state {
  font-size: 0.74rem; color: rgba(255,255,255,0.58);
  margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.paused-state { display: flex; align-items: center; gap: 6px; color: #ff6b6b; font-weight: 500; margin-top: 4px; }

.activity-image-container {
  flex-shrink: 0; width: 48px; height: 48px;
  border-radius: 6px; overflow: hidden;
  background: rgba(0,0,0,0.2);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  transition: all 0.28s ease;
}
.activity-image { width: 100%; height: 100%; object-fit: cover; display: block; }

.activity-img-fallback {
  width: 100%; height: 100%;
  background: rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 700; color: rgba(255,255,255,0.28);
  border-radius: 6px;
}

.progress-container { margin-top: 8px; width: 100%; }
.progress-time {
  display: flex; justify-content: space-between;
  font-size: 0.67rem; color: rgba(255,255,255,0.65);
  margin-bottom: 4px;
}
.progress-bar {
  width: 100%; height: 3px;
  background: rgba(255,255,255,0.09);
  border-radius: 2px; overflow: hidden;
}
.activity-block:not(.spotify-activity) .progress {
  background: var(--activity-accent, #8fbcbb);
  box-shadow: 0 0 8px var(--activity-accent, rgba(143,188,187,0.5));
}
.activity-block.spotify-activity .progress { background: #1db954; box-shadow: 0 0 8px rgba(29,185,84,0.5); }
.progress { height: 100%; width: 0%; transition: width 0.1s linear; border-radius: 2px; }

.spotify-container {
  display: flex; gap: 12px; margin-top: 8px; padding: 10px;
  background: rgba(0,0,0,0.28);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.07);
  position: relative; overflow: hidden;
  transition: all 0.38s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.22);
}
.spotify-container::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg,
    var(--spotify-gradient-start, rgba(255,255,255,0.04)) 0%,
    transparent 50%,
    var(--spotify-gradient-end, rgba(0,0,0,0.02)) 100%);
  pointer-events: none; opacity: 0;
  transition: opacity 0.38s ease;
}
.spotify-container.color-extracted::before { opacity: 1; }
.spotify-container:hover {
  background: var(--spotify-bg-hover, rgba(0,0,0,0.38));
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--spotify-shadow-hover, rgba(0,0,0,0.4));
  border-color: var(--spotify-border, rgba(255,255,255,0.14));
}

.album-art-container { position: relative; flex-shrink: 0; }
.album-art {
  width: 50px; height: 50px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  display: block; transition: all 0.28s ease;
}
.album-art:hover { transform: scale(1.06); }

.album-art-placeholder {
  display: flex; align-items: center; justify-content: center;
  background: rgba(29,185,84,0.12);
  color: #1db954;
  font-size: 1.4rem;
}

.spotify-info {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; justify-content: center;
  position: relative; z-index: 2;
}
.spotify-details .activity-detail { font-size: 0.87rem; font-weight: 600; color: #fff; margin-bottom: 3px; letter-spacing: -0.01em; }
.spotify-details .activity-state  { font-size: 0.74rem; color: #b3b3b3; margin-bottom: 2px; font-weight: 400; }

.loading {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 16px 0;
  color: rgba(255,255,255,0.38); font-size: 0.76rem;
}
.loading-spinner {
  width: 13px; height: 13px;
  border: 1.5px solid rgba(255,255,255,0.10);
  border-top-color: rgba(255,255,255,0.48);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.no-activity {
  text-align: center;
  padding: 18px 0;
  color: rgba(255,255,255,0.28);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  font-style: italic;
}

.refresh-btn {
  background: rgba(255,255,255,0.09);
  color: white;
  border: 1px solid rgba(255,255,255,0.18);
  padding: 8px 16px;
  border-radius: 24px;
  margin-top: 10px;
  font-size: 0.78rem;
  cursor: pointer;
  touch-action: manipulation;
  min-height: 40px;
  transition: background 0.22s ease, transform 0.22s ease;
  font-family: inherit; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: rgba(255,255,255,0.1);
}
.refresh-btn:hover, .refresh-btn:active {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.28);
  transform: translateY(-2px);
}

.error-message {
  text-align: center;
  padding: 16px 0;
  color: #ff6b6b;
  font-size: 0.82rem;
  line-height: 1.5;
}

@media (prefers-reduced-motion: reduce) {
  .activity-block, .spotify-container {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
