* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans',
    'Hiragino Kaku Gothic ProN', 'Yu Gothic', Meiryo, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100dvh;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  overflow: hidden;
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
}

.phone-container {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 600px;
}

/* ヘッダー */
.phone-header {
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: white;
}

.hotel-logo {
  flex-shrink: 0;
}

.hotel-info h1 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.hotel-info p {
  font-size: 13px;
  opacity: 0.9;
}

/* 通話ディスプレイ */
.call-display {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  background: linear-gradient(to bottom, #f9fafb 0%, #ffffff 100%);
}

.avatar-container {
  position: relative;
  margin-bottom: 24px;
}

.avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  transition: all 0.3s ease;
}

.avatar.active {
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
}

.avatar.speaking {
  animation: pulse 1.5s ease-in-out infinite;
}

.avatar.ai-speaking {
  animation: pulse 1s ease-in-out infinite;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

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

.pulse-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid #2563eb;
  transform: translate(-50%, -50%);
  opacity: 0;
  z-index: 1;
}

.pulse-ring.active {
  animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.6;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0;
  }
}

.call-status {
  text-align: center;
  margin-bottom: 16px;
}

.call-status h2 {
  font-size: 22px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 8px;
}

.call-status p {
  font-size: 14px;
  color: #6b7280;
}

.call-timer {
  display: none;
  font-size: 16px;
  color: #2563eb;
  font-weight: 600;
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}

/* 音声可視化 */
.voice-visualizer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 40px;
  margin-top: 16px;
}

.voice-bar {
  width: 4px;
  height: 8px;
  background: #d1d5db;
  border-radius: 2px;
  transition: all 0.1s ease;
}

.voice-visualizer.active .voice-bar {
  animation: voice-wave 0.8s ease-in-out infinite;
}

.voice-visualizer.active .voice-bar:nth-child(1) {
  animation-delay: 0s;
}

.voice-visualizer.active .voice-bar:nth-child(2) {
  animation-delay: 0.1s;
}

.voice-visualizer.active .voice-bar:nth-child(3) {
  animation-delay: 0.2s;
}

.voice-visualizer.active .voice-bar:nth-child(4) {
  animation-delay: 0.3s;
}

.voice-visualizer.active .voice-bar:nth-child(5) {
  animation-delay: 0.4s;
}

@keyframes voice-wave {
  0%,
  100% {
    height: 8px;
    background: #d1d5db;
  }
  50% {
    height: 32px;
    background: #2563eb;
  }
}

/* トランスクリプト */
.transcript-container {
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  max-height: 200px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  display: none;
}

.transcript-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  flex-shrink: 0;
}

.transcript-content {
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.transcript-empty {
  text-align: center;
  color: #9ca3af;
  font-size: 13px;
  padding: 20px;
}

.transcript-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: slideIn 0.3s ease;
}

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

.transcript-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.transcript-user .transcript-label {
  color: #2563eb;
}

.transcript-ai .transcript-label {
  color: #7c3aed;
}

.transcript-text {
  background: white;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: #1f2937;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.transcript-user .transcript-text {
  border-left: 3px solid #2563eb;
}

.transcript-ai .transcript-text {
  border-left: 3px solid #7c3aed;
}

/* コントロール */
.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  padding: 32px 20px;
  background: white;
}

.control-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 12px;
  border-radius: 16px;
  transition: all 0.2s ease;
  color: #6b7280;
  font-size: 12px;
  font-weight: 500;
}

.control-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.control-btn:not(:disabled):hover {
  /* background: #f3f4f6; */
  transform: scale(1.05);
}

.control-btn:not(:disabled):active {
  transform: scale(0.95);
}

/* 通話ボタン */
.call-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  font-size: 14px;
  gap: 4px;
}

.call-btn:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: scale(1.05);
}

.call-btn.active {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.call-btn.active:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

/* ミュートボタン */
.mute-btn {
  display: none;
}
.mute-btn.active {
  color: #ef4444;
}

.speaker-btn {
  display: none;
}

/* 通知 */
.notification {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(0px);
  background: #1f2937;
  color: white;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000;
  max-width: 90%;
  text-align: center;
}

.notification.show {
  opacity: 1;
  transform: translateX(-50%) translateY(100);
}

.notification-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.notification-error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.notification-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.notification-info {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

/* スクロールバー */
.transcript-content::-webkit-scrollbar {
  width: 6px;
}

.transcript-content::-webkit-scrollbar-track {
  background: #f3f4f6;
}

.transcript-content::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.transcript-content::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* レスポンシブ */
@media (max-width: 480px) {
  body {
    padding: 0;
    background: #ffffff;
  }

  .phone-container {
    max-width: 100%;
    border-radius: 0;
    min-height: 100dvh;
    box-shadow: none;
  }

  .phone-header {
    padding: 10px 16px;
    border-radius: 0;
  }

  .call-display {
    padding: 22px 16px;
  }

  .controls {
    padding: 24px 16px;
    gap: 16px;
  }

  .call-btn {
    width: 72px;
    height: 72px;
  }
}

/* 移动端全屏优化 */
@media (max-width: 768px) {
  body {
    padding: 0;
  }

  .phone-container {
    border-radius: 0;
    max-width: 100%;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
  }

  /* 确保transcript容器可以滚动 */
  .transcript-container {
    flex: 0 0 auto;
  }

  /* 在小屏幕上优化按钮大小 */
  .control-btn {
    padding: 8px;
  }
}

/* アニメーション */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.phone-container {
  animation: fadeIn 0.5s ease;
}

/* 通话按钮组样式 */
.call-buttons-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.call-btn-lang {
  width: 100%;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  color: white;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.call-btn-lang .icon-call,
.call-btn-lang .icon-hangup {
  flex-shrink: 0;
}

.call-btn-lang .call-text {
  flex-shrink: 0;
}

.call-btn-lang:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.call-btn-lang:active {
  transform: translateY(0);
}

.call-btn-lang.calling {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
  animation: pulse-button 1.5s ease-in-out infinite;
}

.call-btn-lang.calling:hover {
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

@keyframes pulse-button {
  0%,
  100% {
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
  }
  50% {
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.5);
  }
}

.call-btn-lang .icon-hangup {
  display: none;
}

.call-btn-lang.calling .icon-call {
  display: none;
}

.call-btn-lang.calling .icon-hangup {
  display: block;
}

/* 隐藏未选中的按钮 */
.call-btn-lang.hidden {
  display: none;
}

/* 调整controls布局 */
.controls {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background: #fafafa;
  border-top: 1px solid #e5e7eb;
}

/* 响应式调整 */
@media (max-width: 480px) {
  .call-btn-lang {
    height: 52px;
    font-size: 15px;
  }
}
