/* HashRate Index Modern Theme - Black & Yellow Edition */
/* Modern responsive design with Bootstrap 5 */

@import url("poll.css");
@import url("list.css");
@import url("tags.css");
@import url("news.css");
@import url("objectmenu.css");
@import url("charts.css");

:root {
	--primary-color: #FDB91A;
	--primary-dark: #E5A615;
	--secondary-color: #FFD952;
	--background: #0A0A0A;
	--surface: #1A1A1A;
	--surface-light: #242424;
	--text-primary: #FFFFFF;
	--text-secondary: #B0B0B0;
	--border-color: #2A2A2A;
	--success: #10B981;
	--warning: #F59E0B;
	--error: #EF4444;
	--shadow-sm: 0 2px 4px 0 rgba(0, 0, 0, 0.3);
	--shadow-md: 0 4px 8px -1px rgba(0, 0, 0, 0.4);
	--shadow-lg: 0 10px 20px -3px rgba(0, 0, 0, 0.5);
	--gradient-primary: linear-gradient(135deg, #FDB91A 0%, #FFD952 100%);
	--gradient-dark: linear-gradient(135deg, #1A1A1A 0%, #242424 100%);
}

* {
	box-sizing: border-box;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
	font-size: 14px;
	line-height: 1.6;
	background-color: var(--background);
	color: var(--text-primary);
	text-align: left;
	margin: 0;
	padding: 0;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

a, a:visited {
	color: var(--primary-color);
	text-decoration: none;
	transition: color 0.2s ease;
}

a:hover {
	color: var(--primary-dark);
	text-decoration: none;
}

img {
	border: 0;
	padding: 0;
	max-width: 100%;
	height: auto;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
	font-weight: 600;
	line-height: 1.3;
	color: var(--text-primary);
	margin-top: 0;
	width: 100%;
}

h1 {
	font-size: 2.25rem;
	margin-bottom: 1rem;
}

h2 {
	font-size: 1.875rem;
	margin: 1.5rem 0 1rem 0;
}

h3 {
	font-size: 1.5rem;
	margin: 1.25rem 0 0.75rem 0;
}

h4 {
	font-size: 1.25rem;
	margin: 1rem 0 0.5rem 0;
}

hr {
	display: block;
	height: 1px;
	border: 0;
	border-top: 1px solid var(--border-color);
	margin: 2rem 0;
}

/* Header & Navigation */
#header {
	background: var(--surface);
	border-bottom: 1px solid var(--border-color);
	box-shadow: var(--shadow-md);
	position: sticky;
	top: 0;
	z-index: 1000;
}

#header-logo {
	padding: 1rem 2rem;
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--primary-color);
}

#menu {
	background: var(--surface);
	padding: 0;
	margin: 0;
	border-bottom: 1px solid var(--border-color);
}

#menu ul {
	list-style: none;
	margin: 0;
	padding: 0 2rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

#menu li {
	margin: 0;
	padding: 0;
}

#menu a {
	display: block;
	padding: 1rem 1.25rem;
	color: var(--text-secondary);
	font-weight: 500;
	transition: all 0.2s ease;
	border-bottom: 3px solid transparent;
}

#menu a:hover {
	color: var(--primary-color);
	border-bottom-color: var(--primary-color);
	background-color: rgba(253, 185, 26, 0.1);
}

#menu a.active {
	color: var(--primary-color);
	border-bottom-color: var(--primary-color);
}

/* Main Content */
#main-content {
	max-width: 1400px;
	margin: 0 auto;
	padding: 2rem;
}

.main-left-box, .main-right-box {
	background: var(--surface);
	border-radius: 12px;
	box-shadow: var(--shadow-md);
	margin-bottom: 2rem;
	overflow: hidden;
	border: 1px solid var(--border-color);
}

