/* ===== CIPHER — Blakbox AI Concierge Widget ===== */

/* Keyframes */
@keyframes bx-cipher-breathe {
  0%, 100% { box-shadow: 0 0 20px rgba(0, 212, 170, 0.15), 0 0 40px rgba(0, 212, 170, 0.05); }
  50% { box-shadow: 0 0 24px rgba(0, 212, 170, 0.25), 0 0 56px rgba(0, 212, 170, 0.1); }
}

@keyframes bx-cipher-pulse-ring {
  0% { transform: scale(1); opacity: 0.4; }
  100% { transform: scale(2.2); opacity: 0; }
}

@keyframes bx-cipher-slide-up {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes bx-cipher-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes bx-cipher-dot-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-5px); opacity: 1; }
}

@keyframes bx-cipher-scanline {
  0% { background-position: 0 0; }
  100% { background-position: 0 4px; }
}

@keyframes bx-cipher-glow-border {
  0%, 100% { border-color: rgba(0, 212, 170, 0.12); }
  50% { border-color: rgba(0, 212, 170, 0.25); }
}

/* ===== FLOATING BUTTON ===== */
.bx-cipher-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(0, 212, 170, 0.3);
  background: linear-gradient(145deg, #0E0E18, #080810);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: bx-cipher-breathe 4s ease-in-out infinite;
  transition: transform 0.25s ease, border-color 0.25s ease;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  padding: 0;
}

.bx-cipher-btn:hover {
  transform: scale(1.08);
  border-color: rgba(0, 212, 170, 0.5);
}

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

.bx-cipher-btn svg {
  width: 22px;
  height: 22px;
  color: #00D4AA;
  transition: opacity 0.2s ease;
}

.bx-cipher-btn .bx-cipher-icon-close {
  display: none;
}

.bx-cipher-btn.open .bx-cipher-icon-chat {
  display: none;
}

.bx-cipher-btn.open .bx-cipher-icon-close {
  display: block;
}

/* Pulse ring on idle */
.bx-cipher-btn::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid rgba(0, 212, 170, 0.3);
  animation: bx-cipher-pulse-ring 3s ease-out infinite;
  pointer-events: none;
}

.bx-cipher-btn.open::after {
  display: none;
}

/* ===== CHAT PANEL ===== */
.bx-cipher-panel {
  position: fixed;
  bottom: 88px;
  right: 24px;
  z-index: 9999;
  width: 380px;
  height: 520px;
  max-height: calc(100vh - 120px);
  border-radius: 16px;
  border: 1px solid rgba(0, 212, 170, 0.12);
  background: #0B0B14;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(0, 212, 170, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.02);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: bx-cipher-glow-border 6s ease-in-out infinite;
}

.bx-cipher-panel.open {
  display: flex;
  animation: bx-cipher-slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards,
             bx-cipher-glow-border 6s ease-in-out infinite;
}

/* Subtle scanline overlay */
.bx-cipher-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 212, 170, 0.008) 2px,
    rgba(0, 212, 170, 0.008) 4px
  );
  pointer-events: none;
  z-index: 1;
}

/* ===== HEADER ===== */
.bx-cipher-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(30, 30, 46, 0.8);
  background: linear-gradient(180deg, rgba(14, 14, 24, 0.95), rgba(11, 11, 20, 0.95));
  flex-shrink: 0;
}

.bx-cipher-avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(0, 212, 170, 0.15), rgba(0, 212, 170, 0.05));
  border: 1px solid rgba(0, 212, 170, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bx-cipher-avatar svg {
  width: 16px;
  height: 16px;
  color: #00D4AA;
}

.bx-cipher-header-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.bx-cipher-name {
  font-family: 'JetBrains Mono', Monaco, monospace;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #00D4AA;
  line-height: 1.2;
}

.bx-cipher-status {
  font-family: 'Outfit', sans-serif;
  font-size: 0.65rem;
  font-weight: 400;
  color: #4A4A5A;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.bx-cipher-status::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #00D4AA;
  margin-right: 5px;
  vertical-align: middle;
  box-shadow: 0 0 6px rgba(0, 212, 170, 0.4);
}

/* ===== MESSAGES ===== */
.bx-cipher-messages {
  position: relative;
  z-index: 2;
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 212, 170, 0.1) transparent;
}

.bx-cipher-messages::-webkit-scrollbar {
  width: 4px;
}

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

.bx-cipher-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 212, 170, 0.15);
  border-radius: 2px;
}

/* Message bubbles */
.bx-cipher-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.55;
  animation: bx-cipher-fade-in 0.25s ease-out;
  word-break: break-word;
}

.bx-cipher-msg a {
  color: #00D4AA;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.bx-cipher-msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg, #1A1A28, #161622);
  border: 1px solid rgba(30, 30, 46, 0.6);
  color: #F2F2F2;
  border-bottom-right-radius: 4px;
}

