@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

.asset-trends-container { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 26px; font-family: 'Inter', sans-serif; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05); margin: 25px 0; }
.asset-trends-header h2 { font-size: 22px; font-weight: 700; color: #1a202c; margin-top: 0; margin-bottom: 6px; }
.asset-trends-header p { font-size: 14px; color: #4a5568; margin-bottom: 22px; }

/* Mode Switcher */
.mode-switcher { display: flex; gap: 10px; margin-bottom: 20px; border-bottom: 2px solid #edf2f7; padding-bottom: 15px; }
.mode-btn { background: #edf2f7; border: none; padding: 10px 20px; border-radius: 8px; font-weight: 600; color: #4a5568; cursor: pointer; transition: 0.2s; }
.mode-btn:hover { background: #e2e8f0; }
.mode-btn.active { background: #2b6cb0; color: #fff; }

/* Toolbars */
.asset-trends-toolbar { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 18px; gap: 15px; flex-wrap: wrap; background: #f8fafc; padding: 16px; border-radius: 10px; border: 1px solid #edf2f7; }
.asset-selector-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #4a5568; }
.asset-trends-select { padding: 9px 14px; border: 1px solid #cbd5e0; border-radius: 8px; width: 280px; max-width: 100%; font-size: 14px; background-color: #fff; color: #2d3748; }

.short-select { width: 180px; margin-right: 10px; }
.weight-input { width: 70px; padding: 8px; border: 1px solid #cbd5e0; border-radius: 6px; text-align: center; font-weight: bold; }
.portfolio-inputs { display: flex; flex-wrap: wrap; gap: 15px; align-items: center; }
.port-row { display: flex; align-items: center; background: #fff; padding: 8px; border-radius: 8px; border: 1px solid #cbd5e0; }

.period-selector-group { display: flex; gap: 6px; background: #edf2f7; padding: 5px; border-radius: 9px; }
.period-btn { border: none; background: transparent; padding: 6px 14px; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 600; color: #4a5568; transition: all 0.2s; }
.period-btn:hover { background: #e2e8f0; }
.period-btn.active { background: #fff; color: #2b6cb0; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

/* Sentiment Badge */
.sentiment-badge { background: #fff; border: 1px solid #e2e8f0; padding: 10px 16px; border-radius: 8px; font-size: 13px; min-width: 200px; box-shadow: inset 0 2px 4px rgba(0,0,0,0.02); }
.fg-bar-bg { width: 100%; height: 6px; background: #edf2f7; border-radius: 3px; margin-top: 6px; overflow: hidden; }
.fg-bar-fill { height: 100%; width: 50%; background: #d69e2e; transition: width 0.5s ease-in-out, background-color 0.5s; }

/* Alerts */
#alerts-container { margin-bottom: 15px; }
.alert-box { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 10px; border-left: 5px solid; }
.alert-success { background: #f0fff4; border-color: #38a169; color: #276749; }
.alert-danger { background: #fff5f5; border-color: #e53e3e; color: #9b2c2c; }
.alert-warning { background: #fffff0; border-color: #d69e2e; color: #975a16; }

/* Metrics */
.asset-trends-metrics { display: flex; justify-content: space-between; align-items: center; background: #f8fafc; padding: 14px 18px; border-radius: 10px; margin-bottom: 20px; border: 1px solid #edf2f7; flex-wrap: wrap; gap: 15px; }
.sma-toggles { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.mr-15 { margin-right: 18px; }

.toggle-switch { position: relative; display: inline-block; width: 36px; height: 20px; margin-right: 6px; vertical-align: middle; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #cbd5e0; transition: .3s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 14px; width: 14px; left: 3px; bottom: 3px; background-color: white; transition: .3s; border-radius: 50%; }
input:checked + .trend-slider { background-color: #dd6b20; }
input:checked + .sma50-slider { background-color: #38a169; }
input:checked + .sma200-slider { background-color: #e53e3e; }
input:checked + .slider:before { transform: translateX(16px); }
.toggle-label { font-size: 13px; font-weight: 600; color: #4a5568; vertical-align: middle; }

.export-btn { background: #3182ce; color: white; border: none; padding: 9px 18px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; transition: 0.2s; }
.export-btn:hover { background: #2b6cb0; }

.asset-trends-chart-wrapper { position: relative; height: 450px; width: 100%; border: 1px solid #edf2f7; border-radius: 10px; padding: 10px; }
.loader-overlay { position: absolute; inset: 0; background: rgba(255,255,255,0.85); display: flex; align-items: center; justify-content: center; font-weight: 600; color: #2b6cb0; z-index: 10; border-radius: 10px; }

@media (max-width: 992px) {
    .portfolio-inputs { flex-direction: column; align-items: stretch; }
    .port-row { justify-content: space-between; }
    .asset-trends-toolbar { flex-direction: column; align-items: stretch; }
    .asset-trends-select { width: 100%; }
    .asset-trends-metrics { flex-direction: column; align-items: stretch; }
}