.main-left-title, .main-right-title {
	background: var(--gradient-primary);
	color: #000000;
	padding: 1.25rem 1.5rem;
	font-size: 1.125rem;
	font-weight: 700;
	margin: 0;
	border: none;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.main-left-inner, .main-right-inner {
	padding: 1.5rem;
}

/* Cards & Panels */
.panel, .card {
	background: var(--surface);
	border-radius: 8px;
	padding: 1.5rem;
	margin-bottom: 1.5rem;
	box-shadow: var(--shadow-sm);
	border: 1px solid var(--border-color);
}

/* Fix card overlap when inside d-flex containers */
.d-flex > .w-100 > .card,
.d-flex .card.h-100 {
	margin-bottom: 0;
	height: auto !important;
	flex: 1 1 auto;
}

/* Wrapper inside d-flex columns needs flex layout */
.d-flex > .w-100 {
	display: flex;
	flex-direction: column;
}

/* Ensure proper column stacking on mobile */
.row.g-2 > [class*="col-"] {
	margin-bottom: 0.5rem;
}

@media (max-width: 767.98px) {
	.row.g-2 > [class*="col-"] {
		margin-bottom: 1rem;
	}
}

.panel-header {
	font-size: 1.125rem;
	font-weight: 600;
	margin-bottom: 1rem;
	color: var(--text-primary);
}

/* Stats & Metrics */
.stat-box {
	background: var(--gradient-primary);
	color: #000000;
	border-radius: 12px;
	padding: 1.5rem;
	margin-bottom: 1rem;
	box-shadow: var(--shadow-md);
	border: 2px solid rgba(253, 185, 26, 0.3);
}

.stat-value {
	font-size: 2rem;
	font-weight: 800;
	margin-bottom: 0.25rem;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.stat-label {
	font-size: 0.875rem;
	opacity: 0.8;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	font-weight: 600;
}

/* Buttons */
.button, button, input[type="submit"], input[type="button"], .btn-primary {
	background: var(--gradient-primary);
	color: #000000;
	border: none;
	padding: 0.75rem 1.5rem;
	border-radius: 8px;
	font-size: 0.875rem;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.2s ease;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.button:hover, button:hover, input[type="submit"]:hover, input[type="button"]:hover, .btn-primary:hover {
	background: linear-gradient(135deg, #E5A615 0%, #E5C642 100%);
	box-shadow: 0 4px 12px rgba(253, 185, 26, 0.4);
	transform: translateY(-2px);
}

.button-secondary, .btn-secondary {
	background: var(--surface-light);
	color: var(--text-primary);
	border: 1px solid var(--border-color);
}

.button-secondary:hover, .btn-secondary:hover {
	background: var(--surface);
	border-color: var(--primary-color);
	color: var(--primary-color);
}

.button-success, .btn-success {
	background: var(--success);
	color: white;
}

.button-warning, .btn-warning {
	background: var(--warning);
	color: #000000;
}

.button-error, .btn-danger {
	background: var(--error);
	color: white;
}

/* Badge styles */
.badge {
	font-weight: 600;
	padding: 0.35em 0.65em;
	border-radius: 6px;
}

.badge-primary {
	background: var(--gradient-primary);
	color: #000000;
}

.badge-success {
	background: var(--success);
	color: white;
}

.badge-warning {
	background: var(--warning);
	color: #000000;
}

.badge-danger {
	background: var(--error);
	color: white;
}

/* Forms */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
select,
textarea {
	width: 100%;
	padding: 0.75rem 1rem;
	border: 1px solid var(--border-color);
	border-radius: 8px;
	font-size: 0.875rem;
	font-family: inherit;
	background: var(--surface-light);
	color: var(--text-primary);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
	outline: none;
	border-color: var(--primary-color);
	box-shadow: 0 0 0 3px rgba(253, 185, 26, 0.2);
	background: var(--surface);
}

label {
	display: block;
	margin-bottom: 0.5rem;
	font-weight: 500;
	color: var(--text-primary);
	font-size: 0.875rem;
}

.form-group {
	margin-bottom: 1.5rem;
}

/* Footer */
#footer {
	background: var(--surface);
	border-top: 1px solid var(--border-color);
	padding: 2rem;
	margin-top: 4rem;
	text-align: center;
	color: var(--text-secondary);
	font-size: 0.875rem;
}

#footer a {
	color: var(--primary-color);
	margin: 0 0.5rem;
}

/* Alerts & Messages */
.alert {
	padding: 1rem 1.25rem;
	border-radius: 8px;
	margin-bottom: 1.5rem;
	border-left: 4px solid;
}

.alert-success {
	background: rgba(16, 185, 129, 0.1);
	border-left-color: var(--success);
	color: #065F46;
}

.alert-warning {
	background: rgba(245, 158, 11, 0.1);
	border-left-color: var(--warning);
	color: #92400E;
}

.alert-error {
	background: rgba(239, 68, 68, 0.1);
	border-left-color: var(--error);
	color: #991B1B;
}

.alert-info {
	background: rgba(0, 102, 255, 0.1);
	border-left-color: var(--primary-color);
	color: #1E40AF;
}

/* Badges */
.badge {
	display: inline-block;
	padding: 0.25rem 0.75rem;
	border-radius: 12px;
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.badge-primary {
	background: var(--primary-color);
	color: white;
}

.badge-success {
	background: var(--success);
	color: white;
}

.badge-warning {
	background: var(--warning);
	color: white;
}

.badge-error {
	background: var(--error);
	color: white;
}

/* Responsive */
@media (max-width: 768px) {
	#main-content {
		padding: 1rem;
	}
	
	#menu ul {
		padding: 0 1rem;
		flex-direction: column;
		gap: 0;
	}
	
	#menu a {
		padding: 0.75rem 1rem;
		border-bottom: 1px solid var(--border-color);
		border-left: 3px solid transparent;
	}
	
	#menu a:hover, #menu a.active {
		border-bottom: 1px solid var(--border-color);
		border-left-color: var(--primary-color);
	}
	
	.main-left-box, .main-right-box {
		border-radius: 8px;
	}
	
	.stat-value {
		font-size: 1.5rem;
	}
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
	body.auto-theme {
		--background: #111827;
		--surface: #1F2937;
		--text-primary: #F9FAFB;
		--text-secondary: #9CA3AF;
		--border-color: #374151;
	}
}

