/* ==============================================
   🎨 MARKET-DATA.CSS - ULTRA MODERN 3D VERSION
   Glassmorphism • 3D Effects • Premium Animations
   VERSION FINALE - SIDEBAR NON TOUCHÉE
   ============================================== */

/* ============================================
   🌟 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);
    
    /* Portfolio colors */
    --portfolio-gradient-start: #667eea;
    --portfolio-gradient-end: #764ba2;
    --portfolio-gold: #ffd700;
    --portfolio-shadow: rgba(102, 126, 234, 0.3);
    
    /* Market Data specific */
    --md-blue-primary: #1e5eeb;
    --md-blue-light: #4c8aff;
    --md-blue-dark: #0d3d9f;
    --md-gradient: linear-gradient(135deg, #1e5eeb 0%, #4c8aff 100%);
    
    /* Cache Widget */
    --cache-bg: #ffffff;
    --cache-border: #e5e7eb;
    --cache-text: #1f2937;
    --cache-text-secondary: #6b7280;
    --cache-success: #10b981;
    --cache-warning: #f59e0b;
    --cache-danger: #ef4444;
}

body.dark-mode,
[data-theme="dark"] {
    --glass-bg: rgba(15, 23, 42, 0.7);
    --glass-border: rgba(148, 163, 184, 0.1);
    
    --cache-bg: #1e293b;
    --cache-border: #334155;
    --cache-text: #f1f5f9;
    --cache-text-secondary: #94a3b8;
}

/* ============================================
   ✅ TITRE DE LA PAGE
   ============================================ */
.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;
}

/* ============================================
   📦 CARDS - GLASSMORPHISM
   ============================================ */
.card {
    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: 24px;
    padding: 0;
    margin-bottom: 40px;
    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;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 20px 60px rgba(102, 126, 234, 0.2),
        0 0 40px rgba(118, 75, 162, 0.1);
}

.card-header {
    padding: 30px 35px;
    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 {
    margin: 0;
    font-size: 1.5rem;
    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;
}

.card-title i {
    font-size: 1.8rem;
    animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.card-body {
    padding: 35px;
}

/* ============================================
   🔍 SEARCH PANEL - PREMIUM
   ============================================ */
.search-panel {
    background: linear-gradient(
        135deg,
        rgba(102, 126, 234, 0.1) 0%,
        rgba(118, 75, 162, 0.05) 100%
    );
    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); }
}

.search-input-wrapper {
    position: relative;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    z-index: 1;
}

#symbolInput {
    flex: 1;
    min-width: 250px;
    padding: 18px 24px;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(102, 126, 234, 0.4);
    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);
}

/* ============================================
   🚀 BUTTON SEARCH - HOLOGRAPHIC
   ============================================ */
.btn-search {
    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);
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    box-shadow: 
        0 8px 24px rgba(102, 126, 234, 0.4),
        0 0 20px rgba(118, 75, 162, 0.3);
}

.btn-search::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-search: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-search:hover::before {
    left: 100%;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ============================================
   ✅ BOUTON ADD TO COMPARE - FINALISÉ
   ============================================ */
.btn-add-to-compare,
#addToCompareBtn,
button[onclick*="compare"],
.comparison-actions .btn,
.comparison-actions button {
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 700;
    border: 2px solid rgba(102, 126, 234, 0.5);
    border-radius: 16px;
    background: linear-gradient(
        135deg,
        rgba(102, 126, 234, 0.1) 0%,
        rgba(118, 75, 162, 0.05) 100%
    );
    backdrop-filter: blur(15px) saturate(180%);
    color: var(--text-primary);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: var(--transition-bounce);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 
        0 4px 16px rgba(102, 126, 234, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform-style: preserve-3d;
}

.btn-add-to-compare::before,
#addToCompareBtn::before,
button[onclick*="compare"]::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.6s, height 0.6s;
}

.btn-add-to-compare:hover,
#addToCompareBtn:hover,
button[onclick*="compare"]:hover {
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    border-color: transparent;
    color: white !important;
    transform: translateY(-6px) scale(1.05) rotateX(5deg);
    box-shadow: 
        0 12px 36px rgba(102, 126, 234, 0.4),
        0 0 30px rgba(118, 75, 162, 0.3),
        var(--glow-primary);
}

.btn-add-to-compare:hover::before,
#addToCompareBtn:hover::before,
button[onclick*="compare"]:hover::before {
    width: 400px;
    height: 400px;
}

.btn-add-to-compare:active,
#addToCompareBtn:active,
button[onclick*="compare"]:active {
    transform: translateY(-2px) scale(1.02);
}

.btn-add-to-compare i,
#addToCompareBtn i,
button[onclick*="compare"] i {
    font-size: 1.2rem;
    transition: var(--transition-smooth);
}

.btn-add-to-compare:hover i,
#addToCompareBtn:hover i,
button[onclick*="compare"]:hover i {
    transform: scale(1.2) rotate(10deg);
    color: white !important;
}

.btn-add-to-compare.btn-primary,
.comparison-actions .btn-primary {
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    border-color: transparent;
    color: white;
}

.btn-add-to-compare.btn-primary:hover {
    background: linear-gradient(135deg, var(--ml-secondary), var(--ml-accent));
    box-shadow: 
        0 16px 48px rgba(118, 75, 162, 0.5),
        var(--glow-accent);
}

/* ============================================
   💡 SEARCH SUGGESTIONS - GLASSMORPHISM
   ============================================ */
.search-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 200px;
    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);
    color: white;
}

