/**
 * ====================================================================
 * ALPHAVAULT AI - INVESTMENT ANALYTICS PRO - STYLES COMPLETS
 * ====================================================================
 * Design: Glassmorphism + Gradient Titles + Ultra Premium
 * Performance optimisée • Animations élégantes • Design moderne
 * ✅ MODALS 100% PRÉSERVÉES • Responsive PC & Mobile Parfait
 * ✅ CORRECTIONS FINALES: Charts responsive, Icônes gradient, Alignements
 */

/* ========================================
   VARIABLES
   ======================================== */
:root {
    --ml-primary: #667eea;
    --ml-secondary: #764ba2;
    --ml-accent: #f093fb;
    --ml-success: #43e97b;
    --ml-danger: #f5576c;
    --ml-warning: #f6d365;
    
    --ml-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --ml-gradient-soft: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    --ml-gradient-animated: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    
    /* ✨ Asset Allocation Colors */
    --asset-equity-color: #2563eb;
    --asset-bonds-color: #10b981;
    --asset-crypto-color: #f59e0b;
    --asset-commodities-color: #8b5cf6;
    --asset-real-estate-color: #06b6d4;
    --asset-cash-color: #64748b;
    
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-shadow: 0 8px 32px rgba(102, 126, 234, 0.15);
    
    --glow-primary: 0 0 20px rgba(102, 126, 234, 0.4);
    --glow-success: 0 0 20px rgba(67, 233, 123, 0.4);
    --glow-danger: 0 0 20px rgba(245, 87, 108, 0.4);
    
    --transition-fast: all 0.2s ease;
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    --border-radius: 16px;
    --border-radius-lg: 24px;
}

body.dark-mode {
    --glass-bg: rgba(15, 23, 42, 0.95);
    --glass-border: rgba(100, 116, 139, 0.3);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* ========================================
   ANIMATIONS GLOBALES
   ======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideRight {
    0%, 100% { 
        transform: translateX(0); 
        opacity: 1; 
    }
    50% { 
        transform: translateX(200px); 
        opacity: 0; 
    }
}

@keyframes gradientShift {
    0%, 100% { 
        background-position: 0% 50%; 
    }
    50% { 
        background-position: 100% 50%; 
    }
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1); 
    }
    50% { 
        opacity: 0.85; 
        transform: scale(1.05); 
    }
}

@keyframes floatIcon {
    0%, 100% { 
        transform: translateY(0); 
    }
    50% { 
        transform: translateY(-5px); 
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes spin {
    to { 
        transform: rotate(360deg); 
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ========================================
   GRADIENT TITLES
   ======================================== */
.gradient-title {
    background: var(--ml-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}

.page-title,
.top-header h1,
#pageTitle {
    font-size: 1.5rem !important;
    font-weight: 800 !important;
    background: var(--ml-gradient) !important;
    background-size: 200% 200% !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    margin: 0 !important;
    animation: gradientShift 3s ease infinite !important;
}

.page-title i,
.top-header h1 i,
#pageTitle i {
    background: var(--ml-gradient) !important;
    background-size: 200% 200% !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    font-size: 1.3rem !important;
    animation: floatIcon 3s ease-in-out infinite !important;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--ml-gradient);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    animation: gradientShift 3s ease infinite;
}

.section-title i {
    background: var(--ml-gradient);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.3rem;
    animation: floatIcon 3s ease-in-out infinite;
}

.chart-title {
    font-size: 1.1rem;
    font-weight: 700;
    background: var(--ml-gradient);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
    animation: gradientShift 3s ease infinite;
}

/* ========================================
   HEADER BUTTONS
   ======================================== */
.header-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-icon {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 15px;
    cursor: pointer;
    transition: var(--transition-smooth);
    color: var(--text-primary);
    font-size: 1rem;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.3), transparent);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.btn-icon:hover::before {
    width: 200px;
    height: 200px;
}

.btn-icon:hover {
    background: var(--ml-primary);
    color: white;
    border-color: var(--ml-primary);
    transform: translateY(-3px);
    box-shadow: var(--glow-primary);
}

/* ✅ CORRECTION: Icônes en dégradé sur boutons Active Allocation */
.btn-icon i,
.manager-header .btn-primary i {
    background: var(--ml-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.btn-icon:hover i,
.manager-header .btn-primary:hover i {
    background: none;
    -webkit-text-fill-color: white;
}

body.dark-mode .btn-icon {
    background: #334155;
    border-color: #475569;
}

body.dark-mode .btn-icon:hover {
    background: var(--ml-primary);
    border-color: var(--ml-primary);
}

.header-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
}

/* ========================================
   INFO BUTTONS
   ======================================== */
.btn-info {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid rgba(102, 126, 234, 0.3);
    color: var(--ml-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 800;
    transition: var(--transition-bounce);
    flex-shrink: 0;
}

.btn-info:hover {
    background: var(--ml-primary);
    color: white;
    border-color: var(--ml-primary);
    transform: scale(1.2) rotate(15deg);
    box-shadow: var(--glow-primary);
}

body.dark-mode .btn-info {
    background: rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.4);
    color: #818cf8;
}

body.dark-mode .btn-info:hover {
    background: #667eea;
    color: white;
}

/* ========================================
   SECTION STYLES
   ======================================== */
.analytics-section,
.section {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    padding: 32px;
    margin-bottom: 32px;
    transition: var(--transition-smooth);
    animation: fadeInUp 0.6s ease-out backwards;
}

.analytics-section:hover,
.section:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 48px rgba(102, 126, 234, 0.25);
}

body.dark-mode .analytics-section,
body.dark-mode .section {
    background: var(--glass-bg);
    border-color: var(--glass-border);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
    position: relative;
}

.section-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, var(--ml-primary), transparent);
    animation: slideRight 3s ease-in-out infinite;
}

body.dark-mode .section-header {
    border-bottom-color: #334155;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--ml-gradient);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    animation: gradientShift 3s ease infinite;
}

.section-header h2 i {
    background: var(--ml-gradient);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.3rem;
    animation: floatIcon 3s ease-in-out infinite;
}

