/* Chat Widget Styles */
.chat-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  font-family: 'Inter', sans-serif;
}

.chat-toggle-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.3s ease;
}

.chat-toggle-btn:hover {
  transform: scale(1.1);
}

.chat-toggle-btn .unread-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ef4444;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
}

/* Chat Container */
.chat-container {
  position: fixed;
  bottom: 100px;
  right: 20px;
  width: 400px;
  height: 600px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.98));
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  display: none;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.chat-container.active {
  display: flex;
}

/* Chat Header */
.chat-header {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.chat-header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: white;
  position: relative;
}

.chat-header-avatar .status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid white;
}

.status-dot.online {
  background: #10b981;
}

.status-dot.offline {
  background: #64748b;
}

.chat-header-details {
  flex: 1;
}

.chat-header-name {
  font-size: 16px;
  font-weight: 700;
  color: white;
  margin: 0;
}

.chat-header-status {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

.chat-header-actions {
  display: flex;
  gap: 8px;
}

.chat-header-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.chat-header-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Users List */
.chat-users-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.chat-user-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 8px;
  position: relative;
}

.chat-user-item:hover {
  background: rgba(59, 130, 246, 0.1);
  transform: translateX(4px);
}

.chat-user-item.active {
  background: rgba(59, 130, 246, 0.2);
  border-left: 3px solid #3b82f6;
}

.chat-user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: white;
  position: relative;
  flex-shrink: 0;
}

.chat-user-avatar .status-indicator {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #1e293b;
}

.chat-user-info {
  flex: 1;
  min-width: 0;
}

.chat-user-name {
  font-size: 14px;
  font-weight: 600;
  color: #f8fafc;
  margin: 0 0 4px 0;
}

.chat-user-role {
  font-size: 12px;
  color: #94a3b8;
  margin: 0;
}

