﻿@font-face {
	font-family: MainframeBB;
	src: url('../fonts/MAINBRG_.TTF');
}

@font-face {
	font-family: NewFontMT;
	src: url('../fonts/hirace personal use only.ttf') format('truetype');
}

:root {
	--main-border-color: rgba(100, 149, 237, 1);
	--main-text-color: rgba(5, 80, 220, 0.9);
	--nav-border-color: rgba(100, 149, 237, 1);
	--nav-text-color: rgba(0, 0, 139, 1);
	--nav-bg-color: rgba(173, 216, 230, 0.7);
	--hover-bg-color: rgba(173, 216, 230, 1);
	--hover-text-color: rgba(0, 0, 0, 0.85);
	--panel-bg: rgba(0, 0, 0, 0.55);
	--panel-light: rgba(255, 255, 255, 0.10);
	--panel-border: rgba(255, 255, 255, 0.18);
	--form-bg: #e6f2ff;
	--form-border: #4a90e2;
	--text-light: #ffffff;
	--text-muted: #d6d6d6;
	--danger-bg: #f08080;
	--danger-border: #c62828;
}

html, body {
	height: 100%;
	margin: 0;
	padding: 0;
	background: url('../images/background_1.jpg') no-repeat center center fixed;
	background-size: cover;
	background-color: black;
}

body {
	display: grid;
	grid-template-columns: 260px minmax(0, 1fr);
	grid-template-rows: auto 1fr auto;
	gap: 12px;
	padding: 12px;
	min-height: 100vh;
}

/* ===== Header ===== */

.site-header {
	grid-column: 1 / -1;
}

.site-banner {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
	min-height: 70px;
	padding: 12px 18px;
	background-color: rgba(150, 220, 230, 0.4);
	box-sizing: border-box;
}

.site-title {
	display: inline-block;
	font-size: clamp(28px, 4vw, 50px);
	font-family: NewFontMT, sans-serif;
	color: black;
	text-shadow: 4px 2px 3px white, -1px -1px 2px white, 1px -1px 2px white, -1px 1px 2px white;
}

.header-auth {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.auth-text {
	color: white;
	font-family: MainframeBB, sans-serif;
	text-shadow: 1px 1px 3px black;
}

.auth-form {
	margin: 0;
}

.site-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 100px;
	padding: 8px 14px;
	border-radius: 8px;
	text-decoration: none;
	font-family: MainframeBB, sans-serif;
	font-size: 0.95rem;
	transition: all 0.2s ease;
	cursor: pointer;
	border: 1px solid var(--main-border-color);
}

.site-button-solid {
	background-color: lightblue;
	color: black;
}

	.site-button-solid:hover {
		background-color: white;
		color: black;
		border-color: white;
	}

.site-button-outline {
	background-color: rgba(255, 255, 255, 0.08);
	color: white;
	border-color: white;
}

	.site-button-outline:hover {
		background-color: white;
		color: black;
	}

/* ===== Main content ===== */

.page-shell {
	grid-column: 2 / 3;
	grid-row: 2 / 3;
	min-width: 0;
}

.page-content {
	width: 100%;
	color: var(--main-text-color);
	font-family: MainframeBB, sans-serif;
	padding-bottom: 110px;
}

/* ===== Footer ===== */

.site-footer {
	grid-column: 1 / -1;
	position: fixed;
	bottom: 0;
	left: 0;
	width: 100%;
	color: rgba(190, 190, 190, 0.9);
	font-family: sans-serif;
	background-color: rgba(0, 0, 0, 0.75);
	padding: 8px 16px;
	z-index: 100;
	box-sizing: border-box;
}

.site-footer-inner {
	max-width: 1400px;
	margin: 0 auto;
	display: flex;
	justify-content: space-between;
	gap: 20px;
	align-items: center;
	flex-wrap: wrap;
}

/* ===== Utility ===== */

.hidden {
	display: none;
}

.clickable {
	cursor: pointer;
}

.text-danger {
	color: #ffb3b3 !important;
}

/* ===== Page headings ===== */

.page-title,
.results-title,
.edit-header {
	color: black;
	text-shadow: 4px 2px 3px white, -1px -1px 2px white, 1px -1px 2px white, -1px 1px 2px white;
}

.results-title {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
	padding: 10px 0;
	margin-bottom: 10px;
}

.edit-header {
	font-size: 2.3rem;
	text-align: center;
	margin-bottom: 10px;
}

.season-payout {
	color: white;
	font-size: 1.05rem;
	font-weight: 500;
	text-shadow: 1px 1px 3px black;
}

