/* STT 학습분석 시스템 커스텀 스타일 */
body { 
  font-family: 'Inter', sans-serif; 
}

/* 타임라인 스타일 */
.timeline-bar { 
  height: 60px; 
  border-radius: 8px; 
  overflow: hidden; 
  position: relative; 
}

.timeline-segment { 
  height: 100%; 
  display: inline-block; 
  cursor: pointer; 
  transition: all 0.3s; 
  position: relative;
  overflow: hidden;
}

.timeline-segment:hover { 
  transform: scaleY(1.1); 
  box-shadow: 0 4px 12px rgba(0,0,0,0.3); 
  z-index: 10;
}

/* 타임라인 라벨 텍스트 스타일 */
.timeline-segment span {
  font-size: 10px;
  font-weight: bold;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
  white-space: nowrap;
  overflow: hidden;
}

.timeline-segment:hover span {
  font-size: 11px;
}

/* 시간 미터 스타일 */
.timeline-scale {
  height: 20px;
  position: relative;
  border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(to right, #f9fafb 0%, #f3f4f6 100%);
}

.timeline-scale-mark {
  position: absolute;
  top: 0;
  width: 1px;
  height: 12px;
  background-color: #6b7280;
}

.timeline-scale-mark.major {
  height: 16px;
  background-color: #374151;
  width: 2px;
}

.timeline-scale-label {
  position: absolute;
  top: -2px;
  font-size: 10px;
  color: #6b7280;
  font-weight: 500;
  transform: translateX(-50%);
  white-space: nowrap;
}

/* 호버 툴팁 스타일 */
.timeline-tooltip {
  position: absolute;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  pointer-events: none;
  z-index: 1000;
  opacity: 0;
  transform: translateX(-50%) translateY(-100%);
  transition: opacity 0.2s ease;
  max-width: 250px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.timeline-tooltip.show {
  opacity: 1;
}

.timeline-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.9);
}

/* 키워드 칩 스타일 */
.keyword-chip { 
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  margin: 2px;
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
}

.keyword-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* 툴팁 스타일 */
.tooltip {
  position: absolute;
  background: rgba(0,0,0,0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  pointer-events: none;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s;
}

/* 업로드 존 애니메이션 */
#dropZone.dragover {
  border-color: #4F46E5;
  background-color: #EEF2FF;
  transform: scale(1.02);
}

/* 로딩 애니메이션 개선 */
.loading-spinner {
  border: 3px solid #f3f4f6;
  border-radius: 50%;
  border-top: 3px solid #4F46E5;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 카드 호버 효과 */
.card-hover {
  transition: all 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* 통계 프로그레스 바 */
.progress-bar {
  height: 8px;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 4px;
  transition: width 0.8s ease-in-out;
}

/* 반응형 차트 컨테이너 */
.chart-container {
  position: relative;
  height: 350px;
  width: 100%;
  max-height: 400px;
}

/* 가로막대 차트 특별 스타일 */
#distributionChart {
  max-height: 350px !important;
}

/* 메시지 컨테이너 */
.message-slide-in {
  animation: slideInFromTop 0.3s ease-out;
}

@keyframes slideInFromTop {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 키워드 타임라인 카드 */
.keyword-timeline-card {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-left: 4px solid #667eea;
  transition: all 0.3s ease;
}

.keyword-timeline-card:hover {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  border-left-color: #4F46E5;
}

/* 반응형 디자인 개선 */
@media (max-width: 768px) {
  .timeline-bar {
    height: 40px;
  }
  
  .keyword-chip {
    font-size: 0.75rem;
    padding: 2px 8px;
  }
  
  #legend {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* 접근성 개선 */
button:focus,
input:focus {
  outline: 2px solid #4F46E5;
  outline-offset: 2px;
}

/* 스크롤바 스타일링 */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}