/* ========================================
   KPI GRID & CARDS
   ======================================== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.kpi-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid var(--ml-primary);
    border-radius: var(--border-radius);
    padding: 25px;
    transition: var(--transition-smooth);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    animation: fadeInUp 0.6s ease-out backwards;
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.05) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s, transform 0.5s;
}

.kpi-card:hover::before {
    opacity: 1;
    transform: scale(1.1);
}

.kpi-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px rgba(102, 126, 234, 0.2);
    border-left-width: 5px;
}

.kpi-card:nth-child(1) { animation-delay: 0.1s; }
.kpi-card:nth-child(2) { animation-delay: 0.2s; }
.kpi-card:nth-child(3) { animation-delay: 0.3s; }
.kpi-card:nth-child(4) { animation-delay: 0.4s; }
.kpi-card:nth-child(5) { animation-delay: 0.5s; }
.kpi-card:nth-child(6) { animation-delay: 0.6s; }

body.dark-mode .kpi-card {
    background: #1e293b;
    border-color: #334155;
}

.kpi-card.positive {
    border-left-color: var(--ml-success);
}

.kpi-card.positive::before {
    background: radial-gradient(circle, rgba(67, 233, 123, 0.05) 0%, transparent 70%);
}

.kpi-card.negative {
    border-left-color: var(--ml-danger);
}

.kpi-card.negative::before {
    background: radial-gradient(circle, rgba(245, 87, 108, 0.05) 0%, transparent 70%);
}

.kpi-card.neutral {
    border-left-color: var(--ml-warning);
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.kpi-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(102, 126, 234, 0.1);
    color: var(--ml-primary);
    font-size: 1.2rem;
    transition: var(--transition-smooth);
}

.kpi-card:hover .kpi-icon {
    transform: scale(1.15) rotate(-10deg);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.kpi-card.positive .kpi-icon {
    background: rgba(67, 233, 123, 0.1);
    color: var(--ml-success);
}

.kpi-card.negative .kpi-icon {
    background: rgba(245, 87, 108, 0.1);
    color: var(--ml-danger);
}

.kpi-value {
    font-size: 2rem;
    font-weight: 800;
    background: var(--ml-gradient);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
    line-height: 1;
    animation: gradientShift 3s ease infinite;
}

.kpi-card.positive .kpi-value {
    background: linear-gradient(135deg, var(--ml-success), #38f9d7);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.kpi-card.negative .kpi-value {
    background: linear-gradient(135deg, var(--ml-danger), #fd7e14);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.kpi-change {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 600;
}

.kpi-change.positive {
    color: var(--ml-success);
}

.kpi-change.negative {
    color: var(--ml-danger);
}

.kpi-footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

body.dark-mode .kpi-footer {
    border-top-color: #334155;
}

/* ========================================
   PERIOD SELECTOR
   ======================================== */
.period-selector {
    display: flex;
    gap: 8px;
    background: #f8fafc;
    padding: 5px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

body.dark-mode .period-selector {
    background: #334155;
    border-color: #475569;
}

.period-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.period-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.period-btn:hover::before {
    left: 100%;
}

.period-btn:hover {
    background: #ffffff;
    color: var(--text-primary);
}

body.dark-mode .period-btn:hover {
    background: #1e293b;
}

.period-btn.active {
    background: var(--ml-gradient);
    background-size: 200% 200%;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    animation: gradientShift 3s ease infinite;
}

/* ========================================
   CHARTS GRID & CONTAINERS
   ======================================== */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 25px;
}

.chart-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: var(--transition-smooth);
    animation: fadeInUp 0.6s ease-out backwards;
}

.chart-card:hover {
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
    transform: translateY(-4px);
}

body.dark-mode .chart-card {
    background: #1e293b;
    border-color: #334155;
}

.chart-container,
.chart-container-large {
    min-height: 400px;
    position: relative;
    width: 100%;
    max-width: 100%;
}

.chart-container-large {
    min-height: 500px;
}

.chart-wrapper {
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-smooth);
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    padding: 16px;
    border: 1px solid var(--glass-border);
    width: 100%;
    max-width: 100%;
}

.chart-wrapper:hover {
    transform: scale(1.01);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.2);
}

.chart {
    min-height: 400px;
    width: 100%;
    max-width: 100%;
}

/* ✅ CORRECTION: Charts responsive sur mobile */
.highcharts-container {
    width: 100% !important;
}

.highcharts-root {
    width: 100% !important;
}

/* ========================================
   RISK METRICS TABLE
   ======================================== */
.risk-metrics-container {
    margin-top: 30px;
    animation: fadeInUp 0.6s ease-out backwards;
    animation-delay: 0.3s;
}

.risk-metrics-container h3 {
    font-size: 1.2rem;
    font-weight: 700;
    background: var(--ml-gradient);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: gradientShift 3s ease infinite;
}

.table-responsive {
    overflow-x: auto;
    border-radius: var(--border-radius);
    border: 1px solid #e2e8f0;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: var(--transition-smooth);
    width: 100%;
    max-width: 100%;
}

.table-responsive:hover {
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.12);
}

body.dark-mode .table-responsive {
    background: #1e293b;
    border-color: #334155;
}

.metrics-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    min-width: 600px;
}

.metrics-table thead {
    background: var(--ml-gradient);
    background-size: 200% 200%;
    color: white;
    animation: gradientShift 6s ease infinite;
}

.metrics-table th {
    padding: 18px 20px;
    text-align: left;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.metrics-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: var(--transition-fast);
}

body.dark-mode .metrics-table tbody tr {
    border-bottom-color: #334155;
}

.metrics-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.05), transparent);
    transform: translateX(4px);
}

.metrics-table td {
    padding: 16px 20px;
    color: var(--text-primary);
    font-weight: 500;
}

.metrics-table td:first-child {
    font-weight: 600;
    color: var(--text-primary);
}