.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);
}

.suggestion-icon.finance {
    background: linear-gradient(135deg, #43e97b, #38f9d7);
}

.suggestion-icon.crypto {
    background: linear-gradient(135deg, #FF9800, #FFC107);
}

.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-info {
    flex: 1;
    min-width: 0;
}

/* ============================================
   🎪 POPULAR STOCKS - ANIMATED CHIPS
   ============================================ */
.popular-stocks,
.time-period-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    padding-top: 25px;
    border-top: 2px solid var(--glass-border);
    position: relative;
    z-index: 1;
}

.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,
.period-btn {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(102, 126, 234, 0.4);
    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;
    font-size: 14px;
}

.symbol-chip::before,
.period-btn::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,
.period-btn: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,
.period-btn: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);
    color: white !important;
}

.period-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);
}

/* ============================================
   ⭐ WATCHLIST - 3D CARDS
   ============================================ */
.watchlist-section,
.alerts-section,
.comparison-section {
    margin-bottom: 40px;
}

.watchlist-header,
.alerts-header,
.comparison-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
}

.watchlist-actions,
.comparison-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.watchlist-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.watchlist-card {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.02) 100%
    );
    backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid var(--glass-border);
    padding: 25px;
    border-radius: 20px;
    transition: var(--transition-smooth);
    cursor: pointer;
    transform-style: preserve-3d;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.watchlist-card:hover {
    transform: translateY(-8px) rotateX(2deg);
    box-shadow: 
        0 20px 60px rgba(102, 126, 234, 0.25),
        0 0 40px rgba(118, 75, 162, 0.15);
    border-color: rgba(102, 126, 234, 0.4);
}

.watchlist-symbol {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.watchlist-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 15px 0;
}

.watchlist-change {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 50px;
    display: inline-flex;
}

.watchlist-change.positive {
    background: linear-gradient(135deg, var(--ml-success), #38f9d7);
    color: white;
    box-shadow: 0 4px 12px rgba(67, 233, 123, 0.3);
}

.watchlist-change.negative {
    background: linear-gradient(135deg, var(--ml-danger), #fd7e14);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 87, 108, 0.3);
}

.watchlist-remove {
    background: rgba(239, 68, 68, 0.1);
    color: var(--ml-danger);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-bounce);
    display: flex;
    align-items: center;
    justify-content: center;
}

.watchlist-remove:hover {
    background: var(--ml-danger);
    color: white;
    transform: scale(1.15) rotate(15deg);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.4);
}

.watchlist-empty,
.alerts-empty,
.comparison-empty,
.no-portfolios {
    text-align: center;
    padding: 80px 30px;
    color: var(--text-secondary);
}

.watchlist-empty i,
.alerts-empty i,
.comparison-empty i,
.no-portfolios i {
    font-size: 4rem;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0.3;
    display: block;
}

/* ============================================
   🔔 ALERTS - GLASSMORPHISM
   ============================================ */
.alerts-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.alert-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    padding: 18px 24px;
    border-radius: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    transition: var(--transition-smooth);
    border-left: 4px solid var(--ml-primary);
}

.alert-card:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateX(8px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.2);
}

.alert-card.triggered {
    background: rgba(67, 233, 123, 0.1);
    border-color: var(--ml-success);
}

.alert-info {
    flex: 1;
}

