/* =====================================================================
   Investor Dashboard Pro — Public Stylesheet
   Bloomberg-inspired dark/light financial dashboard
   ===================================================================== */

/* ---- CSS Variables ---- */
.idp-theme-dark {
	--idp-bg:           #0a0e17;
	--idp-bg-panel:     #111827;
	--idp-bg-card:      #1a2235;
	--idp-bg-hover:     #1e2d45;
	--idp-border:       #1e3050;
	--idp-accent:       #f59e0b;
	--idp-accent-2:     #3b82f6;
	--idp-text:         #e2e8f0;
	--idp-text-muted:   #64748b;
	--idp-text-dim:     #94a3b8;
	--idp-green:        #10b981;
	--idp-green-bg:     rgba(16, 185, 129, 0.1);
	--idp-red:          #ef4444;
	--idp-red-bg:       rgba(239, 68, 68, 0.1);
	--idp-yellow:       #f59e0b;
	--idp-blue:         #3b82f6;
	--idp-chart-grid:   rgba(255,255,255,0.05);
	--idp-shadow:       0 4px 20px rgba(0,0,0,0.5);
	--idp-font:         'IBM Plex Mono', 'Courier New', monospace;
	--idp-font-sans:    'IBM Plex Sans', -apple-system, sans-serif;
	--idp-radius:       6px;
	--idp-ticker-bg:    #0d1526;
}

.idp-theme-light {
	--idp-bg:           #f1f5f9;
	--idp-bg-panel:     #ffffff;
	--idp-bg-card:      #f8fafc;
	--idp-bg-hover:     #e2e8f0;
	--idp-border:       #e2e8f0;
	--idp-accent:       #1d4ed8;
	--idp-accent-2:     #7c3aed;
	--idp-text:         #0f172a;
	--idp-text-muted:   #94a3b8;
	--idp-text-dim:     #475569;
	--idp-green:        #059669;
	--idp-green-bg:     rgba(5, 150, 105, 0.1);
	--idp-red:          #dc2626;
	--idp-red-bg:       rgba(220, 38, 38, 0.1);
	--idp-yellow:       #d97706;
	--idp-blue:         #1d4ed8;
	--idp-chart-grid:   rgba(0,0,0,0.06);
	--idp-shadow:       0 2px 12px rgba(0,0,0,0.08);
	--idp-font:         'IBM Plex Mono', 'Courier New', monospace;
	--idp-font-sans:    'IBM Plex Sans', -apple-system, sans-serif;
	--idp-radius:       6px;
	--idp-ticker-bg:    #1e3a5f;
}

/* ---- Google Fonts Import ---- */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@300;400;500;600&family=IBM+Plex+Sans:wght@300;400;500;600;700&display=swap');

/* ---- Base Wrap ---- */
.idp-wrap {
	background: var(--idp-bg);
	color: var(--idp-text);
	font-family: var(--idp-font-sans);
	font-size: 14px;
	line-height: 1.5;
	border-radius: var(--idp-radius);
	overflow: hidden;
	width: 100%;
	box-sizing: border-box;
}

.idp-wrap *, .idp-wrap *::before, .idp-wrap *::after {
	box-sizing: border-box;
}

/* ---- Notice ---- */
.idp-notice {
	padding: 16px 20px;
	border-radius: var(--idp-radius);
	margin-bottom: 16px;
	font-weight: 500;
}
.idp-notice-error {
	background: rgba(239,68,68,0.12);
	border: 1px solid rgba(239,68,68,0.4);
	color: #ef4444;
}

/* ---- Header Bar ---- */
.idp-header-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 20px;
	background: var(--idp-bg-panel);
	border-bottom: 2px solid var(--idp-accent);
}
.idp-header-left {
	display: flex;
	align-items: center;
	gap: 10px;
}
.idp-logo {
	font-size: 22px;
}
.idp-title {
	font-family: var(--idp-font);
	font-size: 16px;
	font-weight: 600;
	letter-spacing: 1px;
	color: var(--idp-accent);
	text-transform: uppercase;
}
.idp-header-right {
	display: flex;
	align-items: center;
	gap: 12px;
}
.idp-live-badge {
	background: var(--idp-green);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	padding: 2px 7px;
	border-radius: 3px;
	letter-spacing: 1px;
	animation: idp-pulse 2s infinite;
}
@keyframes idp-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.6; }
}
.idp-last-update {
	font-size: 11px;
	color: var(--idp-text-muted);
	font-family: var(--idp-font);
}
.idp-refresh-btn {
	background: transparent;
	border: 1px solid var(--idp-border);
	color: var(--idp-text-dim);
	width: 30px;
	height: 30px;
	border-radius: 4px;
	cursor: pointer;
	font-size: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s;
}
.idp-refresh-btn:hover {
	border-color: var(--idp-accent);
	color: var(--idp-accent);
}