.metrics-table td:nth-child(2) {
    font-weight: 700;
    font-size: 1.05rem;
    background: var(--ml-gradient);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.metric-good {
    color: var(--ml-success) !important;
    font-weight: 700;
}

.metric-warning {
    color: var(--ml-warning) !important;
    font-weight: 700;
}

.metric-bad {
    color: var(--ml-danger) !important;
    font-weight: 700;
}

/* ========================================
   CORRELATION MATRIX
   ======================================== */
.correlation-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: var(--transition-smooth);
}

.correlation-container:hover {
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.12);
}

body.dark-mode .correlation-container {
    background: #1e293b;
    border-color: #334155;
}

.correlation-insights {
    margin-top: 20px;
    padding: 20px;
    background: #f8fafc;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--ml-primary);
}

body.dark-mode .correlation-insights {
    background: #334155;
}

.insight-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 15px;
    padding: 12px;
    background: #ffffff;
    border-radius: 12px;
    transition: var(--transition-smooth);
}

body.dark-mode .insight-item {
    background: #1e293b;
}

.insight-item:last-child {
    margin-bottom: 0;
}

.insight-item:hover {
    transform: translateX(6px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.insight-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
    transition: var(--transition-smooth);
}

.insight-item:hover .insight-icon {
    transform: scale(1.15) rotate(-10deg);
}

.insight-icon.positive {
    background: rgba(67, 233, 123, 0.1);
    color: var(--ml-success);
}

.insight-icon.warning {
    background: rgba(246, 211, 101, 0.1);
    color: var(--ml-warning);
}

.insight-icon.negative {
    background: rgba(245, 87, 108, 0.1);
    color: var(--ml-danger);
}

.insight-content h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.insight-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ========================================
   AI SECTION - FOND VIOLET ANIMÉ
   ======================================== */
.ai-section,
.ai-optimization-section {
    background: var(--ml-gradient);
    background-size: 200% 200%;
    border: none;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
    animation: gradientShift 8s ease infinite, fadeInUp 0.6s ease-out backwards;
}

.ai-section .section-header,
.ai-optimization-section .section-header {
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.ai-section .section-header h2,
.ai-optimization-section .section-header h2 {
    color: white !important;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    background: none !important;
    -webkit-text-fill-color: white !important;
}

.ai-section .section-header h2 i,
.ai-optimization-section .section-header h2 i {
    color: #FFD700 !important;
    background: none !important;
    -webkit-text-fill-color: #FFD700 !important;
    animation: pulse 2s ease-in-out infinite;
}

.ai-section .btn-primary {
    background: white;
    color: var(--ml-primary);
    border: none;
    font-weight: 700;
}

.ai-section .btn-primary:hover {
    background: #FFD700;
    color: #333;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(255, 215, 0, 0.4);
}

/* AI Loading */
.ai-loading {
    text-align: center;
    padding: 60px 20px;
}

.ai-loading.hidden {
    display: none;
}

.loading-spinner,
.loading-spinner-large {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #FFD700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-spinner-large {
    width: 80px;
    height: 80px;
    border-width: 6px;
    margin-bottom: 25px;
}

.ai-loading h3 {
    color: white;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.ai-loading p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    margin-bottom: 15px;
}

.loading-progress {
    max-width: 400px;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    margin: 0 auto;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #FFD700, #FFA500);
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s;
    animation: shimmer 2s infinite;
}

.loading-steps {
    max-width: 500px;
    margin: 30px auto 0;
    text-align: left;
}

.loading-steps .step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-bottom: 10px;
    color: white;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.loading-steps .step.completed {
    background: rgba(67, 233, 123, 0.2);
}

.loading-steps .step i {
    font-size: 1.1rem;
    color: #FFD700;
}

.loading-steps .step.completed i {
    color: var(--ml-success);
}

/* AI Models Grid */
.ai-models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
}

.ai-model-card,
.ai-result-card {
    background: #ffffff;
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: var(--transition-smooth);
    border-top: 4px solid var(--ml-primary);
    animation: fadeInUp 0.6s ease-out backwards;
    position: relative;
    overflow: hidden;
}

.ai-model-card::before,
.ai-result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.8s;
}

.ai-model-card:hover::before,
.ai-result-card:hover::before {
    left: 100%;
}

.ai-model-card:nth-child(1) { animation-delay: 0.1s; }
.ai-model-card:nth-child(2) { animation-delay: 0.2s; }
.ai-model-card:nth-child(3) { animation-delay: 0.3s; }
.ai-model-card:nth-child(4) { animation-delay: 0.4s; }

body.dark-mode .ai-model-card,
body.dark-mode .ai-result-card {
    background: #1e293b;
}

.ai-model-card:hover,
.ai-result-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px rgba(102, 126, 234, 0.25);
}

.model-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

/* ✅ CORRECTION: Alignement titres AI à gauche après icônes */
.ai-result-card .card-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

body.dark-mode .ai-result-card .card-header {
    border-bottom-color: #334155;
}

.model-icon,
.card-icon {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: white;
    flex-shrink: 0;
    transition: var(--transition-smooth);
}

.ai-model-card:hover .model-icon,
.ai-result-card:hover .card-icon {
    transform: scale(1.15) rotate(-15deg);
}

