/* =====================================================
   Stock Momentum — style.css
   ===================================================== */

/* ── Couleurs signal ── */
.red-text    { color: #c0392b; font-weight: bold; }
.orange-text { color: #e67e22; font-weight: bold; }
.green-text  { color: #27ae60; font-weight: bold; }

/* ── Conteneur principal ── */
#sm-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    font-family: "Roboto", sans-serif;
    font-size: 15px;
}

/* ── Sélecteur d'indice ── */
#sm-index-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sm-index-btn {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 7px 14px;
    font-size: 14px;
    font-family: "Roboto", sans-serif;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.sm-index-btn:hover {
    background: #f0f4f8;
    border-color: #005792;
}

.sm-index-btn.is-active {
    background: #005792;
    border-color: #005792;
    color: #fff;
}

/* ── Zone statut ── */
#sm-status {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 24px;
    color: #555;
    font-size: 14px;
}

#sm-last-update {
    color: #555;
    font-size: 14px;
}

/* ── Sélection des colonnes (style identique à selection-actions) ── */
#sm-column-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    background: #f2f3f4;
    padding: 15px;
    border-radius: 8px;
    width: 100%;
}

#sm-column-selection label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-family: "Roboto", sans-serif;
    cursor: pointer;
    user-select: none;
}

/* Blocage publicitaire strict dans la sélection des colonnes */
#sm-column-selection > :not(label),
#sm-column-selection ins,
#sm-column-selection iframe,
#sm-column-selection .google-auto-placed,
#sm-column-selection .adsbygoogle {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    max-height: 0 !important;
    width: 0 !important;
    max-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    pointer-events: none !important;
    position: absolute !important;
    overflow: hidden !important;
}

@media (max-width: 768px) {
    #sm-column-selection {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── Spinner ── */
.sm-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-top-color: #005792;
    border-radius: 50%;
    animation: sm-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 4px;
}
@keyframes sm-spin { to { transform: rotate(360deg); } }

/* ── Scroll horizontal ── */
.table-scroll-wrapper {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 8px;
}

/* ── Tableau ── */
#sm-table {
    width: auto;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    font-family: "Roboto", sans-serif;
}

#sm-table thead {
    background-color: #005792;
    color: #fff;
}

#sm-table th,
#sm-table td {
    text-align: center;
    vertical-align: middle;
    padding: 10px 14px;
    border: 1px solid #ddd;
    white-space: nowrap;
}

#sm-table th {
    font-weight: bold;
}

#sm-table code {
    background-color: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 13px;
    color: #333;
}

#sm-table th.sortable {
    cursor: pointer;
    user-select: none;
}

#sm-table th.sortable:hover {
    background-color: #004070;
}

#sm-table th.active {
    background-color: #003a63;
}

/* Lignes alternées */
#sm-table tbody tr:nth-child(even) {
    background-color: #f7f9fc;
}
#sm-table tbody tr:hover {
    background-color: #eaf1f8;
}

/* Badge signal */
.sm-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: bold;
    color: #fff;
}
.sm-badge.achat  { background: #27ae60; }
.sm-badge.neutre { background: #95a5a6; }
.sm-badge.vente  { background: #c0392b; }

/* ── Responsive ── */
@media (max-width: 768px) {
    #sm-index-selector { gap: 6px; }
    .sm-index-btn { font-size: 13px; padding: 6px 10px; }
    #sm-table th, #sm-table td { padding: 8px 10px; }
}
