/* Chat Background Styles */
.chat-background-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  pointer-events: none;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.25;
}

.chat-messages-container {
  position: relative;
  z-index: 1;
}

/* Background Picker Modal */
.background-picker-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.background-picker-modal.show {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.background-picker-content {
  background: white;
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}

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

.background-picker-header {
  padding: 20px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.background-picker-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
}

.background-picker-close {
  background: none;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  transition: all 0.2s;
}

.background-picker-close:hover {
  background: #f3f4f6;
  color: #1f2937;
}

.background-picker-body {
  padding: 20px;
  overflow-y: auto;
}

.background-section {
  margin-bottom: 24px;
}

.background-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.background-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
}

.background-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  cursor: pointer;
  border: 3px solid transparent;
  overflow: hidden;
  transition: all 0.2s;
}

.background-item:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.background-item.active {
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
}

.background-item-preview {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
}

.background-item-check {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  background: #667eea;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 12px;
}

.background-item.active .background-item-check {
  display: flex;
}

/* Solid Colors */
.bg-default {
  background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
}

.bg-blue {
  background: linear-gradient(135deg, #93c5fd 0%, #60a5fa 100%);
}

.bg-purple {
  background: linear-gradient(135deg, #c084fc 0%, #a855f7 100%);
}

.bg-pink {
  background: linear-gradient(135deg, #f9a8d4 0%, #f472b6 100%);
}

.bg-green {
  background: linear-gradient(135deg, #6ee7b7 0%, #34d399 100%);
}

.bg-yellow {
  background: linear-gradient(135deg, #fde047 0%, #facc15 100%);
}

.bg-orange {
  background: linear-gradient(135deg, #fdba74 0%, #fb923c 100%);
}

.bg-red {
  background: linear-gradient(135deg, #fca5a5 0%, #f87171 100%);
}

/* Pattern backgrounds */
.bg-pattern-dots {
  background-color: #e5e7eb;
  background-image: radial-gradient(circle, #9ca3af 2px, transparent 2px);
  background-size: 20px 20px;
}

.bg-pattern-grid {
  background-color: #e5e7eb;
  background-image: linear-gradient(#9ca3af 1.5px, transparent 1.5px),
                    linear-gradient(90deg, #9ca3af 1.5px, transparent 1.5px);
  background-size: 20px 20px;
}

/* Coming soon placeholder */
.background-item-placeholder {
  position: relative;
  background: #f9fafb;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: not-allowed;
  opacity: 0.6;
}

.background-item-placeholder svg {
  width: 24px;
  height: 24px;
  color: #9ca3af;
  margin-bottom: 4px;
}

.background-item-placeholder span {
  font-size: 10px;
  color: #6b7280;
  text-align: center;
}

/* Scrollbar */
.background-picker-body::-webkit-scrollbar {
  width: 6px;
}

.background-picker-body::-webkit-scrollbar-track {
  background: transparent;
}

.background-picker-body::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.background-picker-body::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}
