/* E2EE Component Styles */
/* Following Cookbook Domain-Driven OOP pattern */

.e2ee-component {
  /* Container styles - intentionally minimal for parent customization */
  position: relative;
}

.e2ee-status {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #6c757d;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.e2ee-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(108, 117, 125, 0.1);
  transition: all 0.3s ease;
  opacity: 0.9;
}

.e2ee-indicator.soft-glow {
  box-shadow: 0 0 10px rgba(72, 187, 120, 0.5);
  opacity: 1;
}

.e2ee-component.e2ee-connected .e2ee-indicator {
  background: rgba(72, 187, 120, 0.1);
  color: #48bb78;
}

.e2ee-component.e2ee-connecting .e2ee-indicator {
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
}

.e2ee-component.e2ee-error .e2ee-indicator {
  background: rgba(245, 101, 101, 0.1);
  color: #f56565;
}

.e2ee-component.e2ee-disabled .e2ee-indicator {
  background: rgba(160, 174, 192, 0.1);
  color: #a0aec0;
}

.e2ee-status-text {
  font-weight: 500;
  transition: color 0.2s ease;
}

.e2ee-component.e2ee-connected .e2ee-status-text {
  color: #48bb78;
}

.e2ee-component.e2ee-connecting .e2ee-status-text {
  color: #667eea;
}

.e2ee-component.e2ee-error .e2ee-status-text {
  color: #f56565;
}

.e2ee-component.e2ee-disabled .e2ee-status-text {
  color: #a0aec0;
}

.e2ee-controls {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
}

.e2ee-toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  justify-content: center;
}

.e2ee-toggle-btn:hover {
  background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.e2ee-toggle-btn:active {
  transform: translateY(0);
}

.e2ee-toggle-btn i {
  font-size: 16px;
}

.e2ee-info {
  margin-top: 8px;
  text-align: center;
}

.e2ee-info small {
  color: #718096;
  font-size: 12px;
}

/* E2EE Notifications */
.e2ee-notification {
  position: absolute;
  bottom: 100%;
  left: 20px;
  right: 20px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  animation: e2ee-slide-up 0.3s ease;
  z-index: 1000;
  pointer-events: none;
}

.e2ee-notification.e2ee-success {
  background: rgba(72, 187, 120, 0.95);
  color: white;
  border: 1px solid rgba(72, 187, 120, 0.3);
}

.e2ee-notification.e2ee-error {
  background: rgba(245, 101, 101, 0.95);
  color: white;
  border: 1px solid rgba(245, 101, 101, 0.3);
}

.e2ee-notification.e2ee-warning {
  background: rgba(237, 137, 54, 0.95);
  color: white;
  border: 1px solid rgba(237, 137, 54, 0.3);
}

.e2ee-notification.e2ee-info {
  background: rgba(102, 126, 234, 0.95);
  color: white;
  border: 1px solid rgba(102, 126, 234, 0.3);
}

.e2ee-notification i {
  font-size: 16px;
  flex-shrink: 0;
}

/* Message E2EE Indicators */
.message-e2ee-indicator {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 10;
  pointer-events: none;
}

.message-e2ee-encrypting {
  background: rgba(237, 137, 54, 0.9); /* Orange for encrypting */
  color: white;
  animation: e2ee-spin 1s linear infinite;
}

.message-e2ee-encrypted {
  background: rgba(102, 126, 234, 0.9); /* Blue for encrypted */
  color: white;
}

.message-e2ee-decrypting {
  background: rgba(237, 137, 54, 0.9); /* Orange for decrypting */
  color: white;
  animation: e2ee-pulse 1s ease-in-out infinite;
}

.message-e2ee-decrypted {
  background: rgba(72, 187, 120, 0.9); /* Green for decrypted */
  color: white;
}

.message-e2ee-failed {
  background: rgba(245, 101, 101, 0.9); /* Red for failed */
  color: white;
}

.message-e2ee-unavailable {
  background: rgba(160, 174, 192, 0.9); /* Gray for unavailable */
  color: white;
}

/* Animations */
@keyframes e2ee-slide-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .e2ee-status {
    font-size: 13px;
  }

  .e2ee-indicator {
    width: 18px;
    height: 18px;
  }

  .e2ee-toggle-btn {
    padding: 10px 16px;
    font-size: 14px;
  }

  .e2ee-notification {
    left: 16px;
    right: 16px;
    padding: 10px 14px;
    font-size: 13px;
  }

  .message-e2ee-indicator {
    width: 18px;
    height: 18px;
    font-size: 11px;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .e2ee-status-text {
    color: #e2e8f0;
  }

  .e2ee-indicator {
    background: rgba(113, 128, 150, 0.1);
  }

  .e2ee-controls {
    background: rgba(45, 55, 72, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
  }

  .e2ee-info small {
    color: #a0aec0;
  }

  .message-e2ee-indicator {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  }
}

/* Integration helpers for parent components */
.e2ee-component-inline {
  display: inline-block;
  margin: 0 8px;
}

.e2ee-component-compact .e2ee-status {
  margin-bottom: 0;
}

.e2ee-component-compact .e2ee-controls {
  padding: 8px;
}

.e2ee-component-hidden {
  display: none !important;
}

/* Loading states */
.e2ee-component.loading .e2ee-toggle-btn {
  opacity: 0.7;
  pointer-events: none;
}

.e2ee-component.loading .e2ee-toggle-btn i.fa-spinner {
  animation: e2ee-spin 1s linear infinite;
}

@keyframes e2ee-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes e2ee-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ===== SOLIUS SEEDS STYLES ===== */

.seed-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.seed-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  font-size: 12px;
  transition: all 0.2s ease;
}

.seed-indicator i {
  font-size: 10px;
}

.seed-status-text {
  font-weight: 500;
  transition: color 0.2s ease;
}

/* ===== SOFT TOASTS ===== */

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: linear-gradient(135deg, #0070f3 0%, #1e40af 100%);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  opacity: 0.95;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateY(10px);
  z-index: 1000;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 112, 243, 0.2);
}

