/* DEVXSEC AI Bot - Styles */
#devxsec-bot-root {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999999 !important;
  font-family: system-ui, -apple-system, sans-serif;
  pointer-events: auto;
  visibility: visible !important;
  display: block !important;
}

.dx-bot-fab {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(145deg, #0f172a, #1e293b);
  border: 2px solid #22d3ee;
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.4), 0 8px 32px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  outline: none;
  z-index: 999999 !important;
  visibility: visible !important;
}

.dx-bot-fab:hover,
.dx-bot-fab:focus {
  transform: scale(1.08);
  box-shadow: 0 0 30px rgba(34, 211, 238, 0.7);
}

.dx-bot-fab img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  pointer-events: none;
}

.dx-bot-fab.listening {
  animation: pulse-cyan 1.5s infinite;
}

.dx-bot-fab.speaking {
  animation: pulse-cyan 0.8s infinite;
}

@keyframes pulse-cyan {
  0%, 100% {
    box-shadow: 0 0 15px rgba(34, 211, 238, 0.5);
  }
  50% {
    box-shadow: 0 0 35px rgba(34, 211, 238, 0.9);
  }
}

.dx-chat-window {
  position: absolute;
  bottom: 90px;
  right: 0;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 520px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(34, 211, 238, 0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.dx-chat-window.open {
  display: flex;
  animation: slideUp 0.3s ease-out;
}

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

.dx-header {
  padding: 16px 20px;
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.15), transparent);
  border-bottom: 1px solid rgba(34, 211, 238, 0.2);
  display: flex;
  align-items: center;
  gap: 12px;
}

.dx-header img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.dx-header-text {
  flex: 1;
}

.dx-header h3 {
  margin: 0;
  color: #e0f2fe;
  font-size: 16px;
  font-weight: 600;
}

.dx-header span {
  font-size: 12px;
  color: #67e8f9;
  display: block;
  margin-top: 2px;
}

.dx-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(34, 211, 238, 0.3) transparent;
}

.dx-messages::-webkit-scrollbar {
  width: 6px;
}

.dx-messages::-webkit-scrollbar-track {
  background: transparent;
}

.dx-messages::-webkit-scrollbar-thumb {
  background: rgba(34, 211, 238, 0.3);
  border-radius: 3px;
}

.dx-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(34, 211, 238, 0.5);
}

.dx-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  word-wrap: break-word;
}

.dx-msg.user {
  align-self: flex-end;
  background: rgba(34, 211, 238, 0.2);
  color: #e0f2fe;
  border-bottom-right-radius: 4px;
}

.dx-msg.bot {
  align-self: flex-start;
  background: rgba(30, 41, 59, 0.8);
  color: #f1f5f9;
  border-bottom-left-radius: 4px;
}

.dx-input-area {
  padding: 12px 16px;
  border-top: 1px solid rgba(34, 211, 238, 0.2);
  display: flex;
  gap: 8px;
  align-items: center;
  background: rgba(15, 23, 42, 0.5);
}

.dx-input-area input {
  flex: 1;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: 12px;
  padding: 10px 14px;
  color: #e0f2fe;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
}

.dx-input-area input::placeholder {
  color: rgba(224, 242, 254, 0.5);
}

.dx-input-area input:focus {
  border-color: #22d3ee;
  background: rgba(15, 23, 42, 0.8);
}

.dx-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: none;
  background: rgba(34, 211, 238, 0.15);
  color: #22d3ee;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  font-size: 18px;
  outline: none;
}

.dx-btn:hover {
  background: rgba(34, 211, 238, 0.3);
}

.dx-btn:active {
  transform: scale(0.95);
}

.dx-btn.active {
  background: #22d3ee;
  color: #0f172a;
}

.dx-status {
  font-size: 11px;
  color: #67e8f9;
  padding: 0 16px 8px;
  min-height: 16px;
}

/* Responsive design */
@media (max-width: 480px) {
  #devxsec-bot-root {
    bottom: 16px;
    right: 16px;
  }

  .dx-chat-window {
    width: calc(100vw - 32px);
    height: calc(100vh - 100px);
    max-height: 600px;
  }

  .dx-bot-fab {
    width: 64px;
    height: 64px;
  }

  .dx-bot-fab img {
    width: 52px;
    height: 52px;
  }

  .dx-header h3 {
    font-size: 14px;
  }

  .dx-msg {
    max-width: 90%;
    font-size: 13px;
  }
}

/* Accessibility */
.dx-bot-fab:focus {
  outline: 2px solid rgba(34, 211, 238, 0.8);
  outline-offset: 2px;
}

.dx-btn:focus {
  outline: 2px solid rgba(34, 211, 238, 0.8);
  outline-offset: -2px;
}

.dx-input-area input:focus {
  outline: 2px solid rgba(34, 211, 238, 0.8);
  outline-offset: -2px;
}
