@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
  -webkit-tap-highlight-color: transparent;
}

:root {
  /* Dark mode colors */
  --text-color: #e3e3e3;
  --subheading-color: #828282;
  --placeholder-color: #a6a6a6;
  --primary-color: #121212;
  --secondary-color: #242424;
  --secondary-hover-color: #383838;
  --accent-gradient: linear-gradient(135deg, #8ec5fc 0%, #e0c3fc 100%);
  --glass-border: rgba(255, 255, 255, 0.1);
}

.light_mode {
  /* Light mode colors */
  --text-color: #222;
  --subheading-color: #707070;
  --placeholder-color: #6c6c6c;
  --primary-color: #ffffff;
  --secondary-color: #f0f2f5;
  --secondary-hover-color: #e4e6e9;
  --glass-border: rgba(0, 0, 0, 0.1);
}

body {
  background: var(--primary-color);
  color: var(--text-color);
  transition: background 0.8s ease-in-out, background-color 0.8s ease-in-out;
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Optional: Animation for background transition */
@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* --- Navbar --- */
.navbar {
  position: sticky;
  top: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(20px);
  background: rgba(20, 22, 27, 0.1);
  border-bottom: 1px solid var(--glass-border);
  padding: 12px 20px;
  z-index: 1000;
}

.nav-center h1 {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 1px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.creator-tag {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--subheading-color);
  margin-right: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.icon-box {
  width: 35px;
  height: 35px;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--accent-gradient);
}

/* --- Header & Suggestions --- */
.header {
  margin: 6vh auto 2rem;
  max-width: 980px;
  padding: 1rem;
  text-align: center;
}

body.hide-header .header {
  display: none;
}

.header .title {
  font-size: 3rem;
  background: linear-gradient(to right, #4285f4, #d96570);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

.suggestion-list {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  overflow-x: auto;
  padding-bottom: 10px;
  scrollbar-width: none;
}

.suggestion {
  flex: 0 0 200px;
  background: var(--secondary-color);
  padding: 1.2rem;
  border-radius: 1rem;
  cursor: pointer;
  transition: 0.3s;
  border: 1px solid var(--glass-border);
}

.suggestion:hover {
  background: var(--secondary-hover-color);
  transform: translateY(-5px);
}

/* --- Chat Area --- */
.chat-list {
  padding: 2rem 1rem 150px;
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
}

/* Watermark */
.chat-list::after {
  content: "Built by Thejuliusdev";
  position: fixed;
  bottom: 100px;
  right: 25px;
  opacity: 0.08;
  font-size: 0.75rem;
  pointer-events: none;
  z-index: 1;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.message {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  width: 100%;
  animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.message.outgoing {
  flex-direction: row-reverse;
}

.message-content {
  max-width: 75%;
  padding: 12px 18px;
  font-size: 0.95rem;
  line-height: 1.5;
  position: relative;
}

.message.incoming .message-content {
  background: var(--secondary-color);
  color: var(--text-color);
  border-radius: 18px 18px 18px 2px;
}

.message.outgoing .message-content {
  background: var(--accent-gradient);
  color: #000;
  border-radius: 18px 18px 2px 18px;
  font-weight: 500;
}

/* --- Typing Area --- */
.typing-area {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--primary-color);
  padding: 1rem;
  border-top: 1px solid var(--glass-border);
  z-index: 1000;
}

.typing-form {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.input-wrapper {
  flex: 1;
  background: var(--secondary-color);
  border-radius: 25px;
  display: flex;
  align-items: flex-end;
  padding: 5px 15px;
  position: relative;
  transition: 0.3s;
  border: 1px solid var(--glass-border);
}

.input-wrapper:focus-within {
  background: var(--secondary-hover-color);
  box-shadow: 0 0 0 2px rgba(142, 197, 252, 0.2);
}

/* --- Gemini-Style Image Preview --- */
.image-preview-container {
  position: absolute;
  bottom: 60px;
  left: 15px;
  background: var(--secondary-color);
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

#image-preview {
  max-width: 80px;
  max-height: 80px;
  border-radius: 8px;
  object-fit: cover;
}

#close-preview {
  cursor: pointer;
  font-size: 18px;
  color: var(--subheading-color);
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  padding: 2px;
  transition: 0.2s;
}

#close-preview:hover {
  color: #ff4d4d;
  background: rgba(255,255,255,0.2);
}

#upload-icon {
  cursor: pointer;
  color: var(--subheading-color);
  margin-right: 10px;
  margin-bottom: 8px;
  transition: 0.2s;
}

#upload-icon:hover {
  color: var(--text-color);
}

.typing-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-color);
  font-size: 1rem;
  padding: 10px 40px 10px 0;
  resize: none;
  max-height: 150px;
}

