/* Codex Oracle Chat Widget Styles */
.codex-oracle-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: ui-monospace, "Courier New", monospace;
}

.codex-oracle-toggle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6600 0%, #ffaa00 100%);
  border: 3px solid #ff6600;
  box-shadow: 0 4px 24px rgba(255, 102, 0, 0.4), 0 0 20px rgba(255, 102, 0, 0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  transition: all 0.3s ease;
  animation: glow-pulse 3s ease-in-out infinite;
}

.codex-oracle-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 32px rgba(255, 102, 0, 0.6), 0 0 30px rgba(255, 102, 0, 0.5);
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 4px 24px rgba(255, 102, 0, 0.4), 0 0 20px rgba(255, 102, 0, 0.3); }
  50% { box-shadow: 0 6px 32px rgba(255, 102, 0, 0.6), 0 0 35px rgba(255, 102, 0, 0.5); }
}

.codex-oracle-panel {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 400px;
  max-width: calc(100vw - 48px);
  height: 600px;
  max-height: calc(100vh - 120px);
  background: linear-gradient(135deg, #0b0d10 0%, #16213e 100%);
  border: 3px solid #ff6600;
  border-radius: 18px;
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.8), 0 0 40px rgba(255, 102, 0, 0.2);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.codex-oracle-panel.open {
  display: flex;
  animation: slide-up 0.3s ease-out;
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.codex-oracle-header {
  padding: 16px 20px;
  background: linear-gradient(90deg, #ff6600 0%, #ffaa00 100%);
  color: #000;
  font-weight: bold;
  font-size: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #ff6600;
}

.codex-oracle-close {
  background: none;
  border: none;
  color: #000;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: transform 0.2s;
}

.codex-oracle-close:hover {
  transform: scale(1.2);
}

.codex-oracle-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.codex-oracle-message {
  padding: 12px 16px;
  border-radius: 12px;
  max-width: 85%;
  line-height: 1.5;
  font-size: 14px;
}

.codex-oracle-message.user {
  background: linear-gradient(135deg, #1a1d2e 0%, #252938 100%);
  border: 1px solid #333;
  color: #e7edf3;
  align-self: flex-end;
  margin-left: auto;
}

.codex-oracle-message.assistant {
  background: linear-gradient(135deg, #0f1318 0%, #1a2332 100%);
  border: 1px solid #ff6600;
  color: #e7edf3;
  align-self: flex-start;
}

.codex-oracle-message.assistant a {
  color: #ff6600;
  text-decoration: underline;
}

.codex-oracle-sources {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #333;
  font-size: 12px;
}

.codex-oracle-sources a {
  color: #7cc7ff;
  display: block;
  margin: 4px 0;
  text-decoration: none;
}

.codex-oracle-sources a:hover {
  text-decoration: underline;
}

.codex-oracle-loading {
  padding: 12px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0f1318 0%, #1a2332 100%);
  border: 1px solid #ff6600;
  align-self: flex-start;
  max-width: 85%;
  display: flex;
  gap: 6px;
  align-items: center;
}

.codex-oracle-loading span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff6600;
  animation: bounce 1.4s infinite ease-in-out both;
}

.codex-oracle-loading span:nth-child(1) { animation-delay: -0.32s; }
.codex-oracle-loading span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

.codex-oracle-input-area {
  padding: 16px 20px;
  background: #0b0d10;
  border-top: 2px solid #ff6600;
  display: flex;
  gap: 12px;
}

.codex-oracle-input {
  flex: 1;
  background: #1a1d2e;
  border: 2px solid #333;
  border-radius: 8px;
  padding: 10px 14px;
  color: #e7edf3;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.codex-oracle-input:focus {
  border-color: #ff6600;
}

.codex-oracle-send {
  background: linear-gradient(135deg, #ff6600 0%, #ffaa00 100%);
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  color: #000;
  font-weight: bold;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(255, 102, 0, 0.3);
}

.codex-oracle-send:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(255, 102, 0, 0.5);
}

.codex-oracle-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.codex-oracle-error {
  background: linear-gradient(135deg, #2d1b0f 0%, #3d2b1f 100%);
  border: 2px solid #f59e0b;
  color: #fbbf24;
  padding: 12px 16px;
  border-radius: 12px;
  margin: 12px 0;
  font-size: 13px;
}

/* Mobile responsive */
@media (max-width: 480px) {
  .codex-oracle-widget {
    bottom: 16px;
    right: 16px;
  }
  
  .codex-oracle-panel {
    width: calc(100vw - 32px);
    height: calc(100vh - 120px);
    bottom: 72px;
    right: 0;
  }
  
  .codex-oracle-toggle {
    width: 56px;
    height: 56px;
    font-size: 28px;
  }
}
