/* ============================================
   DressMe Style Assistant — Chat Interface
   Inspired by ChatGPT / Gemini
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
  --chat-bg: #1a1a2e;
  --chat-bg-secondary: #16213e;
  --chat-sidebar-bg: rgba(22, 33, 62, 0.95);
  --chat-sidebar-border: rgba(255, 255, 255, 0.06);
  --chat-input-bg: #1e2a47;
  --chat-input-border: rgba(255, 255, 255, 0.1);
  --chat-input-focus: #6c63ff;
  --chat-msg-user: #2d2b55;
  --chat-msg-bot: transparent;
  --chat-text: #e8e8f0;
  --chat-text-muted: #8b8ca7;
  --chat-accent: #6c63ff;
  --chat-accent-hover: #7f78ff;
  --chat-accent-glow: rgba(108, 99, 255, 0.25);
  --chat-danger: #ff6b6b;
  --chat-success: #51cf66;
  --chat-card-bg: rgba(255, 255, 255, 0.04);
  --chat-card-border: rgba(255, 255, 255, 0.08);
  --chat-card-hover: rgba(255, 255, 255, 0.08);
  --chat-radius: 16px;
  --chat-radius-sm: 10px;
  --chat-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Main Layout ---------- */
.chat-app {
  display: flex !important;
  height: 100vh !important;
  width: 100vw !important;
  background: var(--chat-bg);
  border-radius: 0 !important;
  overflow: hidden !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 9999;
}

/* ---------- Sidebar ---------- */
.chat-sidebar {
  width: 280px;
  min-width: 280px;
  background: var(--chat-sidebar-bg);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--chat-sidebar-border);
  display: flex;
  flex-direction: column;
  transition: var(--chat-transition);
  z-index: 10;
}

.sidebar-header {
  padding: 20px 16px;
  border-bottom: 1px solid var(--chat-sidebar-border);
  position: relative;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--chat-text);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.sidebar-brand i {
  font-size: 1.4rem;
  color: var(--chat-accent);
}

.btn-new-chat {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  color: var(--chat-text);
  border-radius: var(--chat-radius-sm);
  cursor: pointer;
  font-size: 0.875rem;
  transition: var(--chat-transition);
}

.btn-new-chat:hover {
  background: var(--chat-accent-glow);
  border-color: var(--chat-accent);
  color: #fff;
}

.btn-sidebar-close {
  display: none;
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--chat-card-border);
  border-radius: 8px;
  background: var(--chat-card-bg);
  color: var(--chat-text-muted);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Conversations List */
.sidebar-conversations {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.sidebar-conversations::-webkit-scrollbar {
  width: 4px;
}

.sidebar-conversations::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-conversations::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.conversation-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  margin-bottom: 2px;
  color: var(--chat-text-muted);
  font-size: 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--chat-transition);
  position: relative;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--chat-text);
}

.conversation-item.active {
  background: var(--chat-accent-glow);
  color: #fff;
}

.conversation-item i {
  margin-right: 10px;
  font-size: 1rem;
  flex-shrink: 0;
}

.conversation-item .conv-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-item .conv-delete {
  opacity: 0;
  flex-shrink: 0;
  padding: 4px;
  color: var(--chat-text-muted);
  transition: var(--chat-transition);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
}

.conversation-item:hover .conv-delete {
  opacity: 1;
}

.conversation-item .conv-delete:hover {
  color: var(--chat-danger);
}

.sidebar-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--chat-text-muted);
  font-size: 0.85rem;
}

.sidebar-empty i {
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
  opacity: 0.4;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--chat-sidebar-border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--chat-text-muted);
  font-size: 0.85rem;
}

.sidebar-user i {
  font-size: 1.2rem;
}

/* Sidebar Toggle Button */
.btn-sidebar-toggle {
  display: none;
  position: static;
  background: var(--chat-input-bg);
  border: 1px solid var(--chat-input-border);
  color: var(--chat-text);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: var(--chat-transition);
}

.btn-sidebar-toggle:hover {
  background: var(--chat-accent-glow);
}

/* ---------- Main Chat Area ---------- */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  min-width: 0;
}

.chat-mobile-header {
  display: flex;
  justify-content: flex-end;
}

.chat-mobile-header .btn-sidebar-toggle {
  display: none;
}

