* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.chat-container {
  width: 100%;
  max-width: 600px;
  height: 90vh;
  max-height: 800px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.recruiter-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
}

.info .name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 2px;
}

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

.status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  animation: pulse 2s infinite;
}

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

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #f8fafc;
}

.message {
  margin-bottom: 16px;
  display: flex;
  animation: slideIn 0.3s ease-out;
}

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

.message.recruiter {
  justify-content: flex-start;
}

.message.user {
  justify-content: flex-end;
}

.message-content {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 18px;
  line-height: 1.5;
  font-size: 15px;
}

.message.recruiter .message-content {
  background: white;
  color: #1e293b;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.message.user .message-content {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-bottom-right-radius: 4px;
}

.message-time {
  font-size: 11px;
  opacity: 0.6;
  margin-top: 4px;
  padding: 0 4px;
}

.chat-input-container {
  padding: 16px 20px;
  background: white;
  border-top: 1px solid #e2e8f0;
}

.typing-indicator {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
  padding: 8px 12px;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

.chat-input-wrapper {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 24px;
  font-size: 15px;
  font-family: inherit;
  resize: none;
  max-height: 120px;
  transition: border-color 0.2s;
}

.chat-input:focus {
  outline: none;
  border-color: #667eea;
}

.send-button {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}

.send-button:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.send-button:active:not(:disabled) {
  transform: scale(0.95);
}

.send-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

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

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

/* Token Panel */
.token-panel {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30, 41, 59, 0.95);
  color: #e2e8f0;
  padding: 10px 16px;
  border-radius: 12px;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 12px;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  min-width: 500px;
}

.token-row {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
}

.token-row:last-child {
  margin-bottom: 0;
}

.token-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.token-label {
  color: #94a3b8;
  font-weight: 500;
  min-width: 55px;
}

.token-value {
  color: #60a5fa;
  font-weight: 600;
  min-width: 60px;
}

.token-value.token-thinking {
  color: #c084fc;
}

.token-op {
  color: #64748b;
}

.token-price {
  color: #94a3b8;
}

.token-input {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: #fbbf24;
  padding: 2px 6px;
  width: 60px;
  font-family: inherit;
  font-size: 12px;
  text-align: right;
}

.token-input:focus {
  outline: none;
  border-color: #667eea;
}

.token-input-rate {
  width: 50px;
}

.token-cost {
  color: #4ade80;
  font-weight: 600;
  min-width: 70px;
}

.token-cost-rub {
  color: #fb923c;
  font-weight: 500;
  min-width: 70px;
}

.token-separator {
  color: #475569;
  margin: 0 8px;
}

.token-total {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 8px;
  margin-top: 2px;
}

.token-total .token-label {
  color: #f1f5f9;
  font-weight: 600;
}

.token-total .token-cost {
  color: #22c55e;
  font-size: 13px;
}

.token-total .token-cost-rub {
  color: #f97316;
  font-size: 13px;
}

/* Start Overlay */
.start-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.start-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.start-content {
  text-align: center;
  color: white;
}

.start-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  font-weight: 600;
  margin: 0 auto 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.start-content h2 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 8px;
}

.start-content p {
  font-size: 16px;
  opacity: 0.9;
  margin-bottom: 32px;
}

.start-button {
  background: white;
  color: #667eea;
  border: none;
  padding: 16px 48px;
  font-size: 18px;
  font-weight: 600;
  border-radius: 30px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.start-button:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.start-button:active {
  transform: scale(0.98);
}

/* Mobile responsive */
@media (max-width: 640px) {
  body {
    padding: 0;
    padding-top: 100px;
  }

  .token-panel {
    min-width: auto;
    width: calc(100% - 20px);
    font-size: 10px;
    padding: 8px 12px;
  }

  .token-input {
    width: 45px;
    font-size: 10px;
  }

  .token-input-rate {
    width: 40px;
  }

  .token-label {
    min-width: 45px;
  }

  .token-value {
    min-width: 45px;
  }

  .token-cost,
  .token-cost-rub {
    min-width: 55px;
  }

  .chat-container {
    height: calc(100vh - 100px);
    max-height: calc(100vh - 100px);
    border-radius: 0;
  }

  .chat-header {
    padding: 16px;
  }

  .chat-messages {
    padding: 16px;
  }

  .message-content {
    max-width: 85%;
    font-size: 14px;
  }
}

/* Voice Mode Styles */
.voice-button {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: #e2e8f0;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.voice-button:hover {
  background: #cbd5e1;
  color: #475569;
}

.voice-button.active {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  animation: voicePulse 1.5s infinite;
}

@keyframes voicePulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(239, 68, 68, 0);
  }
}

.voice-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #f1f5f9;
  border-radius: 12px;
  margin-bottom: 8px;
  transition: all 0.3s;
}

.voice-status.hidden {
  display: none;
}

.voice-status-icon {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #94a3b8;
  transition: all 0.3s;
}

.voice-status.listening .voice-status-icon {
  background: #4ade80;
  animation: voicePulse 1.5s infinite;
}

.voice-status.speaking .voice-status-icon {
  background: #3b82f6;
  animation: voicePulse 0.8s infinite;
}

.voice-status.processing .voice-status-icon {
  background: #fbbf24;
  animation: spin 1s linear infinite;
}

.voice-status.bot-speaking .voice-status-icon {
  background: #a855f7;
  animation: voicePulse 1.2s infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.voice-status-text {
  font-size: 14px;
  color: #475569;
  font-weight: 500;
}

.partial-transcript {
  padding: 10px 16px;
  background: rgba(102, 126, 234, 0.1);
  border-left: 3px solid #667eea;
  border-radius: 0 8px 8px 0;
  margin-bottom: 8px;
  font-size: 14px;
  color: #475569;
  font-style: italic;
  animation: fadeIn 0.2s ease-out;
}

.partial-transcript.hidden {
  display: none;
}

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