.model-icon.optimizer,
.card-icon.optimizer {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.model-icon.predictor {
    background: linear-gradient(135deg, #10b981, #059669);
}

.model-icon.risk,
.card-icon.risk-profile {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.model-icon.rebalancer {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.card-icon.backtest {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.card-icon.diversification {
    background: linear-gradient(135deg, #10b981, #059669);
}

.card-icon.recommendations {
    background: linear-gradient(135deg, #ec4899, #db2777);
}

.model-info,
.card-title {
    flex: 1;
}

.model-info h3,
.card-title h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 5px 0;
    text-align: left;
    background: var(--ml-gradient);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease infinite;
}

.card-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-align: left;
}

.model-badge,
.card-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--ml-primary);
    color: white;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.card-badge.risk-low {
    background: var(--ml-success);
    color: white !important;
    -webkit-text-fill-color: white !important;
}

.card-badge.risk-medium {
    background: var(--ml-warning);
    color: white !important;
    -webkit-text-fill-color: white !important;
}

.card-badge.risk-high {
    background: var(--ml-danger);
    color: white !important;
    -webkit-text-fill-color: white !important;
}

.card-badge.risk-very-high {
    background: #dc2626;
    color: white !important;
    -webkit-text-fill-color: white !important;
}

.model-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
    line-height: 1.6;
}

.model-results {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px;
    min-height: 150px;
}

body.dark-mode .model-results {
    background: #334155;
    border-color: #475569;
}

.model-results.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-style: italic;
}

.result-item {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

body.dark-mode .result-item {
    border-bottom-color: #475569;
}

.result-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.result-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
    font-weight: 600;
    text-transform: uppercase;
}

.result-value {
    font-size: 1.1rem;
    font-weight: 700;
    background: var(--ml-gradient);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease infinite;
}

.result-value.positive {
    background: linear-gradient(135deg, var(--ml-success), #38f9d7);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.result-value.negative {
    background: linear-gradient(135deg, var(--ml-danger), #fd7e14);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* AI Recommendations */
.ai-recommendations {
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--border-radius);
    padding: 30px;
    margin-top: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: fadeInUp 0.6s ease-out backwards;
    animation-delay: 0.2s;
}

.ai-recommendations h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: white !important;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: none !important;
    -webkit-text-fill-color: white !important;
}

.ai-recommendations h3 i {
    color: #FFD700;
    animation: pulse 2s ease-in-out infinite;
}

.recommendations-list,
.recommendations-advanced {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.recommendation-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95)
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-left: 4px solid white;
    border-radius: 12px;
    transition: var(--transition-smooth);
}

.recommendation-item:hover {
    transform: translateX(6px);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.recommendation-item.priority-high {
    border-left-color: var(--ml-danger);
}

.recommendation-item.priority-medium {
    border-left-color: var(--ml-warning);
}

.recommendation-item.priority-low {
    border-left-color: var(--ml-success);
}

.recommendation-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.2);
    transition: var(--transition-smooth);
}

.recommendation-item:hover .recommendation-icon {
    transform: scale(1.15) rotate(-10deg);
}

.recommendation-item.priority-high .recommendation-icon {
    background: var(--ml-danger);
    color: white;
}

.recommendation-item.priority-medium .recommendation-icon {
    background: var(--ml-warning);
    color: white;
}

.recommendation-item.priority-low .recommendation-icon {
    background: var(--ml-success);
    color: white;
}

.recommendation-content {
    flex: 1;
}

.recommendation-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b
    margin-bottom: 8px;
}

.recommendation-description {
    font-size: 0.9rem;
    color: #475569
    line-height: 1.6;
    margin-bottom: 10px;
}

.recommendation-action {
    display: inline-block;
    padding: 6px 15px;
    background: white;
    color: var(--ml-primary);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-smooth);
}

