/**
 * MarketSnap AI Assistant Styles
 */

.marketsnap-assistant-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 100%;
    background: #ffffff;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    z-index: 1000;
    transition: all 0.3s ease;
    height: calc(100vh - 80px);
}

.marketsnap-assistant-container.collapsed {
    height: 5vh;
}

.marketsnap-assistant-container.expanded {
    height: auto;
}

.assistant-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.5vh 20px 1vh 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    position: relative;
    height: 5vh;
    box-sizing: border-box;
}

.assistant-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1;
    height: 100%;
}

.assistant-header h3 {
    margin: 0;
    font-size: 2.2vh;
    font-weight: 600;
    line-height: 1.2;
}

.assistant-status {
    font-size: 1.5vh;
    opacity: 0.9;
    padding: 0.2vh 0.5vh;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 1vh;
    white-space: nowrap;
    line-height: 1.2;
}

.assistant-toggle {
    position: absolute;
    bottom: 0.5vh;
    left: 50%;
    transform: translateX(-50%);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.toggle-dots {
    display: flex;
    gap: 3px;
    align-items: center;
}

.toggle-dots span {
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    transition: all 0.3s ease;
    display: block;
}

.marketsnap-assistant-container.collapsed .toggle-dots span {
    background: rgba(255, 255, 255, 0.9);
}

.marketsnap-assistant-container.expanded .toggle-dots span {
    background: rgba(255, 255, 255, 0.5);
}

.assistant-content {
    height: auto;
    overflow-y: auto;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.marketsnap-assistant-container.collapsed .assistant-content {
    height: 0;
    overflow: hidden;
}

.assistant-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    min-height: 0;
}

/* Remove margin from ms-content-restriction */
.marketsnap-assistant-container .ms-content-restriction {
    margin: 0 !important;
}

.marketsnap-assistant-container .ms-restriction-box {
    margin: 0 !important;
    border-radius: 0 !important;
    padding: 20px !important;
    width: 100% !important;
}

.message {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
}

.user-message {
    align-items: flex-end;
}

.bot-message {
    align-items: flex-start;
}

.message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
}

.user-message .message-content {
    background: #007bff;
    color: white;
    border-bottom-right-radius: 4px;
}

.bot-message .message-content {
    background: white;
    color: #333;
    border: 1px solid #e9ecef;
    border-bottom-left-radius: 4px;
}

.bot-message.error .message-content {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.message-time {
    font-size: 11px;
    color: #6c757d;
    margin-top: 4px;
    padding: 0 8px;
}

.typing {
    opacity: 0.7;
}

.typing-dots {
    display: flex;
    align-items: center;
    gap: 4px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: #6c757d;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.assistant-suggestions {
    padding: 16px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.suggestions-title {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 8px;
    font-weight: 500;
}

.suggestions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestion-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 16px;
    padding: 6px 12px;
    font-size: 12px;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-item:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
    transform: translateY(-1px);
}

.assistant-input {
    display: flex;
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e9ecef;
}

#assistant-input {
    flex: 1;
    border: 1px solid #e9ecef;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    resize: none;
    min-height: 20px;
    max-height: 100px;
}

#assistant-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

#assistant-send {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    margin-left: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

#assistant-send:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

#assistant-send:active {
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 600px) {
    .marketsnap-chatbot-container {
        margin: 0;
        border-radius: 0;
        height: 100vh;
    }
    
    .assistant-messages {
        height: calc(100vh - 200px);
    }
    
    .message-content {
        max-width: 90%;
    }
}

/* Scrollbar Styling */
.assistant-messages::-webkit-scrollbar {
    width: 6px;
}

.assistant-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.assistant-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.assistant-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