/* Smooth animations */
* {
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* Loading states */
.loading {
	opacity: 0.6;
	pointer-events: none;
	position: relative;
}

.loading::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 20px;
	height: 20px;
	margin: -10px 0 0 -10px;
	border: 2px solid var(--primary-color);
	border-top-color: transparent;
	border-radius: 50%;
	animation: spin 0.6s linear infinite;
}

@keyframes spin {
	to { transform: rotate(360deg); }
}

/* ========================================
   Bootstrap Integration & Card-Based Tables
   ======================================== */

/* Override default table styling - convert to cards */
.main-left-box table,
.main-right-box table,
table.dataGrid,
table.main {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	margin-bottom: 1.5rem;
}

/* Table rows as cards */
.main-left-box table tr,
.main-right-box table tr {
	background: var(--surface);
	border-radius: 8px;
	margin-bottom: 0.75rem;
	box-shadow: var(--shadow-sm);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
	display: block;
}

.main-left-box table tr:hover,
.main-right-box table tr:hover {
	box-shadow: var(--shadow-md);
	transform: translateY(-2px);
}

.main-left-box table td,
.main-right-box table td {
	padding: 1rem;
	border: none;
	display: block;
}

.main-left-box table th,
.main-right-box table th {
	background: var(--primary-color);
	color: white;
	padding: 1rem;
	font-weight: 600;
	text-align: left;
	border-radius: 8px 8px 0 0;
	display: block;
}

/* Grid layout for table cards on larger screens */
@media (min-width: 768px) {
	.main-left-box table tr,
	.main-right-box table tr {
		display: flex;
		align-items: center;
		padding: 0.5rem;
	}
	
	.main-left-box table td,
	.main-right-box table td {
		flex: 1;
		display: flex;
		align-items: center;
		padding: 0.75rem 1rem;
		border-right: 1px solid var(--border-color);
	}
	
	.main-left-box table td:last-child,
	.main-right-box table td:last-child {
		border-right: none;
	}
	
	.main-left-box table th,
	.main-right-box table th {
		display: flex;
		flex: 1;
		align-items: center;
	}
}