.recommendation-action:hover {
    background: #FFD700;
    color: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

.btn-recommendation {
    padding: 8px 16px;
    background: var(--ml-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: not-allowed;
    opacity: 0.6;
    margin-top: 10px;
}

/* ========================================
   AI RESULTS CONTAINER
   ======================================== */
.ai-results-container {
    display: grid;
    gap: 25px;
    margin-top: 30px;
}

.ai-results-container.hidden {
    display: none;
}

.ai-result-card.full-width {
    grid-column: 1 / -1;
}

/* Risk Profile */
.risk-score-visual {
    margin-bottom: 20px;
}

.risk-score-bar {
    height: 30px;
    background: #e2e8f0;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 10px;
    position: relative;
}

body.dark-mode .risk-score-bar {
    background: #475569;
}

.risk-score-fill {
    height: 100%;
    border-radius: 15px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.risk-score-fill.risk-low {
    background: linear-gradient(90deg, var(--ml-success), #38f9d7);
}

.risk-score-fill.risk-medium {
    background: linear-gradient(90deg, var(--ml-warning), #f093fb);
}

.risk-score-fill.risk-high {
    background: linear-gradient(90deg, var(--ml-danger), #fd7e14);
}

.risk-score-fill.risk-very-high {
    background: linear-gradient(90deg, #dc2626, #991b1b);
}

.risk-score-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

.risk-score-value {
    font-size: 1.5rem;
    font-weight: 800;
    text-align: center;
    background: var(--ml-gradient);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease infinite;
    color: white !important;
    background: none !important;
}

.risk-description {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
}

.risk-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.risk-metric {
    background: #f8fafc;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    transition: var(--transition-smooth);
}

body.dark-mode .risk-metric {
    background: #334155;
}

.risk-metric:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.risk-metric .metric-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}

.risk-metric .metric-value {
    font-size: 1.4rem;
    font-weight: 800;
    background: var(--ml-gradient);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease infinite;
}

/* Frontier Insights */
.frontier-insights {
    margin-top: 25px;
}

.insight-card {
    background: #f8fafc;
    border-left: 4px solid var(--ml-primary);
    border-radius: 12px;
    padding: 20px;
}

body.dark-mode .insight-card {
    background: #334155;
}

.insight-card h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.insight-card h4 i {
    color: var(--ml-primary);
}

.insight-card ul {
    margin: 0;
    padding-left: 20px;
}

.insight-card li {
    margin-bottom: 10px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.insight-card li:last-child {
    margin-bottom: 0;
}

/* Strategies Grid */
.strategies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    grid-column: 1 / -1;
}

.strategy-card {
    background: #ffffff;
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: var(--transition-smooth);
    border-top: 5px solid var(--ml-primary);
    animation: fadeInUp 0.6s ease-out backwards;
    position: relative;
    overflow: hidden;
}

body.dark-mode .strategy-card {
    background: #1e293b;
}

.strategy-card:nth-child(1) { animation-delay: 0.1s; }
.strategy-card:nth-child(2) { animation-delay: 0.2s; }
.strategy-card:nth-child(3) { animation-delay: 0.3s; }
.strategy-card:nth-child(4) { animation-delay: 0.4s; }

.strategy-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.8s;
}

.strategy-card:hover::before {
    left: 100%;
}

.strategy-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px rgba(102, 126, 234, 0.2);
}

.strategy-card.conservative {
    border-top-color: var(--ml-success);
}

.strategy-card.balanced {
    border-top-color: var(--ml-primary);
}

.strategy-card.aggressive {
    border-top-color: var(--ml-warning);
}

.strategy-card.custom {
    border-top-color: #8b5cf6;
}

.strategy-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

body.dark-mode .strategy-header {
    border-bottom-color: #334155;
}

.strategy-header i {
    font-size: 2.5rem;
    color: var(--ml-primary);
}

.strategy-card.conservative .strategy-header i {
    color: var(--ml-success);
}

.strategy-card.aggressive .strategy-header i {
    color: var(--ml-warning);
}

.strategy-card.custom .strategy-header i {
    color: #8b5cf6;
}

.strategy-header h4 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.strategy-score {
    padding: 6px 16px;
    background: var(--ml-primary);
    color: white;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 800;
}

.strategy-card.conservative .strategy-score {
    background: var(--ml-success);
}

.strategy-card.aggressive .strategy-score {
    background: var(--ml-warning);
}

.strategy-card.custom .strategy-score {
    background: #8b5cf6;
}

.strategy-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.strategy-metrics {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.strategy-metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f8fafc;
    border-radius: 8px;
}

body.dark-mode .strategy-metric {
    background: #334155;
}

.strategy-metric .label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.strategy-metric .value {
    font-size: 1rem;
    font-weight: 700;
    background: var(--ml-gradient);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease infinite;
}

.strategy-allocation {
    margin-bottom: 20px;
}

.strategy-allocation h5 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.allocation-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

body.dark-mode .allocation-row {
    border-bottom-color: #475569;
}

.allocation-row:last-child {
    border-bottom: none;
}

.allocation-row .asset-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.allocation-row .asset-weight {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--ml-primary);
}

.btn-strategy {
    width: 100%;
    padding: 12px 20px;
    background: var(--ml-gradient);
    background-size: 200% 200%;
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    animation: gradientShift 6s ease infinite;
}

.btn-strategy:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Backtest Metrics */
.backtest-metrics {
    margin-top: 25px;
}

.backtest-metrics h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.backtest-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.backtest-table thead th {
    background: var(--ml-gradient);
    color: white;
    padding: 12px 15px;
    text-align: left;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.backtest-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: var(--transition-fast);
}

body.dark-mode .backtest-table tbody tr {
    border-bottom-color: #334155;
}

.backtest-table tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

.backtest-table td {
    padding: 12px 15px;
    color: var(--text-primary);
}

.backtest-table td:first-child {
    font-weight: 600;
}

/* Diversification */
.diversification-visual {
    margin-bottom: 20px;
}

.diversification-bar {
    height: 25px;
    background: #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 10px;
}

body.dark-mode .diversification-bar {
    background: #475569;
}

.diversification-fill {
    height: 100%;
    border-radius: 12px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.diversification-rating {
    font-size: 1.2rem;
    font-weight: 700;
    text-align: center;
    background: var(--ml-gradient);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease infinite;
    color: white !important;
    background: none !important;
}

.diversification-insights {
    margin-bottom: 20px;
}

.diversification-insights h5 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.diversification-insights ul {
    margin: 0;
    padding-left: 20px;
}

.diversification-insights li {
    margin-bottom: 8px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.diversification-breakdown {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.breakdown-item {
    background: #f8fafc;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
}

body.dark-mode .breakdown-item {
    background: #334155;
}

.breakdown-item .label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
}

.breakdown-item .value {
    font-size: 1.3rem;
    font-weight: 800;
    background: var(--ml-gradient);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease infinite;
}

/* ========================================
   BENCHMARK COMPARISON
   ======================================== */
.benchmark-selector {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.benchmark-selector label {
    font-weight: 600;
    color: var(--text-primary);
}

.benchmark-selector select {
    padding: 10px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
}

body.dark-mode .benchmark-selector select {
    background: #1e293b;
    border-color: #334155;
}

.benchmark-selector select:focus {
    outline: none;
    border-color: var(--ml-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.comparison-metrics {
    margin-top: 20px;
}

/* ========================================
   ASSET ALLOCATION SECTION - FOND VIOLET
   ======================================== */
.asset-config-section,
.allocation-selector-section {
    background: var(--ml-gradient);
    background-size: 200% 200%;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
    animation: gradientShift 8s ease infinite, fadeInUp 0.6s ease-out backwards;
}

.asset-config-section .section-header,
.allocation-selector-section .section-header {
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.asset-config-section .section-header h2,
.allocation-selector-section .section-header h2 {
    color: white !important;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    background: none !important;
    -webkit-text-fill-color: white !important;
}

.asset-config-section .section-header h2 i,
.allocation-selector-section .section-header h2 i {
    animation: floatIcon 3s ease-in-out infinite;
    color: #FFD700 !important;
    background: none !important;
    -webkit-text-fill-color: #FFD700 !important;
}

.asset-config-section .btn-icon,
.allocation-selector-section .btn-icon {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

.asset-config-section .btn-icon i,
.allocation-selector-section .btn-icon i {
    background: var(--ml-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.asset-config-section .btn-icon:hover,
.allocation-selector-section .btn-icon:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.3);
}

.asset-config-section .btn-icon:hover i,
.allocation-selector-section .btn-icon:hover i {
    background: none;
    -webkit-text-fill-color: white;
}

.allocation-selector-section .btn-primary {
    background: white;
    color: var(--ml-primary);
    border: none;
    font-weight: 700;
}

.allocation-selector-section .btn-primary i {
    background: var(--ml-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.allocation-selector-section .btn-primary:hover {
    background: #FFD700;
    color: #333;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(255, 215, 0, 0.4);
}

.allocation-selector-section .btn-primary:hover i {
    background: none;
    -webkit-text-fill-color: #333;
}

.allocation-selector-section .btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.allocation-selector-section .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
}

.info-box {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-left: 4px solid #FFD700;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 25px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: var(--transition-smooth);
}

.info-box:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(4px);
}

.info-box i {
    font-size: 1.2rem;
    color: #FFD700;
    flex-shrink: 0;
    margin-top: 2px;
}

.info-box p {
    margin: 0;
    line-height: 1.6;
    color: white;
}

.portfolio-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-item {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: var(--transition-smooth);
}

.summary-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.2);
}

.summary-label {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    opacity: 0.9;
    color: white;
}

.summary-value {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 5px;
    color: #FFD700;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.summary-hint {
    font-size: 0.75rem;
    opacity: 0.7;
    color: white;
}

.asset-allocation-manager {
    background: #ffffff;
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body.dark-mode .asset-allocation-manager {
    background: #1e293b;
}

.manager-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

body.dark-mode .manager-header {
    border-bottom-color: #334155;
}

.manager-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    background: var(--ml-gradient);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: gradientShift 3s ease infinite;
}

.assets-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.asset-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #667eea;
    border-radius: 12px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition-smooth);
}

body.dark-mode .asset-item {
    background: #334155;
    border-color: #475569;
}

.asset-item:hover {
    transform: translateX(6px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.asset-item.equity {
    border-left-color: var(--asset-equity-color);
}

.asset-item.bonds {
    border-left-color: var(--asset-bonds-color);
}

.asset-item.crypto {
    border-left-color: var(--asset-crypto-color);
}

.asset-item.commodities {
    border-left-color: var(--asset-commodities-color);
}

.asset-item.real-estate {
    border-left-color: var(--asset-real-estate-color);
}

.asset-item.cash {
    border-left-color: var(--asset-cash-color);
}

.asset-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
}

.asset-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    flex-shrink: 0;
    transition: var(--transition-smooth);
}

.asset-item:hover .asset-icon {
    transform: scale(1.15) rotate(-10deg);
}

.asset-icon.equity {
    background: linear-gradient(135deg, var(--asset-equity-color), #1d4ed8);
}

.asset-icon.bonds {
    background: linear-gradient(135deg, var(--asset-bonds-color), #059669);
}

.asset-icon.crypto {
    background: linear-gradient(135deg, var(--asset-crypto-color), #d97706);
}

.asset-icon.commodities {
    background: linear-gradient(135deg, var(--asset-commodities-color), #7c3aed);
}

.asset-icon.real-estate {
    background: linear-gradient(135deg, var(--asset-real-estate-color), #0891b2);
}

.asset-icon.cash {
    background: linear-gradient(135deg, var(--asset-cash-color), #475569);
}

.asset-details {
    flex: 1;
}

.asset-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.asset-ticker {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.asset-allocation-display {
    display: flex;
    align-items: center;
    gap: 15px;
}

.allocation-bar {
    width: 120px;
    height: 8px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

body.dark-mode .allocation-bar {
    background: #475569;
}

.allocation-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 10px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.allocation-percent {
    font-size: 1.1rem;
    font-weight: 700;
    background: var(--ml-gradient);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    min-width: 60px;
    text-align: right;
    animation: gradientShift 3s ease infinite;
}

.asset-actions {
    display: flex;
    gap: 8px;
}

.asset-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-bounce);
    font-size: 0.9rem;
}

.asset-btn.edit {
    background: rgba(37, 99, 235, 0.1);
    color: var(--ml-primary);
}

.asset-btn.edit:hover {
    background: var(--ml-primary);
    color: white;
    transform: scale(1.2);
    box-shadow: var(--glow-primary);
}

.asset-btn.delete {
    background: rgba(239, 68, 68, 0.1);
    color: var(--ml-danger);
}

.asset-btn.delete:hover {
    background: var(--ml-danger);
    color: white;
    transform: scale(1.2);
    box-shadow: var(--glow-danger);
}

.assets-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.assets-empty i {
    font-size: 4rem;
    color: #e2e8f0;
    margin-bottom: 20px;
    animation: pulse 2s ease-in-out infinite;
}

body.dark-mode .assets-empty i {
    color: #475569;
}

.assets-empty h4 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

/* ========================================
   ALLOCATION MANAGER GRID
   ======================================== */
.allocation-manager-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 25px;
    margin-top: 25px;
}

/* Current Allocation Card */
.current-allocation-card {
    background: #ffffff;
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: var(--transition-smooth);
    height: fit-content;
}

body.dark-mode .current-allocation-card {
    background: #1e293b;
}

.current-allocation-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.2);
}

.current-allocation-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

body.dark-mode .current-allocation-card .card-header {
    border-bottom-color: #334155;
}

.current-allocation-card .card-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    background: var(--ml-gradient);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    animation: gradientShift 3s ease infinite;
}

.allocation-badge {
    padding: 4px 12px;
    background: var(--ml-success);
    color: white;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.allocation-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

body.dark-mode .info-row {
    border-bottom-color: #334155;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row .label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.info-row .value {
    font-size: 1rem;
    font-weight: 700;
    background: var(--ml-gradient);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease infinite;
}

.card-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    padding-top: 15px;
    border-top: 2px solid #e2e8f0;
}

body.dark-mode .card-actions {
    border-top-color: #334155;
}

/* Allocations List Card */
.allocations-list-card {
    background: #ffffff;
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: var(--transition-smooth);
}

body.dark-mode .allocations-list-card {
    background: #1e293b;
}

.allocations-list-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

body.dark-mode .allocations-list-card .card-header {
    border-bottom-color: #334155;
}

.allocations-list-card .card-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    background: var(--ml-gradient);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    animation: gradientShift 3s ease infinite;
}

.allocations-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 5px;
}

.allocations-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.allocations-empty i {
    font-size: 3rem;
    color: #e2e8f0;
    margin-bottom: 15px;
    animation: pulse 2s ease-in-out infinite;
}

body.dark-mode .allocations-empty i {
    color: #475569;
}

.allocations-empty p {
    margin-bottom: 15px;
    font-size: 0.95rem;
}

/* Allocation List Item */
.allocation-list-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 4px solid var(--ml-primary);
    border-radius: 12px;
    padding: 15px;
    transition: var(--transition-smooth);
    cursor: pointer;
}

body.dark-mode .allocation-list-item {
    background: #334155;
    border-color: #475569;
}

.allocation-list-item:hover {
    transform: translateX(6px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.allocation-list-item.active {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.1), transparent);
    border-left-width: 5px;
    border-left-color: var(--ml-success);
}

.allocation-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.allocation-item-header h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.badge-active {
    padding: 3px 10px;
    background: var(--ml-success);
    color: white;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.allocation-item-info {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.allocation-item-info span {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.allocation-item-info i {
    color: var(--ml-primary);
}

.allocation-item-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
    border-radius: 8px;
}

.btn-icon-sm {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-bounce);
    font-size: 0.8rem;
}

.btn-icon-sm:hover {
    transform: scale(1.2);
}

/* Allocation Mode Toggle */
.allocation-mode-toggle {
    display: flex;
    gap: 0;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.mode-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 6px;
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.mode-btn.active {
    background: white;
    color: var(--ml-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* ========================================
   MODALS - 100% PRÉSERVÉES
   ======================================== */
.modal,
.modal-info {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
}

.modal.active,
.modal-info.active {
    display: flex;
}

.modal-content,
.modal-info-content {
    background: var(--glass-bg);
    backdrop-filter: blur(40px) saturate(180%);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--glass-border);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-content.modal-medium {
    max-width: 600px;
}

.modal-content.modal-large,
.modal-content.modal-xlarge {
    max-width: 900px;
}

.modal-content.modal-xlarge {
    max-width: 1200px;
    width: 95%;
}

.modal-header,
.modal-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid var(--glass-border);
}

.modal-info-header {
    background: var(--ml-gradient);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    color: white;
}

.modal-header h2,
.modal-info-header h3 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    margin: 0;
}

.modal-header h2 {
    background: var(--ml-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-info-header h3 {
    color: white;
}

.modal-info-header h3 i {
    font-size: 1.6rem;
    color: #FFD700;
}

.modal-close,
.modal-info-close {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.modal-info-close {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--ml-danger);
    transform: rotate(90deg);
}

.modal-info-close:hover {
    background: rgba(239, 68, 68, 0.9);
    transform: rotate(90deg) scale(1.1);
}

.modal-body,
.modal-info-body {
    padding: 30px;
}

.modal-body p,
.modal-info-body p {
    line-height: 1.8;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.modal-body ul,
.modal-body ol,
.modal-info-body ul {
    padding-left: 24px;
    margin-bottom: 16px;
}

.modal-body li,
.modal-info-body li {
    margin-bottom: 8px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.modal-body h4,
.modal-info-body h4 {
    font-size: 1.2rem;
    font-weight: 800;
    background: var(--ml-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 24px 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-info-body h4:first-child {
    margin-top: 0;
}

.modal-info-body strong {
    color: var(--text-primary);
    font-weight: 600;
}

.info-highlight {
    background: rgba(37, 99, 235, 0.1);
    border-left: 4px solid var(--ml-primary);
    padding: 15px 20px;
    border-radius: var(--border-radius);
    margin: 20px 0;
}

body.dark-mode .info-highlight {
    background: rgba(102, 126, 234, 0.15);
}

.info-highlight p {
    margin: 0;
    font-style: italic;
}

.info-example {
    background: var(--glass-bg);
    border-radius: var(--border-radius);
    padding: 15px 20px;
    margin: 15px 0;
    border: 1px solid var(--glass-border);
}

.info-example strong {
    color: var(--ml-success);
}

.metric-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--ml-primary);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 8px;
}

.metric-badge.good {
    background: var(--ml-success);
}

.metric-badge.warning {
    background: var(--ml-warning);
}

.metric-badge.bad {
    background: var(--ml-danger);
}

.warning-box {
    background: rgba(245, 158, 11, 0.1);
    border-left: 4px solid var(--ml-warning);
    padding: 16px;
    border-radius: 8px;
    margin: 20px 0;
}

.warning-box i {
    color: var(--ml-warning);
    margin-right: 8px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background: var(--glass-bg);
    color: var(--text-primary);
    transition: var(--transition-smooth);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--ml-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-hint {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Compare Allocations Modal */
.compare-selector {
    margin-bottom: 25px;
}

.compare-selector h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.allocations-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

body.dark-mode .checkbox-label {
    background: #334155;
    border-color: #475569;
}

.checkbox-label:hover {
    background: #f1f5f9;
    border-color: var(--ml-primary);
    transform: translateY(-2px);
}

body.dark-mode .checkbox-label:hover {
    background: #475569;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--ml-primary);
}

.checkbox-label span {
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.checkbox-label small {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.comparison-results {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e2e8f0;
}

body.dark-mode .comparison-results {
    border-top-color: #334155;
}

.comparison-results.hidden {
    display: none;
}

.comparison-results h3 {
    font-size: 1.3rem;
    font-weight: 700;
    background: var(--ml-gradient);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: gradientShift 3s ease infinite;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.comparison-table th,
.comparison-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

body.dark-mode .comparison-table th,
body.dark-mode .comparison-table td {
    border-bottom-color: #334155;
}

.comparison-table thead th {
    background: var(--ml-gradient);
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.comparison-table tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

.comparison-table tbody tr.total-row {
    font-weight: 700;
    background: #f8fafc;
}

body.dark-mode .comparison-table tbody tr.total-row {
    background: #334155;
}

/* ========================================
   BUTTONS - STYLE FOREX AVEC ANIMATIONS
   ======================================== */
.btn-primary {
    background: var(--ml-gradient);
    background-size: 200% 200%;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    animation: gradientShift 6s ease infinite;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.5);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-primary i {
    font-size: 16px;
    background: none;
    -webkit-text-fill-color: white;
}

.btn-large {
    padding: 15px 32px;
    font-size: 1.05rem;
}

.btn-secondary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

body.dark-mode .btn-secondary {
    background: #334155;
    border-color: #475569;
    color: #cbd5e1;
}

body.dark-mode .btn-secondary:hover {
    background: #475569;
    border-color: #64748b;
}

.text-danger {
    color: var(--ml-danger);
}

.text-success {
    color: var(--ml-success);
}

/* ========================================
   DARK MODE OVERRIDES
   ======================================== */
body.dark-mode .chart-card,
body.dark-mode .analytics-section {
    background: var(--glass-bg);
    border-color: var(--glass-border);
}

body.dark-mode .highcharts-background {
    fill: #1e293b;
}

body.dark-mode .highcharts-title,
body.dark-mode .highcharts-subtitle,
body.dark-mode .highcharts-axis-labels text,
body.dark-mode .highcharts-legend-item text {
    fill: #e2e8f0 !important;
}

body.dark-mode .highcharts-grid-line {
    stroke: #334155;
}

body.dark-mode #pageTitle,
body.dark-mode .top-header h1,
body.dark-mode .chart-title,
body.dark-mode .section-header h2 {
    background: var(--ml-gradient) !important;
    background-size: 200% 200% !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

/* ========================================
   RESPONSIVE DESIGN - CORRECTIONS FINALES
   ======================================== */
@media (max-width: 1200px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .ai-models-grid {
        grid-template-columns: 1fr;
    }
    
    .allocation-manager-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .allocation-manager-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .section,
    .analytics-section {
        padding: 20px;
    }
    
    .page-title,
    #pageTitle {
        font-size: 1.2rem !important;
    }
    
    .section-title {
        font-size: 1.2rem;
    }
    
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .header-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .period-selector {
        flex-wrap: wrap;
        width: 100%;
        justify-content: space-between;
        overflow-x: auto;
    }
    
    .period-btn {
        flex: 1;
        min-width: fit-content;
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    /* ✅ CORRECTION FINALE: Charts responsive mobile */
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .chart-card {
        padding: 15px;
    }
    
    .chart-wrapper {
        padding: 10px;
        overflow-x: auto;
    }
    
    .chart-container,
    .chart-container-large,
    .chart {
        min-height: 300px;
        width: 100%;
        max-width: 100%;
    }
    
    .highcharts-container,
    .highcharts-container svg {
        max-width: 100% !important;
    }
    
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .modal-content,
    .modal-info-content {
        width: 95%;
        margin: 10px;
    }
    
    .modal-header,
    .modal-info-header {
        padding: 16px 20px;
    }
    
    .modal-body,
    .modal-info-body {
        padding: 20px;
    }
    
    .portfolio-summary {
        grid-template-columns: 1fr;
    }
    
    .asset-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .asset-allocation-display {
        width: 100%;
        justify-content: space-between;
    }
    
    .allocation-bar {
        flex: 1;
    }
    
    .ai-models-grid {
        grid-template-columns: 1fr;
    }
    
    .risk-metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .diversification-breakdown {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .kpi-card,
    .ai-model-card,
    .ai-result-card,
    .strategy-card {
        padding: 16px;
    }
    
    .kpi-value {
        font-size: 1.6rem;
    }
    
    .diversification-breakdown {
        grid-template-columns: 1fr;
    }
    
    .allocations-checkboxes {
        grid-template-columns: 1fr;
    }
    
    .model-icon,
    .card-icon {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
    
    .chart-container,
    .chart-container-large {
        min-height: 250px;
    }
}

/* ========================================
   SCROLLBAR STYLING
   ======================================== */
.modal-content::-webkit-scrollbar,
.modal-info-content::-webkit-scrollbar,
.allocations-list::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.modal-content::-webkit-scrollbar-track,
.modal-info-content::-webkit-scrollbar-track,
.allocations-list::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track {
    background: rgba(100, 116, 139, 0.1);
    border-radius: 4px;
}

body.dark-mode .modal-content::-webkit-scrollbar-track,
body.dark-mode .modal-info-content::-webkit-scrollbar-track,
body.dark-mode .allocations-list::-webkit-scrollbar-track,
body.dark-mode .table-responsive::-webkit-scrollbar-track {
    background: #334155;
}

.modal-content::-webkit-scrollbar-thumb,
.modal-info-content::-webkit-scrollbar-thumb,
.allocations-list::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb {
    background: var(--ml-gradient);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover,
.modal-info-content::-webkit-scrollbar-thumb:hover,
.allocations-list::-webkit-scrollbar-thumb:hover,
.table-responsive::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--ml-secondary), var(--ml-accent));
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid var(--ml-primary);
    outline-offset: 2px;
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    .sidebar,
    .top-header,
    .btn-primary,
    .btn-secondary,
    .btn-icon,
    .btn-info,
    .modal,
    .modal-info {
        display: none !important;
    }
    
    .section,
    .analytics-section {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/**
 * ====================================================================
 * FIN DU FICHIER - ALPHAVAULT AI INVESTMENT ANALYTICS PRO
 * VERSION FINALE - 100% PC & MOBILE RESPONSIVE
 * ====================================================================
 */

 /* ========================================
   DATA QUALITY BADGE
   ======================================== */

.data-quality-badge {
    text-align: center;
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(241, 245, 249, 0.8);
    border-radius: 12px;
    transition: var(--transition-smooth);
}

body.dark-mode .data-quality-badge {
    background: rgba(30, 41, 59, 0.8);
}

.data-quality-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.data-quality-badge p {
    margin: 8px 0 0 0;
    font-size: 0.8rem;
    font-style: italic;
}

body.dark-mode .data-quality-badge p {
    color: #94a3b8;
}

/* ═══════════════════════════════════════════════════════════════
   🏢 COMPANY LOGOS - EXACT SAME CSS AS companies-directory.js
   ═══════════════════════════════════════════════════════════════ */

.asset-item .company-logo {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.asset-item:hover .company-logo {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.25);
}

.asset-item .company-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
}

.asset-item .company-logo.text-fallback,
.asset-item .company-logo .text-fallback {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-size: 1.2rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Dark mode */
body.dark-mode .asset-item .company-logo {
    background: linear-gradient(135deg, #1e293b, #334155);
}