/* ==============================================
   🎨 TREND-PREDICTION.CSS - ULTRA MODERN 3D VERSION
   Glassmorphism • 3D Effects • Premium Animations
   VERSION CORRIGÉE FINALE
   ============================================== */

/* ============================================
   🌟 VARIABLES PERSONNALISÉES
   ============================================ */
:root {
    --ml-primary: #667eea;
    --ml-secondary: #764ba2;
    --ml-accent: #f093fb;
    --ml-success: #43e97b;
    --ml-danger: #f5576c;
    --ml-warning: #f6d365;
    
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.18);
    --glass-shadow: rgba(31, 38, 135, 0.37);
    
    --glow-primary: 0 0 20px rgba(102, 126, 234, 0.5);
    --glow-accent: 0 0 30px rgba(240, 147, 251, 0.6);
    
    --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);
}

body.dark-mode {
    --glass-bg: rgba(15, 23, 42, 0.7);
    --glass-border: rgba(148, 163, 184, 0.1);
}

/* ============================================
   🎭 GLOBAL ENHANCEMENTS
   ============================================ */
.container {
    perspective: 1500px;
}

.card,
.section,
.search-panel,
.stock-header,
.model-card,
.ensemble-card,
.recommendation-card {
    backdrop-filter: blur(20px) saturate(180%);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px var(--glass-shadow);
    border-radius: 24px;
    transition: var(--transition-smooth);
    transform-style: preserve-3d;
    will-change: transform, box-shadow;
}

.card:hover,
.model-card:hover,
.ensemble-card:hover {
    transform: translateY(-8px) rotateX(2deg);
    box-shadow: 
        0 20px 60px rgba(102, 126, 234, 0.3),
        0 0 40px rgba(118, 75, 162, 0.2);
}

/* ============================================
   ✅ CORRECTION 1 : TITRE DE LA PAGE - STYLE UNIFORME
   ============================================ */
.top-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.top-header h1 i {
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 2rem;
}

/* ============================================
   🔍 SEARCH PANEL - GLASSMORPHISM PREMIUM
   ============================================ */
.search-panel {
    background: linear-gradient(
        135deg,
        rgba(102, 126, 234, 0.1) 0%,
        rgba(118, 75, 162, 0.05) 100%
    );
    border: 2px solid var(--glass-border);
    padding: 40px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.search-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle,
        rgba(102, 126, 234, 0.1) 0%,
        transparent 70%
    );
    animation: rotateBg 20s linear infinite;
    pointer-events: none;
}

@keyframes rotateBg {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--glass-border);
    position: relative;
}

.card-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 120px;
    height: 2px;
    background: linear-gradient(90deg, var(--ml-primary), transparent);
    animation: slideRight 3s ease-in-out infinite;
}

@keyframes slideRight {
    0%, 100% { transform: translateX(0); opacity: 1; }
    50% { transform: translateX(200px); opacity: 0; }
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 0;
}

.card-title i {
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.8rem;
    animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* ============================================
   🎯 INPUT SEARCH - 3D EFFECT
   ============================================ */
.search-input-wrapper {
    position: relative;
    margin-bottom: 25px;
}

#symbolInput {
    width: 100%;
    padding: 18px 24px;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    color: var(--text-primary);
    transition: var(--transition-smooth);
    backdrop-filter: blur(10px);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
}

#symbolInput:focus {
    outline: none;
    border-color: var(--ml-primary);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 0 0 4px rgba(102, 126, 234, 0.1),
        inset 0 2px 8px rgba(0, 0, 0, 0.05),
        var(--glow-primary);
    transform: translateY(-2px);
}

#symbolInput::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* ============================================
   🚀 BUTTON ANALYZE - HOLOGRAPHIC
   ============================================ */
.btn-analyze {
    margin-top: 20px;
    width: 100%;
    padding: 18px 32px;
    font-size: 1.2rem;
    font-weight: 700;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary), var(--ml-accent));
    background-size: 200% 200%;
    color: white;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
    box-shadow: 
        0 8px 24px rgba(102, 126, 234, 0.4),
        0 0 20px rgba(118, 75, 162, 0.3);
}

.btn-analyze::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transform: rotate(45deg);
    transition: all 0.6s;
}

.btn-analyze:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 
        0 16px 40px rgba(102, 126, 234, 0.5),
        0 0 40px rgba(118, 75, 162, 0.4);
    animation: gradientShift 3s ease infinite;
}