.chat-user-unread {
  background: #ef4444;
  color: white;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Messages Area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-message {
  display: flex;
  gap: 12px;
  max-width: 80%;
  animation: messageSlide 0.3s ease;
}

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

.chat-message.sent {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.chat-message-content {
  flex: 1;
}

.chat-message-bubble {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 12px 16px;
  border-radius: 16px;
  color: #f8fafc;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.chat-message.sent .chat-message-bubble {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  border: none;
}

.chat-message-time {
  font-size: 11px;
  color: #64748b;
  margin-top: 4px;
  padding: 0 4px;
}

.chat-message.sent .chat-message-time {
  text-align: right;
}

/* Chat Input */
.chat-input-area {
  padding: 16px;
  background: rgba(15, 23, 42, 0.6);
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.chat-input-container {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.chat-attachment-btn {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #3b82f6;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.chat-attachment-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  transform: scale(1.05);
}

.chat-input {
  flex: 1;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  padding: 12px 16px;
  color: #f8fafc;
  font-size: 14px;
  resize: none;
  max-height: 100px;
  min-height: 44px;
  font-family: 'Inter', sans-serif;
}

.chat-input:focus {
  outline: none;
  border-color: #3b82f6;
  background: rgba(30, 41, 59, 0.9);
}

.chat-send-btn {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  border: none;
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.chat-send-btn:hover {
  transform: scale(1.05);
}

.chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Emoji Picker */
.emoji-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.2s;
}

.emoji-btn:hover {
  background: rgba(59, 130, 246, 0.1);
  transform: scale(1.2);
}

/* Empty States */
.chat-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
}

.chat-empty-icon {
  font-size: 48px;
  color: #64748b;
  margin-bottom: 16px;
}

.chat-empty-text {
  font-size: 14px;
  color: #94a3b8;
  margin: 0;
}

/* Scrollbar */
.chat-users-list::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-users-list::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 10px;
}

.chat-users-list::-webkit-scrollbar-thumb:hover,
.chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.5);
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: rgba(59, 130, 246, 0.2);
  border-radius: 16px;
  width: fit-content;
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  animation: typingDot 1.4s infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingDot {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
  20%, 40%, 60%, 80% { transform: translateX(10px); }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .chat-container {
    width: calc(100vw - 40px);
    height: calc(100vh - 140px);
    right: 20px;
    left: 20px;
  }
}

/* ================================================================
   WOLF DIVISION — SECURE ACCESS TERMINAL
   ================================================================ */
#wolfSecurityModal {
  background: rgba(0,4,0,0.93) !important;
  backdrop-filter: blur(10px) !important;
}
#wolfMatrixCanvas {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.78;
}
.wolf-modal-inner {
  font-family: 'Space Mono', 'Courier New', monospace;
  position: relative;
  z-index: 1;
  max-width: 400px;
  width: 100%;
  background: linear-gradient(160deg, #020a03 0%, #041008 55%, #020804 100%);
  border: 1px solid rgba(34,197,94,0.35);
  border-radius: 4px;
  padding: 36px 32px 28px;
  text-align: center;
  box-shadow:
    0 0 0 1px rgba(34,197,94,0.08),
    0 0 50px rgba(34,197,94,0.14),
    0 0 100px rgba(34,197,94,0.06),
    inset 0 0 80px rgba(34,197,94,0.025);
  animation: wolfModalIn 0.45s cubic-bezier(0.16,1,0.3,1) forwards, wolfBorderPulse 3.5s ease-in-out 0.45s infinite;
  overflow: hidden;
}
@keyframes wolfModalIn {
  from { opacity:0; transform: scale(0.9) translateY(16px); }
  to   { opacity:1; transform: scale(1)   translateY(0); }
}
@keyframes wolfBorderPulse {
  0%,100% {
    border-color: rgba(34,197,94,0.3);
    box-shadow: 0 0 0 1px rgba(34,197,94,0.07), 0 0 50px rgba(34,197,94,0.12), inset 0 0 80px rgba(34,197,94,0.02);
  }
  50% {
    border-color: rgba(74,222,128,0.6);
    box-shadow: 0 0 0 1px rgba(74,222,128,0.14), 0 0 60px rgba(34,197,94,0.24), 0 0 120px rgba(34,197,94,0.08), inset 0 0 80px rgba(34,197,94,0.05);
  }
}
/* Corner brackets */
.wolf-modal-inner::before,
.wolf-modal-inner::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border-color: rgba(74,222,128,0.6);
  border-style: solid;
  pointer-events: none;
}
.wolf-modal-inner::before { top:8px; left:8px;  border-width: 1.5px 0 0 1.5px; }
.wolf-modal-inner::after  { bottom:8px; right:8px; border-width: 0 1.5px 1.5px 0; }
/* BG grid */
.wolf-bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(34,197,94,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34,197,94,0.025) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
}
/* Moving scan line */
.wolf-scanline {
  position: absolute; left:0; right:0; height:70px;
  background: linear-gradient(180deg, transparent, rgba(34,197,94,0.045), transparent);
  pointer-events: none;
  animation: wolfScanMove 5s linear infinite;
}
@keyframes wolfScanMove {
  0%   { top: -70px; }
  100% { top: calc(100% + 70px); }
}
/* Wolf SVG wrapper */
.wolf-logo-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 10px;
}
.wolf-logo-wrap svg {
  width: 92px; height: 92px;
  filter:
    drop-shadow(0 0 6px rgba(34,197,94,0.55))
    drop-shadow(0 0 18px rgba(34,197,94,0.25))
    drop-shadow(0 0 40px rgba(34,197,94,0.1));
}
/* System bar */
.wolf-sys-bar {
  font-size: 8.5px;
  color: rgba(34,197,94,0.45);
  letter-spacing: 2.5px;
  margin-bottom: 12px;
  text-transform: uppercase;
}
/* Title (typewriter target) */
.wolf-title {
  font-family: 'Space Mono', monospace;
  font-size: 19px;
  font-weight: 700;
  color: #4ade80;
  letter-spacing: 6px;
  margin: 0 0 5px;
  text-shadow: 0 0 12px rgba(74,222,128,0.4);
  min-height: 28px;
}
/* Subtitle */
.wolf-subtitle {
  font-size: 9.5px;
  color: rgba(134,239,172,0.45);
  letter-spacing: 2.5px;
  margin-bottom: 26px;
}
/* 4-digit row */
.wolf-input-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 14px;
}
.wolf-digit {
  width: 54px; height: 66px;
  background: rgba(34,197,94,0.04);
  border: 1px solid rgba(34,197,94,0.28);
  border-radius: 3px;
  color: #4ade80;
  font-family: 'Space Mono', monospace;
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
  caret-color: transparent;
}
.wolf-digit:focus {
  border-color: #4ade80;
  background: rgba(34,197,94,0.09);
  box-shadow: 0 0 0 1px rgba(74,222,128,0.28), 0 0 18px rgba(34,197,94,0.3);
  animation: wolfDigitGlow 1.6s ease-in-out infinite;
}
.wolf-digit.wfilled {
  border-color: rgba(74,222,128,0.5);
  background: rgba(34,197,94,0.06);
}
.wolf-digit.wolf-error {
  border-color: rgba(239,68,68,0.7) !important;
  animation: wolfShake 0.45s ease forwards !important;
  box-shadow: 0 0 18px rgba(239,68,68,0.25) !important;
  background: rgba(239,68,68,0.04) !important;
}
@keyframes wolfDigitGlow {
  0%,100% { box-shadow: 0 0 0 1px rgba(74,222,128,0.25), 0 0 14px rgba(34,197,94,0.22); }
  50%      { box-shadow: 0 0 0 1px rgba(74,222,128,0.45), 0 0 26px rgba(34,197,94,0.42); }
}
@keyframes wolfShake {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-7px); }
  40%     { transform: translateX(7px); }
  60%     { transform: translateX(-4px); }
  80%     { transform: translateX(4px); }
}
/* Status line */
.wolf-status {
  font-size: 9.5px;
  color: rgba(74,222,128,0.38);
  letter-spacing: 1.5px;
  height: 14px;
  margin-bottom: 22px;
  transition: color 0.2s;
}
.wolf-status.werror   { color: rgba(239,68,68,0.8); }
.wolf-status.wsuccess { color: rgba(74,222,128,0.9); }
/* Primary button */
.wolf-btn-primary {
  display: block;
  width: 100%;
  padding: 13px 20px;
  background: transparent;
  border: 1px solid rgba(34,197,94,0.45);
  border-radius: 3px;
  color: #4ade80;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3.5px;
  cursor: pointer;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.wolf-btn-primary::before {
  content: '';
  position: absolute;
  top: 50%; left: -100%;
  width: 55%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(34,197,94,0.18), transparent);
  transform: translateY(-50%) skewX(-20deg);
  transition: left 0.5s ease;
}
.wolf-btn-primary:hover {
  border-color: #4ade80;
  background: rgba(34,197,94,0.09);
  box-shadow: 0 0 22px rgba(34,197,94,0.22);
}
.wolf-btn-primary:hover::before { left: 160%; }
.wolf-btn-primary:active { background: rgba(34,197,94,0.16); }
/* Cancel button */
.wolf-btn-cancel {
  background: none;
  border: none;
  color: rgba(34,197,94,0.22);
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  letter-spacing: 2.5px;
  cursor: pointer;
  padding: 6px 10px;
  transition: color 0.2s;
}
.wolf-btn-cancel:hover { color: rgba(34,197,94,0.5); }
/* Footer */
.wolf-footer {
  margin-top: 20px;
  font-size: 7.5px;
  color: rgba(34,197,94,0.18);
  letter-spacing: 2px;
  padding-top: 12px;
  border-top: 1px solid rgba(34,197,94,0.07);
}
/* === WIZ FEATURE === */
@keyframes wiz-shake {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  10%       { transform: translateX(-10px) rotate(-1.5deg); }
  20%       { transform: translateX(10px) rotate(1.5deg); }
  30%       { transform: translateX(-8px) rotate(-1deg); }
  40%       { transform: translateX(8px) rotate(1deg); }
  50%       { transform: translateX(-5px) rotate(-0.5deg); }
  60%       { transform: translateX(5px) rotate(0.5deg); }
  70%       { transform: translateX(-3px); }
  80%       { transform: translateX(3px); }
  90%       { transform: translateX(-1px); }
}
.wiz-shaking {
  animation: wiz-shake 0.8s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
#wizBtn {
  font-size: 16px;
  padding: 0;
  line-height: 1;
}
#wizBtn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
#wizBtn.on-cooldown {
  font-size: 11px;
  letter-spacing: -0.5px;
}
