/* css/chat.css - Chat interface styles with branded header */

.chat-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  background: linear-gradient(135deg, #003366 0%, #0055aa 100%);
}

/* Branded Header (matching other pages) */
.app-header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  border-bottom: 3px solid #0f3460;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.header-left .logo {
  height: 40px;
  width: auto;
}

/* Header Navigation */
.header-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  justify-content: center;
}

.nav-link {
  padding: 0.5rem 1.25rem;
  color: #e94560;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  position: relative;
}

.nav-link:hover {
  background-color: rgba(233, 69, 96, 0.1);
  color: #ff6b6b;
}

.nav-link.active {
  background-color: rgba(233, 69, 96, 0.2);
  color: #ff6b6b;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -0.75rem;
  left: 50%;
  transform: translateX(-50%);
  width: 40%;
  height: 3px;
  background-color: #e94560;
}

/* Header Right */
.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-name {
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 500;
}

.logout-btn {
  padding: 0.5rem 1rem;
  background-color: transparent;
  color: #e94560;
  border: 1px solid #e94560;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.logout-btn:hover {
  background-color: #e94560;
  color: #ffffff;
}

/* Chat Main Area */
.chat-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Custom scrollbar for chat */
.chat-messages::-webkit-scrollbar {
  width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Message Styles */
.message {
  max-width: 70%;
  padding: 1rem 1.5rem;
  border-radius: 18px;
  line-height: 1.6;
  word-wrap: break-word;
}

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

.message.assistant {
  align-self: flex-start;
  background: white;
  color: #2c3e50;
  border: 1px solid #e0e0e0;
  border-bottom-left-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.message.system {
  align-self: center;
  background: rgba(255, 255, 255, 0.9);
  color: #6c757d;
  font-style: italic;
  font-size: 0.9rem;
  max-width: 90%;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.message-content {
  margin: 0;
}

/* Chat Input Area */
.chat-input {
  background: white;
  border-top: 1px solid #e0e0e0;
  padding: 1.5rem 2rem;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

.input-group {
  display: flex;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  align-items: flex-end;
}

.message-input {
  flex: 1;
  padding: 1rem 1.25rem;
  border: 2px solid #e0e0e0;
  border-radius: 25px;
  font-size: 1rem;
  font-family: inherit;
  resize: none;
  max-height: 120px;
  min-height: 50px;
  transition: border-color 0.2s ease;
}

.message-input:focus {
  outline: none;
  border-color: #e94560;
}

.send-btn {
  padding: 1rem 2rem;
  background: #e94560;
  color: white;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.send-btn:hover:not(:disabled) {
  background: #d63652;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(233, 69, 96, 0.3);
}

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

/* Typing Indicator */
.typing-indicator {
  align-self: flex-start;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 18px;
  border-bottom-left-radius: 6px;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 70%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.typing-indicator span {
  color: #6c757d;
  font-size: 0.9rem;
}

.typing-dots {
  display: flex;
  gap: 4px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: #6c757d;
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

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

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

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

/* Welcome Message (if needed) */
.welcome-message {
  text-align: center;
  padding: 3rem 2rem;
  color: white;
}

.welcome-message h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.welcome-message p {
  font-size: 1.1rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .header-content {
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
  }
  
  .header-nav {
    order: 3;
    width: 100%;
    justify-content: center;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(233, 69, 96, 0.2);
  }
}

@media (max-width: 768px) {
  .chat-messages {
    padding: 1rem;
  }
  
  .message {
    max-width: 85%;
  }
  
  .chat-input {
    padding: 1rem;
  }
  
  .input-group {
    gap: 0.75rem;
  }
  
  .message-input {
    padding: 0.75rem 1rem;
  }
  
  .send-btn {
    padding: 0.75rem 1.5rem;
  }
  
  .header-nav {
    gap: 0.25rem;
  }
  
  .nav-link {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
  }
  
  .user-name {
    display: none;
  }
}

@media (max-width: 480px) {
  .chat-messages {
    padding: 0.75rem;
  }
  
  .message {
    padding: 0.875rem 1.25rem;
    max-width: 90%;
  }
  
  .input-group {
    flex-direction: row;
    align-items: stretch;
  }
  
  .send-btn {
    min-width: 80px;
  }
}

/* Chat message links */
.chat-link {
  color: #3b82f6;
  text-decoration: underline;
  cursor: pointer;
}

.chat-link:hover {
  color: #2563eb;
}

.session-restored .message-content {
  color: var(--text-muted, #888);
  padding: 0.5rem;
  margin: 0.5rem 0;
}
