/* ========================================
   Dashboard Page Styles
   Matches experiment.css dark theme:
   background #0a0a0a→#1a1a2e→#16213e,
   crimson accent, Montserrat font.
   ======================================== */

/* ---- Layout ---- */

body.dashboard-body {
	margin: 0;
	background: #16213e;
	color: #fff;
	min-height: 100vh;
}

.dashboard-section {
	min-height: 100vh;
	background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
	padding: 10rem 2rem 6rem;
}

.dashboard-container {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 3rem;
	max-width: 1200px;
	margin: 0 auto;
	align-items: start;
}

/* ---- Section Headings ---- */

.dashboard-heading {
	color: rgba(255, 255, 255, 0.9);
	font-size: 1.6rem;
	font-weight: 600;
	letter-spacing: 0.15rem;
	text-transform: uppercase;
	margin-bottom: 2rem;
	padding-bottom: 0.8rem;
	border-bottom: 2px solid rgba(220, 20, 60, 0.4);
}

/* ---- Completion Banner ---- */

.completion-banner {
	background: rgba(220, 20, 60, 0.1);
	border: 1px solid rgba(220, 20, 60, 0.35);
	border-radius: 10px;
	max-width: 1200px;
	margin: 0 auto 2rem;
	opacity: 1;
	transition: opacity 0.8s ease-out;
}

.completion-banner.fade-out {
	opacity: 0;
}

.completion-banner-inner {
	padding: 1rem 1.6rem;
	text-align: center;
}

.completion-title {
	color: #fff;
	font-size: 1.4rem;
	font-weight: 600;
	margin: 0 0 0.2rem;
	letter-spacing: 0.05rem;
}

.completion-sub {
	color: rgba(255, 255, 255, 0.65);
	font-size: 1.1rem;
	margin: 0;
}

.completion-sub strong {
	color: crimson;
}

/* ---- Test Cards ---- */

.test-card {
	background: rgba(255, 255, 255, 0.05);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 16px;
	padding: 2.4rem;
	margin-bottom: 2rem;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
	transition: border-color 0.3s, box-shadow 0.3s;
}

.test-card:not(.test-card-disabled):hover {
	border-color: rgba(220, 20, 60, 0.35);
	box-shadow: 0 8px 40px rgba(220, 20, 60, 0.1);
}

/* ---- Equipment Card ---- */
.equipment-card {
	background: rgba(255, 255, 255, 0.06);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 12px;
	padding: 1.6rem 2rem;
	margin-bottom: 2rem;
	color: #fff;
}

.equipment-heading {
	color: #fff;
	font-size: 1.5rem;
	font-weight: 600;
	margin: 0 0 1rem;
}

.equipment-row {
	color: #e0e0e0;
	font-size: 1.3rem;
	margin-bottom: 0.5rem;
}

.equipment-label {
	color: #999;
	font-size: 1.2rem;
	margin-right: 0.4rem;
}

.equipment-edit-btn {
	margin-top: 0.8rem;
	font-size: 1.1rem;
}

.equipment-form-actions {
	display: flex;
	gap: 0.8rem;
	margin-top: 1rem;
}

.btn-secondary {
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.2);
	color: #fff;
	padding: 0.6rem 1.4rem;
	border-radius: 8px;
	cursor: pointer;
	font-size: 1.2rem;
	transition: background 0.2s;
}

.btn-secondary:hover {
	background: rgba(255, 255, 255, 0.15);
}

.btn-sm {
	padding: 0.5rem 1.2rem;
	font-size: 1.1rem;
}

.test-card-disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.test-card-disabled * {
	pointer-events: none;
}

.test-card-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1.2rem;
}

.test-card-title {
	color: #fff;
	font-size: 1.8rem;
	font-weight: 600;
	margin: 0;
}

.participant-badge {
	background: rgba(220, 20, 60, 0.15);
	border: 1px solid rgba(220, 20, 60, 0.3);
	border-radius: 20px;
	color: rgba(255, 255, 255, 0.8);
	font-size: 1.1rem;
	font-weight: 500;
	padding: 0.3rem 1rem;
	white-space: nowrap;
	flex-shrink: 0;
}

.participant-badge #participant-count {
	color: crimson;
	font-weight: 700;
}

.test-card-desc {
	color: rgba(255, 255, 255, 0.75);
	font-size: 1.3rem;
	line-height: 1.6;
	margin-bottom: 1.6rem;
}

.test-card-methods {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin-bottom: 2rem;
}

.method-tag {
	display: inline-block;
	padding: 0.5rem 1.2rem;
	background: rgba(220, 20, 60, 0.25);
	border: 1px solid rgba(220, 20, 60, 0.5);
	border-radius: 20px;
	color: #fff;
	font-size: 1.1rem;
	font-weight: 500;
}

