/**
 * ════════════════════════════════════════════════════════════════
 * NEWS TERMINAL - STYLES COMPLETS
 * ════════════════════════════════════════════════════════════════
 */

/* GRADIENT TITLES */
.gradient-title {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}

.gradient-title i {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* REFRESH BUTTON */
.refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 36px rgba(102, 126, 234, 0.6);
}

.refresh-btn:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .refresh-btn .btn-text {
        display: none;
    }
    .refresh-btn {
        padding: 12px 16px;
    }
}

/* FILTERS SECTION AVEC CONTOURS */
.filters-section {
    margin-bottom: 32px;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    border-radius: 14px;
    border: 3px solid transparent;
    background-image: 
        linear-gradient(var(--glass-bg), var(--glass-bg)),
        linear-gradient(135deg, #667eea, #764ba2);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    transition: all 0.3s ease;
    position: relative;
}

.filter-group::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 14px;
    padding: 3px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.filter-group:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.25);
}

.filter-group:hover::before {
    opacity: 1;
}

.filter-group label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label i {
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.search-input,
.filter-select {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid var(--glass-border);
    border-radius: 10px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.search-input:focus,
.filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

/* STATS GRID */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 36px rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

.stat-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.stat-content { flex: 1; }

.stat-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
    line-height: 1.2;
}

.stat-sublabel {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* VIEW TOGGLES */
.section-header-with-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.view-toggles {
    display: flex;
    gap: 8px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    padding: 6px;
    border-radius: 12px;
    border: 2px solid var(--glass-border);
}

.view-btn {
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-btn:hover {
    color: var(--text-primary);
    background: rgba(102, 126, 234, 0.1);
}

.view-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.view-btn.active i {
    color: white !important;
}

/* ARTICLES GRID */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.articles-grid.list-view {
    grid-template-columns: 1fr;
}

.articles-grid.list-view .article-card {
    display: flex;
    flex-direction: row;
}

.articles-grid.list-view .article-image {
    width: 280px;
    height: 180px;
    flex-shrink: 0;
}

.article-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.article-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 16px 48px rgba(102, 126, 234, 0.3);
    border-color: #667eea;
}

.article-card:hover::before {
    opacity: 1;
}

.article-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    display: block;
}

.article-content {
    padding: 24px;
}

.article-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 12px;
}

.article-source {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #667eea;
    padding: 6px 12px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
}

.article-source i { font-size: 1rem; }

.article-actions {
    display: flex;
    gap: 8px;
}

.article-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 2px solid var(--glass-border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.article-action-btn:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: transparent;
    transform: scale(1.1);
}

.article-action-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: transparent;
}

.article-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-tickers {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.ticker-badge {
    padding: 4px 10px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ticker-badge:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--glass-border);
}

.article-date {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.article-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #667eea;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.article-link:hover { gap: 10px; }

/* LOADING STATES */
.loading-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}

.loading-state i {
    font-size: 3rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
}

.loading-state p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* LOAD MORE BUTTON */
.load-more-container {
    text-align: center;
    margin-top: 32px;
}

.load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 36px rgba(102, 126, 234, 0.6);
}

.load-more-btn:active {
    transform: translateY(0);
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .filters-grid { grid-template-columns: 1fr; }
    .filter-group { padding: 14px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .articles-grid { grid-template-columns: 1fr; }
    .articles-grid.list-view .article-card { flex-direction: column; }
    .articles-grid.list-view .article-image { width: 100%; height: 200px; }
    .stat-icon { width: 56px; height: 56px; font-size: 1.6rem; }
    .stat-value { font-size: 1.6rem; }
    .article-image { height: 180px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .article-image { height: 160px; }
}

.auto-load-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.auto-load-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
}

.auto-load-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.load-all-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    font-weight: 700;
    transition: all 0.3s ease;
}

.load-all-btn:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.4);
}

.article-counter {
    padding: 12px 20px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #667eea;
    text-align: center;
    margin: 16px 0;
}

/* ════════════════════════════════════════════════════════════
   NOUVEAUX BOUTONS - LOAD MODE & AUTO-SCROLL
   ════════════════════════════════════════════════════════════ */

