/* News Fetcher Styles */

.recent-news-widget {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.recent-news-widget .widget-title {
    color: #333;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.news-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

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

.news-item:hover {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
    margin: 0 -15px;
}

.news-thumbnail {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    overflow: hidden;
    border-radius: 6px;
}

.news-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-item:hover .news-thumbnail img {
    transform: scale(1.05);
}

.news-content {
    flex: 1;
    min-width: 0;
}

.news-title {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

.news-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.news-title a:hover {
    color: #0073aa;
}

.news-excerpt {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    margin-bottom: 8px;
}

.news-source {
    font-size: 11px;
    color: #999;
    font-style: italic;
    margin-bottom: 5px;
}

.news-meta {
    font-size: 11px;
    color: #999;
    display: flex;
    align-items: center;
    gap: 10px;
}

.news-date {
    color: #666;
}

.news-original {
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
}

.news-original:hover {
    text-decoration: underline;
}

/* Admin Styles */
.news-fetcher-admin .postbox {
    margin-bottom: 20px;
}

.news-post-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid #ddd;
    margin: 8px 0;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.news-post-item.news-post {
    border-left: 4px solid #0073aa;
}

.news-post-actions {
    display: flex;
    gap: 8px;
}

.news-source {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

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

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

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #0073aa;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* News Categories Filter */
.news-categories-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.news-category-tag {
    padding: 6px 12px;
    background: #e9ecef;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    font-size: 12px;
    color: #495057;
    text-decoration: none;
    transition: all 0.3s ease;
}

.news-category-tag:hover,
.news-category-tag.active {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

/* Loading States */
.news-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.news-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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

/* Success/Error Messages */
.news-message {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-weight: 500;
}

.news-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.news-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .news-item {
        flex-direction: column;
        gap: 10px;
    }
    
    .news-thumbnail {
        width: 100%;
        height: 150px;
    }
    
    .news-stats {
        grid-template-columns: 1fr;
    }
    
    .news-categories-filter {
        flex-direction: column;
    }
    
    .news-post-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .news-post-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* News Post Meta Box */
.news-source-meta {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #0073aa;
}

.news-source-meta label {
    font-weight: 600;
    color: #333;
    display: block;
    margin-bottom: 5px;
}

.news-source-meta input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

.news-source-meta input:read-only {
    background: #f8f9fa;
    color: #666;
}

/* News Post Badge */
.news-post-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #0073aa;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 3px;
    margin-left: 10px;
}

/* Hover Effects */
.news-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* Animation for new posts */
@keyframes slideInFromTop {
    0% {
        transform: translateY(-20px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.news-item.new-post {
    animation: slideInFromTop 0.5s ease-out;
}

/* News API Status Indicator */
.api-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.api-status.connected {
    background: #d4edda;
    color: #155724;
}

.api-status.disconnected {
    background: #f8d7da;
    color: #721c24;
}

.api-status.pending {
    background: #fff3cd;
    color: #856404;
}

/* Shortcode Styles */
.news-posts-shortcode {
    margin: 20px 0;
}

.news-posts-shortcode .news-posts-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.news-posts-container {
    display: grid;
    gap: 20px;
}

.news-posts-grid .news-posts-container {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.news-posts-list .news-posts-container {
    grid-template-columns: 1fr;
}

.news-posts-cards .news-posts-container {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.news-post-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.news-post-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.news-post-thumbnail {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.news-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-post-item:hover .news-post-thumbnail img {
    transform: scale(1.05);
}

.news-post-content {
    padding: 20px;
}

.news-post-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

.news-post-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.news-post-title a:hover {
    color: #0073aa;
}

.news-post-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 15px;
}

.news-post-meta {
    font-size: 12px;
    color: #999;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.news-post-date {
    color: #666;
    font-weight: 500;
}

.news-post-categories {
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 12px;
    color: #495057;
}

.news-post-source {
    font-style: italic;
    color: #6c757d;
}

.news-post-original {
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
    padding: 2px 8px;
    border: 1px solid #0073aa;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.news-post-original:hover {
    background: #0073aa;
    color: #fff;
}

/* News Stats Shortcode */
.news-stats-shortcode {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 20px 0;
}

.news-stat-item {
    text-align: center;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #0073aa;
    min-width: 150px;
}

.news-stat-item .stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #0073aa;
    margin-bottom: 5px;
}

.news-stat-item .stat-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive Design for Shortcodes */
@media (max-width: 768px) {
    .news-posts-grid .news-posts-container,
    .news-posts-cards .news-posts-container {
        grid-template-columns: 1fr;
    }
    
    .news-stats-shortcode {
        flex-direction: column;
        align-items: center;
    }
    
    .news-post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .news-post-thumbnail {
        height: 150px;
    }
}
