/* ML Frontiers Feed Styles */
.ml-frontiers-feed {
    max-width: 100%;
    margin: 2rem 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

/* Header */
.ml-frontiers-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.feed-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.feed-title h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.view-all {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.view-all:hover {
    color: white;
    text-decoration: underline;
}

.feed-description {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
    line-height: 1.4;
}

/* Loading State */
.ml-frontiers-loading {
    padding: 3rem;
    text-align: center;
    color: #666;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Error State */
.ml-frontiers-error {
    padding: 2rem;
    text-align: center;
    color: #721c24;
    background: #f8d7da;
}

.error-message {
    margin: 0 0 1rem;
}

.retry-button {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

.retry-button:hover {
    background: #c82333;
}

/* Articles Container */
.ml-frontiers-articles {
    padding: 0;
}

/* Individual Article */
.ml-frontiers-article {
    display: flex;
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
}

.ml-frontiers-article:hover {
    background-color: #f8f9fa;
}

.ml-frontiers-article:last-child {
    border-bottom: none;
}

/* Article Image */
.article-image {
    flex-shrink: 0;
    margin-right: 1rem;
    width: 120px;
    height: 80px;
    overflow: hidden;
    border-radius: 6px;
    background: #f8f9fa;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.ml-frontiers-article:hover .article-image img {
    transform: scale(1.05);
}

/* Article Content */
.article-content {
    flex: 1;
    min-width: 0; /* Allows flex item to shrink below content size */
}

.article-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
}

.article-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.2s ease;
}

.article-title a:hover {
    color: #667eea;
    text-decoration: underline;
}

.article-subtitle {
    margin: 0 0 0.75rem 0;
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.4;
}

.article-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #868e96;
}

.article-date, .article-author {
    white-space: nowrap;
}

/* Footer */
.ml-frontiers-footer {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    text-align: center;
}

.subscribe-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.subscribe-link:hover {
    color: #5a67d8;
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .feed-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .ml-frontiers-article {
        flex-direction: column;
        padding: 1rem;
    }
    
    .article-image {
        margin-right: 0;
        margin-bottom: 1rem;
        width: 100%;
        height: 180px;
    }
    
    .article-meta {
        flex-direction: column;
        gap: 0.25rem;
    }
}

@media (max-width: 480px) {
    .ml-frontiers-header {
        padding: 1rem;
    }
    
    .ml-frontiers-article {
        padding: 0.75rem;
    }
    
    .feed-title h3 {
        font-size: 1.1rem;
    }
    
    .article-title {
        font-size: 1rem;
    }
    
    .article-image {
        height: 160px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .ml-frontiers-feed {
        background: #1a1a1a;
        border-color: #333;
        color: #e1e5e9;
    }
    
    .ml-frontiers-article:hover {
        background-color: #2a2a2a;
    }
    
    .ml-frontiers-article {
        border-bottom-color: #333;
    }
    
    .article-title a {
        color: #e1e5e9;
    }
    
    .article-title a:hover {
        color: #9f7aea;
    }
    
    .article-subtitle {
        color: #a0a0a0;
    }
    
    .article-meta {
        color: #888;
    }
    
    .ml-frontiers-footer {
        background: #2a2a2a;
        border-top-color: #333;
    }
    
    .subscribe-link {
        color: #9f7aea;
    }
    
    .subscribe-link:hover {
        color: #b794f6;
    }
    
    .article-image {
        background: #2a2a2a;
    }
}