/* style.css — CSS tokens, layouts, and animations for Chummer Reborn Submissions Server */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
	--bg-0: #0a0b0e;
	--bg-1: #0c0d10;
	--panel: #101218;
	--panel-2: #0d0f14;
	--titlebar-a: #15161b;
	--titlebar-b: #101116;
	--border: #1d2029;
	--border-soft: #1b1d24;
	--border-2: #24262f;
	--row-line: #181b22;
	--accent: #ff3d7f;
	--accent-hover: #ff6097;
	--accent-weak: rgba(255, 61, 127, 0.12);
	--cyan: #2fe0d6;
	--cyan-hover: #5ef0e6;
	--cyan-weak: rgba(47, 224, 214, 0.12);
	--amber: #ffb454;
	--green: #5fe0a8;
	--danger: #ff6b6b;
	--t-hi: #f1f2f6;
	--t-1: #e8e9ee;
	--t-2: #b9bcc6;
	--t-3: #9b9da8;
	--t-4: #83868f;
	--t-5: #6a6d77;
	--t-6: #5a5d67;
	
	--mono: 'JetBrains Mono', ui-monospace, monospace;
	--sans: 'Sora', system-ui, sans-serif;
	
	--r-sm: 8px;
	--r-md: 12px;
	--r-lg: 18px;
	
	--glow-pink: 0 0 15px rgba(255, 61, 127, 0.35);
	--glow-cyan: 0 0 15px rgba(47, 224, 214, 0.3);
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

body {
	background-color: var(--bg-1);
	color: var(--t-1);
	font-family: var(--sans);
	font-size: 13px;
	line-height: 1.5;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	overflow-x: hidden;
}

.mono {
	font-family: var(--mono);
}

a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

/* Header & Titlebar */
.titlebar {
	height: 48px;
	flex: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 20px;
	background: linear-gradient(180deg, var(--titlebar-a), var(--titlebar-b));
	border-bottom: 1px solid var(--border);
	position: sticky;
	top: 0;
	z-index: 100;
}

.brand-section {
	display: flex;
	align-items: center;
	gap: 12px;
}

