/* Lexiara Web Interface */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #1a1a2e;
  color: #eee;
  height: 100vh;
  overflow: hidden;
}

/* Login Screen */
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  gap: 1.5rem;
}

.login-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #7b2ff7;
}

.login-container h1 {
  font-size: 2.5rem;
  color: #e0a0ff;
}

.login-container form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 280px;
}

.login-container input {
  padding: 0.8rem 1rem;
  border: 2px solid #444;
  border-radius: 12px;
  background: #2a2a4a;
  color: #eee;
  font-size: 1.2rem;
  outline: none;
}

.login-container input:focus {
  border-color: #e0a0ff;
}

.login-container button {
  padding: 0.8rem;
  border: none;
  border-radius: 12px;
  background: #7b2ff7;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
}

.login-container button:hover {
  background: #9b4fff;
}

.login-error {
  color: #ff6b6b;
  font-size: 0.9rem;
}

/* Chat Header */
.chat-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  padding: 0.5rem 1rem;
  background: #16213e;
  border-bottom: 1px solid #333;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  z-index: 20;
}

.chat-header .profile-pic {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #7b2ff7;
}

.chat-header h2 {
  font-size: 1.2rem;
  color: #e0a0ff;
  flex: 1;
}

.chat-header .user-name {
  color: #888;
  font-size: 0.9rem;
}

.chat-header .skill-indicator {
  font-size: 1rem;
  opacity: 0.85;
  margin-left: 0.4rem;
}

/* Messages Area */
.messages {
  position: fixed;
  top: 48px;
  left: 0;
  right: 0;
  bottom: 0;
  overflow-y: auto;
  padding: 1rem 7rem 1rem 5rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.message {
  max-width: 85%;
  padding: 0.8rem 1rem;
  border-radius: 16px;
  line-height: 1.4;
  font-size: 1.1rem;
  word-wrap: break-word;
}

.message.user {
  align-self: flex-end;
  background: #7b2ff7;
  color: white;
  border-bottom-right-radius: 4px;
}

.message.assistant {
  align-self: flex-start;
  background: #2a2a4a;
  color: #eee;
  border-bottom-left-radius: 4px;
}

.message .sender {
  display: block;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.2rem;
}

.typing-indicator {
  align-self: flex-start;
  color: #888;
  font-style: italic;
  padding: 0.4rem 1rem;
}

/* Controls Right (mic + audio) */
.controls-right {
  position: fixed;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  z-index: 10;
}

/* Controls Left (new + bye + stop) */
.controls-left {
  position: fixed;
  left: 1.5rem;
  top: 55%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  z-index: 10;
}

.new-session-button {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  padding: 0;
  margin: 0;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid #555;
  background: #2a3a4a;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  -webkit-user-select: none;
  user-select: none;
}

.new-session-button:hover {
  border-color: #44aaff;
  background: #2a3a5a;
}

.new-session-button:active {
  transform: scale(0.95);
}

.new-session-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.bye-button {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid #555;
  background: #2a2a4a;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  -webkit-user-select: none;
  user-select: none;
}

.bye-button:hover {
  border-color: #ff9944;
  background: #3a2a2a;
}

.bye-button:active {
  transform: scale(0.95);
}

.stop-button {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid #ff4444;
  background: #3a1a1a;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  -webkit-user-select: none;
  user-select: none;
}

.stop-button:hover {
  border-color: #ff6666;
  background: #4a2020;
}

.stop-button:active {
  transform: scale(0.95);
}

.stop-button.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Bottom spacer for Android nav overlay */
.bottom-spacer {
  min-height: 3rem;
  flex-shrink: 0;
}

.mic-button {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid #7b2ff7;
  background: #2a2a4a;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

.mic-button:active,
.mic-button.recording {
  background: #ff4444;
  border-color: #ff6666;
  transform: scale(1.1);
}

.mic-button.busy {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: #555;
}

.mic-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Audio control buttons */
.audio-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #555;
  background: #2a2a4a;
  color: #ccc;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.audio-btn:hover {
  border-color: #e0a0ff;
  color: #e0a0ff;
}

.audio-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

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

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

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