/**
 * Feminism Magazine - AI Features CSS
 * Tasks 201-225: AI-powered features styles
 * Version: 1.0.0
 */

/* ============================================
   AI CONTENT RECOMMENDATIONS (Task 201)
   ============================================ */

.fem-ai-recommendations {
    min-height: 100px;
}

.fem-ai-rec-loading,
.fem-ai-rec-empty,
.fem-ai-rec-error {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.fem-ai-rec-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.fem-ai-rec-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.2s ease;
}

.fem-ai-rec-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.fem-ai-rec-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
}

.fem-ai-rec-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.fem-ai-rec-item:hover .fem-ai-rec-thumb img {
    transform: scale(1.05);
}

.fem-ai-rec-content {
    flex: 1;
    min-width: 0;
}

.fem-ai-rec-category {
    display: inline-block;
    font-size: 0.75rem;
    color: #D4486D;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.fem-ai-rec-title {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.fem-ai-rec-title a {
    color: #333;
    text-decoration: none;
}

.fem-ai-rec-title a:hover {
    color: #D4486D;
}

.fem-ai-rec-excerpt {
    font-size: 0.8125rem;
    color: #666;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.fem-ai-rec-meta {
    font-size: 0.75rem;
    color: #999;
}

/* Personalized Recommendations Block */
.fem-personalized-recommendations {
    margin-top: 3rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #fdf2f4 0%, #f8f9fa 100%);
    border-radius: 16px;
}

.fem-personalized-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #333;
}

.fem-personalized-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.fem-personalized-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #fff;
    border-radius: 12px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease;
}

.fem-personalized-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.fem-personalized-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.fem-personalized-item span {
    font-weight: 500;
    line-height: 1.4;
}

/* Churn Prevention Block */
.fem-churn-prevention {
    background: linear-gradient(135deg, #D4486D 0%, #B83A5A 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 16px;
    margin: 2rem 0;
}

.fem-churn-prevention h3 {
    margin-bottom: 0.75rem;
}

.fem-churn-articles {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.fem-churn-article {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: rgba(255,255,255,0.15);
    border-radius: 12px;
    color: white;
    text-decoration: none;
    transition: background 0.2s;
}

.fem-churn-article:hover {
    background: rgba(255,255,255,0.25);
}

.fem-churn-article img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
}

/* ============================================
   AI ARTICLE SUMMARIZATION (Task 202)
   ============================================ */

.fem-ai-summary-box {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid #D4486D;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 12px 12px 0;
}

.fem-ai-summary-title {
    font-size: 1rem;
    font-weight: 600;
    color: #D4486D;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fem-ai-summary-title::before {
    content: '⚡';
}

.fem-ai-summary-content {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: #444;
    margin-bottom: 1rem;
}

.fem-ai-summary-content br {
    margin-bottom: 0.5rem;
}

.fem-ai-summary-lengths {
    display: flex;
    gap: 0.5rem;
}

.fem-ai-summary-lengths button {
    padding: 0.375rem 0.75rem;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 20px;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.2s;
}

.fem-ai-summary-lengths button:hover,
.fem-ai-summary-lengths button.active {
    background: #D4486D;
    color: white;
    border-color: #D4486D;
}

.fem-ai-summary-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    font-size: 0.875rem;
    cursor: pointer;
    margin-bottom: 1rem;
    transition: all 0.2s;
}

.fem-ai-summary-toggle:hover {
    background: #e9ecef;
}

.fem-ai-summary-toggle.fem-ai-active {
    background: #D4486D;
    color: white;
    border-color: #D4486D;
}

/* ============================================
   AI SEARCH ENHANCEMENTS (Task 204)
   ============================================ */

.fem-ai-search-input {
    position: relative;
}

.fem-ai-search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    margin-top: 0.5rem;
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    display: none;
}

.fem-ai-search-suggestions.fem-ai-visible {
    display: block;
}

.fem-ai-suggestions-list {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
}

.fem-ai-suggestion-item {
    border-bottom: 1px solid #f0f0f0;
}

.fem-ai-suggestion-item:last-child {
    border-bottom: none;
}

.fem-ai-suggestion-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
}

.fem-ai-suggestion-item a:hover {
    background: #f8f9fa;
}

.fem-ai-suggestion-icon {
    font-size: 1.25rem;
}

.fem-ai-suggestion-text {
    flex: 1;
    font-size: 0.9375rem;
}

.fem-ai-suggestion-text mark {
    background: #ffe082;
    color: #333;
    padding: 0 2px;
    border-radius: 2px;
}

/* Intent Indicator */
.fem-ai-search-intent {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 20px;
    font-size: 0.75rem;
    margin-bottom: 0.75rem;
}

/* Corrected Query */
.fem-ai-search-corrected {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 1rem;
}

.fem-ai-search-corrected strong {
    color: #D4486D;
}

/* ============================================
   A/B TESTING (Task 210)
   ============================================ */

[data-ab-test] [data-ab-variant] {
    display: none;
}

[data-ab-test] [data-ab-variant].fem-ab-visible {
    display: block;
}

.fem-ab-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: #6c757d;
    color: white;
    border-radius: 4px;
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-left: 0.5rem;
}

/* ============================================
   AI META BOX STYLES
   ============================================ */

.fem-ai-meta-box {
    padding: 1rem 0;
}

.fem-ai-scores {
    margin-bottom: 1.5rem;
}

.fem-ai-score-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
}

.fem-ai-score-label {
    font-weight: 600;
    min-width: 90px;
    font-size: 0.8125rem;
}

.fem-ai-score-value {
    flex: 1;
    font-size: 0.8125rem;
}

