/**
 * ════════════════════════════════════════════════════════════════
 * TRENDING TOPICS - ULTRA RESPONSIVE & MODERN GAUGE
 * ════════════════════════════════════════════════════════════════
 */

/* ═══════════════════════════════════════════════════════════════
   TRENDING TOPICS CARDS - RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

.trending-topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.trending-topic-card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 16px;
    border: 2px solid var(--glass-border);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    min-height: 200px;
}

.trending-topic-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.trending-topic-card:hover::before {
    opacity: 1;
}

@media (hover: hover) {
    .trending-topic-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
        border-color: rgba(102, 126, 234, 0.5);
    }
}

.topic-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
}

.topic-name {
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    font-weight: 800;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.topic-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    position: relative;
}

.topic-icon::after {
    content: '🔥';
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.85; }
}

.topic-trend {
    font-size: 1.6rem;
    font-weight: 900;
    flex-shrink: 0;
}

.topic-trend.up { color: #10b981; }
.topic-trend.down { color: #ef4444; }
.topic-trend.neutral { color: #6b7280; }

.topic-mentions {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.topic-mentions .mention-count {
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.3rem;
    font-weight: 900;
}

.topic-timeline {
    height: 70px;
    position: relative;
    margin-top: 12px;
}

.topic-change-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
    margin-top: 12px;
}

.topic-change-badge.positive {
    background: linear-gradient(135deg, #10b981, #059669);
}

.topic-change-badge.negative {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.topic-change-badge.neutral {
    background: linear-gradient(135deg, #6b7280, #4b5563);
}

/* ═══════════════════════════════════════════════════════════════
   FEAR & GREED INDEX - DOUGHNUT MODERNE & ULTRA RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

.fear-greed-wrapper {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(16, 185, 129, 0.08));
    backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid rgba(239, 68, 68, 0.2);
    border-radius: 24px;
    padding: clamp(24px, 4vw, 40px);
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}

.fear-greed-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.1) 0%, transparent 70%);
    animation: pulseGlow 10s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

.fear-greed-header {
    text-align: center;
    margin-bottom: 32px;
    position: relative;
    z-index: 1;
}

.fear-greed-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #ef4444, #10b981);
    color: white;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.global-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-bottom: 8px;
}

.global-subtitle {
    font-size: clamp(0.9rem, 2vw, 1rem);
    color: var(--text-secondary);
}

/* ✅ STRUCTURE PRINCIPALE */
.fear-greed-main {
    background: var(--card-bg);
    border-radius: 20px;
    padding: clamp(24px, 4vw, 32px); /* ✅ Padding réduit */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--glass-border);
    position: relative;
    z-index: 1;
}

/* ✅ TITRE CENTRÉ */
.breakdown-title {
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    font-weight: 800;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 24px; /* ✅ Réduit pour remonter le doughnut */
    text-align: center;
    width: 100%;
}

/* ✅ GRID LAYOUT RESPONSIVE */
.fear-visual-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    align-items: center;
}

@media (min-width: 900px) {
    .fear-visual-wrapper {
        grid-template-columns: minmax(320px, 400px) 1fr;
    }
}

/* ✅ GAUGE CONTAINER */
.fear-greed-gauge {
    position: relative;
    width: 100%;
    max-width: 320px;
    height: auto;
    margin: 0 auto;
    filter: drop-shadow(0 8px 24px rgba(239, 68, 68, 0.3));
}

#fearGreedGauge {
    transition: transform 0.3s ease;
}

#fearGreedGauge:hover {
    transform: scale(1.05);
}

/* ✅ TEXTE CENTRAL (MASQUÉ SUR MOBILE) */
.gauge-center-fear {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    pointer-events: none;
    width: 100%;
}

.fear-value {
    font-size: clamp(2rem, 5vw, 2.5rem); /* ✅ FORTEMENT RÉDUIT : 3rem → 2.5rem sur PC */
    font-weight: 900;
    line-height: 1;
    margin-bottom: 4px; /* ✅ RÉDUIT : 6px → 4px */
    filter: drop-shadow(0 4px 16px rgba(239, 68, 68, 0.5));
    animation: pulseGlow 3s ease-in-out infinite;
}

