/* Premium Luxury Minimalist User Styles */
:root {
  --bg-color: #f9f9f9;
  --chat-bg: #ffffff;
  --text-primary: #1d1d1f;
  --text-secondary: #86868b;
  --accent-color: #000000;
  --border-light: #f0f0f0;
  --bubble-me-bg: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  --bubble-me-text: #ffffff;
  --bubble-other-bg: #f2f2f7;
  --bubble-other-text: #1d1d1f;
  --font-main: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
}

body {
  background-color: #f2f2f7;
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
  color: var(--text-primary);
  display: flex;
  justify-content: center;
  height: 100vh;
  overflow: hidden;
  margin: 0;
}

.user-container {
  width: 100%;
  max-width: 480px;
  height: 100%;
  background: var(--bg-color);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.08);
}

/* Header */
.user-header {
  padding: 44px 24px 16px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 10;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.header-top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.header-top h1 {
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0;
  text-align: center;
}

.logout-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  padding: 8px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logout-btn:hover {
  background: #f5f5f7;
}

.notice-text {
  margin-top: 8px;
  padding: 8px 12px;
  background: #fff1f0;
  color: #ff4d4f;
  font-size: 12px;
  font-weight: 500;
  border-radius: 8px;
  display: block;
  line-height: 1.4;
  text-align: center;
}

/* Agent Info */
.agent-info {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
}

.agent-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f2f2f7;
  object-fit: cover;
}

.agent-details h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.agent-details p {
  font-size: 12px;
  color: #34c759;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.status-indicator {
  width: 6px;
  height: 6px;
  background: #34c759;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(52, 199, 89, 0.2);
}

.disconnect-btn {
  margin-left: auto;
  background: #ff3b30;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  font-family: inherit;
}

.disconnect-btn:hover {
  background: #ff2d20;
  transform: scale(1.02);
}

.disconnect-btn svg {
  width: 16px;
  height: 16px;
}

.disconnect-btn:disabled {
  background: #c7c7cc;
  cursor: not-allowed;
  transform: none;
}

/* Chat Area */
.user-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--chat-bg);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.welcome-message {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  background: #f9f9f9;
  padding: 16px 20px;
  border-radius: 16px;
  line-height: 1.6;
  margin: 0 10px 20px;
}

/* Messages */
.message {
  display: flex;
  gap: 10px;
  max-width: 80%;
  align-items: flex-end;
  animation: fadeIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.message.customer {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message.agent {
  align-self: flex-start;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.message-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.message-bubble {
  padding: 12px 18px;
  border-radius: 20px;
  font-size: 15px;
  line-height: 1.5;
  position: relative;
  word-wrap: break-word;
  max-width: 100%;
}

.message.customer .message-bubble {
  background: var(--bubble-me-bg);
  color: var(--bubble-me-text);
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.message.agent .message-bubble {
  background: var(--bubble-other-bg);
  color: var(--bubble-other-text);
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  border: 1px solid #f0f0f0;
}

.message-timestamp {
  font-size: 10px;
  color: #c7c7cc;
  padding: 0 4px;
}

.message.customer .message-timestamp {
  text-align: right;
}

/* Input Area */
.user-input-area {
  padding: 16px 24px 32px;
  background: #ffffff;
  border-top: 1px solid var(--border-light);
}

.user-input-container {
  display: flex;
  align-items: center;
  background: #f5f5f7;
  padding: 6px 6px 6px 16px;
  border-radius: 24px;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.user-input-container:focus-within {
  background: #ffffff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border-color: #e5e5ea;
}

.user-message-input {
  flex: 1;
  padding: 10px 0;
  border: none;
  background: transparent;
  font-size: 15px;
  font-family: inherit;
  resize: none;
  min-height: 24px;
  max-height: 100px;
  color: var(--text-primary);
}

.user-message-input:focus {
  outline: none;
}

.user-send-btn {
  width: 36px;
  height: 36px;
  background: var(--accent-color);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  margin-left: 8px;
}

.user-send-btn svg {
  width: 18px;
  height: 18px;
  fill: white;
}

.user-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.user-info-footer {
  text-align: center;
  font-size: 11px;
  color: #c7c7cc;
  margin-top: 12px;
  font-weight: 500;
}

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

/* Typing Indicator */
.typing-indicator {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background: #ffffff;
  border-radius: 20px;
  border-bottom-left-radius: 4px;
  width: fit-content;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  border: 1px solid #f0f0f0;
}

.typing-indicator.active {
  display: flex;
}

.typing-dot {
  width: 5px;
  height: 5px;
  background: #8e8e93;
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}
