/* CampusCash AI Finance Chatbot Widget */
:root {
  --chat-primary: #6366f1;
  --chat-primary-hover: #4f46e5;
  --chat-bg: #0f0f1a;
  --chat-user-bubble: #6366f1;
  --chat-bot-bubble: #1e1e35;
  --chat-text: #e2e8f0;
  --chat-text-muted: #94a3b8;
  --chat-border: #1e293b;
  --chat-shadow: 0 0 40px rgba(99, 102, 241, 0.15);
  --chat-radius: 16px;
}

#cc-chat-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--chat-primary);
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  z-index: 10000;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
#cc-chat-toggle:hover {
  transform: scale(1.1);
  background: var(--chat-primary-hover);
}
#cc-chat-toggle .cc-icon-open { display: block; }
#cc-chat-toggle .cc-icon-close { display: none; }
#cc-chat-toggle.cc-active .cc-icon-open { display: none; }
#cc-chat-toggle.cc-active .cc-icon-close { display: block; }

#cc-chat-container {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 380px;
  height: 580px;
  max-height: calc(100vh - 140px);
  background: var(--chat-bg);
  border: 1px solid var(--chat-border);
  border-radius: var(--chat-radius);
  box-shadow: var(--chat-shadow);
  z-index: 9999;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: cc-slideUp 0.3s ease;
}
#cc-chat-container.cc-open { display: flex; }

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

.cc-chat-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.cc-chat-header-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.cc-chat-header-text { flex: 1; }
.cc-chat-header-text h3 { margin: 0; font-size: 14px; font-weight: 600; }
.cc-chat-header-text p { margin: 2px 0 0; font-size: 11px; opacity: 0.8; }

.cc-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}
.cc-chat-messages::-webkit-scrollbar { width: 4px; }
.cc-chat-messages::-webkit-scrollbar-track { background: transparent; }
.cc-chat-messages::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }

.cc-message {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.5;
  animation: cc-fadeIn 0.3s ease;
}
@keyframes cc-fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.cc-message.user {
  align-self: flex-end;
  background: var(--chat-user-bubble);
  color: white;
  border-bottom-right-radius: 4px;
}
.cc-message.bot {
  align-self: flex-start;
  background: var(--chat-bot-bubble);
  color: var(--chat-text);
  border: 1px solid var(--chat-border);
  border-bottom-left-radius: 4px;
}
.cc-message.bot .cc-thinking {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 4px 0;
}
.cc-message.bot .cc-thinking span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--chat-primary);
  animation: cc-bounce 1.4s infinite ease-in-out both;
}
.cc-message.bot .cc-thinking span:nth-child(1) { animation-delay: -0.32s; }
.cc-message.bot .cc-thinking span:nth-child(2) { animation-delay: -0.16s; }
.cc-message.bot .cc-thinking span:nth-child(3) { animation-delay: 0s; }
@keyframes cc-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

.cc-message .cc-suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.cc-message .cc-suggestion-chip {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}
.cc-message .cc-suggestion-chip:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: var(--chat-primary);
}

.cc-chat-input-area {
  padding: 12px 16px;
  border-top: 1px solid var(--chat-border);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
  background: var(--chat-bg);
}
.cc-chat-input-area input {
  flex: 1;
  background: #1a1a2e;
  border: 1px solid var(--chat-border);
  border-radius: 24px;
  padding: 10px 16px;
  color: white;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}
.cc-chat-input-area input:focus { border-color: var(--chat-primary); }
.cc-chat-input-area input::placeholder { color: var(--chat-text-muted); }
.cc-chat-input-area button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--chat-primary);
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}
.cc-chat-input-area button:hover { background: var(--chat-primary-hover); }
.cc-chat-input-area button:disabled { opacity: 0.4; cursor: not-allowed; }

/* Quick action buttons in header */
.cc-quick-actions {
  padding: 8px 16px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  flex-shrink: 0;
  background: rgba(0,0,0,0.2);
}
.cc-quick-actions::-webkit-scrollbar { display: none; }
.cc-quick-action-btn {
  white-space: nowrap;
  padding: 5px 12px;
  border-radius: 16px;
  border: 1px solid var(--chat-border);
  background: transparent;
  color: var(--chat-text-muted);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.cc-quick-action-btn:hover {
  border-color: var(--chat-primary);
  color: var(--chat-primary);
  background: rgba(99, 102, 241, 0.1);
}

@media (max-width: 480px) {
  #cc-chat-container {
    width: calc(100vw - 32px);
    height: calc(100vh - 140px);
    bottom: 90px;
    right: 16px;
    left: 16px;
    max-height: none;
    border-radius: 12px;
  }
  #cc-chat-toggle {
    bottom: 20px;
    right: 20px;
    width: 54px;
    height: 54px;
    font-size: 24px;
  }
}
