/**
 * ════════════════════════════════════════════════════════════════
 * ALPHAVAULT AI - ADVANCED TECHNICAL ANALYSIS STYLES
 * Design Premium: Gradients violets + Glassmorphism + Responsive
 * 100% PC & Mobile Compatible
 * ════════════════════════════════════════════════════════════════
 */

/* ════════════════════════════════════════════════════════════════
   1. UTILITY CLASSES & GRADIENT STYLES
   ════════════════════════════════════════════════════════════════ */

.gradient-title {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}

.gradient-border {
    position: relative;
    border: 2px solid transparent;
    background: var(--glass-bg);
    background-clip: padding-box;
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    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;
    z-index: -1;
}

/* ════════════════════════════════════════════════════════════════
   TITRE DE PAGE EN BLEU VIOLET DÉGRADÉ
   ════════════════════════════════════════════════════════════════ */

.page-header h1,
.main-title,
h1.page-title {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 900;
}

/* ════════════════════════════════════════════════════════════════
   2. MODAL STYLES (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;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #ffffff;
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    position: relative;
    border: 2px solid transparent;
    background-clip: padding-box;
}

/* Bordure dégradée pour modals */
.modal-content::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    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;
    z-index: -1;
}

body.dark-mode .modal-content {
    background: #1e293b;
    color: #e2e8f0;
}

.modal-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 1.5rem 2rem;
    border-radius: 16px 16px 0 0;
    position: relative;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    color: white !important;
    -webkit-text-fill-color: white !important;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-header h2 i {
    color: white !important;
}

.close-modal {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    line-height: 1;
    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);
}

.modal-body {
    padding: 2rem;
    position: relative;
    z-index: 1;
    background: #ffffff;
}

.modal-body h3 {
    font-size: 1.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 1.5rem 0 1rem 0;
}

.modal-body h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #334155;
    margin: 1.25rem 0 0.75rem 0;
}

body.dark-mode .modal-body {
    background: #1e293b;
}

body.dark-mode .modal-body h4 {
    color: #cbd5e1;
}

.modal-body ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.modal-body li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
    color: #475569;
}

body.dark-mode .modal-body li {
    color: #94a3b8;
}

.modal-body p {
    line-height: 1.6;
    color: #475569;
    margin-bottom: 1rem;
}

body.dark-mode .modal-body p {
    color: #94a3b8;
}

.modal-small .modal-content {
    max-width: 500px;
}

.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f5f9;
}

body.dark-mode .modal-content::-webkit-scrollbar-track {
    background: #1e293b;
}

.modal-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
}

/* ════════════════════════════════════════════════════════════════
   3. HELP ICON & INFO BOXES
   ════════════════════════════════════════════════════════════════ */

.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white !important;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 0.5rem;
    border: none;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.help-icon::before {
    content: '?';
}

.help-icon:hover {
    transform: scale(1.15) rotate(15deg);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.6);
}

.formula-box {
    background: rgba(102, 126, 234, 0.05);
    border-left: 4px solid #667eea;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

body.dark-mode .formula-box {
    background: rgba(102, 126, 234, 0.1);
    color: #e2e8f0;
}

.formula-box strong {
    color: #667eea;
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 800;
}

.key-term {
    color: #667eea;
    font-weight: 700;
}

.tip-box {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.05));
    border-left: 4px solid #10b981;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 8px;
    font-size: 0.9rem;
}

body.dark-mode .tip-box {
    background: rgba(16, 185, 129, 0.15);
}

.warning-box {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(217, 119, 6, 0.05));
    border-left: 4px solid #f59e0b;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 8px;
    font-size: 0.9rem;
}

body.dark-mode .warning-box {
    background: rgba(245, 158, 11, 0.15);
}

/* ════════════════════════════════════════════════════════════════
   4. PORTFOLIO MANAGEMENT SECTION (CORRIGÉE MOBILE)
   ════════════════════════════════════════════════════════════════ */

.portfolio-management-section {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid rgba(102, 126, 234, 0.2);
    background-clip: padding-box;
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 28px;
    position: relative;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.12);
}

.portfolio-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.portfolio-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 280px;
}

.portfolio-selector label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.portfolio-selector i {
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.portfolio-dropdown {
    flex: 1;
    padding: 0.75rem 1rem;
    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;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.08);
}

.portfolio-dropdown:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.4);
}

.portfolio-dropdown:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

body.dark-mode .portfolio-dropdown {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(102, 126, 234, 0.3);
}

.portfolio-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-portfolio-action {
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    white-space: nowrap;
}

.btn-portfolio-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.6);
}

.btn-portfolio-action:active {
    transform: translateY(0);
}

/* ════════════════════════════════════════════════════════════════
   5. WATCHLIST SECTION (CONTOURS DISCRETS)
   ════════════════════════════════════════════════════════════════ */

.watchlist-section {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid rgba(102, 126, 234, 0.2);
    background-clip: padding-box;
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 28px;
    position: relative;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.12);
}

.watchlist-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.watchlist-search {
    display: flex;
    gap: 12px;
    flex: 1;
    min-width: 300px;
}

