/* AI Analysis Panel Styles */

/* Placeholder for AI Analysis Panel Image */
.ai-analysis-panel-placeholder {
  width: 300px;
  height: 220px;
  background: var(--card-bg, rgba(26, 26, 26, 0.8));
  border: 2px solid var(--border-color, rgba(168, 85, 247, 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-analysis-panel-placeholder::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.15), transparent);
  animation: shimmer 3.5s infinite;
}

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

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

.ai-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
  animation: aiPulse 3s ease-in-out infinite;
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-icon:nth-child(2) {
  animation-delay: 1s;
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.ai-icon:nth-child(3) {
  animation-delay: 2s;
  background: linear-gradient(135deg, #c084fc 0%, #9333ea 100%);
  box-shadow: 0 4px 15px rgba(192, 132, 252, 0.3);
}

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

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

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

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

.ai-metric {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 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;
}

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

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

.ai-metric:hover {
  transform: translateY(-2px);
  background: rgba(168, 85, 247, 0.25);
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.2);
}

.ai-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;
}

.ai-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;
}

/* AI thinking animation */
.ai-thinking {
  position: absolute;
  width: 8px;
  height: 8px;
  background: rgba(168, 85, 247, 0.8);
  border-radius: 50%;
  animation: aiThinking 2s ease-in-out infinite;
}

.thinking-1 {
  top: 35%;
  left: 20%;
  animation-delay: 0s;
}

.thinking-2 {
  top: 35%;
  left: 30%;
  animation-delay: 0.3s;
}

.thinking-3 {
  top: 35%;
  left: 40%;
  animation-delay: 0.6s;
}

.thinking-4 {
  top: 55%;
  right: 25%;
  animation-delay: 0.9s;
  background: rgba(139, 92, 246, 0.8);
}

.thinking-5 {
  top: 55%;
  right: 35%;
  animation-delay: 1.2s;
  background: rgba(139, 92, 246, 0.8);
}

.thinking-6 {
  top: 55%;
  right: 45%;
  animation-delay: 1.5s;
  background: rgba(139, 92, 246, 0.8);
}

/* Neural network lines */
.neural-line {
  position: absolute;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.4), transparent);
  animation: neuralPulse 3s ease-in-out infinite;
}

.line-1 {
  top: 40%;
  left: 15%;
  width: 30%;
  animation-delay: 0s;
}

.line-2 {
  top: 60%;
  right: 20%;
  width: 35%;
  animation-delay: 1s;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.4), transparent);
}

.line-3 {
  top: 50%;
  left: 50%;
  width: 25%;
  animation-delay: 2s;
  background: linear-gradient(90deg, transparent, rgba(192, 132, 252, 0.4), transparent);
}

/* Hide animations on very small screens to reduce clutter */
@media (max-width: 480px) {
  .ai-thinking,
  .neural-line {
    display: none;
  }
}

@keyframes aiThinking {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

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

@keyframes aiPulse {
  0%, 100% { 
    transform: scale(1);
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
  }
  33% { 
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5);
  }
  66% { 
    transform: scale(0.98);
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
  }
}

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

/* Light mode adjustments */
html.light .ai-analysis-panel-placeholder,
[data-theme="light"] .ai-analysis-panel-placeholder {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(168, 85, 247, 0.2);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

html.light .ai-analysis-panel-placeholder:hover,
[data-theme="light"] .ai-analysis-panel-placeholder:hover {
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(168, 85, 247, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

html.light .ai-metric,
[data-theme="light"] .ai-metric {
  background: rgba(168, 85, 247, 0.08);
  border-color: rgba(168, 85, 247, 0.15);
}

html.light .ai-metric:hover,
[data-theme="light"] .ai-metric:hover {
  background: rgba(168, 85, 247, 0.12);
  border-color: rgba(168, 85, 247, 0.25);
}

html.light .ai-title,
[data-theme="light"] .ai-title {
  color: var(--text-color, #0f172a);
}

html.light .ai-subtitle,
[data-theme="light"] .ai-subtitle {
  color: var(--secondary-text, #475569);
}

html.light .ai-metric-number,
[data-theme="light"] .ai-metric-number {
  color: var(--text-color, #0f172a);
}

html.light .ai-metric-label,
[data-theme="light"] .ai-metric-label {
  color: var(--secondary-text, #64748b);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .ai-analysis-panel-placeholder {
    width: 280px;
    height: 200px;
  }
  
  .ai-icon {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }
  
  .ai-title {
    font-size: 0.95rem;
  }
  
  .ai-subtitle {
    font-size: 0.75rem;
  }
}

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

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

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

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

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  .ai-analysis-panel-placeholder,
  .ai-icon,
  .ai-thinking,
  .neural-line {
    animation: none !important;
  }
  
  .ai-analysis-panel-placeholder:hover,
  .ai-icon:hover {
    transform: none !important;
  }
}

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