/* Pinecone Chatbot Frontend Styles */

.pinecone-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Chat Toggle Button */
.pinecone-chatbot-toggle {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;

    font-size: 14px;
}

.pinecone-chatbot-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.chat-icon {
    font-size: 18px;
}

/* Chat Widget */
.pinecone-chatbot-widget {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pinecone-chatbot-widget.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Chat Header */
.pinecone-chatbot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 15px 15px 0 0;
}

.chatbot-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 16px;
}

.chatbot-controls {
    display: flex;
    gap: 8px;
}

.chatbot-controls button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.2s ease;
}

.chatbot-controls button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Chat Messages */
.pinecone-chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
}

.message {
    display: flex;
    margin-bottom: 15px;
    animation: messageSlideIn 0.3s ease;
}

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

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-right: 10px;
    flex-shrink: 0;
}

.user-message {
    flex-direction: row-reverse;
}

.user-message .message-avatar {
    margin-right: 0;
    margin-left: 10px;
    background: #667eea;
    color: white;
}

.assistant-message .message-avatar {
    background: #f1f3f4;
    color: #5f6368;
}

.system-message .message-avatar {
    background: #e8f5e8;
    color: #34a853;
}

.message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 70%;
    word-wrap: break-word;
    line-height: 1.4;
}

.user-message .message-content {
    background: var(--ascensio-grey);
    color: var(--ascensio-dark-blue);
    border-radius: 18px 18px 4px 18px;
}

.assistant-message .message-content {
    background: #F9FAF5;
    color: #333;
    border-radius: 18px 18px 18px 4px;
    border: 1px solid var(--ascensio-pink);;
}

.system-message .message-content {
    background: #e8f5e8;
    color: #2d5a2d;
    border-radius: 18px;
    font-style: italic;
}

.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    text-align: right;
}

.user-message .message-time {
    text-align: left;
}

/* Chat Input */
.pinecone-chatbot-input {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e1e5e9;
}

.input-group {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.input-group textarea {
    flex: 1;
    border: 1px solid #e1e5e9;
    border-radius: 20px;
    padding: 10px 15px;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    max-height: 100px;
    outline: none;
    transition: border-color 0.2s ease;
}

.input-group textarea:focus {
    border-color: #667eea;
}

.input-group button {
    background: #667eea;
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.input-group button:hover:not(:disabled) {
    background: #5a6fd8;
    transform: scale(1.05);
}

.input-group button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.send-icon {
    font-size: 14px;
    transform: rotate(90deg);
}

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 12px;
    color: #666;
}

.char-count {
    font-size: 11px;
}

.streaming-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.streaming-toggle input[type="checkbox"] {
    margin: 0;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

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

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator 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;
    }
}

/* Access Denied Styles */
.pinecone-chatbot-access-denied {
    padding: 30px 20px;
    text-align: center;
    background: #f8f9fa;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.access-denied-content h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 18px;
}

.access-denied-content p {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.5;
}

.features-list {
    margin: 25px 0;
    text-align: left;
}

.feature {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    color: #555;
}

.feature-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.cta-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-buttons .button {
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;

    transition: all 0.2s ease;
}

.cta-buttons .button-primary {
    background: #667eea;
    color: white;
}

.cta-buttons .button-primary:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.cta-buttons .button:not(.button-primary) {
    background: white;
    color: #667eea;
    border: 1px solid #667eea;
}

.cta-buttons .button:not(.button-primary):hover {
    background: #f8f9fa;
}

/* Shortcode Styles */
.pinecone-chatbot-shortcode {
    border: 1px solid #e1e5e9;
    border-radius: 10px;
    overflow: hidden;
    background: white;
}

.pinecone-chatbot-shortcode .pinecone-chatbot-header {
    border-radius: 0;
}

.pinecone-chatbot-shortcode .pinecone-chatbot-messages {
    height: 300px;
}

.pinecone-chatbot-shortcode .input-group textarea {
    border-radius: 15px;
}

/* Dashboard Widget Styles */
.woocommerce-MyAccount-content-chatbot {
    margin: 30px 0;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.woocommerce-MyAccount-content-chatbot h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 20px;
}

.woocommerce-MyAccount-content-chatbot p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
}

.chatbot-dashboard-widget {
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
}

.chatbot-dashboard-widget .chatbot-messages {
    height: 250px;
    padding: 15px;
}

.chatbot-form {
    padding: 15px;
    background: #f8f9fa;
}

.chatbot-form .form-row {
    margin-bottom: 15px;
}

.chatbot-form .form-row:last-child {
    margin-bottom: 0;
}

.chatbot-form textarea {
    width: 100%;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 12px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
}

.chatbot-form textarea:focus {
    outline: none;
    border-color: #667eea;
}

.chatbot-form .button {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;

    transition: background 0.2s ease;
}

.chatbot-form .button:hover {
    background: #5a6fd8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .pinecone-chatbot-widget {
        width: calc(100vw - 40px);
        height: calc(100vh - 120px);
        bottom: 70px;
        right: 20px;
    }
    
    .pinecone-chatbot-toggle {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .pinecone-chatbot-shortcode {
        width: 100% !important;
    }
}

@media (max-width: 480px) {
    .pinecone-chatbot-container {
        bottom: 10px;
        right: 10px;
    }
    
    .pinecone-chatbot-widget {
        width: calc(100vw - 20px);
        right: 10px;
    }
    
    .message-content {
        max-width: 90%;
        padding: 10px 12px;
    }
    
    .pinecone-chatbot-messages {
        padding: 15px;
    }
    
    .pinecone-chatbot-input {
        padding: 12px 15px;
    }
}

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

.pinecone-chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

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

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

/* Loading States */
.pinecone-chatbot-widget.loading {
    pointer-events: none;
    opacity: 0.7;
}

.pinecone-chatbot-widget.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