.test-start-btn {
	display: block;
	text-align: center;
	text-decoration: none;
	width: 100%;
	box-sizing: border-box;
}

/* Test already completed: dashboard.js removes the href and marks it aria-disabled */
.test-start-btn[aria-disabled="true"] {
	opacity: 0.55;
	cursor: default;
	pointer-events: none;
}

/* ---- Stats Card ---- */

.stats-card {
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 12px;
	padding: 2rem 2.4rem;
	margin-bottom: 2rem;
}

.stats-label {
	color: rgba(255, 255, 255, 0.7);
	font-size: 1.1rem;
	font-weight: 500;
	letter-spacing: 0.1rem;
	text-transform: uppercase;
	margin-bottom: 0.4rem;
}

.stats-count {
	color: crimson;
	font-size: 4rem;
	font-weight: 700;
	line-height: 1;
	margin-bottom: 0.4rem;
}

.stats-sub {
	color: rgba(255, 255, 255, 0.65);
	font-size: 1.1rem;
	margin: 0;
}

/* ---- Download Card ---- */

.download-card {
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 12px;
	padding: 2rem 2.4rem;
	margin-bottom: 2rem;
}

.download-desc {
	color: rgba(255, 255, 255, 0.7);
	font-size: 1.3rem;
	margin-bottom: 0.8rem;
}

.download-note {
	color: rgba(255, 255, 255, 0.65);
	font-size: 1.1rem;
	margin-bottom: 0.8rem;
}

.download-disclaimer {
	color: rgba(255, 255, 255, 0.65);
	font-size: 1rem;
	font-style: italic;
	line-height: 1.5;
	border-left: 2px solid rgba(220, 20, 60, 0.4);
	padding-left: 1rem;
	margin-bottom: 1.6rem;
}

.download-buttons {
	display: flex;
	gap: 1rem;
}

.download-btn {
	display: block;
	text-align: center;
	text-decoration: none;
	flex: 1;
	box-sizing: border-box;
}

.download-btn-count {
	opacity: 0.85;
	font-weight: 400;
}

/* ---- CSV QC Flag Legend ---- */

.csv-legend-card {
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 12px;
	padding: 1.6rem 2.4rem;
	margin-bottom: 2rem;
}

.csv-legend-heading {
	color: rgba(255, 255, 255, 0.85);
	font-size: 1.2rem;
	font-weight: 600;
	letter-spacing: 0.08rem;
	text-transform: uppercase;
	margin: 0 0 0.8rem 0;
}

.csv-legend-list {
	list-style: none;
	margin: 0;
	padding: 0;
	color: rgba(255, 255, 255, 0.7);
	font-size: 1.1rem;
	line-height: 1.5;
}

.csv-legend-list li {
	padding: 0.3rem 0;
}

.csv-legend-list code {
	color: crimson;
	font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
	font-size: 1rem;
	background: rgba(220, 20, 60, 0.08);
	padding: 0.1rem 0.4rem;
	border-radius: 4px;
}

.csv-legend-note {
	color: rgba(255, 255, 255, 0.55);
	font-size: 1rem;
	font-style: italic;
	margin: 0.8rem 0 0 0;
}

.last-completed {
	color: rgba(255, 255, 255, 0.5);
	font-size: 1.1rem;
	margin-bottom: 1.2rem;
}

/* ---- Personal Results Card ---- */

.personal-results-card {
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 12px;
	padding: 2rem 2.4rem;
}

.personal-results-heading {
	color: rgba(255, 255, 255, 0.8);
	font-size: 1.4rem;
	font-weight: 600;
	letter-spacing: 0.08rem;
	margin-bottom: 1.6rem;
}

.loading-text,
.no-results-text {
	color: rgba(255, 255, 255, 0.65);
	font-size: 1.2rem;
}

/* ---- Results Table ---- */

.results-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 1.3rem;
}