.alert-symbol {
    font-size: 1.3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.alert-condition {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 6px;
}

.alert-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-status {
    font-size: 0.8rem;
    padding: 6px 16px;
    border-radius: 50px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.alert-status.active {
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    color: white;
}

.alert-status.triggered {
    background: linear-gradient(135deg, var(--ml-success), #38f9d7);
    color: white;
}

.alert-delete {
    background: rgba(239, 68, 68, 0.1);
    color: var(--ml-danger);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-bounce);
    flex-shrink: 0;
}

.alert-delete:hover {
    background: var(--ml-danger);
    color: white;
    transform: scale(1.15) rotate(15deg);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.4);
}

/* ============================================
   ✅ COMPARISON SECTION - MISE EN FORME COMPLÈTE
   ============================================ */
.comparison-section {
    margin-bottom: 40px;
}

.comparison-section .section-title {
    margin-bottom: 25px;
    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;
}

.comparison-section .section-title i {
    font-size: 2rem;
}

.comparison-stocks {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    margin-bottom: 30px;
}

.comparison-stock-chip {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 2px solid var(--glass-border);
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition-smooth);
}

.comparison-stock-chip:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.4);
}

.comparison-stock-chip .performance {
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.comparison-stock-chip .performance.positive {
    background: linear-gradient(135deg, var(--ml-success), #38f9d7);
    color: white;
}

.comparison-stock-chip .performance.negative {
    background: linear-gradient(135deg, var(--ml-danger), #fd7e14);
    color: white;
}

.comparison-chart {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.02) 100%
    );
    backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid var(--glass-border);
    border-radius: 24px;
    padding: 35px;
    margin-bottom: 30px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.comparison-chart h4 {
    margin: 0 0 25px 0;
    font-size: 1.3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.comparison-table {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.02) 100%
    );
    backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid var(--glass-border);
    border-radius: 24px;
    padding: 35px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    overflow-x: auto;
}

.comparison-table h4 {
    margin: 0 0 25px 0;
    font-size: 1.3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.comparison-table table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    overflow: hidden;
}

.comparison-table thead {
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    color: white;
}

.comparison-table th {
    padding: 18px;
    text-align: left;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.comparison-table tbody tr {
    transition: var(--transition-smooth);
    border-bottom: 1px solid var(--glass-border);
}

.comparison-table tbody tr:hover {
    background: rgba(102, 126, 234, 0.08);
}

.comparison-table td {
    padding: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.comparison-table td:first-child {
    font-weight: 800;
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ============================================
   📊 STOCK OVERVIEW - PREMIUM HEADER
   ============================================ */
.stock-overview {
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
    color: white;
    padding: 40px;
    border-radius: 28px;
    margin-bottom: 40px;
    box-shadow: 
        0 12px 40px rgba(102, 126, 234, 0.4),
        0 0 60px rgba(118, 75, 162, 0.3);
    position: relative;
    overflow: hidden;
}

.stock-overview::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;
}

.overview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.stock-title h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0 0 10px 0;
    color: white;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.stock-symbol {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 700;
    backdrop-filter: blur(10px);
    display: inline-block;
}

.current-price {
    font-size: 3rem;
    font-weight: 800;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.price-change {
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 10px;
    padding: 8px 20px;
    border-radius: 50px;
    display: inline-block;
}

.price-change.positive {
    background: linear-gradient(135deg, var(--ml-success), #38f9d7);
    box-shadow: 0 4px 20px rgba(67, 233, 123, 0.4);
}

.price-change.negative {
    background: linear-gradient(135deg, var(--ml-danger), #fd7e14);
    box-shadow: 0 4px 20px rgba(245, 87, 108, 0.4);
}

.overview-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    position: relative;
    z-index: 1;
}

.stat-item {
    background: rgba(255, 255, 255, 0.15);
    padding: 20px;
    border-radius: 16px;
    backdrop-filter: blur(15px);
    transition: var(--transition-smooth);
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-4px);
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
}

/* ============================================
   📈 CHARTS - GLASSMORPHISM
   ============================================ */
.indicator-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    margin-bottom: 20px;
}

.charts-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(500px, 100%), 1fr));
    gap: 28px;
}

.chart {
    min-height: 500px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    padding: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.chart-medium {
    min-height: 400px;
}

/* ============================================
   ✅ PRICE CHART ET SECTIONS TECHNIQUES
   ============================================ */
.price-chart-section {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.02) 100%
    );
    backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid var(--glass-border);
    border-radius: 24px;
    padding: 35px;
    margin-bottom: 30px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.price-chart-section .section-title {
    margin-bottom: 25px;
    font-size: 1.6rem;
    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;
}