.fem-ai-score-value.grade-a { color: #28a745; font-weight: 600; }
.fem-ai-score-value.grade-b { color: #6c757d; font-weight: 600; }
.fem-ai-score-value.grade-c { color: #ffc107; font-weight: 600; }
.fem-ai-score-value.grade-d { color: #fd7e14; font-weight: 600; }
.fem-ai-score-value.grade-f { color: #dc3545; font-weight: 600; }

.fem-ai-analyze {
    font-size: 11px !important;
    padding: 2px 8px !important;
}

.fem-ai-generate {
    width: 100%;
    text-align: left;
    margin-bottom: 8px !important;
}

.fem-ai-suggestion {
    background: #f0f0f1;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8125rem;
    transition: background 0.2s;
}

.fem-ai-suggestion:hover {
    background: #e0e0e1;
}

.fem-ai-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ============================================
   AI DASHBOARD WIDGET
   ============================================ */

.fem-ai-dashboard {
    padding: 1rem;
}

.fem-ai-dashboard-section {
    margin-bottom: 1.5rem;
}

.fem-ai-dashboard-section h4 {
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.fem-ai-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.fem-ai-stat-item {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.fem-ai-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #D4486D;
}

.fem-ai-stat-label {
    font-size: 0.75rem;
    color: #666;
    margin-top: 0.25rem;
}

.fem-ai-trend-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fem-ai-trend-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
    font-size: 0.875rem;
}

.fem-ai-trend-list li:last-child {
    border-bottom: none;
}

.fem-ai-trend-score {
    float: right;
    padding: 0.125rem 0.5rem;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 12px;
    font-size: 0.75rem;
}

/* ============================================
   FRESHNESS SCORE INDICATOR
   ============================================ */

.fem-freshness-score {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.fem-freshness-high {
    background: #d4edda;
    color: #155724;
}

.fem-freshness-medium {
    background: #fff3cd;
    color: #856404;
}

.fem-freshness-low {
    background: #f8d7da;
    color: #721c24;
}

/* ============================================
   SENTIMENT INDICATOR
   ============================================ */

.fem-sentiment-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.fem-sentiment-positive {
    background: #d4edda;
    color: #155724;
}

.fem-sentiment-negative {
    background: #f8d7da;
    color: #721c24;
}

.fem-sentiment-neutral {
    background: #e2e3e5;
    color: #383d41;
}

/* ============================================
   ACCESSIBILITY WARNINGS
   ============================================ */

.fem-ai-accessibility-warnings {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.fem-ai-accessibility-warnings h4 {
    color: #856404;
    margin-bottom: 0.5rem;
}

.fem-ai-accessibility-warnings ul {
    margin: 0;
    padding-left: 1.25rem;
}

.fem-ai-accessibility-warnings li {
    color: #856404;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

/* ============================================
   READABILITY BADGE
   ============================================ */

.fem-readability-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
}

.fem-readability-easy {
    background: #d4edda;
    color: #155724;
}

.fem-readability-standard {
    background: #e2e3e5;
    color: #383d41;
}

.fem-readability-difficult {
    background: #f8d7da;
    color: #721c24;
}

/* ============================================
   VIRAL POTENTIAL SCORE
   ============================================ */

.fem-viral-score {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.fem-viral-score-bar {
    flex: 1;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.fem-viral-score-fill {
    height: 100%;
    background: linear-gradient(90deg, #D4486D 0%, #B83A5A 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.fem-viral-score-value {
    font-weight: 600;
    color: #D4486D;
    font-size: 0.875rem;
}

/* ============================================
   TRANSLATION WIDGET
   ============================================ */

.fem-translation-widget {
    position: fixed;
    bottom: 90px;
    right: 20px;
    z-index: 999;
}

.fem-translation-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.fem-translation-btn:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.fem-translation-menu {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 0.5rem;
    margin-bottom: 8px;
    min-width: 150px;
    display: none;
}

.fem-translation-menu.visible {
    display: block;
}

.fem-translation-menu button {
    display: block;
    width: 100%;
    padding: 0.625rem 1rem;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: background 0.2s;
}

.fem-translation-menu button:hover {
    background: #f8f9fa;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    .fem-ai-rec-item {
        flex-direction: column;
    }
    
    .fem-ai-rec-thumb {
        width: 100%;
        height: 150px;
    }
    
    .fem-personalized-list {
        grid-template-columns: 1fr;
    }
    
    .fem-ai-stat-grid {
        grid-template-columns: 1fr;
    }
    
    .fem-translation-widget {
        bottom: 80px;
        right: 10px;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fem-ai-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fem-ai-rec-item,
.fem-personalized-item,
.fem-churn-article {
    animation: fem-ai-fade-in 0.3s ease forwards;
}

.fem-ai-rec-item:nth-child(1) { animation-delay: 0s; }
.fem-ai-rec-item:nth-child(2) { animation-delay: 0.05s; }
.fem-ai-rec-item:nth-child(3) { animation-delay: 0.1s; }
.fem-ai-rec-item:nth-child(4) { animation-delay: 0.15s; }
.fem-ai-rec-item:nth-child(5) { animation-delay: 0.2s; }

/* ============================================
   DARK MODE SUPPORT
   ============================================ */

@media (prefers-color-scheme: dark) {
    .fem-ai-rec-item,
    .fem-personalized-item {
        background: #2d2d2d;
    }
    
    .fem-ai-rec-title a,
    .fem-personalized-item {
        color: #e0e0e0;
    }
    
    .fem-ai-summary-box {
        background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    }
    
    .fem-ai-summary-content {
        color: #ccc;
    }
    
    .fem-ai-search-suggestions {
        background: #2d2d2d;
    }
    
    .fem-ai-suggestion-item {
        border-color: #444;
    }
    
    .fem-ai-suggestion-item a:hover {
        background: #3d3d3d;
    }
}