.enter-result {
	display: inline-block;
	margin: 0 0 14px 0;
	color: lightblue;
	font-size: 1.05rem;
	font-weight: 500;
	text-decoration: none;
	text-shadow: 1px 1px 3px black;
}

	.enter-result:hover {
		color: white;
	}

/* ===== Home / message pages ===== */

.home-hero {
	width: 100%;
}

.message-panel {
	max-width: 900px;
	margin: 0 auto;
}

.message-card {
	background-color: rgba(0, 0, 0, 0.5);
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 12px;
	padding: 24px;
	color: white;
	text-align: center;
	font-size: 1.05rem;
	line-height: 1.7;
}

.photo-container {
	display: flex;
	justify-content: center;
	margin-top: 20px;
}

.responsive-photo {
	width: min(100%, 1000px);
	height: auto;
	border-radius: 10px;
	border: 2px solid rgba(255, 255, 255, 0.2);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

/* ===== Identity pages ===== */

.identity-subtitle {
	color: white;
	text-align: center;
	margin-bottom: 20px;
	font-size: 1.2rem;
	text-shadow: 1px 1px 3px black;
}

.identity-links {
	margin-top: 18px;
	text-align: center;
}

	.identity-links p {
		margin-bottom: 8px;
	}

	.identity-links a {
		color: #7ec8ff;
		text-decoration: none;
	}

		.identity-links a:hover {
			text-decoration: underline;
			color: white;
		}

.identity-divider {
	border-color: rgba(255, 255, 255, 0.2);
	margin: 24px 0;
}

.identity-checkbox-row {
	display: flex;
	justify-content: center;
	margin: 12px 0 18px 0;
}

.identity-checkbox-label {
	color: white;
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: normal;
}

/* ===== Race/results cards ===== */

.race-entry {
	border: 2px solid rgba(255,255,255,0.3);
	padding: 12px;
	margin-bottom: 18px;
	border-radius: 10px;
	background-color: rgba(255, 255, 255, 0.05);
}

.track-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	font-weight: bold;
	font-size: 1.2rem;
	padding: 10px 12px;
	background-color: rgba(0, 0, 0, 0.6);
	border-radius: 10px;
	border: 1px solid white;
	color: white;
	cursor: pointer;
}

	.track-header:hover {
		background-color: rgba(255, 255, 255, 0.16);
	}

.track-name {
	flex-shrink: 0;
}

.race-date {
	opacity: 0.9;
	font-size: 1rem;
}

.win-badge {
	background-color: #00c853;
	color: white;
	font-size: 0.9rem;
	padding: 2px 8px;
	border-radius: 4px;
	font-weight: 600;
}

.report-content {
	margin-top: 12px;
	color: white;
}