.fear-label {
    font-size: clamp(0.75rem, 1.8vw, 0.85rem); /* ✅ FORTEMENT RÉDUIT : 0.95rem → 0.85rem sur PC */
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px; /* ✅ RÉDUIT : 1px → 0.8px */
    white-space: nowrap;
}

/* ✅ BREAKDOWN (BARRES) */
.fear-breakdown {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.fear-stat {
    background: var(--glass-bg);
    padding: 16px;
    border-radius: 14px;
    border: 2px solid var(--glass-border);
    transition: var(--transition-smooth);
}

@media (hover: hover) {
    .fear-stat:hover {
        transform: translateX(6px);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    }
}

.fear-stat-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fear-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    flex-shrink: 0;
}

.fear-stat-icon.fear-icon {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.fear-stat-icon.greed-icon {
    background: linear-gradient(135deg, #10b981, #059669);
}

.fear-stat-icon.neutral-icon {
    background: linear-gradient(135deg, #6b7280, #4b5563);
}

.fear-stat-label {
    flex: 1;
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    font-weight: 700;
    color: var(--text-primary);
}

.fear-stat-value {
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    font-weight: 900;
    color: var(--text-primary);
}

/* ✅ TIMELINE CHART */
.fear-timeline {
    margin-top: 24px;
    background: var(--card-bg);
    border-radius: 16px;
    padding: clamp(20px, 3vw, 28px);
    border: 1px solid var(--glass-border);
}

.fear-timeline-title {
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    font-weight: 800;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.fear-chart-wrapper {
    height: clamp(200px, 40vw, 300px);
    position: relative;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE TABLETTE (< 1200px)
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 1200px) {
    .fear-greed-gauge {
        max-width: 260px; /* ✅ Réduit */
    }
    
    .fear-value {
        font-size: 3rem;
    }
    
    .fear-label {
        font-size: 0.95rem;
    }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE MOBILE (< 768px)
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .fear-greed-main {
        padding: 24px 16px;
    }
    
    .fear-visual-wrapper {
        gap: 20px;
    }
    
    .fear-greed-gauge {
        max-width: 180px; /* ✅ Fortement réduit */
    }
    
    /* ✅ TEXTE CENTRAL MASQUÉ SUR MOBILE */
    .gauge-center-fear {
        display: none; /* ✅ Complètement masqué */
    }
    
    .breakdown-title {
        font-size: 1.2rem;
        margin-bottom: 16px;
    }
    
    .fear-stat {
        padding: 14px;
    }
    
    .fear-stat-icon {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE PETIT MOBILE (< 480px)
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
    .fear-greed-main {
        padding: 20px 12px;
        border-radius: 16px;
    }
    
    .fear-greed-gauge {
        max-width: 160px; /* ✅ Encore plus petit */
    }
    
    /* ✅ Texte central toujours masqué */
    .gauge-center-fear {
        display: none;
    }
    
    .breakdown-title {
        font-size: 1.1rem;
        margin-bottom: 14px;
    }
    
    .fear-stat {
        padding: 12px;
    }
    
    .fear-stat-icon {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    .fear-stat:hover {
        transform: translateX(4px);
    }
}

/* ═══════════════════════════════════════════════════════════════
   DARK MODE
   ═══════════════════════════════════════════════════════════════ */

body.dark-mode .fear-greed-wrapper {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(16, 185, 129, 0.12));
    border-color: rgba(239, 68, 68, 0.4);
}

body.dark-mode .fear-greed-main {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

body.dark-mode .fear-stat {
    background: rgba(255, 255, 255, 0.03);
}

@media (hover: hover) {
    body.dark-mode .fear-stat:hover {
        background: rgba(255, 255, 255, 0.05);
    }
}

body.dark-mode .fear-greed-gauge {
    filter: drop-shadow(0 8px 24px rgba(239, 68, 68, 0.5));
}

/* ═══════════════════════════════════════════════════════════════
   RISKS & OPPORTUNITIES - RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

.risks-opportunities-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

@media (min-width: 900px) {
    .risks-opportunities-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.risk-opportunity-panel {
    background: var(--card-bg);
    border-radius: 20px;
    padding: clamp(20px, 3vw, 32px);
    border: 2px solid var(--glass-border);
    position: relative;
    overflow: hidden;
}

.risk-opportunity-panel.risks {
    border-left: 4px solid #ef4444;
}

.risk-opportunity-panel.opportunities {
    border-left: 4px solid #10b981;
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.panel-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: white;
    flex-shrink: 0;
}

.panel-icon.risk {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.panel-icon.opportunity {
    background: linear-gradient(135deg, #10b981, #059669);
}

.panel-title {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    font-weight: 800;
    color: var(--text-primary);
}

.panel-subtitle {
    font-size: clamp(0.85rem, 2vw, 0.9rem);
    color: var(--text-secondary);
    margin-top: 4px;
}

.risk-opportunity-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.risk-opportunity-item {
    background: var(--glass-bg);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    transition: var(--transition-smooth);
    cursor: pointer;
}

@media (hover: hover) {
    .risk-opportunity-item:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    }
}

.item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 12px;
    flex-wrap: wrap;
}

.item-name {
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.item-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    flex-shrink: 0;
}

.item-badge.high-risk {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.item-badge.high-opportunity {
    background: linear-gradient(135deg, #10b981, #059669);
}

.item-description {
    font-size: clamp(0.85rem, 2vw, 0.95rem);
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 10px;
}

.item-metrics {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.metric {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: clamp(0.8rem, 1.8vw, 0.85rem);
    color: var(--text-tertiary);
}

.metric i {
    font-size: 0.9rem;
}

.metric strong {
    color: var(--text-primary);
    font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════
   ENTITY BADGES
   ═══════════════════════════════════════════════════════════════ */

.entity-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    transition: all 0.3s ease;
    margin-right: 6px;
    margin-bottom: 6px;
}

.company-badge {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    color: white;
    border: 2px solid rgba(59, 130, 246, 0.3);
}

@media (hover: hover) {
    .company-badge:hover {
        background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
        transform: translateY(-2px) scale(1.05);
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    }
}

.country-badge {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: white;
    border: 2px solid rgba(16, 185, 129, 0.3);
}

@media (hover: hover) {
    .country-badge:hover {
        background: linear-gradient(135deg, #059669, #047857) !important;
        transform: translateY(-2px) scale(1.05);
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    }
}

.entity-badge i {
    font-size: 0.7em;
    opacity: 0.9;
}

.article-entities {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS - MOBILE FIRST
   ═══════════════════════════════════════════════════════════════ */

/* ✅ TRÈS PETITS ÉCRANS (iPhone SE, etc.) */
@media (max-width: 380px) {
    .trending-topics-grid {
        gap: 16px;
    }
    
    .trending-topic-card {
        padding: 16px;
    }
    
    .topic-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .fear-greed-wrapper {
        padding: 16px;
    }
    
    .fear-greed-main {
        padding: 16px;
        gap: 24px;
    }
    
    .fear-greed-gauge {
        max-width: 280px;
    }
    
    .panel-icon {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
    }
}

/* ✅ PETITS MOBILES (iPhone 12/13/14, Galaxy S) */
@media (max-width: 480px) {
    .fear-breakdown {
        gap: 12px;
    }
    
    .fear-stat {
        padding: 14px;
    }
    
    .fear-stat-icon {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
    
    .item-metrics {
        gap: 10px;
    }
}

/* ✅ TABLETTES PORTRAIT */
@media (min-width: 768px) and (max-width: 899px) {
    .trending-topics-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 24px;
    }
}

/* ✅ GRANDS ÉCRANS */
@media (min-width: 1400px) {
    .fear-greed-gauge {
        max-width: 400px;
    }
    
    .fear-greed-gauge canvas {
        max-height: 200px !important;
    }
}

/* ═══════════════════════════════════════════════════════════════
   DARK MODE
   ═══════════════════════════════════════════════════════════════ */

body.dark-mode .fear-greed-wrapper {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(16, 185, 129, 0.12));
    border-color: rgba(239, 68, 68, 0.4);
}

body.dark-mode .fear-greed-main {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

body.dark-mode .fear-stat {
    background: rgba(255, 255, 255, 0.03);
}

@media (hover: hover) {
    body.dark-mode .fear-stat:hover {
        background: rgba(255, 255, 255, 0.05);
    }
}

/* ═══════════════════════════════════════════════════════════════
   TOUCH OPTIMIZATION (iOS/Android)
   ═══════════════════════════════════════════════════════════════ */

@media (hover: none) and (pointer: coarse) {
    /* Touch-friendly buttons */
    .trending-topic-card,
    .risk-opportunity-item,
    .fear-stat {
        min-height: 44px; /* iOS recommendation */
    }
    
    /* Disable transform on touch to avoid lag */
    .trending-topic-card:active {
        transform: scale(0.98);
    }
    
    .risk-opportunity-item:active {
        transform: scale(0.98);
    }
    
    /* Optimize animations for mobile */
    * {
        -webkit-tap-highlight-color: transparent;
    }
}

/* ═══════════════════════════════════════════════════════════════
   PERFORMANCE OPTIMIZATIONS
   ═══════════════════════════════════════════════════════════════ */

.trending-topic-card,
.fear-greed-gauge,
.risk-opportunity-item {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════════════════════════════
   MODAL ENTREPRISE - ULTRA RESPONSIVE & OPTIMIZED
   ═══════════════════════════════════════════════════════════════ */

.company-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.company-modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    position: relative;
    background: var(--card-bg);
    border-radius: 24px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 2px solid var(--glass-border);
}

@keyframes slideUp {
    from { 
        opacity: 0; 
        transform: translateY(30px) scale(0.95);
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1);
    }
}

/* ═══════════════════════════════════════════════════════════════
   MODAL HEADER
   ═══════════════════════════════════════════════════════════════ */

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 32px;
    border-bottom: 2px solid var(--glass-border);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.08));
}

.modal-title-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.modal-company-logo {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--glass-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid var(--glass-border);
    overflow: hidden;
}

.modal-company-logo img.company-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
}

.modal-company-logo .logo-initials {
    font-size: 1.2rem;
    font-weight: 900;
}

.modal-company-name {
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    font-weight: 900;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.modal-company-ticker {
    font-size: clamp(0.9rem, 2vw, 1rem);
    color: var(--text-tertiary);
    font-weight: 700;
    margin: 4px 0 0 0;
}

.modal-close {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
}

.modal-close:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: transparent;
    color: white;
    transform: rotate(90deg) scale(1.15);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.5);
}

/* ═══════════════════════════════════════════════════════════════
   SENTIMENT BADGE
   ═══════════════════════════════════════════════════════════════ */

.modal-sentiment-badge {
    margin: 24px 32px;
    padding: 16px 20px;
    border-radius: 16px;
    font-size: clamp(0.95rem, 2vw, 1.05rem);
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-sentiment-badge.opportunity {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
}

.modal-sentiment-badge.risk {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3);
}

.modal-sentiment-badge.neutral {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    box-shadow: 0 8px 24px rgba(107, 114, 128, 0.3);
}

/* ═══════════════════════════════════════════════════════════════
   ACTION BUTTONS - EFFETS DOUX & PROFESSIONNELS
   ═══════════════════════════════════════════════════════════════ */

.modal-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    padding: 0 32px 28px 32px;
}