#watchlistSearchInput {
    flex: 1;
    padding: 0.75rem 1rem;
    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.15);
}

body.dark-mode #watchlistSearchInput {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(102, 126, 234, 0.3);
}

.btn-add-watchlist {
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-add-watchlist:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.6);
}

.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;
}

.watchlist-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.watchlist-card {
    background: var(--card-background);
    border-radius: 16px;
    padding: 20px;
    border: 2px solid transparent;
    background-clip: padding-box;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.watchlist-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    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;
}

.watchlist-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 36px rgba(102, 126, 234, 0.25);
}

.watchlist-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.watchlist-symbol {
    font-size: 1.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.watchlist-remove {
    background: transparent;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.watchlist-remove:hover {
    background: rgba(220, 53, 69, 0.1);
    transform: scale(1.1);
}

.watchlist-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.watchlist-change {
    font-size: 1rem;
    font-weight: 700;
}

.watchlist-change.positive {
    color: #10b981;
}

.watchlist-change.negative {
    color: #dc3545;
}

.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;
}

/* ════════════════════════════════════════════════════════════════
   6. SEARCH PANEL (CONTOURS DISCRETS)
   ════════════════════════════════════════════════════════════════ */

.search-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid rgba(102, 126, 234, 0.2);
    background-clip: padding-box;
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 28px;
    position: relative;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.12);
}

.panel-title {
    font-size: 1.75rem;
    font-weight: 900;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.panel-title i {
    font-size: 1.6rem;
}

.search-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.search-input-wrapper {
    position: relative;
}

#symbolInput {
    width: 100%;
    padding: 16px 20px;
    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: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.08);
}

#symbolInput:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

body.dark-mode #symbolInput {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(102, 126, 234, 0.3);
}

.btn-analyze {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    padding: 12px 24px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #667eea, #764ba2);
    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(102, 126, 234, 0.4);
}

.btn-analyze:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.6);
}

.popular-stocks {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.quick-label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.symbol-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid rgba(102, 126, 234, 0.2);
    background-clip: padding-box;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.symbol-chip:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
    border-color: rgba(102, 126, 234, 0.4);
}

.symbol-chip i {
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.prediction-settings {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.setting-group {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.setting-group label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.horizon-btn {
    padding: 10px 20px;
    background: transparent;
    border: 2px solid rgba(102, 126, 234, 0.25);
    background-clip: padding-box;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.horizon-btn:hover {
    color: var(--text-primary);
    transform: translateY(-2px);
    border-color: rgba(102, 126, 234, 0.4);
}

.horizon-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Export Buttons */
.export-buttons-container {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.export-btn {
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.export-csv {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.export-csv:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
}

.export-pdf {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.export-pdf:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.4);
}

/* ════════════════════════════════════════════════════════════════
   7. LOADING & STOCK HEADER
   ════════════════════════════════════════════════════════════════ */

.loading-indicator {
    text-align: center;
    padding: 60px 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid rgba(102, 126, 234, 0.2);
    background-clip: padding-box;
    border-radius: 20px;
    margin-bottom: 28px;
    position: relative;
}

.loading-indicator.hidden {
    display: none;
}

.loading-indicator i {
    font-size: 3rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
}

.loading-indicator span {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stock-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 32px;
    border-radius: 20px;
    margin-bottom: 28px;
    box-shadow: 0 12px 36px rgba(102, 126, 234, 0.4);
}

.stock-header.hidden {
    display: none;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.stock-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

#stockSymbol {
    font-size: 2.5rem;
    font-weight: 900;
    color: white !important;
    margin: 0;
}

.stock-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.stock-price {
    text-align: right;
}

.price {
    font-size: 2rem;
    font-weight: 900;
    color: white !important;
    margin-bottom: 8px;
}

.change {
    font-size: 1.1rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
}

/* ════════════════════════════════════════════════════════════════
   8. RESULTS PANEL & SIGNALS
   ════════════════════════════════════════════════════════════════ */

.results-panel {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.results-panel.hidden {
    display: none;
}

.signals-section {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid rgba(102, 126, 234, 0.2);
    background-clip: padding-box;
    border-radius: 20px;
    padding: 32px;
    position: relative;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.12);
}

.section-title {
    font-size: 1.75rem;
    font-weight: 900;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title i {
    font-size: 1.6rem;
}

.signal-gauge {
    background: rgba(102, 126, 234, 0.05);
    padding: 28px;
    border-radius: 16px;
    margin-bottom: 24px;
    border: 2px solid rgba(102, 126, 234, 0.1);
}

.gauge-header h4 {
    font-size: 1.3rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.gauge-container {
    max-width: 600px;
    margin: 0 auto;
}

.gauge-bar {
    height: 32px;
    background: rgba(100, 116, 139, 0.2);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 16px;
    position: relative;
}

.gauge-fill {
    height: 100%;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 16px;
    transition: width 0.6s ease, background 0.3s ease;
}

.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;
}

.signals-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* ════════════════════════════════════════════════════════════════
   9. AI RECOMMENDATION SECTION
   ════════════════════════════════════════════════════════════════ */

.ai-recommendation-section {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid rgba(102, 126, 234, 0.2);
    background-clip: padding-box;
    border-radius: 24px;
    padding: 40px;
    position: relative;
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.2);
}

.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 {
    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;
}

.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);
}

.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);
}

.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;
}

