/* Basic Reset */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #ffffff;
  color: #222;
}

/* Main Application */
.app {
  display: flex;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: #f7f7f8;
  padding: 20px;
  border-right: 1px solid #e5e5e5;
  display: flex;
  flex-direction: column;
}

.logo {
  font-size: 16px;
  font-weight: bold;
  color: #0288d1;
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  border-radius: 6px;
}

.new-chat {
  padding: 13px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  text-align: left;
  transition: background 0.2s;
}

.new-chat:hover {
  background: #f0f0f0;
}

.sidebar-footer {
  margin-top: auto;
  font-size: 13px;
  color: #777;
}

/* Main Chat */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
}

.topbar {
  height: 60px;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  padding: 0 22px;
  font-weight: bold;
  flex-shrink: 0;
  gap: 8px;
}

.topbar span {
  color: #0288d1;
}

/* Chat Area & Messages */
.chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.messages {
  width: 100%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Welcome Screen */
.welcome {
  text-align: center;
  margin-top: 12vh;
  padding: 20px;
}

.welcome h1 {
  margin: 6px 0;
  font-size: 28px;
}

.welcome h1 span {
  color: #0288d1;
}

.welcome p {
  color: #666;
  font-size: 16px;
  margin-top: 12px;
}

/* Message Bubbles */
.message-row {
  display: flex;
  width: 100%;
}

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

.message-row.ai {
  justify-content: flex-start;
}

.message {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 14px;
  line-height: 1.5;
  font-size: 15px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.message-row.user .message {
  background: #0288d1;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.message-row.ai .message {
  background: #f4f4f6;
  color: #222222;
  border: 1px solid #e5e5e5;
  border-bottom-left-radius: 4px;
}

/* Input Area */
.input-wrapper {
  padding: 12px 16px 20px;
  background: #ffffff;
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

.input-box {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: #f7f7f8;
  border: 1px solid #ddd;
  border-radius: 14px;
  padding: 10px 14px;
  transition: border-color 0.2s;
}

.input-box:focus-within {
  border-color: #0288d1;
  background: #ffffff;
}

#chat-input {
  flex: 1;
  border: none;
  background: transparent;
  resize: none;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.4;
  max-height: 140px;
  outline: none;
  padding: 4px 0;
}

#send-btn {
  background: #0288d1;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.2s;
}

#send-btn:hover:not(:disabled) {
  opacity: 0.9;
}

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

.footer-note {
  text-align: center;
  font-size: 12px;
  color: #888;
  margin-top: 8px;
}

/* Mobile Responsive */
@media (max-width: 700px) {
  .sidebar {
    display: none;
  }
}