.modal-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    border-radius: 12px;
    border: none;
    color: white;
    font-size: clamp(0.95rem, 2vw, 1.05rem);
    font-weight: 800;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* ✅ EFFET GLOW ANIMÉ AU SURVOL */
.modal-action-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.modal-action-btn:hover::before {
    width: 300px;
    height: 300px;
}

/* ✅ BOUTON ANALYZE - VIOLET */
.modal-action-btn.analyze {
    background: linear-gradient(135deg, #667eea, #764ba2);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.modal-action-btn.analyze:hover {
    background: linear-gradient(135deg, #764ba2, #8b5cf6);
    transform: translateY(-6px) scale(1.05);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.6),
                0 0 30px rgba(102, 126, 234, 0.4);
}

.modal-action-btn.analyze:active {
    transform: translateY(-2px) scale(1.02);
}

/* ✅ BOUTON PREDICT - BLEU */
.modal-action-btn.predict {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.modal-action-btn.predict:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-6px) scale(1.05);
    box-shadow: 0 12px 40px rgba(59, 130, 246, 0.6),
                0 0 30px rgba(59, 130, 246, 0.4);
}

.modal-action-btn.predict:active {
    transform: translateY(-2px) scale(1.02);
}

.modal-action-btn i {
    font-size: 1.2rem;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-action-btn:hover i {
    transform: scale(1.2) rotate(10deg);
}

/* ═══════════════════════════════════════════════════════════════
   STATS GRID
   ═══════════════════════════════════════════════════════════════ */

.modal-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
    padding: 24px 32px;
    background: var(--glass-bg);
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
}

