/* AI Chat Panel Styles */

.ai-chat-panel-placeholder {
  width: 300px;
  height: 220px;
  background: var(--card-bg, rgba(26, 26, 26, 0.8));
  border: 2px solid var(--border-color, rgba(236, 72, 153, 0.2));
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  padding: 1rem;
}

.ai-chat-panel-placeholder::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(236, 72, 153, 0.15), transparent);
  animation: shimmer 3.2s infinite;
}

.ai-chat-panel-placeholder:hover {
  transform: scale(1.05) rotate(-0.5deg);
  border-color: rgba(236, 72, 153, 0.4);
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(236, 72, 153, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.chat-icon-container {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  align-items: center;
  margin-top: 0.5rem;
}

.chat-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
  animation: chatBounce 2.8s ease-in-out infinite;
  box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-icon:nth-child(2) {
  animation-delay: 0.9s;
  background: linear-gradient(135deg, #f472b6 0%, #ec4899 100%);
  box-shadow: 0 4px 15px rgba(244, 114, 182, 0.3);
}

.chat-icon:nth-child(3) {
  animation-delay: 1.8s;
  background: linear-gradient(135deg, #f9a8d4 0%, #f472b6 100%);
  box-shadow: 0 4px 15px rgba(249, 168, 212, 0.3);
}

.chat-icon:hover {
  transform: scale(1.1) rotate(-10deg);
}

.chat-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-color, #ffffff);
  text-align: center;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.chat-subtitle {
  font-size: 0.8rem;
  color: var(--secondary-text, #a1a1aa);
  text-align: center;
  opacity: 0.8;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.chat-metrics {
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
  right: 0.75rem;
  display: flex;
  justify-content: space-between;
  gap: 0.375rem;
}

.chat-metric {
  background: rgba(236, 72, 153, 0.15);
  border: 1px solid rgba(236, 72, 153, 0.25);
  border-radius: 8px;
  padding: 0.3rem 0.5rem;
  text-align: center;
  flex: 1;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  min-width: 0;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.chat-metric::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(236, 72, 153, 0.1), transparent);
  transition: left 0.5s ease;
}

.chat-metric:hover::before {
  left: 100%;
}

.chat-metric:hover {
  transform: translateY(-2px);
  background: rgba(236, 72, 153, 0.25);
  border-color: rgba(236, 72, 153, 0.4);
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.2);
}

.chat-metric-number {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-color, #ffffff);
  display: block;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-metric-label {
  font-size: 0.55rem;
  color: var(--secondary-text, #71717a);
  margin-top: 0.125rem;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-message {
  position: absolute;
  height: 8px;
  background: rgba(236, 72, 153, 0.7);
  border-radius: 4px;
  animation: messageSlide 3.5s ease-in-out infinite;
}

.message-1 {
  width: 40px;
  top: 30%;
  left: 12%;
  animation-delay: 0s;
}

.message-2 {
  width: 50px;
  top: 42%;
  right: 15%;
  animation-delay: 0.8s;
  background: rgba(244, 114, 182, 0.7);
}

.message-3 {
  width: 35px;
  top: 54%;
  left: 18%;
  animation-delay: 1.6s;
  background: rgba(249, 168, 212, 0.7);
}

.message-4 {
  width: 45px;
  top: 66%;
  right: 20%;
  animation-delay: 2.4s;
  background: rgba(236, 72, 153, 0.6);
}

.typing-indicator {
  position: absolute;
  width: 6px;
  height: 6px;
  background: rgba(236, 72, 153, 0.9);
  border-radius: 50%;
  animation: typingDot 1.4s ease-in-out infinite;
}

.indicator-1 {
  top: 38%;
  left: 25%;
  animation-delay: 0s;
}

.indicator-2 {
  top: 38%;
  left: 30%;
  animation-delay: 0.2s;
}

.indicator-3 {
  top: 38%;
  left: 35%;
  animation-delay: 0.4s;
}

.conversation-line {
  position: absolute;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(236, 72, 153, 0.5), transparent);
  animation: conversationFlow 3s ease-in-out infinite;
}

.line-1 {
  width: 35%;
  top: 35%;
  left: 10%;
  animation-delay: 0s;
}

.line-2 {
  width: 40%;
  top: 50%;
  right: 12%;
  animation-delay: 1s;
  background: linear-gradient(90deg, transparent, rgba(244, 114, 182, 0.5), transparent);
}

.line-3 {
  width: 30%;
  top: 65%;
  left: 15%;
  animation-delay: 2s;
  background: linear-gradient(90deg, transparent, rgba(249, 168, 212, 0.5), transparent);
}

@media (max-width: 480px) {
  .chat-message,
  .typing-indicator,
  .conversation-line {
    display: none;
  }
}

@keyframes messageSlide {
  0%, 100% {
    opacity: 0.3;
    transform: translateX(-5px);
  }
  50% {
    opacity: 1;
    transform: translateX(5px);
  }
}

@keyframes typingDot {
  0%, 60%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  30% {
    opacity: 1;
    transform: scale(1.2);
  }
}

@keyframes conversationFlow {
  0%, 100% {
    opacity: 0.2;
  }
  50% {
    opacity: 0.8;
  }
}

@keyframes chatBounce {
  0%, 100% { 
    transform: scale(1) translateY(0);
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3);
  }
  25% { 
    transform: scale(1.05) translateY(-3px);
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.5);
  }
  50% { 
    transform: scale(1) translateY(0);
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3);
  }
  75% { 
    transform: scale(0.98) translateY(2px);
    box-shadow: 0 3px 12px rgba(236, 72, 153, 0.25);
  }
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

html.light .ai-chat-panel-placeholder,
[data-theme="light"] .ai-chat-panel-placeholder {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(236, 72, 153, 0.2);
}

html.light .chat-metric,
[data-theme="light"] .chat-metric {
  background: rgba(236, 72, 153, 0.08);
  border-color: rgba(236, 72, 153, 0.15);
}

@media (max-width: 1024px) {
  .ai-chat-panel-placeholder {
    width: 280px;
    height: 200px;
  }
  .chat-icon {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }
}

@media (max-width: 768px) {
  .ai-chat-panel-placeholder {
    width: 100%;
    max-width: 320px;
    height: 180px;
    padding: 0.75rem;
    margin: 0 auto;
  }
  
  .chat-icon-container {
    gap: 0.5rem;
    margin-bottom: 0.5rem;
  }
  
  .chat-icon {
    width: 32px;
    height: 32px;
    font-size: 1rem;
    border-radius: 8px;
  }
  
  .chat-title {
    font-size: 0.9rem;
    margin-bottom: 0.375rem;
  }
  
  .chat-subtitle {
    font-size: 0.7rem;
    margin-bottom: 0.75rem;
  }
  
  .chat-metric {
    padding: 0.2rem 0.3rem;
    border-radius: 6px;
  }
  
  .chat-metric-number {
    font-size: 0.7rem;
  }
  
  .chat-metric-label {
    font-size: 0.5rem;
  }
}

@media (max-width: 640px) {
  .ai-chat-panel-placeholder {
    width: 100%;
    max-width: 280px;
    height: 160px;
    padding: 0.625rem;
    margin: 0 auto;
  }
  
  .chat-icon-container {
    gap: 0.375rem;
    margin-bottom: 0.375rem;
    margin-top: 0.25rem;
  }
  
  .chat-icon {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
    border-radius: 6px;
  }
  
  .chat-title {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
  }
  
  .chat-subtitle {
    font-size: 0.65rem;
    margin-bottom: 0.5rem;
  }
  
  .chat-metric {
    padding: 0.15rem 0.3rem;
  }
  
  .chat-metric-number {
    font-size: 0.65rem;
  }
  
  .chat-metric-label {
    font-size: 0.45rem;
  }
}

@media (max-width: 480px) {
  .ai-chat-panel-placeholder {
    width: 100%;
    max-width: 260px;
    height: 140px;
    padding: 0.5rem;
    margin: 0 auto;
  }
  
  .chat-icon-container {
    gap: 0.25rem;
    margin-bottom: 0.25rem;
    margin-top: 0.125rem;
  }
  
  .chat-icon {
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
    border-radius: 4px;
  }
  
  .chat-title {
    font-size: 0.8rem;
    margin-bottom: 0.2rem;
  }
  
  .chat-subtitle {
    font-size: 0.6rem;
    margin-bottom: 0.375rem;
  }
  
  .chat-metric {
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
  }
  
  .chat-metric-number {
    font-size: 0.6rem;
  }
  
  .chat-metric-label {
    font-size: 0.4rem;
  }
}

@media (max-width: 360px) {
  .ai-chat-panel-placeholder {
    width: 100%;
    max-width: 240px;
    height: 120px;
    padding: 0.375rem;
    margin: 0 auto;
  }
  
  .chat-icon-container {
    gap: 0.2rem;
    margin-bottom: 0.2rem;
  }
  
  .chat-icon {
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
  }
  
  .chat-title {
    font-size: 0.75rem;
    margin-bottom: 0.15rem;
  }
  
  .chat-subtitle {
    font-size: 0.55rem;
    margin-bottom: 0.25rem;
  }
  
  .chat-metric {
    padding: 0.1rem 0.2rem;
  }
  
  .chat-metric-number {
    font-size: 0.55rem;
  }
  
  .chat-metric-label {
    font-size: 0.35rem;
  }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  .ai-chat-panel-placeholder,
  .chat-icon,
  .chat-message,
  .typing-indicator,
  .conversation-line {
    animation: none !important;
  }
  
  .ai-chat-panel-placeholder:hover,
  .chat-icon:hover {
    transform: none !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .ai-chat-panel-placeholder {
    border-width: 3px;
    box-shadow: none;
  }
  
  .chat-metric {
    border-width: 2px;
  }
}
