/* Buffer Debug Panel Styles - Following Design System */

.debug-toggle-button {
  padding: 8px 12px;
  border-radius: 6px;
  border: 2px solid #E12424;
  background: #E12424;
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 700;
  font-family: 'Bio Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.5px;
}

.debug-toggle-button:hover {
  background: #FFFFFF;
  color: #E12424;
  transform: scale(1.05);
}

.debug-toggle-button.loading {
  background: #F59E0B;
  border-color: #F59E0B;
  animation: pulse 1.5s infinite;
}

.debug-panel {
  position: absolute;
  top: 40px;
  right: 0;
  width: 320px;
  max-height: 400px;
  background: #FFFFFF;
  border: 2px solid #E12424;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  overflow: hidden;
  font-family: 'Bio Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  display: flex;
  flex-direction: column;
}

.debug-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #E12424;
  border-bottom: 1px solid #E12424;
}

.debug-loading-indicator {
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 600;
  animation: pulse 1.5s infinite;
}

.debug-panel-header h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  font-family: 'Bio Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #FFFFFF;
  letter-spacing: 0.5px;
}

.debug-close-button {
  background: none;
  border: none;
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  border-radius: 4px;
}

.debug-close-button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.debug-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

/* Tabs */
.debug-tabs {
  display: flex;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
}

.debug-tab {
  flex: 1;
  padding: 8px 6px;
  background: none;
  border: none;
  color: #64748B;
  font-size: 10px;
  font-weight: 700;
  font-family: 'Bio Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
  letter-spacing: 0.5px;
}

.debug-tab:hover {
  color: #E12424;
  background: rgba(225, 36, 36, 0.05);
}

.debug-tab.active {
  color: #E12424;
  background: #FFFFFF;
  border-bottom-color: #E12424;
}

.debug-section {
  padding: 12px;
}

