/**
 * ════════════════════════════════════════════════════════════════
 * ALPHAVAULT AI - ADVANCED ANALYSIS ENHANCED STYLES
 * Design Premium: Gradients violets + Glassmorphism + Responsive
 * Complément de advanced-analysis.css (à charger APRÈS)
 * ════════════════════════════════════════════════════════════════
 */

/* ════════════════════════════════════════════════════════════════
   1. SIGNAL BOXES (Bullish/Bearish/Neutral)
   ════════════════════════════════════════════════════════════════ */

.signal-box {
    padding: 16px 20px;
    background: rgba(102, 126, 234, 0.08);
    border-radius: 12px;
    font-weight: 700;
    text-align: center;
    border: 2px solid rgba(102, 126, 234, 0.15);
    margin-top: 16px;
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.signal-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.signal-box:hover::before {
    opacity: 1;
}

.signal-box.bullish {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.05));
    border-color: rgba(16, 185, 129, 0.3);
    color: #059669;
}

.signal-box.bullish::before {
    background: linear-gradient(135deg, #10b981, #059669);
}

.signal-box.bearish {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.05));
    border-color: rgba(239, 68, 68, 0.3);
    color: #dc2626;
}

.signal-box.bearish::before {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.signal-box.neutral {
    background: linear-gradient(135deg, rgba(100, 116, 139, 0.1), rgba(71, 85, 105, 0.05));
    border-color: rgba(100, 116, 139, 0.3);
    color: #64748b;
}

.signal-box.neutral::before {
    background: linear-gradient(135deg, #64748b, #475569);
}

body.dark-mode .signal-box {
    background: rgba(30, 41, 59, 0.6);
}

body.dark-mode .signal-box.bullish {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
    color: #34d399;
}

body.dark-mode .signal-box.bearish {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
}

body.dark-mode .signal-box.neutral {
    background: rgba(100, 116, 139, 0.15);
    border-color: rgba(100, 116, 139, 0.4);
    color: #94a3b8;
}

/* ════════════════════════════════════════════════════════════════
   2. GAUGE BAR (Consolidated Signals)
   ════════════════════════════════════════════════════════════════ */

.gauge-bar {
    height: 32px;
    background: rgba(100, 116, 139, 0.2);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 16px;
    position: relative;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
}

.gauge-fill {
    height: 100%;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 16px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
    position: relative;
}

.gauge-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.gauge-value {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-top: 8px;
}

.gauge-value.strong-buy { background: linear-gradient(135deg, #10b981, #059669); -webkit-background-clip: text; background-clip: text; }
.gauge-value.buy { background: linear-gradient(135deg, #34d399, #10b981); -webkit-background-clip: text; background-clip: text; }
.gauge-value.neutral { background: linear-gradient(135deg, #f59e0b, #d97706); -webkit-background-clip: text; background-clip: text; }
.gauge-value.sell { background: linear-gradient(135deg, #f87171, #ef4444); -webkit-background-clip: text; background-clip: text; }
.gauge-value.strong-sell { background: linear-gradient(135deg, #ef4444, #dc2626); -webkit-background-clip: text; background-clip: text; }

body.dark-mode .gauge-bar {
    background: rgba(30, 41, 59, 0.6);
}

/* ════════════════════════════════════════════════════════════════
   3. SIGNALS BREAKDOWN
   ════════════════════════════════════════════════════════════════ */

.signals-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.signal-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 10px;
    border: 2px solid rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
}

.signal-row:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.25);
}

.signal-indicator-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.signal-indicator-value {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0 8px;
}

.signal-badge {
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.signal-badge.buy {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.signal-badge.sell {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.signal-badge.neutral {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

body.dark-mode .signal-row {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(102, 126, 234, 0.2);
}

/* ════════════════════════════════════════════════════════════════
   4. AI RECOMMENDATION SECTION (ULTRA PREMIUM)
   ════════════════════════════════════════════════════════════════ */

.ai-recommendation-section {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid transparent;
    background-clip: padding-box;
    border-radius: 24px;
    padding: 40px;
    position: relative;
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.2);
    margin-bottom: 32px;
}

.ai-recommendation-section::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    padding: 2px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.ai-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(135deg, #667eea, #764ba2) 1;
}

.ai-logo-container {
    position: relative;
}

.ai-logo-ring {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.5);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 8px 24px rgba(102, 126, 234, 0.5); }
    50% { transform: scale(1.05); box-shadow: 0 12px 36px rgba(102, 126, 234, 0.7); }
}

.ai-logo-core {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.dark-mode .ai-logo-core {
    background: #1e293b;
}

.ai-logo-core i {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ai-header-text {
    flex: 1;
}

.ai-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(102, 126, 234, 0.15);
    color: #667eea;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.ai-title {
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.ai-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.ai-indicators-count {
    display: inline-block;
    margin-left: 8px;
    padding: 4px 10px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 6px;
    font-size: 0.85rem;
}

/* AI Score Container */
.ai-score-container {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: 24px;
    margin-bottom: 32px;
}

.ai-score-card {
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 32px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 12px 36px rgba(102, 126, 234, 0.4);
}

.ai-score-label {
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 16px;
}

.ai-score-value {
    font-size: 3.5rem;
    font-weight: 900;
    color: white !important;
    margin-bottom: 16px;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.ai-score-bar {
    height: 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 12px;
}

.ai-score-fill {
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 6px;
    transition: width 0.8s ease;
}

.ai-score-rating {
    font-size: 1.1rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
}

/* Quick Stats */
.ai-quick-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.ai-stat-item {
    background: rgba(102, 126, 234, 0.08);
    padding: 20px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    border: 2px solid rgba(102, 126, 234, 0.15);
    transition: all 0.3s ease;
}

.ai-stat-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.2);
}

.ai-stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
}

.ai-stat-icon.bullish {
    background: linear-gradient(135deg, #10b981, #059669);
}

.ai-stat-icon.neutral {
    background: linear-gradient(135deg, #6b7280, #9ca3af);
}

.ai-stat-icon.bearish {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.ai-stat-value {
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ai-stat-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Horizons Grid */
.ai-horizons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 28px;
}

.ai-horizon-card {
    background: rgba(102, 126, 234, 0.05);
    backdrop-filter: blur(10px);
    padding: 28px;
    border-radius: 20px;
    border: 2px solid rgba(102, 126, 234, 0.15);
    transition: all 0.3s ease;
    position: relative;
}

.ai-horizon-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3), rgba(118, 75, 162, 0.3));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ai-horizon-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.3);
}

.ai-horizon-card:hover::before {
    opacity: 1;
}

.ai-horizon-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.ai-horizon-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.ai-horizon-title h3 {
    font-size: 1.4rem;
    font-weight: 900;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.ai-horizon-title p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.ai-horizon-recommendation {
    text-align: center;
    padding: 16px;
    background: rgba(102, 126, 234, 0.08);
    border-radius: 12px;
    margin-bottom: 20px;
}

.ai-rec-badge {
    font-size: 1.3rem;
    font-weight: 900;
    letter-spacing: 1px;
    padding: 8px 20px;
    border-radius: 10px;
    display: inline-block;
}

.ai-rec-badge.buy {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.ai-rec-badge.sell {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.ai-rec-badge.hold {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.ai-horizon-details {
    margin-bottom: 20px;
}

.ai-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.ai-detail-label {
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.ai-detail-value {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.ai-confidence-bar {
    height: 8px;
    background: rgba(100, 116, 139, 0.2);
    border-radius: 4px;
    overflow: hidden;
    flex: 1;
    margin-left: 12px;
}

.ai-confidence-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease;
}

.ai-confidence-fill.buy {
    background: linear-gradient(135deg, #10b981, #059669);
}

.ai-confidence-fill.sell {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.ai-confidence-fill.hold {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.ai-horizon-drivers {
    border-top: 2px solid rgba(102, 126, 234, 0.1);
    padding-top: 16px;
}

.ai-drivers-label {
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-drivers-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-driver-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.ai-driver-item i {
    color: #10b981;
    margin-top: 3px;
    flex-shrink: 0;
}

.ai-disclaimer {
    background: rgba(245, 158, 11, 0.1);
    border-left: 4px solid #f59e0b;
    padding: 20px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.ai-disclaimer i {
    color: #f59e0b;
    margin-right: 8px;
}

/* Dark Mode AI Section */
body.dark-mode .ai-recommendation-section {
    background: rgba(15, 23, 42, 0.9);
}

body.dark-mode .ai-stat-item,
body.dark-mode .ai-horizon-card {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(102, 126, 234, 0.2);
}

body.dark-mode .ai-horizon-recommendation {
    background: rgba(30, 41, 59, 0.6);
}

/* ════════════════════════════════════════════════════════════════
   5. STOCK LOGO (dans le header)
   ════════════════════════════════════════════════════════════════ */

.stock-logo-container {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border: 3px solid rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
    margin-right: 20px;
}

.stock-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.logo-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 900;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.dark-mode .stock-logo-container {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(102, 126, 234, 0.3);
}

/* ════════════════════════════════════════════════════════════════
   6. EXPORT NOTIFICATIONS
   ════════════════════════════════════════════════════════════════ */

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ════════════════════════════════════════════════════════════════
   7. RESPONSIVE MOBILE
   ════════════════════════════════════════════════════════════════ */

@media (max-width: 1200px) {
    .ai-score-container {
        grid-template-columns: 1fr;
    }
    
    .oscillators-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .ai-header {
        flex-direction: column;
        text-align: center;
    }
    
    .ai-quick-stats {
        grid-template-columns: 1fr;
    }
    
    .ai-horizons-grid {
        grid-template-columns: 1fr;
    }
    
    .ai-recommendation-section {
        padding: 24px 18px;
    }
    
    .ai-title {
        font-size: 1.6rem;
    }
    
    .ai-score-value {
        font-size: 2.5rem;
    }
    
    .signals-breakdown {
        grid-template-columns: 1fr;
    }
    
    .stock-logo-container {
        width: 56px;
        height: 56px;
        margin-right: 14px;
    }
}

@media (max-width: 480px) {
    .ai-recommendation-section {
        padding: 20px 14px;
    }
    
    .ai-logo-ring {
        width: 60px;
        height: 60px;
    }
    
    .ai-logo-core {
        width: 50px;
        height: 50px;
    }
    
    .ai-logo-core i {
        font-size: 2rem;
    }
    
    .ai-title {
        font-size: 1.4rem;
    }
    
    .ai-subtitle {
        font-size: 0.9rem;
    }
}

/* ════════════════════════════════════════════════════════════════
   WATCHLIST & PORTFOLIO MANAGEMENT - COMPACT & RESPONSIVE
   ════════════════════════════════════════════════════════════════ */

/* ════════════════════════════════════════════════════════════════
   WATCHLIST CARDS (LAYOUT HORIZONTAL CORRIGÉ)
   ════════════════════════════════════════════════════════════════ */

.watchlist-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
    margin-top: 20px;
}

.watchlist-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 18px;
    padding: 16px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    background-clip: padding-box;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    min-height: 90px;
    display: flex;
    gap: 14px;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.08);
}

.watchlist-card::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 18px;
    padding: 2px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.4), rgba(118, 75, 162, 0.4));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease;
    z-index: 0;
}

.watchlist-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 16px 40px rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.35);
}

.watchlist-card:hover::before {
    opacity: 1;
}

/* Logo à gauche (colonne fixe) */
.watchlist-card img,
.watchlist-card .company-logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    background: white;
    padding: 4px;
    flex-shrink: 0;
    align-self: flex-start;
}

/* Container pour le contenu à droite du logo */
.watchlist-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

/* Header row: Symbol + Delete button (horizontal) */
.watchlist-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.watchlist-symbol {
    font-size: 1.05rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.3px;
    line-height: 1.2;
    flex: 1;
    min-width: 0;
}

.watchlist-remove {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.2);
    color: #dc3545;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.watchlist-remove:hover {
    background: rgba(220, 53, 69, 0.2);
    transform: scale(1.15) rotate(10deg);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* Stock name */
.watchlist-card .stock-name,
.watchlist-card small {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
    margin: 0;
}

/* Price + Change */
.watchlist-price-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.watchlist-price {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.watchlist-change {
    font-size: 0.82rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-block;
    width: fit-content;
}

.watchlist-change.positive {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.watchlist-change.negative {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
}

.watchlist-loading {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
}

.watchlist-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.watchlist-empty i {
    font-size: 4rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0.3;
    margin-bottom: 20px;
    display: block;
}

.watchlist-empty p {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.watchlist-empty small {
    opacity: 0.7;
}

body.dark-mode .watchlist-card {
    background: rgba(30, 41, 59, 0.95);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

body.dark-mode .watchlist-card:hover {
    background: rgba(30, 41, 59, 1);
    box-shadow: 0 16px 40px rgba(102, 126, 234, 0.3);
}

body.dark-mode .watchlist-card img,
body.dark-mode .watchlist-card .company-logo {
    background: rgba(15, 23, 42, 0.8);
}

/* ════════════════════════════════════════════════════════════════
   SEARCH INPUT & DROPDOWN (CONTOURS DISCRETS)
   ════════════════════════════════════════════════════════════════ */

.watchlist-search {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
}

#watchlistSearchInput {
    flex: 1;
    width: 100%;
    padding: 14px 16px;
    border: 2px solid rgba(102, 126, 234, 0.25);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.98);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.08);
}

#watchlistSearchInput:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.12), 0 4px 16px rgba(102, 126, 234, 0.15);
}

#watchlistSearchInput::placeholder {
    color: var(--text-tertiary);
}

body.dark-mode #watchlistSearchInput {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(102, 126, 234, 0.3);
}

body.dark-mode #watchlistSearchInput:focus {
    border-color: rgba(102, 126, 234, 0.6);
}

.btn-add-watchlist {
    padding: 14px 24px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    white-space: nowrap;
}

.btn-add-watchlist:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.6);
}

.btn-add-watchlist:active {
    transform: translateY(0);
}

/* ════════════════════════════════════════════════════════════════
   SEARCH SUGGESTIONS DROPDOWN (CONTOURS DISCRETS)
   ════════════════════════════════════════════════════════════════ */

.search-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    border: 2px solid rgba(102, 126, 234, 0.25);
    border-radius: 12px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(102, 126, 234, 0.1);
    z-index: 1000;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.search-suggestions.active {
    max-height: 400px;
    overflow-y: auto;
    opacity: 1;
}

.search-suggestions::-webkit-scrollbar {
    width: 8px;
}

.search-suggestions::-webkit-scrollbar-track {
    background: rgba(100, 116, 139, 0.1);
    border-radius: 4px;
}

.search-suggestions::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 4px;
}

.search-suggestions::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
}

.suggestion-category {
    padding: 12px 16px;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(102, 126, 234, 0.08);
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px solid rgba(102, 126, 234, 0.1);
}

.suggestion-category:first-child {
    border-top: none;
}

.suggestion-category i {
    color: #667eea;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(100, 116, 139, 0.1);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.selected {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.05));
    padding-left: 20px;
}

.suggestion-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.suggestion-icon.tech {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.suggestion-icon.etf {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.suggestion-icon.crypto {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.suggestion-icon.finance {
    background: linear-gradient(135deg, #10b981, #059669);
}

.suggestion-icon.industrial {
    background: linear-gradient(135deg, #64748b, #475569);
}

.suggestion-info {
    flex: 1;
    min-width: 0;
}

.suggestion-symbol {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.suggestion-match {
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 900;
}

.suggestion-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.suggestion-exchange {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-tertiary);
    background: rgba(102, 126, 234, 0.1);
    padding: 2px 8px;
    border-radius: 6px;
}

.suggestion-loading,
.no-results {
    padding: 32px 20px;
    text-align: center;
}

.suggestion-loading i {
    font-size: 2rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    display: block;
}

.no-results i {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 12px;
    display: block;
}

.no-results p {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.no-results p:last-child {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

body.dark-mode .search-suggestions {
    background: rgba(15, 23, 42, 0.98);
    border-color: rgba(102, 126, 234, 0.3);
}

/* ════════════════════════════════════════════════════════════════
   MODALS (CREATE & MANAGE PORTFOLIOS) - FOND BLANC OPAQUE
   ════════════════════════════════════════════════════════════════ */

.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(10px);
    overflow-y: auto;
    padding: 2rem;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #ffffff;
    border-radius: 20px;
    max-width: 540px;
    width: 100%;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideUp 0.4s ease;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.modal-content::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.modal-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 24px 28px;
    border-radius: 20px 20px 0 0;
    position: relative;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 900;
    color: white !important;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-header h2 i {
    font-size: 1.4rem;
    color: white;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.15) rotate(90deg);
}

.modal-body {
    padding: 32px 28px;
    background: #ffffff;
}

.modal-small .modal-content {
    max-width: 480px;
}

body.dark-mode .modal-content {
    background: #1e293b;
}

body.dark-mode .modal-body {
    background: #1e293b;
}

/* ════════════════════════════════════════════════════════════════
   FORM INPUTS
   ════════════════════════════════════════════════════════════════ */

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid rgba(102, 126, 234, 0.25);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.98);
    color: var(--text-primary);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.08);
}

.form-input:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.12);
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

body.dark-mode .form-input {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(102, 126, 234, 0.3);
}

body.dark-mode .form-input:focus {
    border-color: rgba(102, 126, 234, 0.6);
}

/* ════════════════════════════════════════════════════════════════
   MODAL BUTTONS (DELETE BUTTON 100% FORMATTÉ)
   ════════════════════════════════════════════════════════════════ */

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 28px;
}

.btn-cancel {
    padding: 14px 28px;
    background: transparent;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: #ef4444;
}

.btn-confirm,
.btn-primary {
    padding: 14px 28px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-confirm:hover,
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 36px rgba(102, 126, 234, 0.6);
}

.btn-confirm:active,
.btn-primary:active {
    transform: translateY(0);
}

.btn-confirm:disabled,
.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ════════════════════════════════════════════════════════════════
   MANAGE PORTFOLIOS LIST
   ════════════════════════════════════════════════════════════════ */

.portfolios-manage-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.portfolio-manage-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(102, 126, 234, 0.05);
    border: 2px solid rgba(102, 126, 234, 0.1);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.portfolio-manage-item:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.25);
    transform: translateX(4px);
}

.portfolio-manage-item .portfolio-name {
    font-weight: 800;
    font-size: 1.1rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 10px;
}

.portfolio-manage-item .portfolio-name i {
    font-size: 1.2rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.portfolio-manage-actions {
    display: flex;
    gap: 10px;
}

.btn-rename,
.btn-delete {
    padding: 10px 18px;
    border-radius: 10px;
    border: none;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 100px;
}

.btn-rename {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-rename:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.5);
}

.btn-rename:active {
    transform: translateY(0);
}

.btn-delete {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-delete:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(239, 68, 68, 0.5);
}

.btn-delete:active {
    transform: translateY(0);
}

.btn-delete i {
    color: white !important;
}

.portfolios-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.portfolios-empty i {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 16px;
    display: block;
}

.portfolios-empty p {
    font-weight: 600;
}

body.dark-mode .portfolio-manage-item {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(102, 126, 234, 0.2);
}

/* ════════════════════════════════════════════════════════════════
   FILTER BUTTONS
   ════════════════════════════════════════════════════════════════ */

.watchlist-filters {
    display: flex;
    gap: 8px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    padding: 6px;
    border-radius: 12px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    background-clip: padding-box;
    position: relative;
}

.filter-btn {
    padding: 10px 18px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.filter-btn:hover {
    color: var(--text-primary);
    background: rgba(102, 126, 234, 0.1);
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.filter-btn.active i {
    color: white !important;
}

body.dark-mode .watchlist-filters {
    background: rgba(15, 23, 42, 0.6);
}

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE MOBILE (PORTFOLIO SECTION CORRIGÉE)
   ════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .watchlist-container {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 14px;
    }
    
    .watchlist-card {
        padding: 14px;
        min-height: 85px;
        gap: 8px 12px;
    }
    
    .watchlist-card img,
    .watchlist-card .company-logo {
        width: 48px;
        height: 48px;
    }
    
    .watchlist-symbol {
        font-size: 0.98rem;
    }
    
    .watchlist-search {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-add-watchlist {
        width: 100%;
        justify-content: center;
    }
    
    .search-suggestions.active {
        max-height: 300px;
    }
    
    .modal {
        padding: 1rem;
    }
    
    .modal-content {
        max-width: 100%;
    }
    
    .modal-header {
        padding: 20px 20px;
    }
    
    .modal-header h2 {
        font-size: 1.3rem;
    }
    
    .modal-body {
        padding: 24px 20px;
    }
    
    .modal-actions {
        flex-direction: column-reverse;
        gap: 10px;
    }
    
    .btn-cancel,
    .btn-confirm,
    .btn-primary {
        width: 100%;
        justify-content: center;
    }
    
    .portfolio-manage-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        padding: 16px;
    }
    
    .portfolio-manage-actions {
        width: 100%;
        justify-content: stretch;
        flex-wrap: wrap;
    }
    
    .btn-rename,
    .btn-delete {
        flex: 1;
        justify-content: center;
        min-width: 120px;
        padding: 12px 16px;
    }
}

@media (max-width: 480px) {
    .watchlist-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .watchlist-card {
        padding: 12px;
        min-height: 80px;
    }
    
    .watchlist-symbol {
        font-size: 0.95rem;
    }
    
    .watchlist-price {
        font-size: 1.05rem;
    }
    
    .watchlist-change {
        font-size: 0.78rem;
    }
    
    .search-suggestions.active {
        max-height: 250px;
    }
    
    .suggestion-item {
        padding: 10px 14px;
    }
    
    .suggestion-icon {
        width: 36px;
        height: 36px;
        font-size: 0.7rem;
    }
    
    .suggestion-symbol {
        font-size: 0.9rem;
    }
    
    .suggestion-name {
        font-size: 0.8rem;
    }
    
    .portfolio-manage-item {
        padding: 14px;
    }
    
    .portfolio-manage-item .portfolio-name {
        font-size: 1rem;
    }
    
    .btn-rename,
    .btn-delete {
        font-size: 0.9rem;
        padding: 10px 14px;
        min-width: 100px;
    }
}

/* ════════════════════════════════════════════════════════════════
   ANIMATIONS
   ════════════════════════════════════════════════════════════════ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.watchlist-card {
    animation: fadeInUp 0.4s ease-out backwards;
}

.watchlist-card:nth-child(1) { animation-delay: 0.05s; }
.watchlist-card:nth-child(2) { animation-delay: 0.1s; }
.watchlist-card:nth-child(3) { animation-delay: 0.15s; }
.watchlist-card:nth-child(4) { animation-delay: 0.2s; }
.watchlist-card:nth-child(5) { animation-delay: 0.25s; }
.watchlist-card:nth-child(6) { animation-delay: 0.3s; }
.watchlist-card:nth-child(7) { animation-delay: 0.35s; }
.watchlist-card:nth-child(8) { animation-delay: 0.4s; }