/* RunLabs Futur News - Public Styles */

/* ====================
   MODE LISTE (Cards)
   ==================== */

.rfn-news-list {
    max-width: 1200px;
    margin: 0 auto;
}

.rfn-no-news {
    text-align: center;
    padding: 40px;
    background: #f9f9f9;
    border-radius: 8px;
    color: #666;
}

.rfn-news-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: row;
}

.rfn-news-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.rfn-news-image {
    width: 280px;
    flex-shrink: 0;
    overflow: hidden;
}

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

.rfn-news-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.rfn-news-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
    font-size: 13px;
}

.rfn-news-source {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
}

.rfn-source-benzinga {
    background: #ff6b35;
    color: #fff;
}

.rfn-source-stocknewsapi {
    background: #4ecdc4;
    color: #fff;
}

.rfn-source-finnhub {
    background: #f7931a;
    color: #fff;
}

.rfn-source-marketaux {
    background: #6c5ce7;
    color: #fff;
}

.rfn-source-nasdaq {
    background: #ff6b35;
    color: #fff;
}

.rfn-source-marketwatch {
    background: #00d4aa;
    color: #fff;
}

.rfn-source-cnbc {
    background: #6c5ce7;
    color: #fff;
}

.rfn-news-coins {
    color: #f7931a;
    font-weight: 600;
}

.rfn-news-sentiment {
    font-size: 18px;
}

.rfn-news-time {
    color: #999;
    font-size: 12px;
}

.rfn-news-title {
    margin: 0 0 12px;
    font-size: 22px;
    line-height: 1.3;
}

.rfn-news-title a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.2s;
}

.rfn-news-title a:hover {
    color: #2271b1;
}

.rfn-news-excerpt {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
    flex: 1;
}

.rfn-news-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
    font-size: 13px;
}

.rfn-news-author {
    color: #666;
}

.rfn-read-more {
    color: #2271b1;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.rfn-read-more:hover {
    color: #135e96;
}

/* Responsive Design */
@media (max-width: 768px) {
    .rfn-news-item {
        flex-direction: column;
    }
    
    .rfn-news-image {
        width: 100%;
        height: 200px;
    }
    
    .rfn-news-title {
        font-size: 18px;
    }
    
    .rfn-news-footer {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .rfn-news-item {
        background: #1a1a1a;
        border-color: #333;
    }
    
    .rfn-news-title a {
        color: #e0e0e0;
    }
    
    .rfn-news-title a:hover {
        color: #72aee6;
    }
    
    .rfn-news-excerpt {
        color: #b0b0b0;
    }
    
    .rfn-news-footer {
        border-top-color: #333;
    }
    
    .rfn-read-more {
        color: #72aee6;
    }
    
    .rfn-read-more:hover {
        color: #4f94d4;
    }
}

/* ====================
   MODE TABLEAU (v1.0.4)
   ==================== */

.rfn-news-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    overflow-x: auto;
}