#action-icon {
  position: absolute;
  right: 12px;
  bottom: 8px;
  cursor: pointer;
  color: var(--subheading-color);
  transition: 0.2s;
}

#action-icon:hover {
  color: var(--text-color);
  transform: scale(1.1);
}

.action-buttons {
  display: flex;
  gap: 8px;
}

.action-buttons .icon {
  width: 45px;
  height: 45px;
  background: var(--secondary-color);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: 0.2s;
  border: 1px solid var(--glass-border);
}

.action-buttons .icon:hover {
  background: var(--secondary-hover-color);
}

/* --- Skeleton Loading --- */
.message.loading .message-content {
  width: 100%;
  min-width: 200px;
}

.skeleton {
  height: 12px;
  margin: 10px 0;
  background: linear-gradient(90deg, var(--secondary-hover-color) 25%, var(--secondary-color) 50%, var(--secondary-hover-color) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --- Delete Toast --- */
.toast-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 9998;
}

.toast {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--secondary-color);
  padding: 2rem;
  border-radius: 20px;
  text-align: center;
  z-index: 9999;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
  border: 1px solid var(--glass-border);
}

.toast.show {
  display: block;
}

.toast-buttons {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  gap: 15px;
}

.toast-buttons button {
  padding: 10px 25px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s;
}

#confirm-delete { background: #ff4d4d; color: white; }
#cancel-delete { background: #444; color: white; }

/* --- Responsive --- */
@media (max-width: 600px) {
  .header .title { font-size: 2rem; }
  .message-content { max-width: 85%; }
  .typing-area { padding: 0.8rem; }
  .creator-tag { display: none; }
}
/* Update your existing .typing-input block */
.typing-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-color);
  font-size: 1rem;
  padding: 10px 40px 10px 0;
  resize: none;
  max-height: 200px; /* Maximum height before scrolling begins */
  overflow-y: hidden; /* Hide scrollbar while expanding */
  line-height: 1.5;
}
/* Animation for the voice icon when recording */
@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

#action-icon[textContent="graphic_eq"] {
  animation: pulse 1.5s infinite;
}
/* 1. Remove the blue/gray flash on mobile devices when tapping */
* {
  -webkit-tap-highlight-color: transparent;
}

/* 2. Remove the default blue outline on click for all elements */
*:focus {
  outline: none;
}

/* 3. OPTIONAL: Keep the outline ONLY for people using a keyboard (Better Accessibility) */
/* This ensures the blue ring only shows up if someone is pressing 'Tab' */
*:focus-visible {
  outline: 2px solid var(--accent-gradient); /* Or any color you prefer */
}
/* Container for the icons */
.message-actions {
  display: flex;
  gap: 12px; /* Space between volume and copy icons */
  margin-top: 8px;
  justify-content: flex-end; /* Pushes them to the right */
  opacity: 0.6;
  transition: opacity 0.3s;
}

/* Make them brighter when you hover over the message */
.message:hover .message-actions {
  opacity: 1;
}

/* Individual icon styling */
.message-actions .icon {
  cursor: pointer;
  font-size: 1.2rem !important;
  user-select: none;
}

.message-actions .icon:hover {
  color: #8ec5fc; /* Changes color to blue-ish on hover */
}