.btn-analyze:hover::before {
    left: 100%;
}

.btn-analyze:active {
    transform: translateY(-2px) scale(0.98);
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ============================================
   💡 SEARCH SUGGESTIONS - GLASSMORPHISM
   ============================================ */
.search-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(30px) saturate(200%);
    border: 2px solid var(--glass-border);
    border-radius: 20px;
    max-height: 450px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.2),
        0 0 40px rgba(102, 126, 234, 0.15);
    display: none;
    transform: translateY(-10px);
    opacity: 0;
    transition: var(--transition-smooth);
}

body.dark-mode .search-suggestions {
    background: rgba(15, 23, 42, 0.95);
}

.search-suggestions.active {
    display: block;
    transform: translateY(0);
    opacity: 1;
    animation: slideDownBounce 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes slideDownBounce {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    60% {
        transform: translateY(5px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.suggestion-category {
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.suggestion-item {
    padding: 16px 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid var(--glass-border);
    transition: var(--transition-smooth);
    position: relative;
}

.suggestion-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--ml-primary), transparent);
    transition: width 0.3s ease;
}

.suggestion-item:hover::before,
.suggestion-item.selected::before {
    width: 4px;
}

.suggestion-item:hover,
.suggestion-item.selected {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.1), transparent);
    transform: translateX(4px);
}

.suggestion-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: var(--transition-smooth);
}

.suggestion-item:hover .suggestion-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.suggestion-icon.tech {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.suggestion-icon.finance {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
}

.suggestion-icon.crypto {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: white;
}

.suggestion-icon.etf {
    background: linear-gradient(135deg, #43e97b, #38f9d7);
    color: white;
}

.suggestion-symbol {
    font-weight: 700;
    font-size: 1.15rem;
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.suggestion-name {
    font-size: 0.95rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

.suggestion-match {
    background: var(--ml-warning);
    color: #333;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 600;
}

/* ============================================
   🎪 POPULAR STOCKS - ANIMATED CHIPS
   ============================================ */
.popular-stocks {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 25px;
    margin-bottom: 25px;
}

.quick-label {
    font-weight: 700;
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-right: 10px;
    font-size: 1.05rem;
}

.symbol-chip {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 2px solid var(--glass-border);
    padding: 10px 20px;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition-bounce);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
}

.symbol-chip::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, var(--ml-primary), transparent);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.symbol-chip:hover {
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    border-color: transparent;
    color: white;
    transform: translateY(-4px) scale(1.05);
    box-shadow: 
        0 8px 24px rgba(102, 126, 234, 0.4),
        var(--glow-primary);
}

.symbol-chip:hover::before {
    width: 300px;
    height: 300px;
}

.symbol-chip i {
    font-size: 1.2rem;
    transition: var(--transition-smooth);
}

.symbol-chip:hover i {
    transform: scale(1.2) rotate(10deg);
}

/* ============================================
   ✅ CORRECTION 2 : CONTOURS DE BASE - PREDICTION HORIZON & TRAINING PERIOD
   ============================================ */
.prediction-settings {
    display: flex;
    gap: 30px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.setting-group {
    flex: 1;
    min-width: 280px;
}

.setting-group label {
    display: block;
    margin-bottom: 12px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.05rem;
}

/* Boutons Prediction Horizon - Contours bleus visibles */
.horizon-btn {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(102, 126, 234, 0.4); /* ✅ Contour bleu visible par défaut */
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-weight: 700;
    margin-right: 10px;
    margin-bottom: 10px;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
}

.horizon-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.horizon-btn:hover::before {
    left: 100%;
}

.horizon-btn:hover {
    border-color: var(--ml-primary);
    color: var(--ml-primary);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.horizon-btn.active {
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    border-color: transparent;
    color: white;
    box-shadow: 
        0 6px 20px rgba(102, 126, 234, 0.4),
        var(--glow-primary);
    transform: scale(1.05);
}

/* Training Period Select - Contour bleu visible */
.form-select {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid rgba(102, 126, 234, 0.4); /* ✅ Contour bleu visible par défaut */
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
}

.form-select:focus {
    outline: none;
    border-color: var(--ml-primary);
    box-shadow: 
        0 0 0 4px rgba(102, 126, 234, 0.1),
        var(--glow-primary);
}

/* ============================================
   📊 STOCK HEADER - PREMIUM GLASS
   ============================================ */
.stock-header {
    background: linear-gradient(
        135deg,
        rgba(102, 126, 234, 0.15) 0%,
        rgba(118, 75, 162, 0.1) 100%
    );
    backdrop-filter: blur(30px) saturate(180%);
    border: 2px solid var(--glass-border);
    border-radius: 28px;
    padding: 40px;
    margin-top: 40px;
    margin-bottom: 40px;
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.12),
        0 0 60px rgba(102, 126, 234, 0.15);
    position: relative;
    overflow: hidden;
}

.stock-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle,
        rgba(240, 147, 251, 0.1) 0%,
        transparent 70%
    );
    animation: rotateBg 25s linear infinite reverse;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
    position: relative;
    z-index: 1;
}

.stock-info h2 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary), var(--ml-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: pulse 2s ease-in-out infinite;
}