.modal-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
}

.modal-stat i {
    font-size: 1.6rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    display: block;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    font-weight: 900;
    color: var(--text-primary);
    display: block;
}

/* ═══════════════════════════════════════════════════════════════
   ARTICLES SECTION - FIX SCROLL & SPACER
   ═══════════════════════════════════════════════════════════════ */

.modal-section {
    padding: 28px 32px 16px 32px; /* ✅ Padding-bottom réduit (le spacer JS gère l'espace) */
}

.modal-section-title {
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ✅ CONTAINER AVEC SCROLL OPTIMISÉ */
.modal-articles-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 14px; /* ✅ Augmenté pour compenser la scrollbar */
    padding-bottom: 0; /* ✅ Géré par le spacer JS */
    scroll-padding-bottom: 80px; /* ✅ Scroll intelligent */
}

/* ✅ SCROLLBAR OPTIMISÉE */
.modal-articles-list::-webkit-scrollbar {
    width: 8px; /* ✅ Réduit : 10px → 8px */
}

.modal-articles-list::-webkit-scrollbar-track {
    background: var(--glass-bg);
    border-radius: 8px;
    margin: 4px 0;
}

.modal-articles-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 8px;
    border: 2px solid var(--card-bg);
}

.modal-articles-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
}

/* ✅ CARTE ARTICLE - TAILLE FIXE */
.modal-article-card {
    background: var(--glass-bg);
    border-radius: 14px;
    padding: 18px 20px;
    border-left: 4px solid #6b7280;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    min-height: 130px; /* ✅ Hauteur minimum garantie */
    flex-shrink: 0; /* ✅ CRITIQUE : Empêche la compression */
    width: 100%; /* ✅ Largeur complète */
}

