/* AIOX AI Badge Styles */

.aiox-badge {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.4;
}

.aiox-badge-trigger {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 16px;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    min-width: 140px;
}

.aiox-badge-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.aiox-badge-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.aiox-badge-text {
    flex: 1;
    min-width: 0;
}

.aiox-badge-title {
    font-weight: 600;
    font-size: 13px;
    margin: 0;
    white-space: nowrap;
}

.aiox-badge-subtitle {
    font-size: 11px;
    opacity: 0.9;
    margin: 0;
    white-space: nowrap;
}

.aiox-badge-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.aiox-badge.expanded .aiox-badge-arrow {
    transform: rotate(180deg);
}

.aiox-badge-content {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 10px;
    width: 350px;
    max-width: 90vw;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid #e1e5e9;
    overflow: hidden;
    animation: aiox-slide-up 0.3s ease;
}

@keyframes aiox-slide-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.aiox-badge-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e1e5e9;
    background: #f8f9fa;
}

.aiox-badge-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.aiox-badge-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    color: #6c757d;
    transition: all 0.2s ease;
}

.aiox-badge-close:hover {
    background: #e9ecef;
    color: #495057;
}

.aiox-badge-body {
    max-height: 400px;
    overflow-y: auto;
}

.aiox-badge-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #6c757d;
}

.aiox-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: aiox-spin 1s linear infinite;
    margin-bottom: 12px;
}

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

.aiox-badge-qa-list {
    padding: 0;
}

.aiox-qa-item {
    border-bottom: 1px solid #e1e5e9;
    padding: 16px 20px;
    transition: background-color 0.2s ease;
}

.aiox-qa-item:last-child {
    border-bottom: none;
}

.aiox-qa-item:hover {
    background: #f8f9fa;
}

.aiox-qa-question {
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 8px 0;
    font-size: 14px;
    line-height: 1.4;
}

.aiox-qa-answer {
    color: #495057;
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

.aiox-qa-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 11px;
    color: #6c757d;
}

.aiox-confidence-badge {
    background: #e9ecef;
    color: #495057;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
}

.aiox-confidence-badge.high {
    background: #d4edda;
    color: #155724;
}

.aiox-confidence-badge.medium {
    background: #fff3cd;
    color: #856404;
}

.aiox-confidence-badge.low {
    background: #f8d7da;
    color: #721c24;
}

.aiox-badge-error {
    padding: 40px 20px;
    text-align: center;
    color: #dc3545;
}

.aiox-retry-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 12px;
    transition: background-color 0.2s ease;
}

.aiox-retry-btn:hover {
    background: #5a6fd8;
}

.aiox-badge-footer {
    padding: 12px 20px;
    border-top: 1px solid #e1e5e9;
    background: #f8f9fa;
}

.aiox-badge-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
}

.aiox-method-badge {
    background: #e9ecef;
    color: #495057;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.aiox-method-badge.aiox-method-ai {
    background: #d4edda;
    color: #155724;
}

.aiox-method-badge.aiox-method-basic {
    background: #fff3cd;
    color: #856404;
}

.aiox-powered-by {
    color: #6c757d;
    font-weight: 500;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .aiox-badge {
        bottom: 15px;
        right: 15px;
    }
    
    .aiox-badge-trigger {
        padding: 10px 14px;
        min-width: 120px;
    }
    
    .aiox-badge-content {
        width: 300px;
        max-width: calc(100vw - 30px);
    }
    
    .aiox-badge-title {
        font-size: 12px;
    }
    
    .aiox-badge-subtitle {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .aiox-badge-content {
        width: 280px;
        max-width: calc(100vw - 20px);
    }
    
    .aiox-badge-header,
    .aiox-badge-footer {
        padding: 12px 16px;
    }
    
    .aiox-qa-item {
        padding: 12px 16px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .aiox-badge-content {
        background: #2c3e50;
        border-color: #34495e;
        color: #ecf0f1;
    }
    
    .aiox-badge-header {
        background: #34495e;
        border-color: #4a5f7a;
    }
    
    .aiox-badge-header h3 {
        color: #ecf0f1;
    }
    
    .aiox-badge-close {
        color: #bdc3c7;
    }
    
    .aiox-badge-close:hover {
        background: #4a5f7a;
        color: #ecf0f1;
    }
    
    .aiox-qa-item:hover {
        background: #34495e;
    }
    
    .aiox-qa-question {
        color: #ecf0f1;
    }
    
    .aiox-qa-answer {
        color: #bdc3c7;
    }
    
    .aiox-badge-footer {
        background: #34495e;
        border-color: #4a5f7a;
    }
}


/* AI Enhancement Styles */
.aiox-ai-details {
    margin-bottom: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
    border-radius: 8px;
    border: 1px solid #b3d9ff;
}

.aiox-enhancement-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.aiox-ai-badge {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.aiox-provider-badge {
    background: #2196F3;
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.aiox-summary-section,
.aiox-topics-section,
.aiox-analysis-section {
    margin-bottom: 12px;
}

.aiox-summary-section h4,
.aiox-topics-section h4,
.aiox-analysis-section h4,
.aiox-qa-header h4 {
    margin: 0 0 8px 0;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.aiox-summary-section p {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
    color: #555;
}

.aiox-topics-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.aiox-topic-tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid #bbdefb;
}

.aiox-analysis-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.aiox-analysis-item {
    font-size: 12px;
    color: #666;
}

.aiox-divider {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #ddd 50%, transparent 100%);
    margin: 15px 0;
}

.aiox-qa-header {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f0f0;
}

/* Enhanced method badges */
.aiox-method-badge.aiox-method-openai {
    background: linear-gradient(135deg, #10a37f 0%, #0d8f6f 100%);
    color: white;
}

.aiox-method-badge.aiox-method-gemini {
    background: linear-gradient(135deg, #4285f4 0%, #3367d6 100%);
    color: white;
}

.aiox-method-badge.aiox-method-basic {
    background: linear-gradient(135deg, #757575 0%, #616161 100%);
    color: white;
}

/* Enhanced badge trigger for AI content */
.aiox-badge[data-ai-enhanced="true"] .aiox-badge-trigger {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.3);
}

.aiox-badge[data-ai-enhanced="true"] .aiox-badge-trigger:hover {
    box-shadow: 0 6px 25px rgba(76, 175, 80, 0.4);
}

/* AI enhancement indicator */
.aiox-badge-title.ai-enhanced::after {
    content: "🤖";
    margin-left: 4px;
    font-size: 12px;
}
