/* ========================================
   VERMO CHATBOT - THEME SYNCHRONIZED WITH AADI INVESTMENTS
   Color Scheme: Gold (#FFD700) & Dark Background (#0d0d0d)
   ======================================== */

/* Thinking Animation - Bouncing dots with gold color */
.thinking-animation {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}

.thinking-dot {
    width: 8px;
    height: 8px;
    background-color: #FFD700;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.thinking-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.thinking-dot:nth-child(2) {
    animation-delay: -0.16s;
}

.thinking-dot:nth-child(3) {
    animation-delay: 0s;
}

.thinking-animation span:last-child {
    font-size: 12px;
    color: #FFD700;
    margin-left: 4px;
    font-weight: 500;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scaleY(0.8);
        opacity: 0.6;
    }
    40% {
        transform: scaleY(1);
        opacity: 1;
    }
}

/* Typing Cursor Animation */
.typing-cursor {
    animation: blink 1s infinite;
    margin-left: 2px;
    color: #FFD700;
}

@keyframes blink {
    0%, 49% {
        opacity: 1;
    }
    50%, 100% {
        opacity: 0;
    }
}

/* Typing Message Style - Theme Sync */
.typing-message {
    background-color: rgba(255, 215, 0, 0.08) !important;
    border: 1px solid rgba(255, 215, 0, 0.2) !important;
    animation: typingMessagePulse 0.5s ease-in-out;
}

@keyframes typingMessagePulse {
    0% {
        background-color: rgba(255, 215, 0, 0.05);
    }
    50% {
        background-color: rgba(255, 215, 0, 0.1);
    }
    100% {
        background-color: rgba(255, 215, 0, 0.08);
    }
}

/* Message Text */
.message-text {
    word-wrap: break-word;
    white-space: pre-wrap;
    line-height: 1.5;
}

/* Chat Messages Container - Smooth scrolling */
#vermo-chat-messages {
    scroll-behavior: smooth;
}

/* User Message - Styled with gold accent */
.user-message {
    display: flex;
    justify-content: flex-end;
    margin: 12px 0;
    animation: slideInUser 0.3s ease-out;
    width: 100%;               /* ✓ ADD THIS */
    box-sizing: border-box;    /* ✓ ADD THIS */
}

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

.user-message .message-bubble {
    background: linear-gradient(135deg, #FFD700 0%, #FFF8DC 100%);
    color: #0d0d0d;
    border-radius: 18px;
    padding: 10px 14px;
    max-width: 70%;
    word-break: break-word;
      overflow-wrap: break-word;  /* ✓ ADD THIS */
  white-space: normal;        /* ✓ ADD THIS */
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.2);
      flex-shrink: 1;             /* ✓ ADD THIS */
}

.user-message .message-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    margin-right: 8px;
    align-self: flex-end;
    margin-bottom: 4px;
}

/* AI Message - Dark theme with gold accent */
.ai-message {
    display: flex;
    justify-content: flex-start;
    margin: 12px 0;
    animation: slideInBot 0.3s ease-out;
     width: 100%;              /* ✓ ADD THIS */
  box-sizing: border-box;   /* ✓ ADD THIS */
}

@keyframes slideInBot {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.ai-message .ai-bubble {
    background: rgba(255, 215, 0, 0.05);
    color: #FFFFFF;
    border-radius: 18px;
    padding: 10px 14px;
    max-width: 70%;
    word-break: break-word;
    border: 1px solid rgba(255, 215, 0, 0.2);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    width: 100%;              /* ADD THIS - prevent width expansion */
  overflow-wrap: break-word; /* ADD THIS - ensure text wraps properly */
}

.ai-message .ai-bubble ul {
    margin: 10px 0;
    padding-left: 20px;
}

.ai-message .ai-bubble li {
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.9);
}

.ai-message .message-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    margin-left: 8px;
    align-self: flex-end;
    margin-bottom: 4px;
}