/* Info boxes as Bootstrap cards */
.main-left-box,
.main-right-box {
	background: var(--surface);
	border-radius: 12px;
	padding: 1.5rem;
	margin-bottom: 1.5rem;
	box-shadow: var(--shadow-md);
	border: 1px solid var(--border-color);
}

.main-left-box h2,
.main-right-box h2 {
	font-size: 1.25rem;
	font-weight: 600;
	color: var(--text-primary);
	margin-bottom: 1rem;
	padding-bottom: 0.75rem;
	border-bottom: 2px solid var(--primary-color);
}

/* Stats grid using Bootstrap cards */
.stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 1.5rem;
	margin-bottom: 2rem;
}

.stat-card {
	background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
	border-radius: 12px;
	padding: 1.5rem;
	color: white;
	box-shadow: var(--shadow-md);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--shadow-lg);
}

.stat-card-title {
	font-size: 0.875rem;
	font-weight: 500;
	opacity: 0.9;
	margin-bottom: 0.5rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.stat-card-value {
	font-size: 2rem;
	font-weight: 700;
	margin-bottom: 0.25rem;
}

.stat-card-label {
	font-size: 0.75rem;
	opacity: 0.8;
}

/* Bootstrap-style buttons */
.btn {
	display: inline-block;
	padding: 0.75rem 1.5rem;
	border-radius: 8px;
	font-weight: 600;
	text-align: center;
	cursor: pointer;
	border: none;
	transition: all 0.2s ease;
	font-size: 0.875rem;
	text-decoration: none;
}

.btn-sm {
	padding: 0.5rem 1rem;
	font-size: 0.75rem;
}

.btn-lg {
	padding: 1rem 2rem;
	font-size: 1rem;
}

.btn-primary {
	background: var(--primary-color);
	color: white;
}

.btn-primary:hover {
	background: var(--primary-dark);
	transform: translateY(-2px);
	box-shadow: var(--shadow-md);
}

.btn-success {
	background: var(--success);
	color: white;
}

.btn-success:hover {
	background: #059669;
}

.btn-outline {
	background: transparent;
	border: 2px solid var(--primary-color);
	color: var(--primary-color);
}

.btn-outline:hover {
	background: var(--primary-color);
	color: white;
}

/* Modern data cards */
.data-card {
	background: var(--surface);
	border-radius: 12px;
	padding: 1.5rem;
	margin-bottom: 1.5rem;
	box-shadow: var(--shadow-sm);
	border: 1px solid var(--border-color);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.data-card:hover {
	box-shadow: var(--shadow-md);
	transform: translateY(-2px);
}

.data-card-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 1rem;
	padding-bottom: 1rem;
	border-bottom: 1px solid var(--border-color);
}

.data-card-title {
	font-size: 1.125rem;
	font-weight: 600;
	color: var(--text-primary);
	margin: 0;
}

.data-card-body {
	color: var(--text-secondary);
}

.data-card-footer {
	margin-top: 1rem;
	padding-top: 1rem;
	border-top: 1px solid var(--border-color);
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 0.875rem;
}

/* Responsive grid for cards */
.card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 1.5rem;
	margin-bottom: 2rem;
}

/* List group items as cards */
ul.list-group {
	list-style: none;
	padding: 0;
	margin: 0;
}

.list-group-item {
	background: var(--surface);
	border-radius: 8px;
	padding: 1rem 1.25rem;
	margin-bottom: 0.5rem;
	border: 1px solid var(--border-color);
	transition: all 0.2s ease;
}

.list-group-item:hover {
	box-shadow: var(--shadow-sm);
	transform: translateX(4px);
	border-color: var(--primary-color);
}

/* Progress bars */
.progress {
	height: 8px;
	background: var(--border-color);
	border-radius: 4px;
	overflow: hidden;
	margin: 0.5rem 0;
}

