/* thinking-timer.css - ThinkingTimer 組件專用樣式 */

/* CSS 變數定義 */
.thinking-timer-container {
  --thinking-bg: rgba(94, 99, 155, 0.05);
  --thinking-border: rgba(94, 99, 155, 0.15);
  --thinking-text: #1F2937;
  --thinking-subtitle: #6B7280;
  --thinking-time: #5E639B;
  
  /* Log Monitor Colors */
  --log-bg: rgba(255, 255, 255, 0.95);
  --log-border: #E5E7EB;
  --log-header-bg: #F4F5F7;
  --log-entry-bg: transparent;
  --log-entry-hover: rgba(94, 99, 155, 0.03);
  --log-time-color: #9CA3AF;
  --log-text-color: #1F2937;
  
  /* Status Colors */
  --status-starting: #F59E0B;
  --status-active: #10B981;
  --status-error: #EF4444;
  --status-stopped: #9CA3AF;
}

/* 主容器 */
.thinking-timer-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
  background: var(--thinking-bg);
  border: 1px solid var(--thinking-border);
  border-radius: 12px;
  margin: 10px 0;
}

/* 思考區域 */
.thinking-section {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 10px;
}

/* 機器人頭像區域 */
.bot-avatar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  flex-shrink: 0;
}

.bot-face {
  font-size: 36px;
  animation: botPulse 2s ease-in-out infinite;
}

.thinking-bubbles {
  position: absolute;
  top: -10px;
  right: -15px;
  display: flex;
  gap: 3px;
}

.bubble {
  width: 6px;
  height: 6px;
  background: var(--thinking-time);
  border-radius: 50%;
  animation: bubbleFloat 1.4s ease-in-out infinite;
}

.bubble-2 {
  animation-delay: 0.2s;
}

.bubble-3 {
  animation-delay: 0.4s;
}

/* 思考內容 */
.thinking-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.thinking-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--thinking-text);
  margin: 0;
}

.elapsed-time {
  font-size: 24px;
  font-weight: 700;
  font-family: 'Monaco', 'Consolas', monospace;
  color: var(--thinking-time);
  letter-spacing: 1px;
}

.thinking-subtitle {
  font-size: 14px;
  color: var(--thinking-subtitle);
  margin: 0;
}

/* Log Monitor 區域 */
.log-monitor-section {
  background: var(--log-bg);
  border: 1px solid var(--log-border);
  border-radius: 10px;
  overflow: hidden;
}

.log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--log-header-bg);
  border-bottom: 1px solid var(--log-border);
}

.log-title {
  font-weight: 600;
  color: var(--thinking-text);
  font-size: 14px;
}

.log-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: statusPulse 2s ease-in-out infinite;
}

.status-indicator.status-starting {
  background: var(--status-starting);
}

.status-indicator.status-active {
  background: var(--status-active);
}

.status-indicator.status-error {
  background: var(--status-error);
}

.status-indicator.status-stopped {
  background: var(--status-stopped);
}

.status-text {
  color: var(--thinking-subtitle);
  font-weight: 500;
}

/* Log 內容區域 */
.log-content {
  max-height: 300px;
  overflow-y: auto;
  padding: 0;
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 13px;
  line-height: 1.4;
}

.log-placeholder {
  padding: 20px;
  text-align: center;
  color: var(--thinking-subtitle);
  font-style: italic;
}

.log-entry {
  display: flex;
  gap: 12px;
  padding: 6px 16px;
  border-bottom: 1px solid rgba(229, 231, 235, 0.3);
  transition: background-color 0.2s ease;
}

.log-entry:hover {
  background: var(--log-entry-hover);
}

.log-entry:last-child {
  border-bottom: none;
}

.log-time {
  color: var(--log-time-color);
  font-weight: 500;
  white-space: nowrap;
  font-size: 11px;
  min-width: 70px;
}

.log-text {
  color: var(--log-text-color);
  flex: 1;
  word-break: break-word;
}

/* 響應式設計 */
@media (max-width: 768px) {
  .thinking-timer-container {
    padding: 15px;
    gap: 15px;
  }
  
  .thinking-section {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }
  
  .bot-avatar {
    width: 50px;
    height: 50px;
  }
  
  .bot-face {
    font-size: 30px;
  }
  
  .thinking-text {
    font-size: 16px;
  }
  
  .elapsed-time {
    font-size: 20px;
  }
  
  .log-content {
    max-height: 200px;
  }
  
  .log-entry {
    flex-direction: column;
    gap: 4px;
  }
  
  .log-time {
    min-width: auto;
  }
}

/* 動畫定義 */
@keyframes botPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes bubbleFloat {
  0%, 100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  50% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

@keyframes statusPulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* 捲軸樣式 */
.log-content::-webkit-scrollbar {
  width: 6px;
}

.log-content::-webkit-scrollbar-track {
  background: transparent;
}

.log-content::-webkit-scrollbar-thumb {
  background: rgba(156, 163, 175, 0.3);
  border-radius: 3px;
}

.log-content::-webkit-scrollbar-thumb:hover {
  background: rgba(156, 163, 175, 0.5);
}