/* ========================================
   ICÔNE FOOTER
   ======================================== */
.tradingbot-footer-icon {
    color: #64748b;
    text-decoration: none;
    font-size: 0.9em;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 4px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    line-height: 1;
    cursor: pointer;
}

.tradingbot-footer-icon:hover {
    color: #0ea5e9;
    background-color: rgba(14, 165, 233, 0.08);
    border-color: rgba(14, 165, 233, 0.2);
}

/* ========================================
   MODALE PRINCIPALE
   ======================================== */
.tradingbot-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tradingbot-modal {
    background: linear-gradient(to bottom, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    width: 95%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
    position: relative;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.tradingbot-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: #f1f5f9;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #64748b;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.tradingbot-close:hover {
    background-color: #e2e8f0;
    color: #0f172a;
}

.tradingbot-title {
    margin: 0 0 24px 0;
    font-size: 1.6em;
    font-weight: 700;
    color: #0f172a;
}

/* ========================================
   ONGLETS
   ======================================== */
.tradingbot-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 12px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 0.95em;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.tab-btn:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

.tab-btn.active {
    background-color: #0ea5e9;
    color: #fff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ========================================
   BARRE DE RECHERCHE
   ======================================== */
.tradingbot-search {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    align-items: center;
}

.tradingbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.2s;
}

.tradingbot-input:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.tradingbot-btn-analyze {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.tradingbot-btn-analyze:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
}

/* ========================================
   RÉSULTATS
   ======================================== */
.tradingbot-header-info {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
}

.tradingbot-header-info h3 {
    margin: 0 0 12px 0;
    font-size: 1.15em;
    color: #475569;
}

.tradingbot-price {
    font-size: 2.4em;
    font-weight: 800;
    color: #0f172a;
}

.tradingbot-currency {
    font-size: 0.95em;
    color: #64748b;
    margin-left: 6px;
}

.tradingbot-change {
    font-size: 1.2em;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 6px;
    display: inline-block;
}

.tradingbot-change.positive {
    color: #059669;
    background-color: rgba(5, 150, 105, 0.1);
}

.tradingbot-change.negative {
    color: #dc2626;
    background-color: rgba(220, 38, 38, 0.1);
}

.tradingbot-signal {
    text-align: center;
    padding: 20px;
    border-radius: 12px;
    font-size: 1.5em;
    font-weight: 800;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.confidence-score {
    font-size: 0.7em;
    opacity: 0.9;
}

/* ========================================
   INDICATEURS
   ======================================== */
.tradingbot-indicators {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.indicator-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    transition: all 0.2s;
}

.indicator-card:hover {
    border-color: #0ea5e9;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.1);
}

.indicator-label {
    display: block;
    font-size: 0.75em;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 6px;
}

.indicator-value {
    display: block;
    font-size: 1.3em;
    font-weight: 800;
    color: #0f172a;
}

.indicator-status {
    display: block;
    font-size: 0.75em;
    margin-top: 6px;
    font-weight: 700;
    text-transform: uppercase;
}

.rsi-surachete { color: #dc2626; }
.rsi-survendu { color: #059669; }
.rsi-neutre { color: #64748b; }

/* ========================================
   ACTUALITÉS
   ======================================== */
.news-section {
    margin: 24px 0;
}

.section-title {
    font-size: 1.1em;
    color: #0f172a;
    margin-bottom: 16px;
    font-weight: 700;
}

.news-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.news-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px;
    transition: all 0.2s;
}

.news-item:hover {
    border-color: #0ea5e9;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.1);
}

.news-item h4 {
    margin: 0 0 8px 0;
    font-size: 0.95em;
}

.news-item a {
    color: #0ea5e9;
    text-decoration: none;
}

.news-item a:hover {
    text-decoration: underline;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85em;
    color: #64748b;
}

/* ========================================
   ALERTES
   ======================================== */
.alert-quick-setup {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    margin: 24px 0;
}

.alert-quick-setup h4 {
    margin: 0 0 12px 0;
    color: #0f172a;
}

.alert-inputs {
    display: flex;
    gap: 10px;
}

.alert-inputs input {
    flex: 1;
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
}

.btn-small {
    padding: 10px 20px;
    background: #0ea5e9;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

/* ========================================
   WATCHLIST
   ======================================== */
.watchlist-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.watchlist-input {
    flex: 1;
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
}

.btn-primary {
    padding: 10px 20px;
    background: #0ea5e9;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.watchlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.watchlist-item {
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.watchlist-item:hover {
    border-color: #0ea5e9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
}

.watchlist-ticker {
    font-weight: 700;
    color: #0f172a;
}

.btn-remove-watchlist {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 12px;
}

/* ========================================
   ALERTES TABLE
   ======================================== */
.alerts-table, .history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.alerts-table th, .history-table th {
    background: #f1f5f9;
    padding: 12px;
    text-align: left;
    font-weight: 700;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
}

.alerts-table td, .history-table td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.btn-delete {
    background: #ef4444;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
}

/* ========================================
   HISTORIQUE STATS
   ======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}

.stat-card.buy { border-color: #10b981; }
.stat-card.sell { border-color: #ef4444; }
.stat-card.neutral { border-color: #f59e0b; }

.stat-value {
    display: block;
    font-size: 2em;
    font-weight: 800;
    color: #0f172a;
}

.stat-label {
    display: block;
    font-size: 0.85em;
    color: #64748b;
    margin-top: 4px;
}

.signal-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9em;
}

.signal-buy { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.signal-sell { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.signal-neutral { background: rgba(100, 116, 139, 0.1); color: #64748b; }

/* ========================================
   TOOLTIP
   ======================================== */
.tradingbot-info-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
}

.tradingbot-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background-color: #e2e8f0;
    color: #64748b;
    border-radius: 50%;
    font-size: 13px;
    font-weight: bold;
    cursor: help;
    font-family: Georgia, serif;
    font-style: italic;
}

.tradingbot-info-icon:hover {
    background-color: #0ea5e9;
    color: #fff;
}

.tradingbot-tooltip {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 18px;
    font-size: 0.85em;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    min-width: 280px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s;
    pointer-events: none;
}

.tradingbot-info-wrapper:hover .tradingbot-tooltip {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.tooltip-example {
    color: #64748b;
    font-style: italic;
}

/* ========================================
   ÉTATS
   ======================================== */
.tradingbot-loading {
    text-align: center;
    padding: 50px;
}

.tradingbot-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid #e2e8f0;
    border-top-color: #0ea5e9;
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.tradingbot-error {
    background: #fef2f2;
    border: 2px solid #fecaca;
    color: #dc2626;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.tradingbot-disclaimer {
    background: linear-gradient(to right, #fef3c7, #fde68a);
    border-left: 4px solid #f59e0b;
    padding: 14px;
    font-size: 0.85em;
    color: #92400e;
    border-radius: 6px;
    margin-top: 24px;
}

.no-data, .loading-news, .no-news, .error-news {
    text-align: center;
    color: #64748b;
    padding: 20px;
    font-style: italic;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .tradingbot-modal {
        padding: 20px;
        width: 98%;
    }
    
    .tradingbot-indicators {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tradingbot-price {
        font-size: 2em;
    }
    
    .alert-inputs {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .tradingbot-indicators {
        grid-template-columns: 1fr;
    }
    
    .tradingbot-tabs {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1;
        min-width: 100px;
    }
}