/* ---------- Welcome Screen ---------- */
.chat-welcome {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.welcome-content {
  text-align: center;
  max-width: 600px;
  animation: fadeInUp 0.6s ease-out;
}

.welcome-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  background: linear-gradient(135deg, var(--chat-accent), #a78bfa);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px var(--chat-accent-glow);
}

.welcome-icon i {
  font-size: 2.2rem;
  color: #fff;
}

.welcome-content h1 {
  color: var(--chat-text);
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.welcome-content p {
  color: var(--chat-text-muted);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 32px;
}

.welcome-suggestions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.suggestion-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--chat-card-bg);
  border: 1px solid var(--chat-card-border);
  color: var(--chat-text-muted);
  border-radius: var(--chat-radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  text-align: left;
  transition: var(--chat-transition);
}

.suggestion-chip:hover {
  background: var(--chat-card-hover);
  border-color: var(--chat-accent);
  color: var(--chat-text);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.suggestion-chip i {
  font-size: 1.2rem;
  color: var(--chat-accent);
  flex-shrink: 0;
}

/* ---------- Messages Area ---------- */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 0;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

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

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

/* Individual Message */
.chat-message {
  padding: 20px 24px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  animation: fadeIn 0.4s ease-out;
}

.chat-message-inner {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.chat-message.user-message {
  background: var(--chat-msg-user);
  border-radius: var(--chat-radius);
  margin-bottom: 4px;
}

.chat-message.bot-message {
  background: var(--chat-msg-bot);
  margin-bottom: 4px;
}

/* Avatar */
.msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.9rem;
}

.user-message .msg-avatar {
  background: linear-gradient(135deg, #4f46e5, #6c63ff);
  color: #fff;
}

.bot-message .msg-avatar {
  background: linear-gradient(135deg, #a78bfa, #6c63ff);
  color: #fff;
}

.msg-content {
  flex: 1;
  min-width: 0;
}

.msg-content p {
  color: var(--chat-text);
  font-size: 0.95rem;
  line-height: 1.7;
  margin: 0;
  word-wrap: break-word;
}

.msg-content strong {
  color: #fff;
  font-weight: 600;
}

.msg-time {
  font-size: 0.7rem;
  color: var(--chat-text-muted);
  margin-top: 6px;
  opacity: 0.6;
}

/* ---------- Typing Indicator ---------- */
.typing-indicator {
  padding: 20px 24px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  animation: fadeIn 0.3s ease-out;
}

.typing-indicator .chat-message-inner {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

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

.typing-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--chat-text-muted);
  animation: bounce 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0s;
}

/* ---------- Outfit Cards ---------- */
.outfit-section {
  margin-top: 20px;
}

.outfit-section-title {
  color: var(--chat-text);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.outfit-section-title i {
  color: var(--chat-accent);
}

/* Outfit Group */
.outfit-group {
  background: var(--chat-card-bg);
  border: 1px solid var(--chat-card-border);
  border-radius: var(--chat-radius);
  padding: 20px;
  margin-bottom: 16px;
  transition: var(--chat-transition);
}

.outfit-group:hover {
  border-color: rgba(108, 99, 255, 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.outfit-label {
  font-size: 0.8rem;
  color: var(--chat-accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.outfit-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}

/* Clothing Card */
.clothes-card {
  background: rgba(167, 139, 250, 0.08);
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: var(--chat-radius-sm);
  overflow: hidden;
  transition: var(--chat-transition);
  position: relative;
  cursor: default;
}

.clothes-card:hover {
  transform: translateY(-4px);
  border-color: var(--chat-accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.clothes-card-img {
  width: 100%;
  height: 200px;
  object-fit: contain;
  display: block;
  background: linear-gradient(145deg, rgba(167, 139, 250, 0.12), rgba(99, 102, 241, 0.08));
  padding: 8px;
  transition: var(--chat-transition);
}

.clothes-card:hover .clothes-card-img {
  transform: scale(1.05);
}

.clothes-card-img-wrapper {
  overflow: hidden;
  position: relative;
}

.clothes-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 60%);
  opacity: 0;
  transition: var(--chat-transition);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
}

.clothes-card:hover .clothes-card-overlay {
  opacity: 1;
}

.btn-view-store {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--chat-accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: var(--chat-transition);
  white-space: nowrap;
}

.btn-view-store:hover {
  background: var(--chat-accent-hover);
  transform: scale(1.05);
}

.clothes-card-info {
  padding: 12px;
}

.clothes-card-name {
  color: var(--chat-text);
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clothes-card-type {
  color: var(--chat-text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.clothes-card-price {
  color: var(--chat-accent);
  font-size: 0.85rem;
  font-weight: 700;
}

/* All Items Grid (non-grouped) */
.all-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

/* ---------- Input Area ---------- */
.chat-input-wrapper {
  padding: 16px 24px 20px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.chat-input-form {
  width: 100%;
}

.chat-input-container {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--chat-input-bg);
  border: 1px solid var(--chat-input-border);
  border-radius: var(--chat-radius);
  padding: 8px 8px 8px 20px;
  transition: var(--chat-transition);
}

.chat-input-container:focus-within {
  border-color: var(--chat-accent);
  box-shadow: 0 0 0 3px var(--chat-accent-glow);
}

.chat-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--chat-text);
  font-size: 0.95rem;
  line-height: 1.5;
  resize: none;
  max-height: 120px;
  padding: 8px 0;
  font-family: inherit;
}

.chat-input::placeholder {
  color: var(--chat-text-muted);
}

.btn-send {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: none;
  background: var(--chat-accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: var(--chat-transition);
  flex-shrink: 0;
}

.btn-send:hover:not(:disabled) {
  background: var(--chat-accent-hover);
  transform: scale(1.05);
  box-shadow: 0 4px 16px var(--chat-accent-glow);
}

.btn-send:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.chat-disclaimer {
  text-align: center;
  font-size: 0.72rem;
  color: var(--chat-text-muted);
  margin-top: 8px;
  opacity: 0.6;
}

/* ---------- Overlay ---------- */
.chat-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  z-index: 15;
  backdrop-filter: none;
}

.chat-overlay.active {
  display: block;
}

/* ---------- Confidence Badge ---------- */
.confidence-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 8px;
}

.confidence-badge.high {
  background: rgba(81, 207, 102, 0.15);
  color: var(--chat-success);
}

.confidence-badge.medium {
  background: rgba(255, 193, 7, 0.15);
  color: #ffc107;
}

.confidence-badge.low {
  background: rgba(255, 107, 107, 0.15);
  color: var(--chat-danger);
}

/* ---------- No Image Placeholder ---------- */
.no-image-placeholder {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, rgba(167, 139, 250, 0.12), rgba(99, 102, 241, 0.08));
  color: rgba(167, 139, 250, 0.5);
  font-size: 2rem;
}

/* ---------- Error Message ---------- */
.error-content {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.2);
  border-radius: var(--chat-radius-sm);
  color: var(--chat-danger);
  font-size: 0.9rem;
  margin-top: 8px;
}

/* ---------- Animations ---------- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounce {

  0%,
  80%,
  100% {
    transform: scale(0);
  }

  40% {
    transform: scale(1);
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .chat-sidebar {
    position: fixed;
    left: -300px;
    top: 0;
    bottom: 0;
    z-index: 30;
    transition: left var(--chat-transition);
    backdrop-filter: none;
    background: #16213e;
  }

  .chat-sidebar.open {
    left: 0;
  }

  .chat-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px 8px;
    position: sticky;
    top: 0;
    z-index: 60;
    background: var(--chat-bg);
    border-bottom: 1px solid var(--chat-sidebar-border);
  }

  .btn-sidebar-toggle {
    display: inline-flex !important;
    z-index: auto;
    flex-shrink: 0;
  }

  .chat-mobile-header .btn-sidebar-toggle {
    display: inline-flex !important;
  }

  .chat-mobile-header .lang-switcher {
    position: relative;
    top: auto;
    right: auto;
    z-index: 70;
    margin-left: auto;
  }

  .btn-sidebar-close {
    display: inline-flex;
  }

  .welcome-suggestions {
    grid-template-columns: 1fr;
  }

  .chat-message {
    padding: 14px 16px;
  }

  .chat-input-wrapper {
    padding: 12px 16px 16px;
  }

  .outfit-items-grid,
  .all-items-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .chat-app {
    height: calc(100vh - 56px);
    border-radius: 0;
  }
}

@media (max-width: 480px) {

  .outfit-items-grid,
  .all-items-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Language Switcher ---------- */
.lang-switcher {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 50;
}

.lang-switcher-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: var(--chat-card-bg);
  border: 1px solid var(--chat-card-border);
  color: var(--chat-text-muted);
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: var(--chat-transition);
  letter-spacing: 0.04em;
}

.lang-switcher-btn:hover,
.lang-switcher-btn.active {
  background: var(--chat-accent-glow);
  border-color: var(--chat-accent);
  color: #fff;
}

.lang-current {
  font-weight: 700;
  font-size: 0.78rem;
}

.lang-chevron {
  font-size: 0.75rem;
  transition: transform 0.25s ease;
}

.lang-switcher-btn.active .lang-chevron {
  transform: rotate(180deg);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #1e2a47;
  border: 1px solid var(--chat-card-border);
  border-radius: 12px;
  overflow: hidden;
  min-width: 160px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.lang-dropdown.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--chat-text-muted);
  font-size: 0.85rem;
  text-decoration: none;
  transition: var(--chat-transition);
}

.lang-option:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--chat-text);
}

.lang-option.active {
  background: var(--chat-accent-glow);
  color: var(--chat-accent);
  font-weight: 600;
}

.lang-flag {
  font-size: 1.1rem;
}

/* ---------- Usage Badge ---------- */
.usage-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 7px 10px;
  background: var(--chat-card-bg);
  border: 1px solid var(--chat-card-border);
  border-radius: 8px;
  font-size: 0.75rem;
  color: var(--chat-text-muted);
  transition: var(--chat-transition);
}