.toast.show {
  transform: translateY(0);
}

/* ===== SOFT INDICATOR ===== */

.e2ee-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(108, 117, 125, 0.1);
  transition: all 0.3s ease;
  opacity: 0.9;
}

.e2ee-indicator.soft-glow {
  box-shadow: 0 0 10px rgba(72, 187, 120, 0.5);
  opacity: 1;
}

.e2ee-component.e2ee-connected .e2ee-indicator {
  background: linear-gradient(to right, #0070f3, #1e40af);
  color: white;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-family: 'Geist', sans-serif;
  opacity: 0.95;
  transition: opacity 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 112, 243, 0.2);
}

.e2ee-component.e2ee-connected .e2ee-indicator:hover {
  opacity: 1;
  box-shadow: 0 4px 12px rgba(0, 112, 243, 0.3);
}

.lock-icon {
  margin-right: 5px;
  font-size: 16px;
  opacity: 0.9;
}

/* ===== SEED PROMPT BUBBLE ===== */

.seed-prompt-bubble {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  border-radius: 16px;
  padding: 16px 20px;
  margin: 12px 16px;
  box-shadow: 0 8px 32px rgba(79, 70, 229, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: bubble-slide-in 0.4s ease-out;
  position: relative;
}

.seed-prompt-bubble::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 24px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid rgba(79, 70, 229, 0.9);
}

.bubble-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.bubble-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.bubble-text {
  color: white;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  flex: 1;
  min-width: 200px;
}

.bubble-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.commit-btn {
  background: white;
  color: #4f46e5;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.commit-btn:hover {
  background: #f8fafc;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dismiss-btn {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dismiss-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

@keyframes bubble-slide-in {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}


/* Responsive adjustments */
@media (max-width: 768px) {
  .seed-prompt-bubble {
    margin: 8px 12px;
    padding: 12px 16px;
  }

  .bubble-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .bubble-text {
    font-size: 13px;
    min-width: auto;
  }

  .bubble-actions {
    width: 100%;
    justify-content: flex-end;
  }
}