.brand-badge {
	width: 26px;
	height: 26px;
	border-radius: 8px;
	background: linear-gradient(135deg, var(--accent), #b8235a);
	display: flex;
	align-items: center;
	justify-content: center;
	font: 700 13px var(--mono);
	color: #fff;
	box-shadow: var(--glow-pink);
}

.brand-name {
	font: 600 13px var(--sans);
	letter-spacing: 0.14em;
	display: flex;
	align-items: center;
}

.brand-accent {
	color: var(--accent);
	margin-right: 4px;
}

.brand-sub {
	color: var(--t-3);
	font-weight: 500;
}

.brand-portal {
	color: var(--cyan);
	font-size: 11px;
	font-family: var(--mono);
	background: var(--cyan-weak);
	padding: 2px 6px;
	border-radius: 4px;
	margin-left: 8px;
	letter-spacing: 0.05em;
}

.nav-links {
	display: flex;
	align-items: center;
	gap: 20px;
}

.nav-link {
	color: var(--t-3);
	font-weight: 500;
	font-size: 12px;
	letter-spacing: 0.05em;
}

.nav-link:hover, .nav-link.active {
	color: var(--t-hi);
}

.nav-link.active {
	border-bottom: 2px solid var(--accent);
	padding-bottom: 2px;
}

/* Page Containers */
.container {
	max-width: 960px;
	width: 100%;
	margin: 0 auto;
	padding: 40px 20px;
	flex: 1;
	display: flex;
	flex-direction: column;
}

.page-title {
	font-size: 24px;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: var(--t-hi);
	margin-bottom: 8px;
}

.page-lede {
	font-size: 14px;
	color: var(--t-3);
	margin-bottom: 30px;
	max-width: 680px;
}

/* Forms and Inputs */
.panel {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: var(--r-md);
	padding: 24px;
	margin-bottom: 24px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.section-title {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.12em;
	color: var(--t-4);
	text-transform: uppercase;
	margin-bottom: 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.section-divider {
	height: 1px;
	background: var(--border-soft);
	margin: 20px 0;
}

/* Drag and Drop Zone */
.upload-zone {
	border: 2px dashed var(--border-2);
	border-radius: var(--r-md);
	padding: 40px 20px;
	text-align: center;
	cursor: pointer;
	transition: all 0.25s ease;
	background: var(--panel-2);
	position: relative;
	overflow: hidden;
}

.upload-zone.dragover {
	border-color: var(--cyan);
	background: var(--cyan-weak);
	box-shadow: var(--glow-cyan);
}

.upload-zone:hover:not(.dragover) {
	border-color: var(--accent);
	background: rgba(255, 61, 127, 0.02);
}

.upload-icon {
	font-size: 32px;
	color: var(--t-4);
	margin-bottom: 12px;
	transition: transform 0.2s ease;
}

.upload-zone:hover .upload-icon {
	transform: translateY(-4px);
	color: var(--accent);
}

.upload-zone.dragover .upload-icon {
	color: var(--cyan);
	transform: scale(1.1);
}

.upload-text {
	font-size: 15px;
	font-weight: 600;
	color: var(--t-hi);
	margin-bottom: 6px;
}

.upload-subtext {
	font-size: 11px;
	color: var(--t-4);
}

.file-input {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
}

/* File List styling */
.file-list {
	margin-top: 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.file-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 14px;
	background: var(--panel-2);
	border: 1px solid var(--border-soft);
	border-radius: var(--r-sm);
	font-family: var(--mono);
	font-size: 12px;
	animation: slideIn 0.2s ease;
}

@keyframes slideIn {
	from { opacity: 0; transform: translateY(5px); }
	to { opacity: 1; transform: translateY(0); }
}

.file-info {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

.file-name {
	color: var(--t-2);
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.file-size {
	color: var(--t-5);
	flex-shrink: 0;
}

.file-type-badge {
	font-size: 9px;
	font-weight: 700;
	padding: 2px 6px;
	border-radius: 4px;
	text-transform: uppercase;
}

.file-type-badge.chum5 {
	background: rgba(255, 61, 127, 0.15);
	color: var(--accent);
	border: 1px solid rgba(255, 61, 127, 0.3);
}

.file-type-badge.settings {
	background: rgba(47, 224, 214, 0.15);
	color: var(--cyan);
	border: 1px solid rgba(47, 224, 214, 0.3);
}

.remove-file-btn {
	background: transparent;
	border: none;
	color: var(--t-5);
	font-size: 14px;
	cursor: pointer;
	padding: 4px;
	border-radius: 4px;
	line-height: 1;
	transition: all 0.2s ease;
}

.remove-file-btn:hover {
	color: var(--danger);
	background: rgba(255, 107, 107, 0.1);
}

/* Form Settings Layout */
.form-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
	margin-top: 16px;
}

@media(min-width: 768px) {
	.form-grid {
		grid-template-columns: 1fr 1fr;
	}
}

.form-group {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.form-label {
	font-size: 12px;
	font-weight: 600;
	color: var(--t-2);
}

.profile-option {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 16px;
	background: var(--panel-2);
	border: 1px solid var(--border-soft);
	border-radius: var(--r-sm);
	transition: border-color 0.2s ease;
}

.profile-option:has(input[type="radio"]:checked) {
	border-color: var(--cyan-weak);
}

.radio-label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
	color: var(--t-hi);
	cursor: pointer;
}

.select-control {
	width: 100%;
	background: var(--bg-0);
	border: 1px solid var(--border);
	color: var(--t-2);
	padding: 8px 12px;
	border-radius: var(--r-sm);
	font-family: var(--sans);
	font-size: 13px;
	outline: none;
	transition: border-color 0.2s ease;
}

.select-control:focus {
	border-color: var(--cyan);
}

.custom-file-wrapper {
	position: relative;
	border: 1px dashed var(--border);
	border-radius: var(--r-sm);
	padding: 10px 14px;
	background: var(--bg-0);
	text-align: center;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 38px;
}

.custom-file-wrapper span {
	color: var(--t-4);
	font-family: var(--mono);
	font-size: 11px;
}

.custom-file-input {
	position: absolute;
	inset: 0;
	opacity: 0;
	cursor: pointer;
}

/* Buttons */
.btn-row {
	display: flex;
	justify-content: flex-end;
	gap: 12px;
	margin-top: 10px;
}

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 20px;
	border-radius: var(--r-sm);
	font-family: var(--sans);
	font-weight: 600;
	font-size: 13px;
	cursor: pointer;
	transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
	border: 1px solid var(--border-2);
	background: var(--panel-2);
	color: var(--t-2);
}

.btn:hover {
	color: var(--t-hi);
	border-color: var(--t-4);
}

.btn-primary {
	background: var(--accent);
	color: #fff;
	border: none;
	box-shadow: var(--glow-pink);
}

.btn-primary:hover {
	background: var(--accent-hover);
	color: #fff;
	transform: translateY(-1px);
	box-shadow: 0 0 20px rgba(255, 61, 127, 0.5);
}

.btn-primary:active {
	transform: translateY(0);
}

.btn-secondary {
	background: transparent;
	color: var(--cyan);
	border: 1px solid rgba(47, 224, 214, 0.4);
}

.btn-secondary:hover {
	background: var(--cyan-weak);
	color: var(--cyan-hover);
	border-color: var(--cyan);
}

.btn-danger {
	background: transparent;
	border: 1px solid rgba(255, 107, 107, 0.4);
	color: var(--danger);
}

.btn-danger:hover {
	background: rgba(255, 107, 107, 0.1);
	color: #fff;
	border-color: var(--danger);
}

/* Tables / Submissions History */
.table-wrapper {
	overflow-x: auto;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: var(--r-md);
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.table {
	width: 100%;
	border-collapse: collapse;
	text-align: left;
}

.table th {
	padding: 14px 18px;
	background: var(--bg-0);
	border-bottom: 1px solid var(--border);
	color: var(--t-4);
	font-weight: 700;
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.table td {
	padding: 14px 18px;
	border-bottom: 1px solid var(--border-soft);
	color: var(--t-2);
	vertical-align: middle;
}

.table tr:last-child td {
	border-bottom: none;
}

.table tr:hover td {
	background: rgba(255, 255, 255, 0.01);
}

.sub-id {
	font-family: var(--mono);
	font-weight: 600;
	color: var(--cyan);
}

.sub-time {
	font-size: 12px;
	color: var(--t-4);
}

.sub-count {
	font-family: var(--mono);
	font-weight: bold;
	color: var(--t-hi);
}

.sub-profile {
	font-family: var(--mono);
	font-size: 11.5px;
	padding: 2px 6px;
	background: var(--bg-0);
	border: 1px solid var(--border);
	border-radius: 4px;
	color: var(--t-3);
	display: inline-block;
}

.sub-chars {
	max-width: 300px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	font-size: 12px;
}

.table-actions {
	display: flex;
	gap: 8px;
	justify-content: flex-end;
}

.action-btn {
	background: transparent;
	border: 1px solid var(--border-2);
	color: var(--t-3);
	width: 28px;
	height: 28px;
	border-radius: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.2s ease;
}

.action-btn:hover {
	color: var(--t-hi);
	border-color: var(--t-3);
}

.action-btn.view:hover {
	color: var(--cyan);
	border-color: var(--cyan);
	background: var(--cyan-weak);
}

.action-btn.zip:hover {
	color: var(--green);
	border-color: var(--green);
	background: rgba(95, 224, 168, 0.1);
}

.action-btn.del:hover {
	color: var(--danger);
	border-color: var(--danger);
	background: rgba(255, 107, 107, 0.15);
}

/* Empty State */
.empty-state {
	text-align: center;
	padding: 60px 20px;
	color: var(--t-4);
	border: 1px dashed var(--border);
	border-radius: var(--r-md);
	background: var(--panel-2);
}

.empty-icon {
	font-size: 32px;
	margin-bottom: 12px;
	opacity: 0.5;
}

.empty-text {
	font-size: 14px;
	margin-bottom: 16px;
}

/* Grid Layout for Characters in Detail view */
.char-cards-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
	margin-top: 24px;
}

@media(min-width: 900px) {
	.char-cards-grid {
		grid-template-columns: 1fr 1fr;
	}
}

.char-card {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: var(--r-md);
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 16px;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
	position: relative;
	overflow: hidden;
}

.char-card::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 4px;
	height: 100%;
	background: var(--accent);
}

.char-card.magician::before {
	background: var(--cyan);
}

.char-card.adept::before {
	background: var(--amber);
}

.char-card-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
}

.char-avatar {
	width: 42px;
	height: 42px;
	border-radius: 10px;
	background: linear-gradient(135deg, #24262f, var(--bg-0));
	border: 1px solid var(--border-2);
	color: var(--t-hi);
	font-size: 18px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	text-transform: uppercase;
}

.char-card.magician .char-avatar {
	border-color: rgba(47, 224, 214, 0.3);
}

.char-card.adept .char-avatar {
	border-color: rgba(255, 180, 84, 0.3);
}

.char-title-block {
	flex: 1;
	min-width: 0;
}

.char-name {
	font-size: 16px;
	font-weight: 700;
	color: var(--t-hi);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	margin-bottom: 2px;
}

.char-subtitle {
	font-family: var(--mono);
	font-size: 11px;
	color: var(--t-4);
}

.char-essence-badge {
	font-family: var(--mono);
	font-size: 11px;
	font-weight: bold;
	padding: 4px 8px;
	border-radius: 6px;
	background: var(--bg-0);
	border: 1px solid var(--border);
	color: var(--accent);
}

.char-card.magician .char-essence-badge {
	color: var(--cyan);
}

/* Attributes Grid */
.attr-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 6px;
	background: var(--bg-0);
	padding: 8px;
	border-radius: var(--r-sm);
	border: 1px solid var(--border-soft);
}

.attr-cell {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 6px 0;
	background: var(--panel-2);
	border-radius: 4px;
	border: 1px solid var(--border-soft);
}

.attr-name {
	font-family: var(--mono);
	font-size: 9px;
	color: var(--t-5);
	font-weight: bold;
}

.attr-val {
	font-family: var(--mono);
	font-size: 13px;
	font-weight: 700;
	color: var(--t-hi);
	margin-top: 2px;
}

/* Details sections (Qualities, Ware, etc.) */
.char-details-section {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.detail-row {
	display: flex;
	gap: 8px;
	align-items: flex-start;
}

.detail-label {
	font-size: 11px;
	font-weight: 700;
	color: var(--t-4);
	width: 75px;
	flex-shrink: 0;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	padding-top: 2px;
}

.detail-content {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	flex: 1;
}

.detail-pill {
	font-size: 10.5px;
	padding: 2px 6px;
	background: var(--panel-2);
	border: 1px solid var(--border-soft);
	border-radius: 4px;
	color: var(--t-3);
}

.detail-pill.positive {
	color: var(--green);
	background: rgba(95, 224, 168, 0.06);
	border-color: rgba(95, 224, 168, 0.2);
}

.detail-pill.negative {
	color: var(--danger);
	background: rgba(255, 107, 107, 0.06);
	border-color: rgba(255, 107, 107, 0.2);
}

.detail-pill.ware {
	color: var(--cyan);
	background: var(--cyan-weak);
	border-color: rgba(47, 224, 214, 0.2);
}

.detail-pill.spell {
	color: var(--amber);
	background: rgba(255, 180, 84, 0.06);
	border-color: rgba(255, 180, 84, 0.2);
}

.detail-pill.vehicle {
	color: var(--t-2);
	background: rgba(255, 255, 255, 0.03);
}

/* Card Actions */
.card-actions {
	display: flex;
	justify-content: flex-end;
	margin-top: auto;
	border-top: 1px solid var(--border-soft);
	padding-top: 12px;
}

/* Toast Messages */
.toast {
	position: fixed;
	bottom: 24px;
	right: 24px;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: var(--r-sm);
	padding: 12px 20px;
	color: var(--t-hi);
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
	display: flex;
	align-items: center;
	gap: 12px;
	z-index: 1000;
	animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	border-left: 4px solid var(--green);
}

.toast.error {
	border-left-color: var(--danger);
}

@keyframes slideInRight {
	from { transform: translateX(100%); opacity: 0; }
	to { transform: translateX(0); opacity: 1; }
}

/* Footer info */
.footer-info {
	margin-top: auto;
	text-align: center;
	padding: 20px;
	color: var(--t-5);
	font-family: var(--mono);
	font-size: 10px;
	letter-spacing: 0.05em;
	border-top: 1px solid var(--border-soft);
}

/* Mobile responsiveness adjustments */
@media (max-width: 600px) {
	.titlebar {
		padding: 0 12px;
		gap: 12px;
	}
	.brand-sub {
		display: none; /* Hide "· REBORN" on small screens to save space */
	}
	.brand-portal {
		font-size: 9px;
		padding: 1px 4px;
		margin-left: 4px;
		letter-spacing: 0.02em;
	}
	.nav-links {
		gap: 12px;
	}
	.nav-link {
		font-size: 11px;
		letter-spacing: 0.02em;
	}
}

@media (max-width: 400px) {
	.brand-portal {
		display: none; /* Hide "SUBMISSIONS" badge entirely on very narrow screens */
	}
	.brand-name {
		font-size: 12px;
		letter-spacing: 0.08em;
	}
	.brand-badge {
		width: 22px;
		height: 22px;
		border-radius: 6px;
		font-size: 11px;
	}
	.nav-links {
		gap: 10px;
	}
}

