/* SRS AI ChatBot Public Styles */

/* Chat Widget Container */
.srs-chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.srs-chatbot-inline {
    position: relative;
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Toggle Button */
.srs-chatbot-toggle {
    position: relative;
}

.srs-chatbot-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.srs-chatbot-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.srs-chatbot-icon {
    width: 24px;
    height: 24px;
}

.srs-chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.srs-chatbot-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #ff4757;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: white;
}

/* Chat Window */
.srs-chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.srs-chatbot-inline .srs-chatbot-window {
    position: relative;
    bottom: auto;
    right: auto;
    width: 100%;
    height: 100%;
}

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

.srs-chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.srs-chatbot-header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.srs-chatbot-header-text h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.srs-chatbot-status {
    font-size: 12px;
    opacity: 0.8;
}

.srs-chatbot-header-actions {
    display: flex;
    gap: 8px;
}

.srs-chatbot-header-actions button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.srs-chatbot-header-actions button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.srs-chatbot-header-actions svg {
    width: 16px;
    height: 16px;
}

/* Messages Container */
.srs-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.srs-chatbot-message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
}

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

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

.srs-chatbot-message-content {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.srs-chatbot-message-user .srs-chatbot-message-content {
    background: #667eea;
    color: white;
    border-bottom-right-radius: 4px;
}

.srs-chatbot-message-bot .srs-chatbot-message-content {
    background: #f1f3f4;
    color: #333;
    border-bottom-left-radius: 4px;
}

.srs-chatbot-message-time {
    font-size: 11px;
    color: #666;
    margin-top: 4px;
    padding: 0 4px;
}

/* Typing Indicator */
.srs-chatbot-typing {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #f1f3f4;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    max-width: 80%;
}

.srs-chatbot-typing-dots {
    display: flex;
    gap: 4px;
}

.srs-chatbot-typing-dot {
    width: 6px;
    height: 6px;
    background: #666;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

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

/* Input Area */
.srs-chatbot-input-area {
    border-top: 1px solid #e0e0e0;
    padding: 16px;
}

.srs-chatbot-input-container {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: #f8f9fa;
    border-radius: 24px;
    padding: 8px;
    border: 1px solid #e0e0e0;
    transition: border-color 0.2s ease;
}

.srs-chatbot-input-container:focus-within {
    border-color: #667eea;
}

.srs-chatbot-file-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.srs-chatbot-file-btn:hover {
    background: #e0e0e0;
    color: #333;
}

.srs-chatbot-file-btn svg {
    width: 16px;
    height: 16px;
}

.srs-chatbot-input {
    flex: 1;
    border: none;
    outline: none;
    background: none;
    font-size: 14px;
    line-height: 1.4;
    padding: 8px 0;
    resize: none;
    max-height: 120px;
    min-height: 20px;
}

.srs-chatbot-send-btn {
    background: #667eea;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.srs-chatbot-send-btn:hover:not(:disabled) {
    background: #5a6fd8;
    transform: scale(1.05);
}

.srs-chatbot-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.srs-chatbot-send-btn svg {
    width: 16px;
    height: 16px;
}

/* File Preview */
.srs-chatbot-file-preview {
    margin-top: 8px;
    padding: 8px;
    background: #f1f3f4;
    border-radius: 8px;
    font-size: 12px;
}

.srs-chatbot-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
}

.srs-chatbot-file-remove {
    background: none;
    border: none;
    color: #ff4757;
    cursor: pointer;
    padding: 2px;
    border-radius: 2px;
}

/* Responsive Design */
@media (max-width: 480px) {
    .srs-chatbot-widget {
        bottom: 10px;
        right: 10px;
    }
    
    .srs-chatbot-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        bottom: 70px;
        right: -10px;
    }
}

/* Accessibility */
.srs-chatbot-widget [aria-label]:focus,
.srs-chatbot-widget button:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Shortcode Container */
.srs-chatbot-shortcode-container {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

/* WooCommerce Product Links */
.srs-message-type-woocommerce .srs-product-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: inline-block;
}

.srs-message-type-woocommerce .srs-product-link:hover {
    background: #667eea;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.srs-message-type-woocommerce .srs-product-link:visited {
    color: #5a6fd8;
}

.srs-message-type-woocommerce .srs-product-link:active {
    transform: translateY(0);
}

/* WooCommerce Message Formatting */
.srs-message-type-woocommerce .srs-chatbot-message-content {
    line-height: 1.6;
}

.srs-message-type-woocommerce strong {
    color: #333;
    font-weight: 600;
}

.srs-message-type-woocommerce em {
    color: #666;
    font-style: italic;
}

/* Better spacing for product lists */
.srs-message-type-woocommerce br + br {
    display: block;
    margin: 8px 0;
    content: "";
}

/* HTML Message Formatting */
.srs-message-type-html .srs-chatbot-message-content,
.srs-message-type-formatted .srs-chatbot-message-content {
    line-height: 1.6;
}

.srs-message-type-html strong,
.srs-message-type-formatted strong {
    color: #333;
    font-weight: 600;
}

.srs-message-type-html em,
.srs-message-type-formatted em {
    color: #666;
    font-style: italic;
}

.srs-message-type-html ul,
.srs-message-type-formatted ul {
    margin: 10px 0;
    padding-left: 20px;
}

.srs-message-type-html li,
.srs-message-type-formatted li {
    margin: 5px 0;
}

.srs-message-type-html a,
.srs-message-type-formatted a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.srs-message-type-html a:hover,
.srs-message-type-formatted a:hover {
    text-decoration: underline;
}
