/* ---------- Watchlist controls ---------- */

.watchlist-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
}

/* Shared button styling */
#save_watchlist,
#in_watchlist,
#update_analysis,
#remove_watchlist {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

#save_watchlist,
#in_watchlist,
#update_analysis {
    padding: var(--space-2) var(--space-3);
}

/* Add to watchlist */
#save_watchlist {
    background: transparent;
    color: var(--gold);
    border-color: var(--gold-line);
    cursor: pointer;
}

#save_watchlist:disabled {
    opacity: 0.6;
    cursor: progress;
}

#save_watchlist:hover:not(:disabled) {
    background: var(--surface);
    border-color: var(--gold);
    color: var(--gold-hover);
}

#save_watchlist:active {
    background: var(--border);
}

/* Saved-state actions: status pill + primary action on one row,
   with the last-saved time underneath, right-aligned */
#watchlist-actions {
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    column-gap: var(--space-3);
    row-gap: var(--space-2);
    width: max-content;
}

.watchlist-status-controls {
    display: flex;
}

/* "In watchlist" is a status, not an action: no button chrome */
#in_watchlist {
    background: var(--gold-soft);
    border-color: transparent;
    color: var(--gold);
    cursor: default;
}

#in_watchlist:disabled {
    opacity: 1;
}

/* The save button joins the grid; its timestamp sits on the second row */
.save-analysis-control {
    display: contents;
}

#update_analysis {
    grid-column: 2;
    grid-row: 1;
}

#analysis-last-saved {
    grid-column: 1 / -1;
    grid-row: 2;
}

/* Primary action: filled gold */
#update_analysis {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--gold-ink);
    font-weight: 600;
    cursor: pointer;
}

#update_analysis:hover:not(:disabled) {
    background: var(--gold-hover);
    border-color: var(--gold-hover);
}

#update_analysis:active:not(:disabled) {
    background: var(--gold);
}

#analysis-last-saved {
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.75rem;
    line-height: 1.4;
    text-align: right;
    white-space: nowrap;
}




/* Keep Lucide icons consistent */
.watchlist-controls svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