.subsection-title {
    margin-bottom: 20px;
    margin-top: 30px;
    font-size: 1.3rem;
    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: 12px;
}

.subsection-title i {
    font-size: 1.5rem;
}

.technical-indicators-section,
.oscillators-section,
.volume-analysis-section,
.support-resistance-section {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.02) 100%
    );
    backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid var(--glass-border);
    border-radius: 24px;
    padding: 35px;
    margin-bottom: 30px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

/* ============================================
   📊 SIGNALS & STATS - 3D CARDS
   ============================================ */
.signals-grid,
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.signal-card,
.stat-box {
    padding: 25px;
    border-radius: 20px;
    border: 2px solid;
    transition: var(--transition-smooth);
    backdrop-filter: blur(15px);
    transform-style: preserve-3d;
}

.signal-card:hover,
.stat-box:hover {
    transform: translateY(-8px) rotateX(2deg);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2);
}

.signal-card.bullish {
    background: linear-gradient(135deg, rgba(67, 233, 123, 0.15), rgba(56, 249, 215, 0.05));
    border-color: var(--ml-success);
}

.signal-card.bearish {
    background: linear-gradient(135deg, rgba(245, 87, 108, 0.15), rgba(253, 126, 20, 0.05));
    border-color: var(--ml-danger);
}

.signal-card.neutral {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.05));
    border-color: var(--ml-primary);
}

.stat-box {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--glass-border);
    text-align: center;
}

.stat-box .label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.stat-box .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;
}

/* ============================================
   ✅ COMPANY PROFILE - ACCORDION
   ============================================ */
.company-logo {
    display: none !important;
}

.company-profile-section {
    margin-bottom: 40px;
}

.company-accordion {
    margin-bottom: 15px;
    border: 2px solid rgba(102, 126, 234, 0.4);
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    transition: var(--transition-smooth);
}

.company-accordion:hover {
    border-color: rgba(102, 126, 234, 0.6);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.15);
}

.accordion-header {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    padding: 18px 25px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    color: var(--text-primary);
    transition: var(--transition-smooth);
    user-select: none;
}

.accordion-header:hover {
    background: rgba(102, 126, 234, 0.1);
}

.accordion-header i.fa-chevron-down {
    transition: transform var(--transition-smooth);
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.accordion-header.active i.fa-chevron-down {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.accordion-content.active {
    max-height: 3000px;
    transition: max-height 0.5s ease-in;
}

.accordion-body {
    padding: 25px;
}

/* ============================================
   💼 PORTFOLIO MANAGEMENT - ULTRA COMPACT ✅
   ============================================ */

/* Suppression zone blanche totale */
.main-content > .section:has(.simulation-management) {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.portfolio-section,
.simulation-section {
    margin-bottom: 15px !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.portfolio-section h2,
.simulation-section h2,
h2:has(+ .simulation-management) {
    margin-top: 0 !important;
    margin-bottom: 15px !important;
    padding-top: 0 !important;
}

.section.portfolio-section,
.section.simulation-section {
    padding-top: 15px !important;
    margin-top: 0 !important;
}

.card:has(.simulation-management) {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.card:has(.simulation-management) .card-body {
    padding-top: 20px !important;
}

/* Container principal */
.simulation-management {
    background: linear-gradient(135deg, var(--portfolio-gradient-start) 0%, var(--portfolio-gradient-end) 100%) !important;
    color: white !important;
    padding: 20px 25px !important;
    border-radius: 24px;
    box-shadow: 0 12px 40px var(--portfolio-shadow);
    margin-top: 0 !important;
    margin-bottom: 15px !important;
    position: relative;
    overflow: hidden;
}

.simulation-management::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.03) 10px,
        rgba(255, 255, 255, 0.03) 20px
    );
    animation: moveStripes 20s linear infinite;
    pointer-events: none;
}

@keyframes moveStripes {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.simulation-management h3 {
    color: white !important;
    margin-top: 0 !important;
    margin-bottom: 15px !important;
    padding-top: 0 !important;
    font-size: 1.6rem;
    font-weight: 800;
    position: relative;
    z-index: 1;
}

.simulation-management h3 i {
    color: white !important;
}

.current-simulation-display {
    background: rgba(255, 255, 255, 0.15) !important;
    padding: 14px 16px !important;
    border-radius: 16px;
    text-align: center;
    backdrop-filter: blur(10px);
    margin-bottom: 15px !important;
    position: relative;
    z-index: 1;
}

.current-simulation-display * {
    color: white !important;
}

.current-simulation-display .value {
    font-size: 1.4rem !important;
    font-weight: 800 !important;
    color: var(--portfolio-gold) !important;
}

.toolbar-row {
    display: flex;
    align-items: center;
    gap: 8px !important;
    flex-wrap: wrap;
    justify-content: center;
    position: relative;
    z-index: 1;
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.simulation-management .btn,
.simulation-management .btn-success,
.simulation-management .btn-primary,
.simulation-management .btn-secondary,
.simulation-management .btn-warning,
.simulation-management .btn-info {
    margin: 2px !important;
    transition: var(--transition-smooth);
    font-weight: 700;
    border: none;
    cursor: pointer;
    padding: 10px 24px !important;
    border-radius: 16px;
    font-size: 0.95rem !important;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.simulation-management .btn-success {
    background: linear-gradient(135deg, var(--ml-success), #38f9d7);
    color: white !important;
}

.simulation-management .btn-success:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 30px rgba(67, 233, 123, 0.4);
}

.simulation-management .btn-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white !important;
}

.simulation-management .btn-primary:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.4);
}

.simulation-management .btn-secondary {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white !important;
}

.simulation-management .btn-secondary:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 30px rgba(107, 114, 128, 0.4);
}

.simulation-management .btn-warning {
    background: linear-gradient(135deg, var(--ml-warning), #fda085);
    color: white !important;
}

.simulation-management .btn-warning:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 30px rgba(246, 211, 101, 0.4);
}

.simulation-management .btn-info {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: white !important;
}

.simulation-management .btn-info:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 30px rgba(6, 182, 212, 0.4);
}