.results-table thead tr {
	border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.results-table th {
	color: rgba(255, 255, 255, 0.75);
	font-weight: 600;
	font-size: 1.1rem;
	letter-spacing: 0.08rem;
	text-transform: uppercase;
	padding: 0.6rem 0;
	text-align: left;
}

.results-table th:last-child,
.results-table td:last-child {
	text-align: right;
}

.results-table th:nth-child(2),
.results-table td:nth-child(2) {
	text-align: center;
}

.results-table tbody tr {
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.results-table td {
	color: rgba(255, 255, 255, 0.85);
	padding: 0.8rem 0;
}

.results-table td:last-child {
	color: crimson;
	font-weight: 600;
}

/* ---- Dashboard Form Elements ---- */

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

.form-group label {
	display: block;
	color: rgba(255, 255, 255, 0.8);
	font-size: 1.2rem;
	font-weight: 500;
	margin-bottom: 0.5rem;
}

.form-group input,
.form-group select {
	width: 100%;
	padding: 1rem 1.2rem;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 8px;
	color: #fff;
	font-family: inherit;
	font-size: 1.3rem;
	outline: none;
}

.form-group input::placeholder {
	color: rgba(255, 255, 255, 0.3);
}

.form-group input:focus,
.form-group select:focus {
	border-color: crimson;
	box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.15);
}

.form-group select option {
	background: #1a1a2e;
	color: #fff;
}

.form-row {
	display: flex;
	gap: 1.2rem;
}

.form-group.half {
	flex: 1;
}

.form-error {
	color: #ff6b6b;
	font-size: 1.2rem;
	min-height: 1.8rem;
	margin-bottom: 1rem;
}

/* ---- Contact Section ---- */

.contact-section {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 2rem 4rem;
}

.contact-card {
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 12px;
	padding: 2.4rem 3rem;
}

.contact-heading {
	color: #fff;
	font-size: 1.6rem;
	font-weight: 600;
	margin: 0 0 1.2rem;
}

.contact-text {
	color: rgba(255, 255, 255, 0.7);
	font-size: 1.2rem;
	line-height: 1.7;
	margin-bottom: 1rem;
}

.contact-email {
	color: rgba(255, 255, 255, 0.8);
	font-size: 1.3rem;
	margin-top: 1.2rem;
}

.contact-email a {
	color: crimson;
	text-decoration: none;
}

.contact-email a:hover {
	text-decoration: underline;
}

/* ---- Account Section ---- */

.account-section {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 2rem 2rem;
}

.account-card {
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: 12px;
	padding: 1.6rem 1.8rem;
	margin-top: 1.5rem;
}

.account-card .personal-results-heading {
	margin-top: 0;
}

.account-text {
	color: rgba(255, 255, 255, 0.6);
	font-size: 1rem;
	line-height: 1.5;
	margin: 0 0 1rem;
}

.btn-danger {
	background: rgba(220, 20, 60, 0.15);
	border: 1px solid rgba(220, 20, 60, 0.4);
	color: #ff6b6b;
	padding: 0.6rem 1.4rem;
	border-radius: 8px;
	cursor: pointer;
	font-size: 1.1rem;
	font-weight: 500;
	white-space: nowrap;
	transition: background 0.2s;
}

.btn-danger:hover {
	background: rgba(220, 20, 60, 0.3);
}

.account-actions {
	display: flex;
	gap: 0.8rem;
	flex-wrap: wrap;
	align-items: center;
}

.account-actions .btn-secondary {
	text-decoration: none;
	padding: 0.6rem 1.4rem;
	font-size: 1.1rem;
	white-space: nowrap;
}

/* Re-consent modal (forced on outdated consent_version) */
.reconsent-modal {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.7);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10000;
	padding: 20px;
}
.reconsent-modal-inner {
	background: rgb(31, 30, 30);
	color: white;
	border: 1px solid rgba(220, 20, 60, 0.4);
	border-radius: 12px;
	padding: 2rem;
	max-width: 600px;
	width: 100%;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.reconsent-modal-inner h2 {
	margin-top: 0;
	color: crimson;
	font-size: 1.4rem;
}
.reconsent-modal-inner p {
	color: rgba(255, 255, 255, 0.85);
	margin-bottom: 1.2rem;
	line-height: 1.5;
}
.reconsent-modal-inner a {
	color: crimson;
	text-decoration: underline;
}
.reconsent-line {
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
	margin-bottom: 1rem;
	font-size: 0.95rem;
	line-height: 1.4;
}
.reconsent-line input[type="checkbox"] {
	margin-top: 0.3rem;
	flex-shrink: 0;
}
.reconsent-modal-inner .form-error {
	color: #ff6b6b;
	min-height: 1.5rem;
	margin-bottom: 0.5rem;
}
.reconsent-modal-inner .btn-primary,
.reconsent-modal-inner .btn-secondary {
	margin-right: 0.6rem;
	margin-top: 0.4rem;
}

/* ---- Utility ---- */

.hidden {
	display: none !important;
}

/* ---- Responsive ---- */

@media (max-width: 900px) {
	.dashboard-container {
		grid-template-columns: 1fr;
	}

	.dashboard-left {
		order: 1;
	}

	.dashboard-right {
		order: 2;
	}
}

@media (max-width: 600px) {
	.dashboard-section {
		padding: 8rem 1.5rem 4rem;
	}

	.test-card-header {
		flex-direction: column;
		align-items: flex-start;
	}

	.stats-count {
		font-size: 3rem;
	}

	.completion-banner-inner {
		padding: 0.8rem 1.2rem;
	}
}
