/**
 * 受電画面スタイル - 改善版
 */

.voice-container {
  max-width: 1200px;
  margin: 0 auto;
  display: block;
  padding: 0 20px;
}

.left-column {
  width: 100%;
}

.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-size: 12px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #9aa3b2;
}

.dot.is-connecting {
  background: #f59e0b;
}

.dot.is-connected {
  background: #22c55e;
}

.dot.is-error {
  background: #ef4444;
}

/* ヘッダー統合スタイル */
.panel-header-with-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.panel-header-with-status .panel-title {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  position: static;
}

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

.status-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.connected {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border: 1px solid #22c55e;
}

.status-badge.connecting {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border: 1px solid #f59e0b;
}

.status-badge.disconnected {
  background: rgba(156, 163, 175, 0.1);
  color: #6b7280;
  border: 1px solid #6b7280;
}

.status-badge.error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid #ef4444;
}

.timer-badge {
  font-family: monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

/* カラムレイアウト */
.left-column, .right-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: stretch;
}

.right-column {
  height: 700px;
  min-height: 700px;
  max-height: 700px;
}

/* Slack風パネルタイトル */
.panel-title {
  margin: 0;
  padding: 16px 24px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 1px;
  position: sticky;
  top: 0;
  z-index: 10;
}

/* コントロールパネル */
.control-panel {
  order: 1;
}

/* ログパネル */
.log-panel {
  order: 1;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.log-panel .log-section {
  padding: 0 24px 24px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.log-panel .card {
  flex: 1;
  overflow-y: scroll;
  min-height: 0;
  max-height: none;
}

/* ヒントテキストのバッジスタイル */
.log-section .hint {
  display: inline-block;
  padding: 4px 8px;
  background: rgba(99, 102, 241, 0.05);
  color: var(--accent);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 8px;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  margin-top: 8px;
}

/* ナレッジセクション */
.knowledge-section {
  order: 2;
  max-height: 470px;
  overflow-y: auto;
}

.voice-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
}

/* バッジスタイルのボタン */
.voice-controls .btn {
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid;
  transition: all 0.2s ease;
  min-width: 120px;
  width: 120px;
  text-align: center;
}

.voice-controls .btn-primary {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border-color: #22c55e;
}

.voice-controls .btn-primary:hover:not(:disabled) {
  background: rgba(34, 197, 94, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.voice-controls .btn:disabled {
  background: rgba(156, 163, 175, 0.1);
  color: #9ca3af;
  border-color: #d1d5db;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.voice-controls .btn:not(.btn-primary):not(:disabled) {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-color: #ef4444;
}

.voice-controls .btn:not(.btn-primary):hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.audio-section {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.audio-box {
  flex: 1;
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
}

.audio-box audio {
  width: 100%;
}

.log-section {
  flex: 1;
}

.card {
  padding: 14px;
  height: 240px;
  overflow: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--mono-bg);
}

.card pre {
  margin: 0;
  white-space: pre-wrap;
  color: var(--mono);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12.5px;
  line-height: 1.6;
}

.knowledge-section {
  margin-top: 20px;
}

.knowledge-input {
  width: 100%;
  min-height: 80px;
  max-height: 120px;
  resize: vertical;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  box-shadow: var(--shadow);
  font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.knowledge-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  flex-wrap: wrap;
}

/* ナレッジコントロールのバッジスタイル */
.knowledge-controls .btn {
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border: 1px solid;
  transition: all 0.2s ease;
  min-width: auto;
}

.knowledge-controls .btn-ghost {
  background: rgba(99, 102, 241, 0.08);
  color: var(--accent);
  border-color: var(--accent);
}

.knowledge-controls .btn-ghost:hover {
  background: rgba(99, 102, 241, 0.15);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}


.knowledge-controls .btn-primary {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border-color: #f59e0b;
}

.knowledge-controls .btn-primary:hover {
  background: rgba(245, 158, 11, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

/* ナレッジ統計表示 */
.knowledge-controls .hint {
  padding: 4px 8px;
  background: rgba(156, 163, 175, 0.08);
  color: #6b7280;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.knowledge-info {
  padding: 12px 16px;
  background: rgba(99, 102, 241, 0.05);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 12px;
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.5;
}

.knowledge-info strong {
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-size: 11px;
}


#scriptSelect {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.03);
  color: var(--fg);
  font-size: 13px;
  font-weight: 500;
  min-width: 200px;
  transition: all 0.2s ease;
  cursor: pointer;
}

#scriptSelect:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

#scriptSelect:focus {
  outline: none;
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
  transform: translateY(-1px);
}


/* マイク選択セクション */
.microphone-settings {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0;
  padding: 20px 24px;
  background: var(--card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.microphone-settings .btn-secondary {
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: rgba(99, 102, 241, 0.08);
  color: var(--accent);
  border: 1px solid var(--accent);
  transition: all 0.2s ease;
}

.microphone-settings .btn-secondary:hover {
  background: rgba(99, 102, 241, 0.15);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.2);
}

.microphone-settings label {
  padding: 4px 8px;
  background: rgba(156, 163, 175, 0.08);
  color: #6b7280;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.microphone-select {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.03);
  color: var(--fg);
  font-size: 13px;
  font-weight: 500;
  min-width: 200px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.microphone-select:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

.microphone-select:focus {
  outline: none;
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
  transform: translateY(-1px);
}

.microphone-select option {
  padding: 8px 12px;
  background: white;
  color: var(--fg);
  border: none;
}

/* ログの折り畳みスタイル */
.log-header {
  user-select: none;
  transition: background-color 0.2s;
  border-radius: 6px;
}

.log-header:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

.log-toggle {
  font-size: 12px;
  color: #9ca3af;
  transition: transform 0.2s;
  font-weight: bold;
}

.log-content {
  margin-top: 12px;
  animation: slideDown 0.3s ease-out;
}

.log-display {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  max-height: 400px;
  overflow-y: auto;
}

.log-display pre {
  margin: 0;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.6;
  color: #374151;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* ログのスクロールバーをカスタマイズ */
.log-display::-webkit-scrollbar {
  width: 8px;
}

.log-display::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.log-display::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

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

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

/* 通話情報入力フィールド */
.form-input-small {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  color: #374151;
  transition: all 0.2s;
}

.form-input-small:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-input-small::placeholder {
  color: #9ca3af;
}

/* AI面接アバター */
.interview-avatar {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.interview-avatar.speaking {
  animation: avatarPulse 1s ease-in-out infinite;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  box-shadow: 0 10px 40px rgba(245,87,108,0.4);
}

.interview-avatar.listening {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  box-shadow: 0 10px 40px rgba(79,172,254,0.4);
}

.interview-avatar.thinking {
  animation: avatarRotate 2s linear infinite;
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

@keyframes avatarPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

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

.avatar-face {
  font-size: 120px;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}