.info-box,
.info-box-white-text {
    background: rgba(255, 255, 255, 0.1) !important;
    border-left: 4px solid white !important;
    padding: 12px 14px !important;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    margin-top: 12px !important;
    position: relative;
    z-index: 1;
}

.info-box *,
.info-box-white-text * {
    color: white !important;
}

/* ============================================
   📂 PORTFOLIO ITEMS - ULTRA COMPACT
   ============================================ */
.simulations-info {
    background: linear-gradient(135deg, var(--portfolio-gradient-start), var(--portfolio-gradient-end));
    color: white !important;
    padding: 14px 18px !important;
    border-radius: 16px;
    margin-bottom: 15px !important;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.simulations-info * {
    color: white !important;
}

#portfoliosListContainer {
    display: flex;
    flex-direction: column;
    gap: 10px !important;
    margin-top: 0 !important;
}

.simulation-item {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 14px 16px !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    margin-bottom: 0 !important;
}

.simulation-item::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;
}

.simulation-item:hover::before {
    left: 100%;
}

.simulation-item:not(.active) {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%) !important;
    border: 2px solid #e5e7eb !important;
}

.simulation-item:not(.active):hover {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%) !important;
    border-color: var(--portfolio-gradient-start) !important;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.2);
}

.simulation-item:not(.active) .simulation-name,
.simulation-item:not(.active) .simulation-meta {
    color: #1f2937 !important;
}

.simulation-item:not(.active) .simulation-name i:first-child {
    color: var(--portfolio-gradient-start) !important;
}

.simulation-item:not(.active) .simulation-meta i {
    color: #9ca3af !important;
}

.simulation-item.active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    border-color: var(--portfolio-gold) !important;
    box-shadow: 0 12px 40px rgba(16, 185, 129, 0.4);
}

.simulation-item.active * {
    color: white !important;
}

.simulation-item.active .simulation-name i:first-child {
    color: var(--portfolio-gold) !important;
}

.simulation-info {
    flex: 1;
    cursor: pointer;
    user-select: none;
}

.simulation-name {
    font-size: 1.2rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.simulation-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 0.9rem;
}

.simulation-actions {
    display: flex;
    gap: 10px;
    position: relative;
    z-index: 10;
}

.btn-sm {
    padding: 10px 20px;
    font-size: 0.9rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 8px;
}

.simulation-item:not(.active) .btn-sm {
    background: rgba(102, 126, 234, 0.1);
    color: var(--portfolio-gradient-start);
}

.simulation-item:not(.active) .btn-sm:hover {
    background: var(--portfolio-gradient-start);
    color: white;
    transform: scale(1.05);
}

.simulation-item:not(.active) .btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--ml-danger);
}

.simulation-item:not(.active) .btn-danger:hover {
    background: var(--ml-danger);
    color: white;
}

