/**
 * JARVIS SIDE-PANEL STYLES
 *
 * Estilos completos para o side-panel do JARVIS com animações suaves.
 */

/* ========== NOTIFICAÇÕES FLUTUANTES ========== */
.jarvis-notifications {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.jarvis-notification-toast {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 12px 20px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.3s ease-out, pulse 2s infinite;
  max-width: 300px;
}

.notification-icon {
  animation: ringBell 1s ease-in-out infinite;
}

@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes ringBell {
  0%, 100% { transform: rotate(0deg); }
  10%, 30% { transform: rotate(-10deg); }
  20%, 40% { transform: rotate(10deg); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

/* ========== BOTÃO FLUTUANTE ========== */
.jarvis-floating-button {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
}

.jarvis-floating-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(102, 126, 234, 0.6);
}

.jarvis-floating-button.has-notifications {
  animation: bounce 0.5s ease-in-out infinite;
}

.jarvis-avatar {
  font-size: 32px;
}

.jarvis-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ef4444;
  color: white;
  font-size: 12px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
  animation: pulse 1s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ========== SIDE PANEL ========== */
.jarvis-panel {
  position: fixed;
  top: 0;
  right: -450px;
  width: 450px;
  height: 100vh;
  background: white;
  box-shadow: -4px 0 30px rgba(0, 0, 0, 0.1);
  z-index: 9997;
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.jarvis-panel.open {
  right: 0;
}

.jarvis-panel.minimized {
  height: 60px;
}

/* ========== HEADER ========== */
.jarvis-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.jarvis-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.jarvis-avatar-small {
  font-size: 24px;
}

.jarvis-title h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.jarvis-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  opacity: 0.9;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  animation: pulse 2s infinite;
}

.status-dot.online {
  background: #10b981;
}

.status-dot.offline {
  background: #ef4444;
}

.jarvis-actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.icon-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.icon-button.primary {
  background: #667eea;
}

.icon-button.primary:hover {
  background: #5568d3;
}

/* ========== MESSAGES AREA ========== */
.jarvis-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #f9fafb;
}

/* Custom scrollbar */
.jarvis-messages::-webkit-scrollbar {
  width: 6px;
}

.jarvis-messages::-webkit-scrollbar-track {
  background: transparent;
}

.jarvis-messages::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.jarvis-messages::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Welcome Message */
.jarvis-welcome {
  text-align: center;
  padding: 40px 20px;
  color: #6b7280;
}

.welcome-avatar {
  font-size: 64px;
  margin-bottom: 16px;
}

.jarvis-welcome h4 {
  margin: 0 0 8px 0;
  color: #1f2937;
  font-size: 20px;
}

.jarvis-welcome p {
  margin: 0;
  font-size: 14px;
}

/* Message Bubble */
.jarvis-message {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  animation: fadeInUp 0.3s ease-out;
}

.jarvis-message.user {
  flex-direction: row-reverse;
}

.message-avatar {
  font-size: 32px;
  flex-shrink: 0;
}

.message-content {
  max-width: 70%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.message-text {
  background: white;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.5;
}

.jarvis-message.user .message-content {
  align-items: flex-end;
}

.jarvis-message.user .message-text {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.jarvis-message.success .message-text {
  background: #d1fae5;
  color: #065f46;
  border-left: 4px solid #10b981;
}

.jarvis-message.info .message-text {
  background: #dbeafe;
  color: #1e40af;
  border-left: 4px solid #3b82f6;
}

.jarvis-message.proactive .message-text {
  background: #fef3c7;
  color: #92400e;
  border-left: 4px solid #f59e0b;
}

.message-time {
  font-size: 11px;
  color: #9ca3af;
  padding: 0 4px;
}

/* Message Actions */
.message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.action-button {
  background: white;
  border: 1px solid #e5e7eb;
  color: #374151;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.action-button:hover {
  background: #f9fafb;
  border-color: #667eea;
  color: #667eea;
  transform: translateY(-1px);
}

/* Typing Indicator */
.jarvis-message.typing .message-content {
  padding: 12px 16px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.typing-indicator {
  display: flex;
  gap: 4px;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: #9ca3af;
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== ACTION CARDS ========== */
.blocks-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.jarvis-action-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.2s;
}

.jarvis-action-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.jarvis-action-card.priority-critical {
  border-left: 4px solid #ef4444;
}

.jarvis-action-card.priority-medium {
  border-left: 4px solid #f59e0b;
}

.jarvis-action-card.priority-normal {
  border-left: 4px solid #3b82f6;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.priority-icon.critical {
  color: #ef4444;
}

.priority-icon.medium {
  color: #f59e0b;
}

.priority-icon.normal {
  color: #3b82f6;
}

.card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
}

.card-description {
  margin: 0 0 12px 0;
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
}

.card-metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
}

.metadata-item {
  font-size: 12px;
}

.metadata-key {
  color: #9ca3af;
  margin-right: 4px;
}

.metadata-value {
  color: #374151;
  font-weight: 500;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-action-button {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  color: #374151;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.card-action-button:hover {
  background: #667eea;
  border-color: #667eea;
  color: white;
  transform: translateY(-1px);
}

.card-action-button.primary {
  background: #667eea;
  border-color: #667eea;
  color: white;
}

.card-action-button.primary:hover {
  background: #5568d3;
  border-color: #5568d3;
}

/* ========== INPUT AREA ========== */
.jarvis-input-area {
  padding: 16px 20px;
  background: white;
  border-top: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.jarvis-input {
  width: 100%;
  min-height: 44px;
  max-height: 120px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  resize: none;
  transition: all 0.2s;
}

.jarvis-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ========== FILE UPLOAD & OCR STYLES ========== */

/* Drop Zone */
.jarvis-drop-zone {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(102, 126, 234, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.jarvis-drop-zone.drag-over {
  background: rgba(102, 126, 234, 0.98);
  border: 2px dashed white;
}

.drop-zone-content {
  text-align: center;
  color: white;
  pointer-events: none;
}

.drop-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 16px;
  animation: bounce 1s infinite;
}

.drop-zone-content p {
  margin: 8px 0;
  font-size: 16px;
  font-weight: 500;
}

.drop-hint {
  font-size: 13px !important;
  opacity: 0.9;
}

/* File Preview */
.jarvis-file-preview {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #3b82f6;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
  animation: slideInUp 0.3s ease;
}

.file-preview-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.file-icon {
  font-size: 24px;
}

.file-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: #1e40af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-remove-btn {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
}

.file-remove-btn:hover {
  background: #ef4444;
  color: white;
  transform: scale(1.1);
}

/* Processing Status */
.file-processing-status {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 6px;
}

.processing-text {
  font-size: 13px;
  color: #3b82f6;
  font-weight: 500;
}

.processing-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #e5e7eb;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Attachment Message Style */
.jarvis-message.attachment .message-text {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #3b82f6;
  color: #1e40af;
}

/* Error Message Style */
.jarvis-message.error .message-text {
  background: #fee2e2;
  color: #991b1b;
  border-left: 4px solid #ef4444;
}

/* Attachment Button */
#jarvis-attach-btn {
  position: relative;
}

#jarvis-attach-btn:hover {
  transform: scale(1.1) rotate(-15deg);
  transition: all 0.2s ease;
}

/* Markdown-like formatting in messages */
.message-text {
  white-space: pre-wrap;
}

.message-text strong {
  font-weight: 600;
  color: #1f2937;
}

.jarvis-message.user .message-text strong {
  color: white;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .jarvis-panel {
    width: 100%;
    right: -100%;
  }

  .message-content {
    max-width: 85%;
  }

  .drop-icon {
    font-size: 36px;
  }

  .drop-zone-content p {
    font-size: 14px;
  }
}