/* ---- Search Bar ---- */
.idp-search-bar {
	display: flex;
	gap: 8px;
	padding: 12px 20px;
	background: var(--idp-bg-panel);
	border-bottom: 1px solid var(--idp-border);
}
.idp-symbol-search {
	flex: 1;
	background: var(--idp-bg-card);
	border: 1px solid var(--idp-border);
	color: var(--idp-text);
	padding: 8px 14px;
	border-radius: var(--idp-radius);
	font-family: var(--idp-font);
	font-size: 13px;
	outline: none;
	transition: border-color 0.2s;
}
.idp-symbol-search:focus {
	border-color: var(--idp-accent-2);
}
.idp-symbol-search::placeholder {
	color: var(--idp-text-muted);
}
.idp-search-btn {
	background: var(--idp-accent);
	color: #000;
	border: none;
	padding: 8px 18px;
	border-radius: var(--idp-radius);
	font-weight: 600;
	font-size: 13px;
	cursor: pointer;
	transition: opacity 0.2s;
}
.idp-search-btn:hover {
	opacity: 0.85;
}

/* ---- Ticker Tape ---- */
.idp-ticker-tape {
	background: var(--idp-ticker-bg);
	border-bottom: 1px solid var(--idp-border);
	overflow: hidden;
	padding: 8px 0;
	white-space: nowrap;
}
.idp-ticker-inner {
	display: inline-flex;
	gap: 32px;
	animation: idp-ticker 40s linear infinite;
	padding: 0 20px;
}
.idp-ticker-inner:hover {
	animation-play-state: paused;
}
@keyframes idp-ticker {
	0% { transform: translateX(0); }
	100% { transform: translateX(-50%); }
}
.idp-ticker-item {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: var(--idp-font);
	font-size: 12px;
	white-space: nowrap;
}
.idp-ticker-sym {
	color: var(--idp-accent);
	font-weight: 600;
}
.idp-ticker-price {
	color: var(--idp-text);
}
.idp-ticker-change.up { color: var(--idp-green); }
.idp-ticker-change.down { color: var(--idp-red); }
.idp-loading-text {
	color: var(--idp-text-muted);
	font-family: var(--idp-font);
	font-size: 12px;
	padding: 0 20px;
}

/* ---- Dashboard Grid ---- */
.idp-dashboard-grid {
	display: grid;
	grid-template-columns: 260px 1fr 260px;
	grid-template-rows: auto auto;
	gap: 1px;
	background: var(--idp-border);
}

@media (max-width: 1100px) {
	.idp-dashboard-grid {
		grid-template-columns: 240px 1fr;
	}
	.idp-panel-detail { grid-column: 1 / -1; }
	.idp-panel-top20  { grid-column: 1 / -1; }
	.idp-panel-market { grid-column: 1 / -1; }
	.idp-panel-news   { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
	.idp-dashboard-grid {
		grid-template-columns: 1fr;
	}
	.idp-panel-quotes { grid-column: 1; }
	.idp-panel-chart  { grid-column: 1; }
}

/* ---- Panels ---- */
.idp-panel {
	background: var(--idp-bg-panel);
}
.idp-panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px;
	border-bottom: 1px solid var(--idp-border);
	flex-wrap: wrap;
	gap: 8px;
}
.idp-panel-header h3 {
	margin: 0;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: var(--idp-text-muted);
	font-family: var(--idp-font);
}

/* ---- Chart Controls ---- */
.idp-chart-controls {
	display: flex;
	gap: 4px;
}
.idp-chart-interval {
	background: transparent;
	border: 1px solid var(--idp-border);
	color: var(--idp-text-muted);
	padding: 3px 9px;
	border-radius: 3px;
	font-size: 11px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.15s;
}
.idp-chart-interval:hover {
	border-color: var(--idp-accent-2);
	color: var(--idp-accent-2);
}
.idp-chart-interval.active {
	background: var(--idp-accent-2);
	border-color: var(--idp-accent-2);
	color: #fff;
}

/* ---- Chart Wrap ---- */
.idp-chart-wrap {
	padding: 12px;
	position: relative;
}

