/* Scoped CSS to avoid conflicts */
#solar-app-root {
	font-family: 'Segoe UI', sans-serif;
	background-color: #050505;
	color: #e0e0e0;
	overflow: hidden;
	position: relative;
	width: 100%;
	height: 100vh;
}

#solar-app-root #canvas-container { 
	position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; overflow: hidden;
}

/* Loading Overlay */
#solar-app-root #loading-overlay {
	position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 20000;
	background: rgba(0,0,0,0.85); display: none; 
	flex-direction: column; justify-content: center; align-items: center;
}

#solar-app-root .spinner { 
	width: 50px; height: 50px; border: 5px solid #333; border-top: 5px solid #ffc107; 
	border-radius: 50%; animation: spin 1s linear infinite; 
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

#solar-app-root #error-panel {
	position: absolute; bottom: 10px; right: 10px; width: auto; z-index: 9999;
	background: rgba(220, 53, 69, 0.95); color: white; padding: 10px;
	display: none; font-family: monospace; font-size: 12px; border-bottom: 2px solid #fff;
	border-radius: 4px;
}

/* --- Left Sidebar Wrapper (Overlay Implementation) --- */
#solar-app-root #left-wrapper {
	position: absolute; 
	top: 0; 
	left: 0; 
	height: 100%; 
	z-index: 20; 
	display: flex; 
	flex-direction: row; 
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	pointer-events: none; /* Let clicks pass through empty areas */
}

/* Collapsed State: Hide the content (320px) but keep toggle visible */
#solar-app-root #left-wrapper.collapsed { 
	transform: translateX(-320px); 
}

/* The Content Layer */
#solar-app-root #left-layer { 
	width: 320px; 
	height: 100%; 
	background: rgba(15, 15, 25, 0.95); 
	backdrop-filter: blur(10px); 
	padding: 15px; 
	overflow-y: auto; 
	border-right: 1px solid #333; 
	pointer-events: auto; /* Re-enable clicks */
	display: flex;
	flex-direction: column;
}

/* The Toggle Button Container */
#solar-app-root #toggle-left-container {
	width: 40px;
	padding-top: 15px;
	pointer-events: auto;
}

/* The Toggle Button */
#solar-app-root #toggle-left {
	background: rgba(15, 15, 25, 0.95);
	border: 1px solid #444;
	border-left: none;
	color: #ffc107;
	padding: 10px;
	border-radius: 0 8px 8px 0;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 40px;
	font-weight: bold;
	box-shadow: 2px 0 5px rgba(0,0,0,0.2);
	transition: background 0.2s;
}
#solar-app-root #toggle-left:hover {
	background: #333;
	color: #fff;
}

/* --- Right Sidebar Fixed (Overlay) --- */
#solar-app-root #right-wrapper { 
	position: absolute; top: 0; right: 0; height: 100%; z-index: 515; 
	display: flex; flex-direction: row; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); pointer-events: none; 
}
#solar-app-root #right-wrapper.collapsed { transform: translateX(380px); }

#solar-app-root #right-layer { 
	width: 380px; height: 100%; background: rgba(15, 15, 25, 0.95); 
	backdrop-filter: blur(10px); padding: 20px; overflow-y: auto; 
	border-left: 1px solid #333; pointer-events: auto; 
}

#solar-app-root #toggle-right-container { width: 40px; padding-top: 20px; pointer-events: auto; }

#solar-app-root #toggle-right { 
	background: #1a1a25; border: 1px solid #333; border-right: none; color: #fff; 
	padding: 10px; border-radius: 8px 0 0 8px; cursor: pointer; 
	display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; 
}
#solar-app-root #toggle-right:hover { background: #2a2a35; color: #0dcaf0; }

/* --- Common UI --- */
#solar-app-root .card { 
	background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.1); 
	margin-bottom: 15px; padding: 15px; border-radius: 8px; 
}
#solar-app-root h5 { 
	font-size: 0.75rem; font-weight: 700; color: #888; 
	text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; 
	border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 5px; 
}
#solar-app-root .form-label, #solar-app-root label { font-size: 0.75rem; color: #ccc; margin-bottom: 2px; }

/* BS4 Overrides */
#solar-app-root .btn-sm { font-size: 0.75rem; }
#solar-app-root .custom-select-sm { height: calc(1.5em + 0.5rem + 2px); padding-top: 0.25rem; padding-bottom: 0.25rem; font-size: 0.875rem; }
#solar-app-root .form-control-range { width: 100%; }

#solar-app-root .nav-tabs { border-bottom: 1px solid #333; }
#solar-app-root .nav-tabs .nav-link { color: #666; font-size: 0.75rem; padding: 5px 8px; border: none; background: transparent; }
#solar-app-root .nav-tabs .nav-link.active { background: transparent; color: #ffc107; border-bottom: 2px solid #ffc107; }
#solar-app-root #rightTabs .nav-link.active { color: #0dcaf0; border-bottom: 2px solid #0dcaf0; }

#solar-app-root .chart-container { position: relative; width: 100%; height: 160px; }
#solar-app-root canvas.chart-canvas { width: 100%; height: 100%; }
#solar-app-root #c-polar, #solar-app-root #c-azalt { height: 300px; width: 100%; }

#solar-app-root .btn-maximize {
	position: absolute; top: 15px; right: 15px;
	background: transparent; border: none; color: #666; 
	font-size: 1.2rem; cursor: pointer; z-index: 5; padding: 0; line-height: 1;
}
#solar-app-root .btn-maximize:hover { color: #fff; }

#solar-app-root .data-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 0.8rem; }
#solar-app-root .data-item label { display: block; font-size: 0.65rem; color: #666; text-transform: uppercase; margin:0; }
#solar-app-root .data-item span { font-weight: 600; color: #fff; }

#solar-app-root .drop-zone { 
	border: 2px dashed #444; padding: 15px; text-align: center; font-size: 0.8rem; 
	color: #666; cursor: pointer; border-radius: 6px; transition: 0.2s; position: relative;
}
#solar-app-root .drop-zone:hover { border-color: #ffc107; color: #fff; background: rgba(255,193,7,0.05); }

/* Bootstrap Modal Overrides */
.modal-content.dark-theme { background-color: #1a1a25; color: #eee; border: 1px solid #444; }
.modal-header.dark-theme { border-bottom: 1px solid #333; }
.modal-footer.dark-theme { border-top: 1px solid #333; }
.close { color: #fff; opacity: 0.7; }

/* Scrollbars */
#solar-app-root ::-webkit-scrollbar { width: 6px; }
#solar-app-root ::-webkit-scrollbar-track { background: #111; }
#solar-app-root ::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }

#viewcube2 {
	background-color: transparent;
	border: 1px solid rgba(0,0,0,0.1);
	height: 80px;
	overflow: hidden;
	position: absolute;
	right: 50px;
	top: 10px;
	width: 80px;
	z-index: 500;
}