/* AI Blog Helper Frontend Styles */

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

/* Floating Icon */
.abhg-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.abhg-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.abhg-icon img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.abhg-icon svg {
    width: 24px;
    height: 24px;
}

/* Chat Window */
.abhg-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
    transition: all 0.3s ease;
}

/* Expanded Chat Window */
.abhg-window.is-expanded {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    height: 80vh;
    bottom: auto;
    right: auto;
}

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

/* Header */
.abhg-header {
    padding: 16px 20px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.abhg-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.abhg-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.abhg-logo {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    object-fit: cover;
}

.abhg-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.abhg-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.abhg-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.abhg-expand {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.abhg-expand:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

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

.abhg-message {
    display: flex;
    margin-bottom: 12px;
}

.abhg-message-bot {
    justify-content: flex-start;
}

.abhg-message-user {
    justify-content: flex-end;
}

.abhg-message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.abhg-message-bot .abhg-message-content {
    background-color: #f1f3f4;
    color: #333;
}

.abhg-message-user .abhg-message-content {
    background-color: #0073aa;
    color: white;
}

/* Buttons */
.abhg-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.abhg-button {
    background-color: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    color: #333;
}

.abhg-button:hover {
    background-color: #e9ecef;
    border-color: #0073aa;
}

.abhg-button:active {
    transform: translateY(1px);
}

/* Input Container */
.abhg-input-container {
    padding: 16px 20px;
    border-top: 1px solid #e1e5e9;
    display: flex;
    gap: 8px;
    align-items: center;
}

.abhg-input {
    flex: 1;
    border: 1px solid #e1e5e9;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.abhg-input:focus {
    border-color: #0073aa;
}

.abhg-send {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.abhg-send:hover {
    transform: scale(1.05);
}

.abhg-send:active {
    transform: scale(0.95);
}

/* Contact Modal */
.abhg-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.abhg-modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.abhg-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.abhg-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

/* Form Styles */
.abhg-form-group {
    margin-bottom: 20px;
}

.abhg-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.abhg-form-group input,
.abhg-form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.abhg-form-group input:focus,
.abhg-form-group textarea:focus {
    border-color: #0073aa;
}

.abhg-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.abhg-form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 20px;
    border-top: 1px solid #e1e5e9;
}

.abhg-button-secondary {
    background-color: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #333;
}

.abhg-button-secondary:hover {
    background-color: #e9ecef;
}

.abhg-button-primary {
    background-color: #0073aa;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
}

.abhg-button-primary:hover {
    opacity: 0.9;
}

/* Loading State */
.abhg-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 14px;
}

.abhg-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #e1e5e9;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Related Articles */
.abhg-related-articles {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e1e5e9;
}

.abhg-related-articles h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.abhg-related-article {
    display: block;
    padding: 8px 12px;
    margin-bottom: 8px;
    background-color: #f8f9fa;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    font-size: 13px;
    transition: background-color 0.2s ease;
}

.abhg-related-article:hover {
    background-color: #e9ecef;
    text-decoration: none;
    color: #333;
}

.abhg-related-article-title {
    font-weight: 500;
    margin-bottom: 4px;
}

.abhg-related-article-excerpt {
    color: #666;
    line-height: 1.3;
}

/* Responsive Design */
@media (max-width: 768px) {
    .abhg-window {
        width: 90vw;
        max-width: 380px;
        height: 75vh;
        bottom: 15px;
        right: 15px;
        top: auto;
        left: auto;
        transform: none;
    }
    
    .abhg-window.is-expanded {
        width: 90vw;
        max-width: 380px;
        height: 75vh;
        bottom: 15px;
        right: 15px;
        top: auto;
        left: auto;
        transform: none;
    }
    
    .abhg-message-content {
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal;
    }
    
    .abhg-modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .abhg-form-actions {
        flex-direction: column;
    }
    
    .abhg-button-secondary,
    .abhg-button-primary {
        width: 100%;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .abhg-window {
        background: #1a1a1a;
        color: #ffffff;
    }
    
    .abhg-message-bot .abhg-message-content {
        background-color: #2d2d2d;
        color: #ffffff;
    }
    
    .abhg-button {
        background-color: #2d2d2d;
        border-color: #404040;
        color: #ffffff;
    }
    
    .abhg-button:hover {
        background-color: #404040;
    }
    
    .abhg-input {
        background-color: #2d2d2d;
        border-color: #404040;
        color: #ffffff;
    }
    
    .abhg-input:focus {
        border-color: #0073aa;
    }
    
    .abhg-modal-content {
        background: #1a1a1a;
        color: #ffffff;
    }
    
    .abhg-form-group input,
    .abhg-form-group textarea {
        background-color: #2d2d2d;
        border-color: #404040;
        color: #ffffff;
    }
    
    .abhg-button-secondary {
        background-color: #2d2d2d;
        border-color: #404040;
        color: #ffffff;
    }
    
    .abhg-related-article {
        background-color: #2d2d2d;
        color: #ffffff;
    }
    
    .abhg-related-article:hover {
        background-color: #404040;
    }
}
