/* Start File: assets/css/chat-stylish.css */

/* Chat bubble with hover pop + rotate */
#marvin-chat-bubble.stylish-bubble {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: linear-gradient(135deg, var(--marvin-primary), var(--marvin-secondary));
  color: #fff;
  font-size: 24px;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  text-align: center;
  line-height: 56px;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
#marvin-chat-bubble.stylish-bubble:hover {
  transform: scale(1.1) rotate(10deg);
  box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

/* Animate the panel sliding up + fade-in */
#marvin-chat-box.stylish-box {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 300px;
  background: #fff;
  border-radius: var(--marvin-bubble-radius);
  border: 1px solid #ddd;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  font-family: var(--marvin-font-family);
  font-size: var(--marvin-font-size);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}
#marvin-chat-box.stylish-box:not(.hidden) {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Header with stronger gradient and styled close button */
.marvin-header.stylish-header {
  background: linear-gradient(135deg, var(--marvin-primary), var(--marvin-secondary));
  color: white;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 8px 8px 0 0;
  border-bottom: 2px solid var(--marvin-secondary);
}
.marvin-header.stylish-header .close-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  transition: color 0.2s ease;
}
.marvin-header.stylish-header .close-btn:hover {
  color: var(--marvin-secondary);
}

/* Message container uses flex so we can align bubbles left/right */
#marvin-messages {
  padding: 10px;
  height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Speech-bubble styling for messages */
#marvin-messages .marvin-message {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  word-wrap: break-word;
  transition: background 0.3s ease;
}
#marvin-messages .user-message {
  background: var(--marvin-secondary);
  color: #fff;
  align-self: flex-end;
  text-align: right;
}
#marvin-messages .marvin-response {
  background: #f1f1f1;
  color: #333;
  align-self: flex-start;
  border-left: 4px solid var(--marvin-primary);
}

/* Form styling with gradient-hover send button */
#marvin-form {
  display: flex;
  border-top: 1px solid #ddd;
}
#marvin-input {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--marvin-primary);
  border-radius: 0 0 0 var(--marvin-bubble-radius);
  font-family: var(--marvin-font-family);
  font-size: var(--marvin-font-size);
  transition: border-color 0.3s ease;
}
#marvin-input:focus {
  outline: none;
  border-color: var(--marvin-secondary);
}
#marvin-form .send-btn {
  background-image: linear-gradient(45deg, var(--marvin-secondary), var(--marvin-primary));
  background-size: 200% 100%;
  background-position: right center;
  color: #fff;
  border: none;
  padding: 0 16px;
  border-radius: 0 var(--marvin-bubble-radius) var(--marvin-bubble-radius) 0;
  cursor: pointer;
  transition: background-position 0.4s ease;
}
#marvin-form .send-btn:hover {
  background-position: left center;
}
/* === MARVIN CHAT LINK STYLES === */
.marvin-message a {
  color: #1e88e5;
  text-decoration: none;
  border-bottom: 1px solid #1e88e5;
  transition: all 0.2s ease;
  cursor: pointer;
  font-weight: 500;
}

.marvin-message a:hover {
  color: #1565c0;
  border-bottom-color: #1565c0;
  background-color: rgba(30, 136, 229, 0.05);
  padding: 1px 3px;
  border-radius: 3px;
  text-decoration: none;
}

.marvin-message a:active {
  transform: translateY(1px);
  background-color: rgba(30, 136, 229, 0.1);
}

/* External link indicator */
.marvin-message a[target="_blank"]::after {
  content: " ↗";
  font-size: 0.85em;
  opacity: 0.7;
  margin-left: 2px;
  color: #666;
}

/* Focus state for accessibility */
.marvin-message a:focus {
  outline: 2px solid #1e88e5;
  outline-offset: 2px;
  background-color: rgba(30, 136, 229, 0.1);
}

/* External links styling - applied via JavaScript */
.marvin-message a.external-link {
  color: #d32f2f;
  border-bottom-color: #d32f2f;
}

.marvin-message a.external-link:hover {
  color: #b71c1c;
  border-bottom-color: #b71c1c;
  background-color: rgba(211, 47, 47, 0.05);
}

/* Connection status indicator */
.marvin-connection-status {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-left: 8px;
    transition: all 0.3s ease;
    border: 1px solid #d4d4d4;
}

.marvin-connection-status.online {
    background-color: #0c8c11; /* Green */
    box-shadow: 0 0 4px rgba(76, 175, 80, 0.4);
}

.marvin-connection-status.offline {
    background-color: #f44336; /* Red */
    box-shadow: 0 0 4px rgba(244, 67, 54, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}


/* End File: assets/css/chat-stylish.css */
