/* AI Trade Signals - Public Widget CSS */

.ats-widget {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 820px;
    margin: 0 auto;
    color: #1a1a1a;
    line-height: 1.5;
}

/* TABS */
.ats-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 1.5rem;
    gap: 2px;
}
.ats-tab {
    padding: 10px 18px;
    border: none;
    background: transparent;
    font-size: 14px;
    cursor: pointer;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}
.ats-tab:hover { color: #111; }
.ats-tab.active { color: #111; border-bottom-color: #111; font-weight: 500; }

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

/* ANALYZER */
.ats-analyzer-header { margin-bottom: 1.5rem; }
.ats-title { font-size: 22px; font-weight: 600; margin: 0 0 4px; }
.ats-subtitle { font-size: 14px; color: #666; margin: 0; }

.ats-input-section { margin-bottom: 1.5rem; }
.ats-row { display: flex; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.ats-input {
    flex: 1; min-width: 160px;
    padding: 9px 13px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    color: #111;
    transition: border-color 0.2s;
}
.ats-input:focus { outline: none; border-color: #555; }
.ats-input-sm {
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    color: #111;
}
.ats-input-sm:focus { outline: none; border-color: #555; }

.ats-mode-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}
.ats-mode-btn {
    padding: 7px 14px;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    background: transparent;
    font-size: 13px;
    cursor: pointer;
    color: #555;
    transition: all 0.2s;
}
.ats-mode-btn.active {
    background: #111;
    color: #fff;
    border-color: #111;
}
.ats-mode-btn:hover:not(.active) { background: #f5f5f5; }

.ats-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 13px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    min-height: 90px;
    resize: vertical;
    color: #111;
    margin-bottom: 10px;
}
.ats-textarea:focus { outline: none; border-color: #555; }

.ats-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-bottom: 12px;
}
.ats-chips-label { font-size: 12px; color: #888; }
.ats-chip {
    padding: 4px 10px;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    background: transparent;
    font-size: 12px;
    cursor: pointer;
    color: #555;
    transition: all 0.15s;
}
.ats-chip:hover { background: #f0f0f0; color: #111; }

.ats-analyze-btn {
    width: 100%;
    padding: 11px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: #111;
}
.ats-analyze-btn:hover { background: #f5f5f5; }
.ats-analyze-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* SIGNAL RESULT CARD */
.ats-result-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
    animation: ats-fadein 0.3s ease;
}
@keyframes ats-fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.ats-signal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    flex-wrap: wrap;
}
.ats-badge {
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.ats-badge-buy { background: #d4edda; color: #155724; }
.ats-badge-sell { background: #f8d7da; color: #721c24; }
.ats-badge-hold { background: #fff3cd; color: #856404; }

.ats-stock-label { font-size: 17px; font-weight: 600; color: #111; }
.ats-stock-sub { font-size: 13px; color: #888; }
.ats-confidence { font-size: 13px; color: #666; margin-left: auto; }

.ats-result-body { padding: 1.25rem; }
.ats-summary { font-size: 14px; color: #444; margin-bottom: 1.25rem; }

.ats-meter { margin-bottom: 1.25rem; }
.ats-meter-labels { display: flex; justify-content: space-between; font-size: 12px; color: #888; margin-bottom: 5px; }
.ats-meter-track { height: 7px; background: #f0f0f0; border-radius: 4px; overflow: hidden; }
.ats-meter-fill { height: 100%; border-radius: 4px; transition: width 0.6s ease; }
.fill-green { background: #3B6D11; }
.fill-red { background: #E24B4A; }
.fill-amber { background: #BA7517; }

.ats-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.25rem; }
.ats-points-section h4 { font-size: 13px; font-weight: 600; margin: 0 0 8px; color: #333; }
.ats-point { display: flex; gap: 8px; font-size: 13px; color: #555; margin-bottom: 6px; align-items: flex-start; }
.ats-dot { width: 6px; height: 6px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.dot-green { background: #3B6D11; }
.dot-red { background: #E24B4A; }

.ats-meta-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 1rem; }
.ats-meta-pill {
    background: #f7f7f7;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    flex: 1;
    min-width: 120px;
}
.ats-meta-label { color: #888; font-size: 11px; margin-bottom: 2px; }
.ats-meta-value { font-weight: 500; color: #111; }

.ats-action-row { display: flex; gap: 8px; padding-top: 0.5rem; flex-wrap: wrap; }
.ats-sm-btn {
    padding: 7px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: transparent;
    font-size: 13px;
    cursor: pointer;
    color: #555;
    transition: all 0.15s;
    white-space: nowrap;
}
.ats-sm-btn:hover { background: #f5f5f5; }
.ats-primary-btn { background: #111; color: #fff; border-color: #111; }
.ats-primary-btn:hover { background: #333; }

.ats-disclaimer {
    font-size: 11px;
    color: #aaa;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid #e5e7eb;
}

/* NEWS ITEMS */
.ats-news-list { margin-top: 0.5rem; }
.ats-news-item {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}
.ats-news-item:last-child { border-bottom: none; }
.ats-news-item a { color: #2563eb; text-decoration: none; }
.ats-news-item a:hover { text-decoration: underline; }
.ats-news-source { font-size: 11px; color: #888; margin-top: 2px; }

/* WATCHLIST */
.ats-watchlist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.ats-wl-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    position: relative;
}
.ats-wl-symbol { font-size: 16px; font-weight: 600; color: #111; }
.ats-wl-name { font-size: 12px; color: #888; margin-bottom: 8px; }
.ats-wl-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.ats-remove-btn { font-size: 11px; color: #999; background: none; border: none; cursor: pointer; padding: 2px 0; }
.ats-remove-btn:hover { color: #e24b4a; }

/* HISTORY */
.ats-history-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ats-history-table th { text-align: left; padding: 8px 10px; border-bottom: 2px solid #e5e7eb; color: #555; font-weight: 600; font-size: 12px; white-space: nowrap; }
.ats-history-table td { padding: 9px 10px; border-bottom: 1px solid #f0f0f0; vertical-align: top; }
.ats-history-table tr:hover td { background: #fafafa; }
.ats-table-wrap { overflow-x: auto; }

/* ALERTS */
.ats-alert-form { background: #fafafa; border-radius: 8px; padding: 1rem; margin-bottom: 1rem; }
.ats-alert-form .ats-row { margin-bottom: 8px; }
.ats-alert-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #e5e7eb; border-radius: 8px; margin-bottom: 8px; font-size: 13px; }

/* GENERAL */
.ats-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; gap: 8px; }
.ats-section-header h3, .ats-section-header h4 { margin: 0; font-size: 16px; }
.ats-filter-row { display: flex; gap: 8px; }
.ats-empty { color: #aaa; font-size: 14px; padding: 1.5rem 0; text-align: center; }
.ats-loading { color: #888; font-size: 14px; padding: 1rem 0; }
.ats-desc { font-size: 13px; color: #666; margin-top: 0; }
.ats-msg-success { background: #d4edda; color: #155724; padding: 8px 12px; border-radius: 6px; font-size: 13px; margin: 8px 0; }
.ats-msg-error { background: #f8d7da; color: #721c24; padding: 8px 12px; border-radius: 6px; font-size: 13px; margin: 8px 0; }

@media (max-width: 580px) {
    .ats-two-col { grid-template-columns: 1fr; }
    .ats-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .ats-tab { padding: 8px 12px; font-size: 13px; }
    .ats-meta-row { flex-direction: column; }
}