.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;
}

.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-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;
}

.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;
}

/* ════════════════════════════════════════════════════════════════
   10. OSCILLATORS & CHARTS
   ════════════════════════════════════════════════════════════════ */

.oscillators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.oscillator-card,
.chart-section {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid rgba(102, 126, 234, 0.2);
    background-clip: padding-box;
    border-radius: 20px;
    padding: 28px;
    position: relative;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.12);
}

.chart {
    min-height: 350px;
    margin-bottom: 16px;
}

.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);
}

/* ════════════════════════════════════════════════════════════════
   11. DARK MODE SUPPORT
   ════════════════════════════════════════════════════════════════ */

body.dark-mode .portfolio-management-section,
body.dark-mode .watchlist-section,
body.dark-mode .search-panel,
body.dark-mode .signals-section,
body.dark-mode .ai-recommendation-section,
body.dark-mode .oscillator-card,
body.dark-mode .chart-section,
body.dark-mode .loading-indicator {
    background: rgba(15, 23, 42, 0.9);
}

body.dark-mode .watchlist-card,
body.dark-mode .signal-gauge,
body.dark-mode .ai-stat-item,
body.dark-mode .ai-horizon-card,
body.dark-mode .signal-box {
    background: rgba(30, 41, 59, 0.6);
}

body.dark-mode .watchlist-filters {
    background: rgba(15, 23, 42, 0.6);
}

/* ════════════════════════════════════════════════════════════════
   12. RESPONSIVE DESIGN (PORTFOLIO SECTION 100% CORRIGÉE)
   ════════════════════════════════════════════════════════════════ */

@media (max-width: 1200px) {
    .oscillators-grid {
        grid-template-columns: 1fr;
    }
    
    .ai-score-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    /* Portfolio Toolbar Mobile */
    .portfolio-toolbar,
    .watchlist-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .portfolio-selector,
    .watchlist-search {
        width: 100%;
        min-width: unset;
        flex-direction: column;
        align-items: stretch;
    }
    
    .portfolio-selector label {
        margin-bottom: 8px;
    }
    
    .portfolio-dropdown {
        width: 100%;
        min-width: unset;
    }
    
    .portfolio-actions,
    .watchlist-filters {
        width: 100%;
        justify-content: center;
    }
    
    .btn-portfolio-action {
        flex: 1;
        justify-content: center;
    }
    
    /* Stock Header Mobile */
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .stock-price {
        text-align: left;
    }
    
    #stockSymbol {
        font-size: 2rem;
    }
    
    .price {
        font-size: 1.5rem;
    }
    
    /* AI Section Mobile */
    .ai-header {
        flex-direction: column;
        text-align: center;
    }
    
    .ai-quick-stats {
        grid-template-columns: 1fr;
    }
    
    .ai-horizons-grid {
        grid-template-columns: 1fr;
    }
    
    /* Modal Mobile */
    .modal-body {
        padding: 1.5rem;
    }
    
    /* Panels Mobile */
    .search-panel,
    .signals-section,
    .ai-recommendation-section,
    .oscillator-card,
    .portfolio-management-section,
    .watchlist-section {
        padding: 24px 18px;
    }
}

@media (max-width: 480px) {
    /* Titres Mobile */
    .panel-title,
    .section-title,
    .ai-title {
        font-size: 1.4rem;
    }
    
    /* Search Input Mobile */
    .btn-analyze {
        position: static;
        transform: none;
        width: 100%;
        margin-top: 12px;
        justify-content: center;
    }
    
    /* Popular Stocks Mobile */
    .popular-stocks {
        flex-direction: column;
        align-items: stretch;
    }
    
    .symbol-chip {
        width: 100%;
        justify-content: center;
    }
    
    /* AI Score Mobile */
    .ai-score-value {
        font-size: 2.5rem;
    }
    
    /* Watchlist Mobile */
    .watchlist-container {
        grid-template-columns: 1fr;
    }
    
    /* Portfolio Actions Mobile */
    .portfolio-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-portfolio-action {
        width: 100%;
    }
    
    /* Portfolio Management Section Mobile */
    .portfolio-management-section {
        padding: 20px 16px;
    }
    
    .portfolio-toolbar {
        gap: 16px;
    }
}

/* ════════════════════════════════════════════════════════════════
   13. ANIMATIONS
   ════════════════════════════════════════════════════════════════ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.oscillator-card,
.watchlist-card,
.ai-horizon-card {
    animation: fadeIn 0.5s ease-out backwards;
}

.oscillator-card:nth-child(1) { animation-delay: 0.05s; }
.oscillator-card:nth-child(2) { animation-delay: 0.1s; }
.oscillator-card:nth-child(3) { animation-delay: 0.15s; }

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.fa-spinner {
    animation: spin 1s linear infinite;
}