.stock-name {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-top: 8px;
}

.stock-price {
    text-align: right;
}

.price {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
    text-shadow: 0 2px 20px rgba(102, 126, 234, 0.3);
}

.change {
    font-size: 1.4rem;
    font-weight: 700;
    padding: 8px 20px;
    border-radius: 50px;
    display: inline-block;
}

.change.positive {
    background: linear-gradient(135deg, var(--ml-success), #38f9d7);
    color: white;
    box-shadow: 0 4px 20px rgba(67, 233, 123, 0.4);
}

.change.negative {
    background: linear-gradient(135deg, var(--ml-danger), #fd7e14);
    color: white;
    box-shadow: 0 4px 20px rgba(245, 87, 108, 0.4);
}

/* ============================================
   🌈 ENSEMBLE PREDICTION - CORRECTION FINALE (TEXTE BLANC)
   ============================================ */
.prediction-overview {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
    border-radius: 28px;
    padding: 50px;
    margin-top: 40px;
    margin-bottom: 40px;
    box-shadow: 
        0 20px 60px rgba(102, 126, 234, 0.4),
        0 0 80px rgba(118, 75, 162, 0.3);
    position: relative;
    overflow: hidden;
}

.prediction-overview::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.05) 10px,
        rgba(255, 255, 255, 0.05) 20px
    );
    animation: moveStripes 20s linear infinite;
}

@keyframes moveStripes {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* ✅ TITRE BLANC avec ombre portée */
.prediction-overview .section-title {
    color: white !important;
    margin-bottom: 35px;
    font-size: 2rem;
    text-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    position: relative;
    z-index: 1;
    font-weight: 800;
}

.prediction-overview .section-title i {
    color: white !important;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

/* ✅ BOUTON ? (HELP ICON) - BLANC */
.prediction-overview .help-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white !important;
    border: 2px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.prediction-overview .help-icon:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white !important;
    transform: scale(1.15) rotate(15deg);
    box-shadow: 
        0 8px 24px rgba(255, 255, 255, 0.4),
        0 0 20px rgba(255, 255, 255, 0.3);
}

.ensemble-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    position: relative;
    z-index: 1;
}

.ensemble-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    border-radius: 20px;
    padding: 28px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition-smooth);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transform-style: preserve-3d;
}

body.dark-mode .ensemble-card {
    background: rgba(15, 23, 42, 0.9);
}

.ensemble-card:hover {
    transform: translateY(-8px) rotateY(5deg);
    box-shadow: 
        0 16px 48px rgba(0, 0, 0, 0.2),
        0 0 60px rgba(255, 255, 255, 0.3);
}

.card-icon {
    width: 70px;
    height: 70px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transition: var(--transition-smooth);
}

.ensemble-card:hover .card-icon {
    transform: scale(1.15) rotate(-10deg);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
}