/* Chat Input Area */
.ai-chat-input-area {
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 215, 0, 0.2);
    background: rgba(13, 13, 13, 0.95);
}

#vermo-input {
    padding: 10px 14px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    background: rgba(255, 215, 0, 0.05);
    color: #FFFFFF;
}

#vermo-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

#vermo-input:focus {
    border-color: #FFD700;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
    background: rgba(255, 215, 0, 0.08);
}

/* Send Button - Gold gradient */
#vermo-send-btn {
    padding: 8px 20px;
    border-radius: 20px;
    border: none;
    background: linear-gradient(135deg, #FFD700 0%, #FFF8DC 100%);
    color: #0d0d0d;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

#vermo-send-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

#vermo-send-btn:active:not(:disabled) {
    transform: translateY(0);
}

#vermo-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Chat Header - Gold theme */
.ai-chat-header {
    background: rgba(255, 215, 0, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.2);
    color: #FFFFFF;
    padding: 16px;
    text-align: center;
    border-radius: 8px 8px 0 0;
}

.ai-chat-header h2 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 700;
    color: #FFD700;
}

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

.back-nav {
    text-align: left;
    margin-bottom: 12px;
}

.back-btn {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: #FFD700;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: #FFD700;
    transform: translateX(-2px);
}

.back-btn i {
    margin-right: 4px;
}

/* Chatbot Button - Hide/Show with animation */
#ai-widget-btn {
    animation: buttonFadeIn 0.3s ease-out;
}

@keyframes buttonFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

#ai-widget-btn:hover {
    transform: scale(1.1);
}

/* Page Content Styling */
.page-content {
    max-width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ai-chat-page {
    display: flex;
    flex-direction: column;
    height: 100%;
      width: 50%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

/* Mobile responsive - only width change */
@media (max-width: 768px) {
  .ai-chat-page {
    width: 100%;
  }

  #vermo-input {
    font-size: 16px; /* Prevents zoom on mobile */
  }
}


#vermo-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: rgba(13, 13, 13, 0.95);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Scrollbar Styling - Gold accent */
#vermo-chat-messages::-webkit-scrollbar {
    width: 6px;
}

#vermo-chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 215, 0, 0.05);
}

#vermo-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.3);
    border-radius: 3px;
}

#vermo-chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.5);
}

/* Dock Item Container - Show/Hide animation */
.dock-item {
    animation: dockItemFadeIn 0.3s ease-out;
}

@keyframes dockItemFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.dock-item.hidden {
    animation: dockItemFadeOut 0.3s ease-out forwards;
}

@keyframes dockItemFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

/* Dock Label - Hidden when button is hidden */
.dock-label {
    display: flex;
    align-items: center;
    justify-content: center;
}

.dock-label b {
    color: #FFD700;
}

/* Vermo specific dock button */
.dock-btn.vermo {
    background: linear-gradient(135deg, #FFD700 0%, #FFF8DC 100%);
    color: #0d0d0d;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.3);
}

.dock-btn.vermo:hover {
    box-shadow: 0 6px 25px rgba(255, 215, 0, 0.4);
}

/* Animation for thinking indicator */
.thinking-indicator {
    display: flex;
    justify-content: flex-start;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .user-message .message-bubble,
    .ai-message .ai-bubble {
        max-width: 85%;
    }

    #vermo-input {
        font-size: 16px; /* Prevents zoom on mobile */
    }

    .ai-chat-page {
        padding: 0;
    }

    #vermo-chat-messages {
        padding: 12px;
    }

    .ai-chat-input-area {
        padding: 10px 12px;
    }
}

/* Dark mode support (already dark, but ensure consistency) */
@media (prefers-color-scheme: dark) {
    .ai-bubble {
        background: rgba(255, 215, 0, 0.05);
        border-color: rgba(255, 215, 0, 0.2);
    }

    .user-bubble {
        background: linear-gradient(135deg, #FFD700 0%, #FFF8DC 100%);
    }
}