.usage-badge i {
  font-size: 0.95rem;
  flex-shrink: 0;
}

.usage-badge.usage-warning {
  border-color: rgba(255, 193, 7, 0.3);
  color: #ffc107;
  background: rgba(255, 193, 7, 0.07);
}

.usage-badge.usage-danger {
  border-color: rgba(255, 107, 107, 0.3);
  color: var(--chat-danger);
  background: rgba(255, 107, 107, 0.07);
}

/* ---------- Sidebar Auth Links ---------- */
.sidebar-auth-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-auth-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--chat-transition);
  border: 1px solid var(--chat-card-border);
  color: var(--chat-text-muted);
  background: var(--chat-card-bg);
}

.sidebar-auth-btn:hover {
  background: var(--chat-card-hover);
  color: var(--chat-text);
  border-color: var(--chat-accent);
}

.sidebar-auth-btn--register {
  background: var(--chat-accent-glow);
  border-color: rgba(108, 99, 255, 0.4);
  color: var(--chat-accent);
}

.sidebar-auth-btn--register:hover {
  background: var(--chat-accent);
  color: #fff;
}

/* ---------- Sidebar logout link ---------- */
.sidebar-logout-link {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  color: var(--chat-text-muted);
  text-decoration: none;
  transition: var(--chat-transition);
}