.results-container {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.result-card {
	flex: 1 1 150px;
	min-width: 140px;
	background-color: rgba(255, 255, 255, 0.1);
	border: 1px solid var(--main-border-color);
	border-radius: 12px;
	padding: 12px 16px;
	color: white;
	text-align: center;
	box-shadow: 2px 2px 6px rgba(0,0,0,0.35);
}

	.result-card .label {
		display: block;
		margin-bottom: 4px;
		font-size: 0.85rem;
		font-weight: bold;
		text-transform: uppercase;
		color: #ddd;
	}

	.result-card .value {
		font-size: 1.15rem;
	}

/* ===== Report formatting ===== */

.byline {
	font-style: italic;
	color: #bbb;
	font-size: 0.95rem;
	margin-bottom: 8px;
}

.report-body {
	background-color: rgba(0, 0, 0, 0.6);
	line-height: 1.8;
	font-family: Calibri, sans-serif;
	font-size: 1.1rem;
	padding: 12px;
	border-radius: 10px;
	border: 1px solid var(--main-border-color);
	color: white;
}

.report-body-text {
	white-space: pre-line;
}

/* ===== Form layout ===== */

.page-form-wrapper {
	max-width: 820px;
	margin: 0 auto;
}

.page-form {
	background-color: rgba(0, 0, 0, 0.45);
	border: 1px solid rgba(255,255,255,0.18);
	border-radius: 12px;
	padding: 20px;
}

.form-row-custom {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: 16px;
}

	.form-row-custom label {
		width: 160px;
		margin: 0;
		font-weight: bold;
		color: deepskyblue;
		text-align: right;
		flex-shrink: 0;
	}

.form-field {
	flex: 1;
}

.form-control,
.edit-input,
textarea.form-control,
input.form-control {
	background-color: var(--form-bg);
	border: 1px solid var(--form-border);
	color: black;
	border-radius: 8px;
	box-sizing: border-box;
	font-family: Calibri, sans-serif;
	font-size: 1.05rem;
	text-align: left;
}

	.form-control:focus,
	.edit-input:focus {
		border-color: #007bff;
		box-shadow: 0 0 5px rgba(0,123,255,0.45);
	}

textarea.form-control {
	min-height: 180px;
	resize: vertical;
}

.form-actions {
	display: flex;
	justify-content: center;
	gap: 12px;
	margin-top: 20px;
	flex-wrap: wrap;
}

.back-link {
	margin-top: 20px;
	text-align: center;
}

	.back-link a {
		color: #7ec8ff;
		text-decoration: none;
	}

		.back-link a:hover {
			text-decoration: underline;
		}

/* ===== Edit/Delete buttons ===== */

.action-buttons {
	margin-top: 14px;
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.edit-btn,
.delete-btn {
	display: inline-block;
	padding: 10px 16px;
	text-decoration: none;
	border-radius: 8px;
	text-align: center;
	font-family: MainframeBB, sans-serif;
}

.edit-btn {
	background-color: #007bff;
	color: white;
}

	.edit-btn:hover {
		background-color: lightblue;
		color: black;
	}

.delete-btn {
	background-color: lightblue;
	color: black;
	border: 1px solid blue;
}

	.delete-btn:hover {
		background-color: lightcoral;
		color: black;
		border-color: white;
	}

/* ===== Delete confirmation ===== */

.delete-confirmation-container {
	width: min(700px, 100%);
	margin: 20px auto 16px auto;
	padding: 12px 16px;
	border: 3px solid var(--danger-border);
	border-radius: 10px;
	background-color: var(--danger-bg);
	color: black;
	text-align: center;
}

/* ===== Products ===== */

.products-section {
	display: flex;
	justify-content: center;
	width: 100%;
}

.products-container {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	justify-content: center;
	width: 100%;
	max-width: 1100px;
}

.product-card {
	width: 260px;
	border: 1px solid #ccc;
	border-radius: 12px;
	overflow: hidden;
	background: rgba(20, 20, 20, 0.92);
	color: white;
	padding: 14px;
	text-align: center;
	box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.35);
}

.product-image {
	display: flex;
	justify-content: center;
	align-items: center;
	height: 130px;
	margin-bottom: 12px;
}

	.product-image img {
		width: 110px;
		height: 110px;
		object-fit: contain;
		cursor: pointer;
		border-radius: 6px;
		background-color: #2b2b2b;
		padding: 4px;
		transition: transform 0.2s ease;
	}

		.product-image img:hover {
			transform: scale(1.05);
		}

.no-image {
	width: 110px;
	height: 110px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #444;
	border-radius: 6px;
	color: #ddd;
	font-size: 0.95rem;
}

.product-info h3 {
	margin: 10px 0 6px 0;
	font-size: 1.2rem;
}

.part-number {
	font-size: 0.9rem;
	color: #aaa;
	margin-bottom: 8px;
}

.description {
	font-size: 0.95rem;
	margin: 10px 0;
	color: #f0f0f0;
	min-height: 48px;
}

.price {
	font-size: 1.2rem;
	font-weight: bold;
	color: #4CAF50;
	margin-bottom: 0;
}

.product-actions {
	margin-top: 14px;
	display: flex;
	justify-content: center;
	gap: 10px;
	flex-wrap: wrap;
}

.product-preview-image {
	max-width: 160px;
	max-height: 160px;
	object-fit: contain;
	border: 1px solid #ccc;
	padding: 4px;
	background-color: #fff;
	border-radius: 6px;
}

.form-row-custom small {
	display: block;
	margin-top: 6px;
	color: #d6d6d6;
}

/* ===== Product image modal ===== */

.product-modal-dialog {
	max-width: min(90vw, 900px);
}

.product-modal-body {
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 16px;
	overflow: hidden;
}

#modalProductImage {
	display: block;
	max-width: 100%;
	max-height: 75vh;
	width: auto;
	height: auto;
	object-fit: contain;
	cursor: pointer;
	border-radius: 6px;
}

/* ===== Checkout ===== */

.checkout-summary {
	overflow-x: auto;
	margin-top: 10px;
}