/* Summary View */
.debug-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.debug-summary-card {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.debug-summary-number {
  font-size: 18px;
  font-weight: 700;
  font-family: 'Bio Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #E12424;
  margin-bottom: 4px;
}

.debug-summary-label {
  font-size: 9px;
  color: #64748B;
  font-weight: 600;
  font-family: 'Bio Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.debug-time-range {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}

.debug-time-range h4 {
  margin: 0 0 6px 0;
  font-size: 11px;
  color: #E12424;
  font-weight: 700;
  font-family: 'Bio Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.debug-time-range p {
  margin: 0;
  font-size: 10px;
  color: #374151;
  font-family: 'Bio Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.4;
}

.debug-unique-people h4 {
  margin: 0 0 8px 0;
  font-size: 11px;
  color: #E12424;
  font-weight: 700;
  font-family: 'Bio Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.debug-unique-people-title {
  margin: 20px 0 8px 0 !important;
  font-size: 11px;
  color: #E12424;
  font-weight: 700;
  font-family: 'Bio Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.debug-people-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.debug-person-tag {
  background: #E12424;
  border: 1px solid #E12424;
  color: #FFFFFF;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 8px;
  font-weight: 600;
  font-family: 'Bio Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  word-break: break-all;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.debug-person-tag.more {
  background: #64748B;
  border-color: #64748B;
  color: #FFFFFF;
}

/* Current Time View */
.debug-current-time h4 {
  margin: 0 0 12px 0;
  font-size: 12px;
  color: #E12424;
  font-weight: 700;
  font-family: 'Bio Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

.debug-current-summary {
  background: #FEF3C7;
  border: 1px solid #F59E0B;
  border-radius: 6px;
  padding: 8px;
  margin-bottom: 12px;
  text-align: center;
  color: #92400E;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Bio Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

.debug-people-grid {
  display: grid;
  gap: 8px;
}

.debug-person-card {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  padding: 8px;
  border-left: 3px solid #E12424;
}

.debug-person-id {
  font-size: 10px;
  font-weight: 700;
  color: #E12424;
  margin-bottom: 6px;
  font-family: 'Bio Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

.debug-person-info {
  display: grid;
  gap: 2px;
}

.debug-person-info div {
  font-size: 9px;
  color: #64748B;
  font-family: 'Bio Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

.debug-person-info strong {
  color: #374151;
}

/* Timeline View */
.debug-timeline-controls {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  align-items: center;
}

.debug-search-input {
  flex: 1;
  padding: 6px 8px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 4px;
  color: #374151;
  font-size: 10px;
  font-family: 'Bio Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

.debug-search-input:focus {
  outline: none;
  border-color: #E12424;
}

.debug-search-btn {
  padding: 6px 8px;
  background: #E12424;
  border: none;
  border-radius: 4px;
  color: #FFFFFF;
  font-size: 9px;
  font-weight: 600;
  font-family: 'Bio Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.3px;
}

.debug-search-btn:hover {
  background: #B91C1C;
}

.debug-timeline-header {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: 4px;
  padding: 6px 8px;
  margin-bottom: 8px;
  font-size: 9px;
  color: #B91C1C;
  font-weight: 600;
  font-family: 'Bio Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

.debug-timeline-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.debug-timeline-item {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 4px;
  padding: 8px;
  transition: all 0.2s ease;
}

.debug-timeline-item.current {
  border-color: #E12424;
  background: #FEF2F2;
}

.debug-timeline-time {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.debug-timeline-time strong {
  font-family: 'Bio Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 10px;
  color: #374151;
}

.debug-timeline-count {
  font-size: 8px;
  color: #64748B;
  background: #E2E8F0;
  padding: 2px 4px;
  border-radius: 2px;
  font-family: 'Bio Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

.debug-timeline-people {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.debug-timeline-person {
  background: #E12424;
  border: 1px solid #E12424;
  color: #FFFFFF;
  padding: 2px 4px;
  border-radius: 2px;
  font-size: 8px;
  font-weight: 600;
  font-family: 'Bio Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  display: flex;
  align-items: center;
  gap: 2px;
}

.debug-person-coords {
  color: #FECACA;
  font-size: 7px;
}

.debug-no-data {
  text-align: center;
  padding: 20px 12px;
  color: #64748B;
}

.debug-no-data p {
  margin: 4px 0;
  font-family: 'Bio Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 10px;
}

.debug-no-data-subtitle {
  margin: 4px 0;
  font-family: 'Bio Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 9px;
  color: #9CA3AF;
}

/* Scrollbar styling */
.debug-panel-content::-webkit-scrollbar,
.debug-timeline-list::-webkit-scrollbar {
  width: 4px;
}

.debug-panel-content::-webkit-scrollbar-track,
.debug-timeline-list::-webkit-scrollbar-track {
  background: #F1F5F9;
}

.debug-panel-content::-webkit-scrollbar-thumb,
.debug-timeline-list::-webkit-scrollbar-thumb {
  background: #E12424;
  border-radius: 2px;
}

.debug-panel-content::-webkit-scrollbar-thumb:hover,
.debug-timeline-list::-webkit-scrollbar-thumb:hover {
  background: #B91C1C;
}

/* Responsive */
@media (max-width: 768px) {
  .debug-panel {
    width: 280px;
    max-height: 300px;
  }
  
  .debug-summary-grid {
    grid-template-columns: 1fr;
  }
  
  .debug-timeline-list {
    max-height: 150px;
  }
  
  .debug-toggle-button {
    padding: 6px 10px;
    font-size: 9px;
  }
  
  .debug-panel-header h3 {
    font-size: 11px;
  }
  
  .debug-tab {
    font-size: 9px;
    padding: 6px 4px;
  }
  
  .debug-section {
    padding: 10px;
  }
}

@media (max-width: 480px) {
  .debug-panel {
    width: calc(100vw - 20px);
    max-width: 280px;
    max-height: 250px;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
  }
  
  .debug-toggle-button {
    padding: 4px 8px;
    font-size: 8px;
  }
  
  .debug-panel-header h3 {
    font-size: 10px;
  }
  
  .debug-tab {
    font-size: 8px;
    padding: 4px 2px;
  }
  
  .debug-section {
    padding: 8px;
  }
  
  .debug-summary-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  
  .debug-summary-card {
    padding: 8px;
  }
  
  .debug-summary-number {
    font-size: 16px;
  }
  
  .debug-summary-label {
    font-size: 8px;
  }
  
  .debug-timeline-list {
    max-height: 120px;
  }
  
  .debug-person-card {
    padding: 6px;
  }
  
  .debug-person-id {
    font-size: 9px;
  }
  
  .debug-person-info div {
    font-size: 8px;
  }
}