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

html, body {
  height: 100%;
  font-family: 'Poppins', sans-serif;
  background-color: #000;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Main Chat Container */
.container {
  width: 100%;
  max-width: 600px;
  background-color: rgba(26, 26, 26, 0.7);
  border-radius: 16px;
  border: 2px solid rgba(10, 132, 255, 0.2);
  box-shadow: 0 0 25px rgba(0, 170, 255, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Fixed Header */
.chat-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  z-index: 1000;
  padding: 15px 20px;
  background-color: rgba(26, 26, 26, 0.95);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border-bottom: 1px solid #333;
}

.chat-header-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-profile-img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #0a84ff;
  box-shadow: 0 0 6px rgba(0, 170, 255, 0.5);
}

.chat-title {
  font-size: 1.4rem;
  font-weight: 600;
  background: linear-gradient(90deg, #00aaff, #0066ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.5px;
}

/* Chat Window */
.chat-window {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  overflow: hidden;
  position: relative;
  padding-top: 72px; /* Matches header height */
}

/* Scrollable Chat Area */
.chat-history {
  flex-grow: 1;
  padding: 15px;
  overflow-y: auto;
  background-color: #111;
  display: flex;
  flex-direction: column;
  scroll-behavior: smooth;
}

/* Message Bubbles */
.message {
  margin-bottom: 12px;
  padding: 10px 15px;
  border-radius: 20px;
  font-size: 0.9rem;
  max-width: 80%;
  word-wrap: break-word;
}

.user-message {
  background-color: #0055ff;
  color: #fff;
  align-self: flex-end;
  text-align: right;
}

.model-message {
  background-color: #333;
  color: #fff;
  align-self: flex-start;
  text-align: left;
}

/* Sticky Input Bar */
.input-area {
  position: sticky;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: rgba(26, 26, 26, 0.95);
  padding: 10px;
  display: flex;
  align-items: center;
  border-top: 1px solid #333;
  z-index: 999;
}

input {
  flex-grow: 1;
  padding: 10px;
  border: 2px solid #0a84ff;
  border-radius: 25px;
  font-size: 1rem;
  background-color: #000;
  color: #fff;
  outline: none;
  margin-right: 10px;
}

input:focus {
  border-color: #00aaff;
  box-shadow: 0 0 5px rgba(0, 170, 255, 0.7);
}

.send-button {
  background-color: #0a84ff;
  color: #fff;
  border: none;
  border-radius: 25px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.send-button:hover {
  background-color: #0077e6;
}

input::placeholder {
  color: #aaa;
}

/* Scrollbar Styling */
.chat-history::-webkit-scrollbar {
  width: 6px;
}

.chat-history::-webkit-scrollbar-thumb {
  background-color: #555;
  border-radius: 10px;
}

.chat-history::-webkit-scrollbar-track {
  background: transparent;
}

/* Mobile Styles */
@media (max-width: 600px) {
  .container {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .chat-profile-img {
    width: 36px;
    height: 36px;
  }

  .chat-title {
    font-size: 1.2rem;
  }

  input, .send-button {
    font-size: 0.95rem;
  }
}

@media (min-width: 601px) {
  .container {
    height: 100dvh;
  }
}
