/**
 * Scrollable News Cards CSS
 * Horizontal scrolling cards with images for real-time market data
 */

.sffc-news-container {
    width: 100%;
    padding: 15px 0;
    position: relative;
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 12px;
    margin: 20px 0;
}

.sffc-news-header {
    padding: 0 20px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sffc-news-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sffc-news-title::before {
    content: "📊";
    font-size: 20px;
}

.sffc-news-refresh {
    background: none;
    border: 1px solid #e0e0e0;
    color: #666;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sffc-news-refresh:hover {
    background: #f0f0f0;
    border-color: #999;
}

.sffc-news-scroll-wrapper {
    position: relative;
    overflow: hidden;
}

.sffc-news-scroll-container {
    display: flex;
    gap: 15px;
    padding: 0 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.2) transparent;
}

.sffc-news-scroll-container::-webkit-scrollbar {
    height: 6px;
}

.sffc-news-scroll-container::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.05);
    border-radius: 3px;
}

.sffc-news-scroll-container::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 3px;
}

.sffc-news-scroll-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.3);
}

.sffc-news-card {
    flex: 0 0 320px;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.sffc-news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.sffc-news-card-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.sffc-news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sffc-news-card-image.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    opacity: 0.7;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.sffc-news-category {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.sffc-news-card-content {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sffc-news-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 12px;
    color: #999;
}

.sffc-news-source {
    font-weight: 500;
    color: #666;
}

.sffc-news-time {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sffc-news-time::before {
    content: "•";
    color: #ccc;
}

.sffc-news-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sffc-news-card-description {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.sffc-news-card-footer {
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sffc-news-sentiment {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
}

.sffc-news-sentiment.positive {
    color: #10b981;
}

.sffc-news-sentiment.negative {
    color: #ef4444;
}

.sffc-news-sentiment.neutral {
    color: #6b7280;
}

.sffc-news-sentiment-icon {
    font-size: 14px;
}

.sffc-news-read-more {
    color: #667eea;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

.sffc-news-read-more:hover {
    color: #764ba2;
}

.sffc-news-read-more::after {
    content: "→";
    transition: transform 0.2s;
}

.sffc-news-read-more:hover::after {
    transform: translateX(3px);
}

/* Scroll buttons */
.sffc-news-scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.sffc-news-scroll-btn:hover {
    background: #f8f9fa;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.sffc-news-scroll-btn.prev {
    left: 10px;
}

.sffc-news-scroll-btn.next {
    right: 10px;
}

.sffc-news-scroll-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.sffc-news-scroll-btn svg {
    width: 20px;
    height: 20px;
    fill: #666;
}

/* Loading state */
.sffc-news-loading {
    display: flex;
    gap: 15px;
    padding: 0 20px;
}

.sffc-news-skeleton {
    flex: 0 0 320px;
    height: 320px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: sffc-skeleton-loading 1.5s infinite;
    border-radius: 10px;
}

@keyframes sffc-skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Empty state */
.sffc-news-empty {
    width: 100%;
    padding: 40px;
    text-align: center;
    color: #999;
}

.sffc-news-empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.sffc-news-empty-text {
    font-size: 14px;
    color: #666;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .sffc-news-card {
        flex: 0 0 280px;
    }
    
    .sffc-news-scroll-btn {
        display: none;
    }
    
    .sffc-news-container {
        margin: 10px 0;
    }
    
    .sffc-news-header {
        padding: 0 15px 10px;
    }
    
    .sffc-news-scroll-container {
        padding: 0 15px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .sffc-news-container {
        background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
    }
    
    .sffc-news-card {
        background: #1a1a1a;
        box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    }
    
    .sffc-news-card:hover {
        box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    }
    
    .sffc-news-title,
    .sffc-news-card-title {
        color: #f0f0f0;
    }
    
    .sffc-news-card-description {
        color: #999;
    }
    
    .sffc-news-card-footer {
        border-top-color: #2a2a2a;
    }
    
    .sffc-news-scroll-btn {
        background: #1a1a1a;
        border-color: #333;
    }
    
    .sffc-news-scroll-btn:hover {
        background: #222;
    }
}