.sidebar-logout-link:hover {
  background: rgba(255, 107, 107, 0.1);
  color: var(--chat-danger);
}

.sidebar-buy-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  padding: 9px 12px;
  border: 1px solid rgba(0, 156, 222, 0.35);
  border-radius: 9px;
  background: rgba(0, 156, 222, 0.15);
  color: #a8dfff;
  font-size: 0.83rem;
  cursor: pointer;
  transition: var(--chat-transition);
}

.sidebar-buy-btn:hover {
  background: rgba(0, 156, 222, 0.28);
  border-color: rgba(0, 156, 222, 0.6);
  color: #fff;
}

.sidebar-username {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Limit Reached Message ---------- */
.limit-reached-content {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--chat-radius-sm);
  color: #f59e0b;
  font-size: 0.9rem;
  margin-top: 8px;
}

/* ---------- Guest Notice ---------- */
.sidebar-guest-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(108, 99, 255, 0.08);
  border: 1px solid rgba(108, 99, 255, 0.2);
  border-radius: 8px;
  color: var(--chat-text-muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

.sidebar-guest-notice i {
  color: var(--chat-accent);
  flex-shrink: 0;
  font-size: 1rem;
}

/* ---------- Outfit unavailable (old messages) ---------- */
.outfit-unavailable {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(167, 139, 250, 0.07);
  border: 1px dashed rgba(167, 139, 250, 0.25);
  border-radius: 8px;
  color: var(--chat-text-muted);
  font-size: 0.82rem;
  font-style: italic;
}

/* ---------- Buy Modal ---------- */
.chat-buy-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none;
}

.chat-buy-modal.open {
  display: block;
}

.chat-buy-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.chat-buy-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 28px));
  background: #1a2541;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.45);
}

.chat-buy-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--chat-card-border);
  background: var(--chat-card-bg);
  color: var(--chat-text-muted);
  cursor: pointer;
}

.chat-buy-dialog h3 {
  color: var(--chat-text);
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.chat-buy-subtitle {
  color: var(--chat-text-muted);
  margin: 0 0 18px;
  font-size: 0.9rem;
}

.chat-buy-packages {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.chat-buy-card {
  border: 1px solid var(--chat-card-border);
  border-radius: 12px;
  background: var(--chat-card-bg);
  padding: 14px;
}

.chat-buy-messages {
  color: var(--chat-text);
  font-size: 1rem;
  font-weight: 700;
}

.chat-buy-price {
  color: #80d4ff;
  font-size: 1.2rem;
  font-weight: 800;
  margin-top: 4px;
}

.chat-buy-action {
  width: 100%;
  margin-top: 12px;
  padding: 9px 10px;
  border: 1px solid rgba(0, 156, 222, 0.45);
  border-radius: 9px;
  background: rgba(0, 156, 222, 0.2);
  color: #b8e8ff;
  cursor: pointer;
  transition: var(--chat-transition);
  font-weight: 600;
}

.chat-buy-action:hover {
  background: rgba(0, 156, 222, 0.34);
  color: #fff;
}

.chat-buy-action:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

@media (max-width: 680px) {
  .chat-buy-packages {
    grid-template-columns: 1fr;
  }
}