.simulation-item.active .btn-sm {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.simulation-item.active .btn-sm:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

/* ============================================
   🗄️ CACHE WIDGET - COMPLET
   ============================================ */
.cache-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    max-height: 80vh;
    background: var(--cache-bg);
    border: 1px solid var(--cache-border);
    border-radius: 20px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
    z-index: 9000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.cache-widget.active {
    display: flex;
    animation: slideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cache-widget-header {
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cache-widget-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cache-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-bounce);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cache-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg) scale(1.1);
}

.cache-widget-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.cache-section {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--cache-border);
}

.cache-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.cache-section h4 {
    margin: 0 0 15px 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--cache-text);
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cache-section h4 i {
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cache-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.cache-stat-value {
    color: var(--cache-text);
    font-weight: 800;
    font-size: 1.2rem;
}

.cache-progress-bar {
    width: 100%;
    height: 10px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50px;
    overflow: hidden;
    margin: 15px 0;
}

.cache-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cache-success), #059669);
    border-radius: 50px;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.cache-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-cache {
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-cache-refresh {
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    color: white;
}

.btn-cache-refresh:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-cache-clear {
    background: linear-gradient(135deg, var(--ml-warning), #fda085);
    color: white;
}

.btn-cache-clear:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(246, 211, 101, 0.4);
}

.btn-cache-export {
    background: linear-gradient(135deg, var(--ml-success), #38f9d7);
    color: white;
}

.btn-cache-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(67, 233, 123, 0.4);
}

.cache-activity {
    max-height: 200px;
    overflow-y: auto;
}

.cache-activity-entry {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(5px);
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.cache-empty-state {
    text-align: center;
    color: var(--cache-text-secondary);
    font-size: 0.9rem;
    padding: 20px;
}

/* ============================================
   ✅ MODALS - STYLE PREMIUM UNIFORME
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto;
    padding: 20px;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex !important;
    opacity: 1;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.3s ease;
    margin: auto;
}

body.dark-mode .modal-content {
    background: #1e293b;
}

.modal.active .modal-content {
    transform: scale(1);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.9) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 30px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, #2649B2, #4A74F3);
    color: white;
    border-radius: 20px 20px 0 0;
}

#portfoliosModal .modal-header {
    background: linear-gradient(135deg, var(--portfolio-gradient-start), var(--portfolio-gradient-end));
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: white !important;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-header h2 i {
    color: white !important;
}

.close-modal,
.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 1.5rem;
    color: white !important;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.close-modal:hover,
.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
    color: var(--text-primary);
    background: white;
}

body.dark-mode .modal-body {
    background: #1e293b;
    color: #e2e8f0;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 30px;
    border-top: 1px solid var(--border-color);
    background: var(--background-secondary);
    border-radius: 0 0 20px 20px;
}

/* ============================================
   ✅ BOUTONS MODALS - STYLE PREMIUM
   ============================================ */

/* Bouton principal "Load Comparison" */
.modal-body button[onclick*="loadComparison"],
.modal-body .btn-load-comparison,
button:has(i.fa-chart-line),
.modal-footer .btn-primary,
.modal button[type="submit"] {
    padding: 14px 32px !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    border: none !important;
    border-radius: 16px !important;
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary), var(--ml-accent)) !important;
    background-size: 200% 200% !important;
    color: white !important;
    cursor: pointer !important;
    position: relative !important;
    overflow: hidden !important;
    transition: var(--transition-smooth) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    box-shadow: 
        0 8px 24px rgba(102, 126, 234, 0.4),
        0 0 20px rgba(118, 75, 162, 0.3) !important;
    transform-style: preserve-3d !important;
}

.modal-body button[onclick*="loadComparison"]::before,
.modal-body .btn-load-comparison::before,
.modal-footer .btn-primary::before {
    content: '' !important;
    position: absolute !important;
    top: -50% !important;
    left: -50% !important;
    width: 200% !important;
    height: 200% !important;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    ) !important;
    transform: rotate(45deg) !important;
    transition: all 0.6s !important;
}

.modal-body button[onclick*="loadComparison"]:hover,
.modal-body .btn-load-comparison:hover,
.modal-footer .btn-primary:hover {
    transform: translateY(-4px) scale(1.02) !important;
    box-shadow: 
        0 16px 40px rgba(102, 126, 234, 0.5),
        0 0 40px rgba(118, 75, 162, 0.4) !important;
    animation: gradientShift 3s ease infinite !important;
}

