/* Stream UI Styles */
.stream-container {
  margin: 20px auto;
  padding: 20px 25px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  max-width: 800px;
  font-family: 'Roboto', sans-serif;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.stream-container.hidden {
  opacity: 0;
}

.stream-header {
  margin-bottom: 20px;
}

.stream-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  color: #2c3e50;
  padding-bottom: 12px;
  border-bottom: 1px solid #eaecef;
}

.stream-title span {
  font-size: 18px;
  color: #1a73e8;
}

.stream-toggle {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  font-size: 16px;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.stream-toggle:hover {
  background: #f5f7fa;
  color: #1a73e8;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(26,115,232,0.7);
  }
  50% {
    transform: scale(1.3);
    opacity: 0.7;
    box-shadow: 0 0 0 6px rgba(26,115,232,0);
  }
  100% {
    transform: scale(1);
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(26,115,232,0);
  }
}

.section-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 500px;
  overflow-y: auto;
  opacity: 1;
  transition: all 0.3s ease-out;
  visibility: visible;
  scrollbar-width: thin;
  scrollbar-color: #1a73e8 #f5f7fa;
  padding-bottom: 8px;
}

/* Webkit scrollbar styling */
.section-list::-webkit-scrollbar {
  width: 8px;
}

.section-list::-webkit-scrollbar-track {
  background: #f5f7fa;
  border-radius: 4px;
}

.section-list::-webkit-scrollbar-thumb {
  background: #1a73e8;
  border-radius: 4px;
}

.section-list::-webkit-scrollbar-thumb:hover {
  background: #1557b0;
}

.section-list.collapsed {
  max-height: 0;
  opacity: 0;
  margin: 0;
  padding: 0;
  visibility: hidden;
}

.section-item {
  margin: 15px 0;
  padding: 18px;
  background: #f8fafd;
  border-radius: 10px;
  border: 1px solid #eaecef;
  transition: all 0.2s ease;
}

.section-item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  border-color: #e1e4e8;
}

.section-header {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.section-name {
  font-weight: 600;
  color: #2c3e50;
  flex: 1;
  font-size: 15px;
}

.section-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e0e0e0;
  position: relative;
}

.status-indicator.pending {
  background: #ffd700;
}

.status-indicator.active {
  background: #1a73e8;
  animation: pulse 1.5s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

.status-indicator.complete {
  background: #34a853;
  position: relative;
}

.status-indicator.complete::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #34a853;
  animation: pulse 2s infinite;
  opacity: 0.3;
}

.status-text {
  font-size: 13px;
  color: #666;
  font-weight: 500;
}

.section-content {
  margin-top: 12px;
  font-size: 14px;
}

/* Search Queries Styling */
.search-queries {
  margin: 12px 0;
  padding: 12px 15px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e1e4e8;
}

.search-queries strong {
  color: #1a73e8;
  font-size: 13px;
  font-weight: 600;
  display: block;
  margin-bottom: 8px;
}

.search-query-list {
  list-style: none;
  padding: 0;
  margin: 5px 0;
}

.search-query-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  color: #444;
  font-size: 13px;
  line-height: 1.4;
}

.search-query-item::before {
  content: "";
  width: 16px;
  height: 16px;
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%231a73e8"><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>');
  background-size: contain;
  flex-shrink: 0;
}

/* Search Results Styling */
.search-results {
  margin: 12px 0;
}

.search-results strong {
  color: #1a73e8;
  font-size: 13px;
  font-weight: 600;
  display: block;
  margin-bottom: 12px;
}

.search-result-list {
  list-style: none;
  padding: 0;
  margin: 5px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.search-result-item {
  margin: 0;
  flex: 0 1 auto; 
}

.result-link {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid #e1e4e8;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
  overflow: visible;
  white-space: nowrap;
}

.result-link:hover {
  border-color: #1a73e8;
  box-shadow: 0 2px 8px rgba(26,115,232,0.1);
  z-index: 1;
}

.result-favicon {
  width: 16px;
  height: 16px;
  margin-right: 8px;
  border-radius: 3px;
  flex-shrink: 0;
}

.result-title {
  font-size: 13px;
  color: #1a73e8;
  margin-right: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-url {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  background: white;
  padding: 8px 12px;
  font-size: 12px;
  color: #1a73e8;
  border: 1px solid #1a73e8;
  border-radius: 6px;
  margin-top: 4px;
  box-shadow: 0 2px 8px rgba(26,115,232,0.1);
  max-width: 300px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 2;
}

/* Show full URL on hover over the truncated URL */
.result-url:hover {
  white-space: normal;
  word-break: break-all;
}

.result-link:hover .result-url {
  display: block;
}

/* Timeline styles */
.section-list.timeline {
  position: relative;
  padding-left: 30px;
  margin: 0;
}

.section-list.timeline::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 0;
  height: 100%; 
  width: 2px;
  background: #e1e4e8;
  z-index: 0;
}

.timeline {
  position: relative;
}

.timeline::before {
  display: none; 
}

/* Ensure proper spacing for items */
.timeline-item {
  position: relative;
  z-index: 1;
  margin: 12px 0;
}

.timeline-item:first-child {
  margin-top: 0;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -24px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #1a73e8;
  border: 2px solid white;
  box-shadow: 0 0 0 2px #1a73e8;
  z-index: 2;
}

.timeline-item.active::before {
  animation: pulse 2s infinite;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .stream-container {
    margin: 15px 10px;
    padding: 15px;
  }
  
  .stream-title span {
    font-size: 16px;
  }
  
  .section-list {
    max-height: 400px; 
  }
  
  .section-item {
    padding: 12px;
    margin: 10px 0;
  }
  
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .section-name {
    font-size: 14px;
    width: 100%;
    padding-right: 8px; 
  }

  .section-status {
    padding-left: 2px; 
  }

  .status-text {
    font-size: 12px;
  }
  
  .search-queries {
    padding: 10px;
  }
  
  .search-query-item {
    font-size: 12px;
  }
  
  .search-result-list {
    gap: 6px;
  }
  
  .result-link {
    padding: 6px 10px;
    width: 100%; 
  }
  
  .result-url {
    max-width: 250px;
  }
  
  .status-message {
    padding: 6px 12px !important;
    margin-bottom: 10px !important;
  }
}

/* Additional small screen adjustments */
@media (max-width: 480px) {
  .stream-container {
    margin: 10px 5px;
    padding: 12px;
  }
  
  .section-list {
    max-height: 350px;
  }
  
  .search-result-item {
    flex: 0 0 100%; 
  }
  
  .section-name {
    font-size: 13px;
  }
  
  .result-url {
    max-width: 200px;
  }
}

.status-message {
  background: transparent !important;
  border: none !important;
  padding: 8px 18px !important;
  margin-bottom: 15px !important;
  position: relative;
}

.status-message:not(:last-child)::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 18px;
  right: 18px;
  height: 1px;
  background: #eaecef;
  opacity: 0.5;
}

.status-message .section-header {
  flex-direction: row;
  align-items: center;
}

.status-message .section-status {
  margin-left: 0;
}

.status-message.complete {
  opacity: 0.7;
} 