/* Filtres Front-End */
.rfn-news-filters {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.rfn-filter-container {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.rfn-filter-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rfn-filter-item label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.rfn-filter-icon {
    font-size: 18px;
}

.rfn-frontend-filter {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 180px;
    background: #fff;
}

.rfn-reset-btn {
    padding: 8px 16px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}

.rfn-reset-btn:hover {
    background: #135e96;
}

.rfn-filter-results {
    margin-top: 10px;
    font-size: 13px;
    color: #666;
}

/* Bouton Fetch front-end (v1.3.0) */
.rfn-fetch-btn {
    padding: 8px 16px;
    background: #1a7f37;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}

.rfn-fetch-btn:hover {
    background: #14622a;
}

.rfn-fetch-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.rfn-fetch-status {
    margin-left: 10px;
    font-weight: 600;
}

.rfn-fetch-status.rfn-success {
    color: #1a7f37;
}

.rfn-fetch-status.rfn-error {
    color: #b32d2e;
}

.rfn-list-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.rfn-spin {
    display: inline-block;
    animation: rfn-spin 1s linear infinite;
}

@keyframes rfn-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Numéro de version du plugin (v1.3.0) */
.rfn-plugin-version {
    margin-top: 15px;
    padding-left: 4px;
    text-align: right;
    font-size: 12px;
    color: #999;
}

/* Tableau de News */
.rfn-news-table-container {
    background: #fff;
    border-radius: 8px;
    overflow-x: auto;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.rfn-news-table {
    width: 100%;
    min-width: 1400px;
    border-collapse: collapse;
    table-layout: fixed;
}

.rfn-news-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.rfn-news-table thead th {
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    border-bottom: 2px solid #fff;
    white-space: nowrap;
}

.rfn-news-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.2s;
}

.rfn-news-table tbody tr:hover {
    background: #f9f9f9;
}

.rfn-news-table tbody tr:last-child {
    border-bottom: none;
}

.rfn-news-table tbody td {
    padding: 12px 8px;
    vertical-align: top;
    font-size: 12px;
}

/* Colonnes - largeurs fixes */
.rfn-col-title {
    width: 40%;
    min-width: 320px;
}

.rfn-col-source {
    width: 9%;
    min-width: 100px;
    text-align: center;
}

.rfn-col-sentiment,
.rfn-col-sentiment-nlp,
.rfn-col-sentiment-google,
.rfn-col-sentiment-openai {
    width: 4%;
    min-width: 38px;
    text-align: center;
}

.rfn-col-coins,
.rfn-col-coins-nlp,
.rfn-col-coins-google,
.rfn-col-coins-openai {
    width: 5%;
    min-width: 45px;
    max-width: 55px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rfn-col-time {
    width: 4%;
    min-width: 45px;
    text-align: right;
}

/* Titre avec image */
.rfn-title-wrapper {
    display: flex;
    gap: 12px;
}

.rfn-title-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
}

.rfn-title-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rfn-title-content {
    flex: 1;
}

.rfn-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    line-height: 1.4;
}

.rfn-title a {
    color: #1a1a1a;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.rfn-title a:hover {
    color: #2271b1;
}

.rfn-excerpt {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 8px;
}

.rfn-author {
    font-size: 12px;
    color: #999;
}

/* Badges */
.rfn-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
}

.rfn-badge-benzinga {
    background: #ff6b35;
    color: #fff;
}

.rfn-badge-stocknewsapi {
    background: #4ecdc4;
    color: #fff;
}

.rfn-badge-finnhub {
    background: #f7931a;
    color: #fff;
}

.rfn-badge-marketaux {
    background: #6c5ce7;
    color: #fff;
}

.rfn-badge-nasdaq {
    background: #ff6b35;
    color: #fff;
}

.rfn-badge-marketwatch {
    background: #00d4aa;
    color: #fff;
}

.rfn-badge-cnbc {
    background: #6c5ce7;
    color: #fff;
}

/* Sentiment Badge */
.rfn-sentiment-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

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

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

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

/* Coins */
.rfn-coins-list {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.rfn-coin-tag {
    display: inline-block;
    padding: 2px 5px;
    background: #f7931a;
    color: #fff;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
}

.rfn-coin-more {
    display: inline-block;
    padding: 2px 5px;
    background: #e0e0e0;
    color: #666;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
}

.rfn-coin-link {
    display: block;
    padding: 1px 3px;
    background: #f7931a;
    color: #fff !important;
    border-radius: 2px;
    font-size: 8px;
    font-weight: 700;
    text-decoration: none;
    margin-bottom: 2px;
    white-space: nowrap;
    transition: background 0.2s;
    text-align: center;
}

.rfn-coin-link:hover {
    background: #e8850f;
    color: #fff !important;
}

.rfn-coin-more {
    display: block;
    padding: 1px 3px;
    background: #e0e0e0;
    color: #666;
    border-radius: 2px;
    font-size: 8px;
    font-weight: 700;
    cursor: help;
    text-align: center;
}

.rfn-no-coins {
    color: #999;
    font-size: 9px;
}

.rfn-empty,
.rfn-sentiment-empty {
    color: #ccc;
    font-size: 9px;
}

/* Time compact */
.rfn-time-ago {
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.rfn-time-label {
    display: none;
}

/* Time */
.rfn-time-ago {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.rfn-time-label {
    display: block;
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

/* Responsive */
@media (max-width: 1024px) {
    .rfn-col-title {
        width: 50%;
    }
    
    .rfn-col-source,
    .rfn-col-sentiment {
        width: 15%;
    }
    
    .rfn-col-coins {
        width: 20%;
    }
    
    .rfn-title-image {
        width: 60px;
        height: 60px;
    }
    
    .rfn-title {
        font-size: 14px;
    }
    
    .rfn-excerpt {
        display: none;
    }
}

@media (max-width: 768px) {
    .rfn-filter-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .rfn-filter-item {
        flex-direction: column;
        align-items: stretch;
    }
    
    .rfn-frontend-filter {
        width: 100%;
    }
    
    .rfn-news-table-container {
        overflow-x: auto;
    }
    
    .rfn-news-table {
        min-width: 700px;
    }
    
    .rfn-title-wrapper {
        flex-direction: column;
    }
    
    .rfn-title-image {
        width: 100%;
        height: 150px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .rfn-news-filters,
    .rfn-news-table-container {
        background: #1a1a1a;
    }
    
    .rfn-news-table tbody tr {
        border-color: #333;
    }
    
    .rfn-news-table tbody tr:hover {
        background: #222;
    }
    
    .rfn-title a {
        color: #e0e0e0;
    }
    
    .rfn-title a:hover {
        color: #72aee6;
    }
    
    .rfn-excerpt {
        color: #b0b0b0;
    }
    
    .rfn-frontend-filter {
        background: #2a2a2a;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .rfn-filter-item label {
        color: #e0e0e0;
    }
}

/* ====================
   PAGINATION (v1.1.5)
   ==================== */

.rfn-pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    flex-wrap: wrap;
    gap: 10px;
}

.rfn-pagination-info {
    font-size: 13px;
    color: #666;
}

.rfn-pagination-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.rfn-per-page {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
}

.rfn-per-page select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
    cursor: pointer;
}

.rfn-pagination-nav {
    display: flex;
    align-items: center;
    gap: 5px;
}

.rfn-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #333;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.rfn-page-btn:hover {
    background: #f0f0f0;
    border-color: #ccc;
}

.rfn-page-btn.active {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

.rfn-page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.rfn-page-ellipsis {
    padding: 0 5px;
    color: #999;
}

/* Dark mode pagination */
@media (prefers-color-scheme: dark) {
    .rfn-pagination-wrapper {
        background: #1a1a1a;
        border-color: #333;
    }
    
    .rfn-pagination-info,
    .rfn-per-page {
        color: #b0b0b0;
    }
    
    .rfn-per-page select {
        background: #2a2a2a;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .rfn-page-btn {
        background: #2a2a2a;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .rfn-page-btn:hover {
        background: #3a3a3a;
    }
    
    .rfn-page-btn.active {
        background: #2271b1;
        border-color: #2271b1;
    }
}