.modal-body button[onclick*="loadComparison"]:hover::before,
.modal-body .btn-load-comparison:hover::before {
    left: 100% !important;
}

/* Bouton secondaire "Cancel" */
.modal-body button[onclick*="closeModal"],
.modal-body .btn-cancel,
.modal-footer .btn-secondary,
.modal-footer button:not(.btn-primary) {
    padding: 14px 32px !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    border: 2px solid rgba(102, 126, 234, 0.4) !important;
    border-radius: 16px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(15px) saturate(180%) !important;
    color: var(--text-primary) !important;
    cursor: pointer !important;
    transition: var(--transition-bounce) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    position: relative !important;
    overflow: hidden !important;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

.modal-body button[onclick*="closeModal"]:hover,
.modal-body .btn-cancel:hover,
.modal-footer .btn-secondary:hover {
    background: rgba(102, 126, 234, 0.15) !important;
    border-color: var(--ml-primary) !important;
    color: var(--ml-primary) !important;
    transform: translateY(-3px) scale(1.02) !important;
    box-shadow: 
        0 8px 24px rgba(102, 126, 234, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

/* Quick Presets - Style chips premium */
.modal-body button[onclick*="preset"],
.modal-body .preset-btn,
button:has(i.fa-microchip),
button:has(i.fa-bitcoin),
button:has(i.fa-chart-pie) {
    padding: 10px 20px !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    border: 2px solid rgba(102, 126, 234, 0.4) !important;
    border-radius: 50px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(10px) !important;
    color: var(--text-primary) !important;
    cursor: pointer !important;
    transition: var(--transition-bounce) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    position: relative !important;
    overflow: hidden !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.modal-body button[onclick*="preset"]::before,
.modal-body .preset-btn::before {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 0 !important;
    height: 0 !important;
    border-radius: 50% !important;
    background: radial-gradient(circle, var(--ml-primary), transparent) !important;
    transform: translate(-50%, -50%) !important;
    transition: width 0.6s, height 0.6s !important;
}

.modal-body button[onclick*="preset"]:hover,
.modal-body .preset-btn:hover {
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary)) !important;
    border-color: transparent !important;
    color: white !important;
    transform: translateY(-4px) scale(1.05) !important;
    box-shadow: 
        0 8px 24px rgba(102, 126, 234, 0.4),
        var(--glow-primary) !important;
}

.modal-body button[onclick*="preset"]:hover::before,
.modal-body .preset-btn:hover::before {
    width: 300px !important;
    height: 300px !important;
}

.modal-body button[onclick*="preset"]:hover i,
.modal-body .preset-btn:hover i {
    transform: scale(1.2) rotate(10deg) !important;
    color: white !important;
}

/* Input dans modal */
.modal-body input[type="text"],
.modal-body input[type="number"] {
    width: 100% !important;
    padding: 16px 22px !important;
    font-size: 1rem !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 2px solid rgba(102, 126, 234, 0.3) !important;
    border-radius: 16px !important;
    color: var(--text-primary) !important;
    transition: var(--transition-smooth) !important;
    backdrop-filter: blur(10px) !important;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}

.modal-body input[type="text"]:focus,
.modal-body input[type="number"]:focus {
    outline: none !important;
    border-color: var(--ml-primary) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    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) !important;
    transform: translateY(-2px) !important;
}

/* Message d'alerte dans modal */
.modal-body .alert,
.modal-body [class*="alert-"],
.modal-body .warning-message {
    background: linear-gradient(
        135deg,
        rgba(246, 211, 101, 0.15),
        rgba(253, 160, 133, 0.1)
    ) !important;
    border-left: 4px solid var(--ml-warning) !important;
    padding: 12px 18px !important;
    border-radius: 12px !important;
    backdrop-filter: blur(10px) !important;
    font-size: 0.9rem !important;
    color: var(--text-primary) !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin: 15px 0 !important;
}

.modal-body .alert i,
.modal-body [class*="alert-"] i {
    color: var(--ml-warning) !important;
    font-size: 1.2rem !important;
}

/* Label dans modal */
.modal-body label {
    font-weight: 700 !important;
    color: var(--text-primary) !important;
    font-size: 1rem !important;
    margin-bottom: 10px !important;
    display: block !important;
}

/* Section "Quick Presets" */
.modal-body .quick-presets-section,
.modal-body > div:has(button[onclick*="preset"]) {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    align-items: center !important;
    margin-top: 20px !important;
    padding-top: 20px !important;
    border-top: 2px solid var(--glass-border) !important;
}

.modal-body .quick-presets-section > span,
.modal-body > div:has(button[onclick*="preset"]) > span {
    font-weight: 700 !important;
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary)) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    font-size: 1.05rem !important;
}