.card-icon.bullish {
    background: linear-gradient(135deg, var(--ml-success), #38f9d7);
    color: white;
}

.card-icon.bearish {
    background: linear-gradient(135deg, var(--ml-danger), #fd7e14);
    color: white;
}

.card-icon.neutral {
    background: linear-gradient(135deg, #6c757d, #adb5bd);
    color: white;
}

.card-icon.accuracy {
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    color: white;
}

.card-label {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.card-value {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 6px;
    line-height: 1.2;
}

.card-sublabel {
    font-size: 0.95rem;
    font-weight: 700;
}

/* ============================================
   ✅ CORRECTION 4 : MODEL CARDS - COMPLETED AU MÊME NIVEAU
   ============================================ */
.models-section {
    margin-top: 40px;
    margin-bottom: 40px;
}

.section-title {
    margin-bottom: 30px;
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 15px;
}

.section-title i {
    font-size: 2rem;
}

.models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 28px;
}

.model-card {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.02) 100%
    );
    backdrop-filter: blur(25px) saturate(180%);
    border: 2px solid var(--glass-border);
    border-radius: 24px;
    padding: 28px;
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: var(--transition-smooth);
    transform-style: preserve-3d;
    position: relative;
    overflow: hidden;
}

.model-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;
}

.model-card:hover::before {
    left: 100%;
}

.model-card:hover {
    transform: translateY(-10px) rotateX(3deg);
    box-shadow: 
        0 24px 60px rgba(102, 126, 234, 0.25),
        0 0 80px rgba(118, 75, 162, 0.15);
    border-color: rgba(102, 126, 234, 0.4);
}

.model-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--glass-border);
    position: relative;
    min-height: 50px; /* ✅ Hauteur minimale pour alignement */
}

.model-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, var(--ml-primary), transparent);
}

.model-header h4 {
    margin: 0;
    font-size: 1.1rem; /* ✅ Taille réduite pour alignement */
    font-weight: 700;
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
}

.model-header h4 i {
    font-size: 1.3rem;
}

/* ✅ Badge COMPLETED - Même niveau et taille réduite */
.model-badge {
    padding: 6px 14px; /* ✅ Padding réduit */
    border-radius: 50px;
    font-size: 0.75rem; /* ✅ Taille de police réduite */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    flex-shrink: 0; /* ✅ Ne rétrécit pas */
    min-width: 95px; /* ✅ Largeur minimale fixe */
    text-align: center;
}

