/* 営業AI管理画面システム カスタムスタイル */

body {
  color: #213547;
  background-color: #f8fafc;
  font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  font-weight: 400;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 { 
  font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
  font-weight: 600;
}

/* カスタムスクロールバー */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* サイドバー専用スタイル */
.sidebar-transition {
  transition: transform 0.3s ease-in-out;
}

.nav-item:hover {
  background-color: rgba(59, 130, 246, 0.1);
}

.nav-item.active {
  background-color: rgba(59, 130, 246, 0.15);
  border-left: 3px solid #3b82f6;
}

/* リアルタイム通話専用スタイル */
.connection-status {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.connection-status.connected {
  background-color: #10b981;
  color: white;
}

.connection-status.disconnected {
  background-color: #6b7280;
  color: white;
}

.connection-status.error {
  background-color: #ef4444;
  color: white;
}

.recording-status {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.recording-status.active {
  background-color: #f59e0b;
  color: white;
  animation: pulse 1.5s infinite;
}

.recording-status.inactive {
  background-color: #d1d5db;
  color: #6b7280;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* 書き起こしアイテム */
.transcript-item {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.transcript-item.final {
  border-left: 4px solid #10b981;
  background-color: #f0fdf4;
}

.transcript-item.interim {
  border-left: 4px solid #f59e0b;
  background-color: #fffbeb;
  opacity: 0.8;
}

.transcript-item.speaker-customer {
  margin-left: 0;
  margin-right: 20px;
}

.transcript-item.speaker-ai_agent {
  margin-left: 20px;
  margin-right: 0;
  background-color: #f8fafc;
}

.transcript-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
  color: #6b7280;
}

.transcript-text {
  font-size: 14px;
  line-height: 1.5;
  color: #374151;
}

.speaker {
  font-weight: 600;
  color: #1f2937;
}

.confidence {
  font-size: 11px;
  color: #9ca3af;
}

.status.final {
  color: #10b981;
  font-weight: 600;
}

.status.interim {
  color: #f59e0b;
  font-weight: 600;
}

.timestamp {
  font-size: 11px;
  color: #9ca3af;
}

/* AI応答アイテム */
.ai-response-item {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  margin-bottom: 8px;
  background-color: #faf5ff;
  border-left: 4px solid #8b5cf6;
}

.ai-response-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
  color: #6b7280;
}

.ai-response-text {
  font-size: 14px;
  line-height: 1.5;
  color: #374151;
  font-style: italic;
}

.agent {
  font-weight: 600;
  color: #8b5cf6;
}

.emotion {
  padding: 2px 6px;
  background-color: #8b5cf6;
  color: white;
  border-radius: 12px;
  font-size: 10px;
  text-transform: capitalize;
}

/* システムメッセージ */
.system-message {
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 4px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.system-message.system {
  background-color: #f3f4f6;
  color: #374151;
  border-left: 3px solid #6b7280;
}

.system-message.error {
  background-color: #fef2f2;
  color: #dc2626;
  border-left: 3px solid #dc2626;
}

.system-message .timestamp {
  font-size: 11px;
  color: #9ca3af;
}

.system-message .message {
  flex: 1;
  margin-left: 8px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .transcript-item.speaker-customer,
  .transcript-item.speaker-ai_agent {
    margin-left: 0;
    margin-right: 0;
  }
  
  .transcript-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* アニメーション */
.fade-in {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.slide-in {
  animation: slideIn 0.3s ease-out;
}

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

/* カード要素のホバー効果 */
.card-hover:hover {
  transform: translateY(-2px);
  transition: all 0.2s ease-in-out;
}

/* ボタンのアクティブ効果 */
.btn-active {
  transform: scale(0.98);
  transition: transform 0.1s ease;
}

/* ステータス色の定義 */
.status-pending { color: #f59e0b; }
.status-in-progress { color: #3b82f6; }
.status-completed { color: #10b981; }
.status-failed { color: #ef4444; }
.status-cancelled { color: #6b7280; }

/* グラデーション背景 */
.gradient-bg {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* テキストの日本語対応 */
.ja-text {
  font-feature-settings: "palt";
  letter-spacing: 0.02em;
}

/* レスポンシブテーブル */
@media (max-width: 768px) {
  .responsive-table {
    font-size: 12px;
  }
  
  .responsive-table th,
  .responsive-table td {
    padding: 8px 4px;
  }
}

/* 印刷スタイル */
@media print {
  .no-print {
    display: none !important;
  }
  
  body {
    background: white !important;
  }
}

/* ダークモード対応（将来実装用） */
@media (prefers-color-scheme: dark) {
  .dark-mode-enabled body {
    background-color: #1e293b;
    color: #f8fafc;
  }
}