/* ============================================
   📋 FORMULAIRES DANS MODALS
   ============================================ */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.form-group label {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1rem;
}

.form-input,
.modal-body select,
.modal-body textarea {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--background-primary);
    transition: var(--transition-smooth);
}

.form-input:focus,
.modal-body select:focus,
.modal-body textarea:focus {
    outline: none;
    border-color: var(--ml-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.btn-create {
    flex: 1;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
    font-size: 1rem;
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    color: white;
}

.btn-create:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.btn-cancel {
    flex: 1;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    background: var(--background-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-cancel:hover {
    background: var(--background-tertiary);
}

/* ============================================
   ✅ HELP ICON VISIBLE
   ============================================ */
.help-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    color: white;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 800;
    transition: var(--transition-bounce);
    margin-left: auto;
    flex-shrink: 0;
    position: relative;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    border: none;
    line-height: 1;
}

.help-icon::after {
    content: '?';
    color: white;
    font-size: 1.1rem;
    font-weight: 800;
}

.help-icon:hover {
    transform: scale(1.15) rotate(15deg);
    box-shadow: 
        0 8px 24px rgba(102, 126, 234, 0.5),
        var(--glow-primary);
}

/* ============================================
   🌙 DARK MODE
   ============================================ */
body.dark-mode .card,
body.dark-mode .search-panel,
body.dark-mode .signals-section,
body.dark-mode .price-chart-section,
body.dark-mode .technical-indicators-section,
body.dark-mode .oscillators-section,
body.dark-mode .volume-analysis-section,
body.dark-mode .support-resistance-section,
body.dark-mode .comparison-chart,
body.dark-mode .comparison-table {
    background: linear-gradient(
        135deg,
        rgba(102, 126, 234, 0.05) 0%,
        rgba(15, 23, 42, 0.5) 100%
    );
}

body.dark-mode .simulation-item:not(.active) {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%) !important;
    border-color: #475569 !important;
}

body.dark-mode .simulation-item:not(.active) .simulation-name,
body.dark-mode .simulation-item:not(.active) .simulation-meta {
    color: white !important;
}

body.dark-mode .simulation-item:not(.active):hover {
    background: #334155 !important;
    border-color: var(--portfolio-gradient-start) !important;
}

body.dark-mode .modal-body button[onclick*="closeModal"],
body.dark-mode .modal-body .btn-cancel {
    background: rgba(15, 23, 42, 0.5) !important;
    color: #e2e8f0 !important;
}

body.dark-mode .modal-body button[onclick*="closeModal"]:hover,
body.dark-mode .modal-body .btn-cancel:hover {
    background: rgba(102, 126, 234, 0.2) !important;
    color: var(--ml-primary) !important;
}

/* ============================================
   📱 RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .card-body {
        padding: 20px;
    }
    
    .search-input-wrapper {
        flex-direction: column;
    }
    
    .search-suggestions {
        right: 0;
    }
    
    .watchlist-container {
        grid-template-columns: 1fr;
    }
    
    .charts-grid-2 {
        grid-template-columns: 1fr;
    }
    
    .simulation-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .simulation-actions {
        width: 100%;
    }
    
    .cache-widget {
        width: 100%;
        bottom: 0;
        right: 0;
        left: 0;
        border-radius: 20px 20px 0 0;
    }
    
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        max-width: 100%;
    }
    
    .alert-card {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .alert-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .modal-body button[onclick*="loadComparison"],
    .modal-body button[onclick*="closeModal"],
    .modal-footer .btn-primary,
    .modal-footer .btn-secondary {
        padding: 12px 24px !important;
        font-size: 1rem !important;
    }
    
    .modal-body button[onclick*="preset"] {
        padding: 8px 16px !important;
        font-size: 0.9rem !important;
    }
}

@media (max-width: 480px) {
    .card {
        margin-bottom: 20px;
    }
    
    .card-header {
        padding: 20px;
    }
    
    .card-body {
        padding: 15px;
    }
}

/* ============================================
   🎬 ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-panel > * {
    animation: fadeInUp 0.6s ease-out backwards;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.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;
}

body.modal-open {
    overflow: hidden !important;
}

/* ============================================
   🎯 FIN DU FICHIER - ULTRA MODERN 3D CSS
   SIDEBAR 100% INTACTE ✅
   ============================================ */