/* Bouton Load MAX Articles */
.load-max-btn {
    width: 100%;
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.load-max-btn:hover {
    background: linear-gradient(135deg, #d97706, #b45309) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.5);
}

.load-max-btn:active {
    transform: translateY(0);
}

.load-max-btn i {
    font-size: 18px;
}

/* Container Auto-Load */
.auto-load-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.auto-load-container:hover {
    background: rgba(102, 126, 234, 0.1);
}

.auto-load-container input[type="checkbox"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: #667eea;
}

.auto-load-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.auto-load-label i {
    color: #667eea;
    font-size: 16px;
}

/* Dark Mode */
body.dark-mode .auto-load-container {
    background: rgba(102, 126, 234, 0.1);
}

body.dark-mode .auto-load-container:hover {
    background: rgba(102, 126, 234, 0.15);
}

/* ════════════════════════════════════════════════════════════
   FIX CRITIQUE - Particles ne doivent PAS bloquer les clics
   ════════════════════════════════════════════════════════════ */

.particles-background,
#particles-canvas {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: -1 !important; /* DERRIÈRE tout le contenu */
    pointer-events: none !important; /* NE PAS intercepter les clics */
    opacity: 0.6;
}

body.dark-mode .particles-background,
body.dark-mode #particles-canvas {
    opacity: 0.3;
}

/* Assurer que les filtres sont au-dessus */
.filters-section,
.filter-group,
.filter-select,
.load-max-btn,
.auto-load-container {
    position: relative !important;
    z-index: 10 !important; /* AU-DESSUS du canvas */
    pointer-events: auto !important; /* ACCEPTER les clics */
}

/* Forcer les boutons à être cliquables */
button,
input,
select,
.dashboard-btn,
.load-max-btn {
    pointer-events: auto !important;
    cursor: pointer !important;
    z-index: 10 !important;
}

/* Container principal au-dessus */
.main-content,
.container,
.section {
    position: relative !important;
    z-index: 1 !important;
}

/* ════════════════════════════════════════════════════════════
   FILTERS DROPDOWN STYLES
   ════════════════════════════════════════════════════════════ */

/* Header des filtres (toujours visible) */
.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 0;
}

.filters-header:hover {
    border-color: #667eea;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.filters-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

.filters-title i {
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.3rem;
}

.filter-count {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-left: 8px;
}

.filters-toggle-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.filters-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 18px rgba(102, 126, 234, 0.5);
}

.filters-toggle-btn i {
    transition: transform 0.3s ease;
}

/* Rotation de l'icône quand ouvert */
.filters-header:not(.collapsed) .filters-toggle-btn i {
    transform: rotate(180deg);
}

/* Container des filtres (collapsible) */
.filters-content {
    max-height: 2000px; /* Hauteur max quand ouvert */
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease,
                margin-top 0.3s ease;
    opacity: 1;
    margin-top: 20px;
}

.filters-content.collapsed {
    max-height: 0 !important;
    opacity: 0;
    margin-top: 0;
    pointer-events: none; /* Désactive les interactions quand fermé */
}

/* Ajustement de la grille existante */
.filters-content .filters-grid {
    padding-top: 0;
}

/* Animation du filtre actif */
.filter-group.has-value {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.filter-group.has-value::before {
    opacity: 1;
}

/* Badge pour les filtres actifs */
.filter-group.has-value label::after {
    content: '●';
    color: #10b981;
    font-size: 0.6rem;
    margin-left: 6px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Responsive */
@media (max-width: 768px) {
    .filters-header {
        padding: 16px 20px;
    }
    
    .filters-title {
        font-size: 1rem;
    }
    
    .filter-count {
        display: none; /* Masquer le compteur sur mobile */
    }
    
    .filters-toggle-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}

/* ✅ BADGES ENTREPRISES & PAYS */
.company-badge {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    border: 2px solid rgba(59, 130, 246, 0.3);
}

.company-badge:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
    border-color: rgba(59, 130, 246, 0.6);
    transform: translateY(-2px) scale(1.05);
}

.country-badge {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    border: 2px solid rgba(16, 185, 129, 0.3);
}

.country-badge:hover {
    background: linear-gradient(135deg, #059669, #047857) !important;
    border-color: rgba(16, 185, 129, 0.6);
    transform: translateY(-2px) scale(1.05);
}

.ticker-badge i {
    margin-right: 6px;
    font-size: 0.85em;
    opacity: 0.9;
}