.progress-bar {
	height: 100%;
	background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
	border-radius: 4px;
	transition: width 0.3s ease;
}

/* Pagination */
.pagination {
	display: flex;
	list-style: none;
	gap: 0.5rem;
	padding: 0;
	margin: 2rem 0;
	justify-content: center;
}

.pagination li {
	display: block;
}

.pagination a {
	display: block;
	padding: 0.5rem 1rem;
	border-radius: 6px;
	background: var(--surface);
	border: 1px solid var(--border-color);
	color: var(--text-primary);
	transition: all 0.2s ease;
}

.pagination a:hover,
.pagination .active a {
	background: var(--primary-color);
	color: white;
	border-color: var(--primary-color);
}

/* Remove old tabmenu styles - replaced by Bootstrap navbar */
.tabmenu-out,
.tabmenu-inner {
	display: none;
}

/* Ensure main content has proper spacing */
#main-content {
	min-height: calc(100vh - 200px);
}

/* Utility classes */
.text-center {
	text-align: center;
}

.text-right {
	text-align: right;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* Fix for small tags to be visible in light contexts */
small {
	color: var(--text-secondary);
	font-size: 0.875em;
}

/* Ensure small tags within light/yellow backgrounds are visible */
.main-left-title small,
.main-right-title small,
[style*="background-color: #FDB91A"] small,
[style*="background-color:#FDB91A"] small {
	color: #000000 !important;
}

/* Ensure small tags in card contexts remain visible */
.card small,
.panel small {
	color: var(--text-secondary);
}

/* ========================================
   Wallet Page Specific Styles
   ======================================== */

/* Mining Summary Section */
#main_miners_results .card {
	background: var(--surface);
	border: 1px solid var(--border-color);
}

#main_miners_results .card-body {
	color: var(--text-primary);
}

/* Worker cards styling */
#main_miners_results .card-header {
	background: transparent;
	border-bottom: 1px solid rgba(253, 185, 26, 0.2);
	padding: 0.75rem 1rem;
}

#main_miners_results .card-header .header-title {
	color: var(--text-primary);
	font-size: 0.9rem;
	margin: 0;
}

/* Earnings summary on hashrate chart */
.earnings-summary h4,
.earnings-summary h6,
.earnings-summary small {
	color: inherit;
}

.earnings-summary .text-muted {
	color: rgba(255, 255, 255, 0.6) !important;
}

/* Graph container - ensure proper positioning */
#main_graphs_results {
	position: relative;
	z-index: 1;
	width: 100%;
}

#main_graphs_results .card {
	overflow: visible;
}

#main_graphs_results [id^="graph_results_"] {
	min-height: 350px;
	width: 100% !important;
	max-width: 100%;
	padding-top: 30px;
}

/* Fix ApexCharts container */
.apexcharts-canvas {
	max-width: 100% !important;
}

/* Blocks found section - proper flex layout */
#main_found_results .card {
	overflow: visible;
}

#main_found_results .d-flex {
	flex-wrap: wrap;
}

/* Block found items */
.blockFound {
	width: 40px;
	height: 40px;
	flex: 0 0 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 6px;
	margin: 2px;
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blockFound:hover {
	transform: scale(1.1);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.blockFound img {
	max-width: 24px;
	max-height: 24px;
	border-radius: 50%;
	object-fit: contain;
}

/* Floating div for block details */
.floatingDiv {
	display: none;
	position: absolute;
	z-index: 1000;
	min-width: 280px;
}

.blockFound:hover .floatingDiv,
.hoverDiv:hover .floatingDiv {
	display: block;
}

/* Fix for text-dark class inside dark theme - use specific selectors */
.card .text-dark,
.card-body .text-dark,
#main_graphs_results .text-dark,
#main_miners_results .text-dark {
	color: #212529;
}

/* Ensure proper contrast for badge text */
.badge.bg-success,
.badge.bg-danger,
.badge.bg-warning,
.badge.bg-info,
.badge.bg-primary {
	color: #fff;
}

.badge.bg-warning {
	color: #000;
}