/* ---- Quotes List ---- */
.idp-quotes-list {
	overflow-y: auto;
	max-height: 420px;
}
.idp-quote-row {
	display: flex;
	align-items: center;
	padding: 10px 16px;
	border-bottom: 1px solid var(--idp-border);
	cursor: pointer;
	transition: background 0.15s;
	gap: 8px;
}
.idp-quote-row:hover,
.idp-quote-row.active {
	background: var(--idp-bg-hover);
}
.idp-quote-row.active .idp-qr-sym {
	color: var(--idp-accent);
}
.idp-qr-sym {
	font-family: var(--idp-font);
	font-weight: 600;
	font-size: 13px;
	color: var(--idp-text);
	min-width: 55px;
}
.idp-qr-info {
	flex: 1;
	min-width: 0;
}
.idp-qr-name {
	font-size: 11px;
	color: var(--idp-text-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.idp-qr-price-wrap {
	text-align: right;
}
.idp-qr-price {
	font-family: var(--idp-font);
	font-weight: 600;
	font-size: 13px;
}
.idp-qr-change {
	font-size: 11px;
	font-family: var(--idp-font);
}
.idp-qr-spark {
	width: 40px;
	height: 28px;
}
.idp-up   { color: var(--idp-green); }
.idp-down { color: var(--idp-red); }
.idp-up-bg   { background: var(--idp-green-bg); }
.idp-down-bg { background: var(--idp-red-bg); }

/* ---- Stock Detail ---- */
.idp-detail-content {
	padding: 16px;
	overflow-y: auto;
	max-height: 420px;
}
.idp-placeholder-text {
	color: var(--idp-text-muted);
	text-align: center;
	padding: 40px 16px;
	font-size: 13px;
}
.idp-detail-header {
	margin-bottom: 16px;
}
.idp-detail-sym {
	font-family: var(--idp-font);
	font-size: 22px;
	font-weight: 700;
	color: var(--idp-accent);
}
.idp-detail-name {
	font-size: 13px;
	color: var(--idp-text-muted);
	margin-bottom: 8px;
}
.idp-detail-price {
	font-family: var(--idp-font);
	font-size: 28px;
	font-weight: 700;
	line-height: 1.1;
}
.idp-detail-change-row {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 4px;
}
.idp-detail-change-badge {
	padding: 3px 8px;
	border-radius: 3px;
	font-family: var(--idp-font);
	font-size: 12px;
	font-weight: 600;
}
.idp-detail-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	margin-top: 16px;
}
.idp-detail-stat {
	background: var(--idp-bg-card);
	border: 1px solid var(--idp-border);
	border-radius: var(--idp-radius);
	padding: 8px 10px;
}
.idp-stat-label {
	font-size: 10px;
	color: var(--idp-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 2px;
}
.idp-stat-value {
	font-family: var(--idp-font);
	font-size: 13px;
	font-weight: 600;
	color: var(--idp-text);
}
.idp-detail-desc {
	margin-top: 12px;
	font-size: 12px;
	color: var(--idp-text-muted);
	line-height: 1.6;
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ---- Tabs ---- */
.idp-tabs {
	display: flex;
	gap: 4px;
}
.idp-tab {
	background: transparent;
	border: 1px solid var(--idp-border);
	color: var(--idp-text-muted);
	padding: 4px 10px;
	border-radius: 3px;
	font-size: 11px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.15s;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}
.idp-tab:hover {
	border-color: var(--idp-accent-2);
	color: var(--idp-accent-2);
}
.idp-tab.active {
	background: var(--idp-accent);
	border-color: var(--idp-accent);
	color: #000;
}

/* ---- Movers ---- */
.idp-movers-content {
	max-height: 360px;
	overflow-y: auto;
}
.idp-movers-tab-content {
	display: none;
}
.idp-movers-tab-content.active {
	display: block;
}
.idp-mover-row {
	display: grid;
	grid-template-columns: 40px 1fr auto auto;
	align-items: center;
	gap: 10px;
	padding: 9px 16px;
	border-bottom: 1px solid var(--idp-border);
	transition: background 0.15s;
}
.idp-mover-row:hover {
	background: var(--idp-bg-hover);
}
.idp-mover-rank {
	font-size: 11px;
	color: var(--idp-text-muted);
	font-family: var(--idp-font);
	text-align: center;
}
.idp-mover-sym {
	font-family: var(--idp-font);
	font-weight: 700;
	font-size: 13px;
	color: var(--idp-text);
}
.idp-mover-name {
	font-size: 11px;
	color: var(--idp-text-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.idp-mover-price {
	font-family: var(--idp-font);
	font-size: 12px;
	font-weight: 600;
	text-align: right;
}
.idp-mover-pct {
	font-family: var(--idp-font);
	font-size: 11px;
	font-weight: 600;
	padding: 2px 6px;
	border-radius: 3px;
	min-width: 60px;
	text-align: center;
}

/* ---- Market Overview ---- */
.idp-market-content {
	min-height: 200px;
}
.idp-market-tab-content {
	display: none;
	padding: 12px 16px;
}
.idp-market-tab-content.active {
	display: block;
}
.idp-forex-row,
.idp-commodity-row,
.idp-economy-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 0;
	border-bottom: 1px solid var(--idp-border);
	gap: 10px;
}
.idp-market-label {
	font-size: 13px;
	font-weight: 600;
	color: var(--idp-text);
}
.idp-market-sub {
	font-size: 11px;
	color: var(--idp-text-muted);
}
.idp-market-value {
	font-family: var(--idp-font);
	font-size: 14px;
	font-weight: 700;
	text-align: right;
}
.idp-market-date {
	font-size: 10px;
	color: var(--idp-text-muted);
	text-align: right;
}

/* ---- News ---- */
.idp-news-list {
	max-height: 500px;
	overflow-y: auto;
}
.idp-news-item {
	display: flex;
	gap: 12px;
	padding: 14px 16px;
	border-bottom: 1px solid var(--idp-border);
	transition: background 0.15s;
}
.idp-news-item:hover {
	background: var(--idp-bg-hover);
}
.idp-news-thumb {
	width: 56px;
	height: 56px;
	border-radius: var(--idp-radius);
	object-fit: cover;
	flex-shrink: 0;
	background: var(--idp-bg-card);
}
.idp-news-thumb-placeholder {
	width: 56px;
	height: 56px;
	border-radius: var(--idp-radius);
	background: var(--idp-bg-card);
	border: 1px solid var(--idp-border);
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
}
.idp-news-body {
	flex: 1;
	min-width: 0;
}
.idp-news-title {
	font-size: 13px;
	font-weight: 600;
	color: var(--idp-text);
	margin-bottom: 4px;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.idp-news-meta {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}
.idp-news-source {
	font-size: 11px;
	color: var(--idp-text-muted);
}
.idp-news-time {
	font-size: 11px;
	color: var(--idp-text-muted);
	font-family: var(--idp-font);
}
.idp-sentiment-badge {
	font-size: 10px;
	font-weight: 700;
	padding: 2px 6px;
	border-radius: 3px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}
.idp-sentiment-bullish {
	background: var(--idp-green-bg);
	color: var(--idp-green);
	border: 1px solid rgba(16,185,129,0.3);
}
.idp-sentiment-bearish {
	background: var(--idp-red-bg);
	color: var(--idp-red);
	border: 1px solid rgba(239,68,68,0.3);
}
.idp-sentiment-neutral {
	background: rgba(100,116,139,0.1);
	color: var(--idp-text-muted);
	border: 1px solid rgba(100,116,139,0.3);
}
.idp-news-link {
	font-size: 11px;
	color: var(--idp-accent-2);
	text-decoration: none;
	white-space: nowrap;
}
.idp-news-link:hover {
	text-decoration: underline;
}

/* ---- Loading State ---- */
.idp-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px;
	color: var(--idp-text-muted);
	font-size: 13px;
	gap: 10px;
}
.idp-loading::before {
	content: '';
	width: 16px;
	height: 16px;
	border: 2px solid var(--idp-border);
	border-top-color: var(--idp-accent);
	border-radius: 50%;
	animation: idp-spin 0.7s linear infinite;
}
@keyframes idp-spin {
	to { transform: rotate(360deg); }
}

/* ---- Error State ---- */
.idp-error {
	padding: 20px;
	color: var(--idp-red);
	font-size: 13px;
	text-align: center;
}

/* ---- Footer ---- */
.idp-footer {
	padding: 10px 20px;
	background: var(--idp-bg-panel);
	border-top: 1px solid var(--idp-border);
	font-size: 11px;
	color: var(--idp-text-muted);
	text-align: center;
}

/* ---- Standalone Widget Quote ---- */
.idp-widget-quote .idp-detail-content {
	max-height: none;
}

/* ---- Scrollbar Styling ---- */
.idp-wrap ::-webkit-scrollbar {
	width: 4px;
	height: 4px;
}
.idp-wrap ::-webkit-scrollbar-track {
	background: var(--idp-bg);
}
.idp-wrap ::-webkit-scrollbar-thumb {
	background: var(--idp-border);
	border-radius: 2px;
}
.idp-wrap ::-webkit-scrollbar-thumb:hover {
	background: var(--idp-text-muted);
}

/* ---- Responsive Adjustments ---- */
@media (max-width: 480px) {
	.idp-header-bar { flex-wrap: wrap; gap: 8px; }
	.idp-search-bar { flex-wrap: wrap; }
	.idp-symbol-search { min-width: 0; }
	.idp-detail-grid { grid-template-columns: 1fr; }
	.idp-mover-row { grid-template-columns: 30px 1fr auto; }
	.idp-mover-price { display: none; }
}
