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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #050505;
  color: #e5e5e5;
  height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: var(--bg-image, url('/static/bg/all.jpg'));
  background-size: cover;
  background-position: center;
  opacity: 0.07;
  z-index: -1;
  transition: background-image 0.6s ease;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  background: rgba(10,10,10,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  z-index: 10;
}

.header-left h1 {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}

#artist-select {
  background: rgba(255,255,255,0.06);
  color: #e5e5e5;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

#artist-select:hover { background: rgba(255,255,255,0.1); }
#artist-select:focus { border-color: rgba(255,255,255,0.25); }

#chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
}

#messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

#messages::-webkit-scrollbar { width: 6px; }
#messages::-webkit-scrollbar-track { background: transparent; }
#messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

.message { display: flex; gap: 10px; animation: fadeIn 0.3s ease; }
.message.user { justify-content: flex-end; }
.message.bot { justify-content: flex-start; }

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

.bubble {
  max-width: 80%;
  padding: 14px 18px;
  border-radius: 20px;
  font-size: 14px;
  line-height: 1.6;
  word-wrap: break-word;
}

.message.user .bubble {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  border-bottom-right-radius: 6px;
  box-shadow: 0 2px 12px rgba(37,99,235,0.25);
}

.message.bot .bubble {
  background: rgba(255,255,255,0.05);
  color: #e5e5e5;
  border-bottom-left-radius: 6px;
  border: 1px solid rgba(255,255,255,0.07);
  max-width: 90%;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.bubble a { color: #60a5fa; text-decoration: none; transition: color 0.2s; }
.bubble a:hover { color: #93c5fd; text-decoration: underline; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.product-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  border-color: rgba(255,255,255,0.15);
}

.product-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: rgba(255,255,255,0.03);
}

.product-info {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.product-title {
  font-weight: 600;
  font-size: 12px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #f0f0f0;
}

.product-price {
  font-size: 16px;
  font-weight: 700;
  color: #4ade80;
}

.buy-btn {
  display: block;
  text-align: center;
  background: #fff;
  color: #000;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s;
}

.buy-btn:hover { background: #e5e5e5; transform: scale(1.02); text-decoration: none; }

.inline-product-img {
  max-width: 180px;
  border-radius: 10px;
  margin: 6px 0;
  display: block;
}

.section-header {
  display: block;
  font-size: 15px;
  font-weight: 600;
  margin: 10px 0 4px;
}

#upload-btn {
  font-size: 20px;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  transition: background 0.2s;
}

#upload-btn:hover { background: rgba(255,255,255,0.12); }

#image-preview {
  padding: 8px 20px;
  background: rgba(10,10,10,0.85);
  position: relative;
}

#image-preview img {
  max-height: 120px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
}

#remove-img {
  position: absolute;
  top: 4px;
  right: 24px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.2s;
}

#remove-img:hover { background: rgba(255,255,255,0.3); }

#chat-form {
  display: flex;
  gap: 8px;
  padding: 16px 20px;
  background: rgba(10,10,10,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,255,255,0.06);
  align-items: center;
}

#chat-input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  color: #e5e5e5;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 13px 18px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

#chat-input:focus { border-color: rgba(255,255,255,0.25); background: rgba(255,255,255,0.08); }
#chat-input::placeholder { color: rgba(255,255,255,0.3); }

#send-btn {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 13px 24px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

#send-btn:hover { opacity: 0.9; transform: scale(1.02); }
#send-btn:disabled { opacity: 0.3; cursor: not-allowed; transform: none; }

.typing { color: rgba(255,255,255,0.4); font-style: italic; }

@media (max-width: 600px) {
  .bubble { max-width: 92%; }
  .message.bot .bubble { max-width: 95%; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .product-card img { aspect-ratio: 1; }
  header { padding: 12px 16px; }
  #messages { padding: 16px 12px; }
  #chat-form { padding: 12px; }
}
