/* Modern Chat Application Styles */

/* App Layout */
.app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f5f5;
}

/* Session List Styles */
.session-list-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  height: 100vh;
  overflow-y: auto;
}

.session-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e0e0e0;
}

.session-list-header h1 {
  margin: 0;
  color: #333;
  font-size: 24px;
  font-weight: 600;
}

.session-list-actions {
  display: flex;
  gap: 10px;
}

.refresh-button {
  background: none;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
}

.refresh-button:hover {
  background: #f0f0f0;
  border-color: #ccc;
}

/* AI Assistant Status */
.ai-assistant-status {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.assistant-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.assistant-avatar {
  font-size: 20px;
}

.assistant-name {
  font-size: 16px;
}

.assistant-description {
  font-size: 14px;
  opacity: 0.9;
}

.create-session-button {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
  align-self: flex-start;
}

.create-session-button:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
}

/* Session List */
.session-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.session-list-item {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
}

.session-list-item:hover {
  border-color: #667eea;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
  transform: translateY(-1px);
}

.session-list-item.active {
  border-color: #667eea;
  background: #f8f9ff;
}

.session-avatar {
  font-size: 24px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
  border-radius: 50%;
}

.session-info {
  flex: 1;
}

.session-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.session-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.session-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #666;
}

.session-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: #888;
}

.session-creator {
  font-weight: 500;
}

.session-stats {
  color: #aaa;
}

/* Chat Room Styles */
.chat-room-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: white;
}

.chat-room-header {
  background: white;
  border-bottom: 1px solid #e0e0e0;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.back-button {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #667eea;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.2s;
}

.back-button:hover {
  background: #f0f0f0;
}

.chat-room-info {
  flex: 1;
}

.chat-room-info h2 {
  margin: 0 0 4px 0;
  font-size: 18px;
  color: #333;
}

.chat-room-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #666;
}

.participant-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Messages Area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Message Bubbles */
.message-bubble-container {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 70%;
}

.message-bubble-container.own {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-bubble-container.other {
  align-self: flex-start;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #667eea;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.message-avatar.own-avatar {
  background: #28a745;
}

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

.message-sender {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #666;
  margin-bottom: 2px;
}

.sender-name {
  font-weight: 600;
}

.message-bubble {
  padding: 12px 16px;
  border-radius: 18px;
  position: relative;
  word-wrap: break-word;
  display: flex;
  align-items: center;
  gap: 8px;
}

.message-bubble.own-bubble {
  background: #667eea;
  color: white;
  border-bottom-right-radius: 6px;
}

.message-bubble.other-bubble {
  background: white;
  color: #333;
  border: 1px solid #e0e0e0;
  border-bottom-left-radius: 6px;
}

.message-bubble.assistant-bubble {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
}

.message-text {
  margin: 0;
  line-height: 1.4;
  flex: 1;
}

.message-status {
  font-size: 10px;
  opacity: 0.7;
  margin-left: 4px;
}

.message-timestamp {
  font-size: 11px;
  color: #aaa;
  text-align: right;
}

.message-bubble-container.own .message-timestamp {
  text-align: left;
}

/* Chat Input */
.chat-input-form {
  background: white;
  border-top: 1px solid #e0e0e0;
  padding: 16px 20px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.chat-input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 24px;
  padding: 12px 16px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

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

.send-button {
  background: #667eea;
  color: white;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.send-button:hover:not(:disabled) {
  background: #5a6fd8;
  transform: scale(1.05);
}

.send-button:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}
