/* AI Blog Recommender Frontend Styles */

/* Base recommendation container */
.aibr-recommendations {
    margin: 1.5em 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Loading state */
.aibr-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2em;
    color: #666;
}

.aibr-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: aibr-spin 1s linear infinite;
    margin-right: 0.5em;
}

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

/* Error state */
.aibr-error {
    padding: 1em;
    background: #fff2f2;
    border: 1px solid #f5c6c6;
    border-radius: 4px;
    color: #721c24;
    font-size: 0.9em;
}

/* Empty state */
.aibr-empty {
    padding: 1em;
    text-align: center;
    color: #666;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 4px;
}

/* AI Badge */
.aibr-ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    padding: 0.2em 0.6em;
    background: linear-gradient(135deg, #0073aa, #005a87);
    color: white;
    font-size: 0.75em;
    font-weight: 500;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0,115,170,0.3);
}

.aibr-ai-badge::before {
    content: '🤖';
    font-size: 1.1em;
}

/* Relevance indicator */
.aibr-relevance-indicator {
    position: relative;
    display: inline-block;
}

.aibr-relevance-bar {
    width: 60px;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
}

.aibr-relevance-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 2px;
    transition: width 0.8s ease;
}

/* Hover effects */
.aibr-recommendation-item {
    transition: all 0.3s ease;
}

.aibr-recommendation-item:hover {
    transform: translateY(-1px);
}

/* Focus management */
.aibr-recommendation-item a:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .aibr-content-box {
        background: #1a1a1a;
        border-color: #333;
        color: #e0e0e0;
    }
    
    .aibr-content-box-link {
        color: #4fc3f7;
    }
    
    .aibr-content-box-link:hover {
        color: #81d4fa;
    }
    
    .aibr-content-box-excerpt {
        color: #b0b0b0;
    }
    
    .aibr-inline-recommendations {
        background: #1a1a1a;
        border-color: #4fc3f7;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .aibr-recommendations {
        margin: 1em 0;
    }
    
    .aibr-content-box-meta {
        flex-direction: column;
        gap: 0.5em;
    }
    
    .aibr-inline-links {
        line-height: 1.8;
    }
    
    .aibr-separator {
        display: block;
        margin: 0.2em 0;
    }
}

/* Print styles */
@media print {
    .aibr-ai-badge,
    .aibr-relevance-indicator,
    .aibr-powered-by {
        display: none;
    }
    
    .aibr-content-box {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .aibr-content-box {
        border-width: 2px;
    }
    
    .aibr-content-box-link {
        text-decoration: underline;
    }
    
    .aibr-ai-badge {
        background: #000;
        border: 1px solid #fff;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .aibr-recommendation-item,
    .aibr-content-box,
    .aibr-relevance-fill {
        transition: none;
    }
    
    .aibr-loading::before {
        animation: none;
    }
    
    .aibr-recommendation-item:hover {
        transform: none;
    }
}

/* Animation classes */
.aibr-fade-in {
    animation: aibr-fadeIn 0.6s ease-in-out;
}

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

.aibr-slide-in {
    animation: aibr-slideIn 0.5s ease-out;
}

@keyframes aibr-slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Utility classes */
.aibr-hidden {
    display: none !important;
}

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

/* Custom scrollbar for content boxes */
.aibr-content-boxes {
    scrollbar-width: thin;
    scrollbar-color: #0073aa #f1f1f1;
}

.aibr-content-boxes::-webkit-scrollbar {
    width: 6px;
}

.aibr-content-boxes::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.aibr-content-boxes::-webkit-scrollbar-thumb {
    background: #0073aa;
    border-radius: 3px;
}

.aibr-content-boxes::-webkit-scrollbar-thumb:hover {
    background: #005a87;
}