/**
 * AI Facebook Chatbot Module Styles
 * 
 * @author AI Administrator Ltd
 * @copyright 2025 AI Administrator Ltd
 * @license Commercial License
 * @version 1.0.0
 * @file modules/aifacebook/views/css/aifacebook.css
 * 
 * Styling for the AI Facebook Chatbot module admin interface
 */

/* AI Administrator Ltd Branding */
.aifacebook-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.aifacebook-header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.aifacebook-header p {
    margin: 5px 0 0 0;
    opacity: 0.9;
    font-size: 14px;
}

/* Configuration Tabs */
.aifacebook-tabs {
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 20px;
}

.aifacebook-tab {
    display: inline-block;
    padding: 12px 24px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-bottom: none;
    margin-right: 5px;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: all 0.3s ease;
}

.aifacebook-tab:hover {
    background: #e9ecef;
}

.aifacebook-tab.active {
    background: white;
    border-bottom: 2px solid white;
    margin-bottom: -2px;
    font-weight: 600;
    color: #667eea;
}

/* Form Styling */
.aifacebook-form-group {
    margin-bottom: 20px;
}

.aifacebook-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #495057;
}

.aifacebook-form-group input,
.aifacebook-form-group textarea,
.aifacebook-form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.aifacebook-form-group input:focus,
.aifacebook-form-group textarea:focus,
.aifacebook-form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.aifacebook-form-group .help-text {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
}

/* Status Indicators */
.aifacebook-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.aifacebook-status.success {
    background: #d4edda;
    color: #155724;
}

.aifacebook-status.warning {
    background: #fff3cd;
    color: #856404;
}

.aifacebook-status.error {
    background: #f8d7da;
    color: #721c24;
}

.aifacebook-status.info {
    background: #d1ecf1;
    color: #0c5460;
}

/* Statistics Cards */
.aifacebook-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.aifacebook-stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
    border-left: 4px solid #667eea;
}

.aifacebook-stat-card h3 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 700;
    color: #667eea;
}

.aifacebook-stat-card p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
}

/* Knowledge Base */
.aifacebook-knowledge-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    transition: box-shadow 0.3s ease;
}

.aifacebook-knowledge-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.aifacebook-knowledge-title {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.aifacebook-knowledge-category {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    margin-right: 10px;
}

.aifacebook-knowledge-content {
    color: #6c757d;
    font-size: 14px;
    margin-top: 10px;
    max-height: 100px;
    overflow: hidden;
}

/* Conversation History */
.aifacebook-conversation {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.aifacebook-message {
    display: flex;
    margin-bottom: 15px;
    align-items: flex-start;
}

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

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

.aifacebook-message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
}

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

.aifacebook-message.bot .aifacebook-message-bubble {
    background: #f1f3f4;
    color: #333;
    border-bottom-left-radius: 4px;
}

.aifacebook-message-time {
    font-size: 11px;
    color: #6c757d;
    margin-top: 5px;
}

/* Buttons */
.aifacebook-btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.aifacebook-btn-primary {
    background: #667eea;
    color: white;
}

.aifacebook-btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.aifacebook-btn-secondary {
    background: #6c757d;
    color: white;
}

.aifacebook-btn-secondary:hover {
    background: #5a6268;
}

.aifacebook-btn-success {
    background: #28a745;
    color: white;
}

.aifacebook-btn-success:hover {
    background: #218838;
}

.aifacebook-btn-danger {
    background: #dc3545;
    color: white;
}

.aifacebook-btn-danger:hover {
    background: #c82333;
}

/* Alerts */
.aifacebook-alert {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.aifacebook-alert-success {
    background: #d4edda;
    color: #155724;
    border-left-color: #28a745;
}

.aifacebook-alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left-color: #ffc107;
}

.aifacebook-alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left-color: #dc3545;
}

.aifacebook-alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left-color: #17a2b8;
}

/* Loading Spinner */
.aifacebook-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: aifacebook-spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .aifacebook-stats {
        grid-template-columns: 1fr;
    }
    
    .aifacebook-tab {
        display: block;
        margin-bottom: 5px;
        margin-right: 0;
    }
    
    .aifacebook-message-bubble {
        max-width: 85%;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .aifacebook-conversation {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .aifacebook-message.bot .aifacebook-message-bubble {
        background: #4a5568;
        color: #e2e8f0;
    }
    
    .aifacebook-knowledge-item {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
}

/* Accessibility */
.aifacebook-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus indicators for keyboard navigation */
.aifacebook-btn:focus,
.aifacebook-tab:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .aifacebook-header,
    .aifacebook-btn,
    .aifacebook-tabs {
        display: none;
    }
    
    .aifacebook-conversation,
    .aifacebook-knowledge-item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
}