.modal-article-card:hover {
    transform: translateX(6px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.article-sentiment-indicator {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 4px 0 0 4px;
}

.article-sentiment-indicator.positive {
    background: linear-gradient(135deg, #10b981, #059669);
}

.article-sentiment-indicator.negative {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.article-sentiment-indicator.neutral {
    background: linear-gradient(135deg, #6b7280, #4b5563);
}

.article-content {
    margin-left: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 100%; /* ✅ Prend toute la hauteur */
}

.article-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.article-source {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-time {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    font-weight: 600;
}

/* ✅ TITRE ARTICLE */
.article-title {
    font-size: clamp(0.95rem, 2vw, 1.05rem);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ✅ FOOTER TOUJOURS VISIBLE */
.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 14px;
    border-top: 1px solid var(--glass-border);
    margin-top: auto; /* ✅ Pousse en bas */
    min-height: 46px; /* ✅ Hauteur minimum garantie */
}

.article-sentiment {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.article-sentiment i {
    font-size: 1rem;
}

.sentiment-score {
    padding: 4px 10px;
    border-radius: 8px;
    background: var(--glass-bg);
    font-weight: 900;
    border: 1px solid var(--glass-border);
}

/* ✅ BOUTON "READ MORE" - TOUJOURS VISIBLE */
.article-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #3b82f6;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 8px 16px; /* ✅ Padding augmenté */
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    white-space: nowrap;
    flex-shrink: 0;
}

.article-link:hover {
    background: rgba(59, 130, 246, 0.2);
    color: #2563eb;
    gap: 10px;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.article-link i {
    transition: transform 0.3s ease;
}

.article-link:hover i {
    transform: translateX(3px);
}

/* ═══════════════════════════════════════════════════════════════
   LOGOS D'ENTREPRISES - CARTES & MODAL
   ═══════════════════════════════════════════════════════════════ */

.company-logo-mini {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    margin-right: 10px;
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.company-logo-mini img.company-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

.logo-initials {
    font-size: 0.75rem;
    font-weight: 900;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.item-name {
    display: flex;
    align-items: center;
}

.item-name span {
    flex: 1;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE MOBILE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .company-modal {
        padding: 0;
        align-items: flex-end;
    }
    
    .modal-content {
        max-height: 95vh;
        border-radius: 20px 20px 0 0;
        max-width: 100%;
    }
    
    .modal-header {
        padding: 20px;
    }
    
    .modal-company-logo {
        width: 48px;
        height: 48px;
    }
    
    .modal-sentiment-badge,
    .modal-section {
        padding: 20px;
    }
    
    .modal-actions {
        grid-template-columns: 1fr;
        padding: 0 20px 20px 20px;
    }
    
    .modal-stats {
        grid-template-columns: repeat(2, 1fr);
        padding: 20px;
    }
    
    .modal-section {
        padding: 20px 20px 28px 20px; /* ✅ Padding-bottom augmenté */
    }
    
    .modal-articles-list {
        max-height: 400px;
        padding-right: 8px;
        padding-bottom: 40px; /* ✅ CONSERVÉ : 40px */
    }
    
    .modal-article-card {
        padding: 16px;
        min-height: 110px;
    }
    
    .modal-article-card:last-child {
        margin-bottom: 8px; /* ✅ CONSERVÉ */
    }
}

@media (max-width: 480px) {
    .modal-stats {
        grid-template-columns: 1fr;
    }
    
    .modal-action-btn {
        font-size: 0.9rem;
        padding: 14px 20px;
    }
    
    .modal-actions {
        gap: 12px;
    }
    
    .modal-section {
        padding: 20px 16px 28px 16px;
    }
    
    .modal-articles-list {
        gap: 12px;
        padding-bottom: 40px; /* ✅ CONSERVÉ : 40px */
    }
    
    .modal-article-card:last-child {
        margin-bottom: 8px; /* ✅ CONSERVÉ */
    }
    
    .company-logo-mini {
        width: 32px;
        height: 32px;
        margin-right: 8px;
    }
    
    .modal-company-logo {
        width: 48px;
        height: 48px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   DARK MODE OPTIMIZATIONS
   ═══════════════════════════════════════════════════════════════ */

body.dark-mode .modal-content {
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
}

body.dark-mode .modal-article-card {
    background: rgba(255, 255, 255, 0.03);
}

body.dark-mode .modal-article-card:hover {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-mode .article-link {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
}

body.dark-mode .article-link:hover {
    background: rgba(59, 130, 246, 0.25);
}

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS SUPPLÉMENTAIRES
   ═══════════════════════════════════════════════════════════════ */

@keyframes slideInArticle {
    from { 
        opacity: 0; 
        transform: translateY(10px);
    }
    to { 
        opacity: 1; 
        transform: translateY(0);
    }
}

.modal-article-card {
    animation: slideInArticle 0.3s ease forwards;
}

.modal-article-card:nth-child(1) { animation-delay: 0.05s; }
.modal-article-card:nth-child(2) { animation-delay: 0.1s; }
.modal-article-card:nth-child(3) { animation-delay: 0.15s; }
.modal-article-card:nth-child(4) { animation-delay: 0.2s; }
.modal-article-card:nth-child(5) { animation-delay: 0.25s; }