.bx-cipher-msg-bot {
  align-self: flex-start;
  background: linear-gradient(135deg, #0F0F1A, #0C0C16);
  border: 1px solid rgba(0, 212, 170, 0.06);
  color: #D0D0DC;
  border-bottom-left-radius: 4px;
}

/* Typing indicator */
.bx-cipher-typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #0F0F1A, #0C0C16);
  border: 1px solid rgba(0, 212, 170, 0.06);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
}

.bx-cipher-typing span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #00D4AA;
  animation: bx-cipher-dot-bounce 1.4s ease-in-out infinite;
}

.bx-cipher-typing span:nth-child(2) { animation-delay: 0.16s; }
.bx-cipher-typing span:nth-child(3) { animation-delay: 0.32s; }

/* Welcome message */
.bx-cipher-welcome {
  text-align: center;
  padding: 24px 12px 8px;
}

.bx-cipher-welcome-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(0, 212, 170, 0.12), rgba(0, 212, 170, 0.04));
  border: 1px solid rgba(0, 212, 170, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bx-cipher-welcome-icon svg {
  width: 20px;
  height: 20px;
  color: #00D4AA;
}

.bx-cipher-welcome h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #F2F2F2;
  margin-bottom: 6px;
}

.bx-cipher-welcome p {
  font-family: 'Outfit', sans-serif;
  font-size: 0.78rem;
  font-weight: 300;
  color: #5A5A6A;
  line-height: 1.5;
}

/* Quick action chips */
.bx-cipher-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  padding: 4px 0 8px;
}

.bx-cipher-chip {
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem;
  font-weight: 400;
  color: #7A7A8A;
  background: rgba(20, 20, 31, 0.8);
  border: 1px solid rgba(30, 30, 46, 0.6);
  border-radius: 20px;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-user-select: none;
  user-select: none;
}

.bx-cipher-chip:hover {
  color: #00D4AA;
  border-color: rgba(0, 212, 170, 0.25);
  background: rgba(0, 212, 170, 0.05);
}

/* ===== INPUT ===== */
.bx-cipher-input-wrap {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid rgba(30, 30, 46, 0.6);
  background: rgba(8, 8, 16, 0.6);
  flex-shrink: 0;
}

.bx-cipher-input {
  flex: 1;
  background: #0A0A14;
  border: 1px solid rgba(30, 30, 46, 0.8);
  border-radius: 10px;
  padding: 10px 14px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 400;
  color: #F2F2F2;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  min-height: 20px;
}

.bx-cipher-input::placeholder {
  color: #2A2A3A;
}

.bx-cipher-input:focus {
  border-color: rgba(0, 212, 170, 0.35);
  box-shadow: 0 0 0 2px rgba(0, 212, 170, 0.06);
}

.bx-cipher-send {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: #00D4AA;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  padding: 0;
  outline: none;
}

.bx-cipher-send:hover {
  background: #00F0C0;
  box-shadow: 0 0 16px rgba(0, 212, 170, 0.25);
}

.bx-cipher-send:active {
  transform: scale(0.92);
}

.bx-cipher-send:disabled {
  background: #1A1A28;
  cursor: not-allowed;
  box-shadow: none;
}

.bx-cipher-send:disabled svg {
  color: #3A3A4A;
}

.bx-cipher-send svg {
  width: 16px;
  height: 16px;
  color: #080810;
}

/* ===== HEADER CLOSE BUTTON ===== */.bx-cipher-header-close {  margin-left: auto;  width: 32px;  height: 32px;  border-radius: 8px;  border: 1px solid rgba(30, 30, 46, 0.6);  background: transparent;  cursor: pointer;  display: flex;  align-items: center;  justify-content: center;  padding: 0;  transition: all 0.2s ease;  flex-shrink: 0;}.bx-cipher-header-close svg {  width: 14px;  height: 14px;  color: #6B6B80;}.bx-cipher-header-close:hover {  border-color: #3A3A4A;  background: rgba(255, 255, 255, 0.03);}.bx-cipher-header-close:hover svg {  color: #F2F2F2;}
/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  .bx-cipher-btn {
    bottom: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
  }

  .bx-cipher-panel {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
    border: none;
  }

  .bx-cipher-panel.open {
    animation: bx-cipher-slide-up 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
.bx-cipher-btn.open {    display: none !important;  }
}

@media (min-width: 481px) and (max-width: 640px) {
  .bx-cipher-panel {
    width: calc(100vw - 32px);
    right: 16px;
    bottom: 76px;
    height: 480px;
  }

  .bx-cipher-btn {
    bottom: 16px;
    right: 16px;
  }
}