.checkout-table {
	width: 100%;
	border-collapse: collapse;
	color: white;
	background-color: rgba(0, 0, 0, 0.35);
	border-radius: 8px;
	overflow: hidden;
}

	.checkout-table th,
	.checkout-table td {
		border: 1px solid rgba(255, 255, 255, 0.18);
		padding: 10px 12px;
		text-align: left;
	}

	.checkout-table th {
		background-color: rgba(255, 255, 255, 0.08);
	}

	.checkout-table tfoot td {
		font-weight: bold;
	}

/* ===== Images gallery ===== */

.images-section {
	display: flex;
	justify-content: center;
	width: 100%;
}

.images-gallery {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	justify-content: center;
	width: 100%;
	max-width: 1100px;
}

.image-card {
	width: 200px;
	text-align: center;
}

.gallery-image-thumb {
	width: 100%;
	height: 150px;
	object-fit: cover;
	cursor: pointer;
	border-radius: 8px;
	border: 1px solid rgba(255,255,255,0.2);
	background-color: rgba(0,0,0,0.35);
	box-shadow: 2px 2px 8px rgba(0,0,0,0.3);
	transition: transform 0.2s ease;
}

	.gallery-image-thumb:hover {
		transform: scale(1.03);
	}

.image-card-actions {
	margin-top: 10px;
	display: flex;
	justify-content: center;
}

/* ===== Images ===== */

#modalImage {
	display: block;
	max-width: 100%;
	max-height: 75vh;
	width: auto;
	height: auto;
	object-fit: contain;
	cursor: pointer;
	border-radius: 6px;
}

.drop-zone {
	border: 2px dashed var(--main-border-color);
	padding: 30px;
	text-align: center;
	color: var(--main-text-color);
	cursor: pointer;
	margin-bottom: 20px;
}

	.drop-zone.hover {
		background-color: rgba(173, 216, 230, 0.3);
	}

#addPicturesBtn {
	position: fixed;
	bottom: 20px;
	right: 20px;
	z-index: 999;
	padding: 10px 20px;
	font-size: 16px;
}

/* ===== Responsive ===== */

@media (max-width: 1024px) {
	body {
		grid-template-columns: 1fr;
		grid-template-rows: auto auto 1fr auto;
		padding: 10px;
	}

	.site-header,
	nav,
	.page-shell,
	.site-footer {
		grid-column: 1 / -1 !important;
	}

	.page-shell {
		grid-row: 3 / 4;
	}

	.site-footer {
		position: relative;
		left: auto;
		bottom: auto;
		width: 100%;
	}
}

@media (max-width: 768px) {
	html, body {
		background-attachment: scroll;
	}

	body {
		gap: 10px;
		padding: 8px;
	}

	.site-banner {
		flex-direction: column;
		align-items: center;
		text-align: center;
		padding: 12px;
	}

	.site-title {
		font-size: clamp(22px, 7vw, 36px);
		line-height: 1.1;
	}

	.header-auth {
		justify-content: center;
		width: 100%;
	}

	.auth-text {
		width: 100%;
		text-align: center;
	}

	.page-content {
		padding-bottom: 20px;
	}

	.results-title {
		flex-direction: column;
		align-items: center;
		text-align: center;
	}

	.track-header {
		flex-direction: column;
		align-items: flex-start;
	}

	.form-row-custom {
		flex-direction: column;
		align-items: stretch;
		gap: 8px;
	}

		.form-row-custom label {
			width: 100%;
			text-align: left;
		}

	.result-card {
		min-width: 100%;
	}

	.product-card {
		width: 100%;
		max-width: 340px;
	}

	.image-card {
		width: 100%;
		max-width: 240px;
	}

	.site-footer-inner {
		flex-direction: column;
		text-align: center;
		gap: 8px;
	}

	.edit-header {
		font-size: 1.9rem;
	}

	.message-card,
	.page-form {
		padding: 16px;
	}
}

@media (max-width: 480px) {
	body {
		padding: 6px;
	}

	.site-title {
		font-size: clamp(18px, 8vw, 28px);
	}

	.site-button {
		width: 100%;
		max-width: 240px;
	}

	.header-auth {
		flex-direction: column;
		gap: 8px;
	}

	.results-title,
	.edit-header {
		text-align: center;
	}

	.track-header {
		font-size: 1rem;
		padding: 10px;
	}

	.race-entry {
		padding: 10px;
	}

	.result-card {
		padding: 10px 12px;
	}

	.checkout-table th,
	.checkout-table td {
		padding: 8px;
		font-size: 0.9rem;
	}

	.product-card {
		max-width: 100%;
	}

	.image-card {
		max-width: 100%;
	}
}