.model-badge.training {
    background: linear-gradient(135deg, var(--ml-warning), #fda085);
    color: #333;
    animation: pulse 1.5s ease-in-out infinite;
}

.model-badge.completed {
    background: linear-gradient(135deg, var(--ml-success), #38f9d7);
    color: white;
}

.model-badge.error {
    background: linear-gradient(135deg, var(--ml-danger), #fd7e14);
    color: white;
}

.model-chart {
    min-height: 280px;
    margin-bottom: 20px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.model-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.metric {
    text-align: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    transition: var(--transition-smooth);
}

.metric:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.2);
}

.metric span {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric strong {
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ============================================
   🏆 PERFORMANCE SECTION
   ============================================ */
.performance-section {
    background: linear-gradient(
        135deg,
        rgba(102, 126, 234, 0.08) 0%,
        rgba(118, 75, 162, 0.05) 100%
    );
    backdrop-filter: blur(30px) saturate(180%);
    border: 2px solid var(--glass-border);
    border-radius: 28px;
    padding: 40px;
    margin-top: 40px;
    margin-bottom: 40px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.performance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 28px;
    margin-bottom: 35px;
}

.performance-chart {
    min-height: 450px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.performance-table table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.performance-table th {
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    padding: 18px;
    text-align: left;
}

.performance-table td {
    padding: 18px;
    border-bottom: 1px solid var(--glass-border);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.02);
    transition: var(--transition-smooth);
}

.performance-table tr:hover td {
    background: rgba(102, 126, 234, 0.08);
}

.performance-table .best {
    background: linear-gradient(90deg, rgba(67, 233, 123, 0.15), transparent);
    border-left: 4px solid var(--ml-success);
}

.performance-table .worst {
    background: linear-gradient(90deg, rgba(245, 87, 108, 0.15), transparent);
    border-left: 4px solid var(--ml-danger);
}

.performance-table .rank {
    font-weight: 800;
    font-size: 1.2rem;
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ============================================
   💡 RECOMMENDATION - PREMIUM CARD
   ============================================ */
.recommendation-section {
    margin-top: 40px;
    margin-bottom: 40px;
}

.recommendation-card {
    background: linear-gradient(
        135deg,
        rgba(240, 147, 251, 0.1) 0%,
        rgba(102, 126, 234, 0.05) 100%
    );
    backdrop-filter: blur(30px) saturate(180%);
    border: 2px solid var(--glass-border);
    border-radius: 28px;
    padding: 50px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 0 80px rgba(240, 147, 251, 0.2);
    position: relative;
    overflow: hidden;
}

.recommendation-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle,
        rgba(102, 126, 234, 0.1) 0%,
        transparent 70%
    );
    animation: rotateBg 30s linear infinite;
}

.recommendation-header {
    display: flex;
    align-items: center;
    gap: 28px;
    margin-bottom: 35px;
    padding-bottom: 28px;
    border-bottom: 3px solid var(--glass-border);
    position: relative;
    z-index: 1;
}

.recommendation-icon {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    flex-shrink: 0;
    box-shadow: 
        0 12px 36px rgba(0, 0, 0, 0.2),
        0 0 60px rgba(255, 255, 255, 0.3);
    animation: float 3s ease-in-out infinite, rotate3d 6s linear infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes rotate3d {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

.recommendation-icon.strong-buy {
    background: linear-gradient(135deg, var(--ml-success), #38f9d7);
    color: white;
}

.recommendation-icon.buy {
    background: linear-gradient(135deg, #43e97b, #6c757d);
    color: white;
}

.recommendation-icon.hold {
    background: linear-gradient(135deg, var(--ml-warning), #fda085);
    color: white;
}

.recommendation-icon.sell {
    background: linear-gradient(135deg, var(--ml-danger), #fd7e14);
    color: white;
}

.recommendation-icon.strong-sell {
    background: linear-gradient(135deg, #dc3545, #6c1e4d);
    color: white;
}

.recommendation-header h4 {
    margin: 0;
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary), var(--ml-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.recommendation-header p {
    margin: 8px 0 0 0;
    color: var(--text-secondary);
    font-size: 1.15rem;
    font-weight: 600;
}

.recommendation-body {
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.recommendation-body h4 {
    color: var(--text-primary);
    margin-top: 25px;
    margin-bottom: 18px;
    font-size: 1.3rem;
    font-weight: 700;
}

.recommendation-body ul {
    list-style: none;
    padding: 0;
}

.recommendation-body li {
    padding: 18px 24px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-left: 4px solid var(--ml-primary);
    border-radius: 12px;
    color: var(--text-primary);
    font-weight: 600;
    transition: var(--transition-smooth);
}

.recommendation-body li:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateX(8px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.2);
}

.recommendation-body li i {
    margin-right: 12px;
    font-size: 1.2rem;
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.recommendation-footer {
    padding-top: 25px;
    border-top: 2px solid var(--glass-border);
}

.disclaimer {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15), rgba(255, 152, 0, 0.1));
    border: 2px solid rgba(255, 193, 7, 0.3);
    border-left: 6px solid var(--ml-warning);
    padding: 20px 28px;
    border-radius: 16px;
    display: flex;
    align-items: start;
    gap: 18px;
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.2);
    position: relative;
    z-index: 1;
}

.disclaimer i {
    color: var(--ml-warning);
    font-size: 1.8rem;
    flex-shrink: 0;
    margin-top: 2px;
    animation: pulse 2s ease-in-out infinite;
}

.disclaimer div {
    color: var(--text-primary);
    font-weight: 600;
}

/* ============================================
   ⏳ LOADING INDICATOR - ANIMATED
   ============================================ */
.loading-indicator {
    text-align: center;
    padding: 80px 30px;
    background: linear-gradient(
        135deg,
        rgba(102, 126, 234, 0.05) 0%,
        rgba(118, 75, 162, 0.03) 100%
    );
    backdrop-filter: blur(20px);
    border: 2px solid var(--glass-border);
    border-radius: 28px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
    margin: 40px 0;
}

.loading-indicator i {
    font-size: 4rem;
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 24px;
    display: inline-block;
    animation: spin 1.5s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loadingText {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ============================================
   ❓ HELP ICON - PREMIUM STYLE
   ============================================ */
.help-icon {
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-bounce);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.help-icon:hover {
    transform: scale(1.15) rotate(15deg);
    box-shadow: 
        0 8px 24px rgba(102, 126, 234, 0.5),
        var(--glow-primary);
}

/* ============================================
   📱 RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1200px) {
    .models-grid {
        grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    }
}

@media (max-width: 768px) {
    .ensemble-cards,
    .models-grid,
    .performance-grid {
        grid-template-columns: 1fr;
    }
    
    .prediction-settings {
        flex-direction: column;
    }
    
    .recommendation-header {
        flex-direction: column;
        text-align: center;
    }
    
    .prediction-overview,
    .recommendation-card {
        padding: 30px 20px;
    }
    
    .stock-header {
        padding: 30px 20px;
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .stock-price {
        text-align: left;
    }
    
    .search-panel {
        padding: 25px 20px;
    }
    
    .performance-section {
        padding: 25px 20px;
    }
    
    .model-card {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 1.5rem;
    }
    
    .card-value {
        font-size: 1.6rem;
    }
    
    .price {
        font-size: 2.2rem;
    }
    
    .stock-info h2 {
        font-size: 2rem;
    }
    
    .recommendation-header h4 {
        font-size: 1.8rem;
    }
    
    .btn-analyze {
        font-size: 1.05rem;
        padding: 16px 24px;
    }
    
    .symbol-chip {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .model-header h4 {
        font-size: 1rem;
    }
    
    .model-badge {
        font-size: 0.7rem;
        padding: 5px 12px;
    }
}

/* ============================================
   🎨 SCROLLBAR CUSTOM - PREMIUM
   ============================================ */
.search-suggestions::-webkit-scrollbar {
    width: 10px;
}

.search-suggestions::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.search-suggestions::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    border-radius: 10px;
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
}

.search-suggestions::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--ml-secondary), var(--ml-accent));
}

/* ============================================
   🌙 DARK MODE ENHANCEMENTS
   ============================================ */
body.dark-mode .search-panel,
body.dark-mode .stock-header,
body.dark-mode .performance-section,
body.dark-mode .recommendation-card {
    background: linear-gradient(
        135deg,
        rgba(102, 126, 234, 0.05) 0%,
        rgba(15, 23, 42, 0.5) 100%
    );
}

body.dark-mode .model-card {
    background: linear-gradient(
        135deg,
        rgba(15, 23, 42, 0.6) 0%,
        rgba(30, 41, 59, 0.4) 100%
    );
}

body.dark-mode .suggestion-item:hover,
body.dark-mode .suggestion-item.selected {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.15), transparent);
}

body.dark-mode .metric {
    background: rgba(15, 23, 42, 0.5);
}

body.dark-mode .recommendation-body li {
    background: rgba(15, 23, 42, 0.4);
}

body.dark-mode .disclaimer {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 152, 0, 0.05));
}

/* ============================================
   ✨ UTILITY CLASSES
   ============================================ */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================
   🎬 GLOBAL ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-panel > * {
    animation: fadeInUp 0.6s ease-out backwards;
}

.results-panel > *:nth-child(1) { animation-delay: 0.1s; }
.results-panel > *:nth-child(2) { animation-delay: 0.2s; }
.results-panel > *:nth-child(3) { animation-delay: 0.3s; }
.results-panel > *:nth-child(4) { animation-delay: 0.4s; }
.results-panel > *:nth-child(5) { animation-delay: 0.5s; }

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

/* ============================================
   🎯 CHART SECTION - GLASSMORPHISM
   ============================================ */
.chart-section {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.08) 0%,
        rgba(255, 255, 255, 0.02) 100%
    );
    backdrop-filter: blur(25px) saturate(180%);
    border: 2px solid var(--glass-border);
    border-radius: 28px;
    padding: 35px;
    margin-bottom: 40px;
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.chart-large {
    min-height: 650px;
    border-radius: 20px;
    overflow: hidden;
}

/* ============================================
   🎪 CACHE BUTTON HEADER
   ============================================ */
.btn-icon-header {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 2px solid var(--glass-border);
    color: var(--text-primary);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-bounce);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 12px;
}

.btn-icon-header:hover {
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    color: white;
    transform: translateY(-4px) scale(1.1);
    box-shadow: 
        0 8px 24px rgba(102, 126, 234, 0.4),
        var(--glow-primary);
}

.cache-badge-mini {
    position: absolute;
    top: -6px;
    right: -6px;
    background: linear-gradient(135deg, var(--ml-danger), #fd7e14);
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 3px 7px;
    border-radius: 50px;
    min-width: 20px;
    text-align: center;
    line-height: 1.2;
    box-shadow: 0 2px 8px rgba(245, 87, 108, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

/* ============================================
   🎯 FIN DU FICHIER - ULTRA MODERN 3D CSS
   ============================================ */