/* Underlight GM Tools — Dark theme (ported from PHP, extended for SPA) */

/* Reset and Base */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
	background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
	color: #e0e0e0;
	min-height: 100vh;
	padding: 0;
	line-height: 1.6;
}

/* Layout */
.container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 2rem 1rem;
}

/* Header / Nav Bar */
header {
	text-align: center;
	margin-bottom: 2rem;
	padding: 1.5rem 2rem;
	background: rgba(255, 255, 255, 0.05);
	border-radius: 16px;
	backdrop-filter: blur(10px);
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

header h1 {
	font-size: 2rem;
	font-weight: 700;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
	margin-bottom: 0.75rem;
}

/* Navigation */
nav {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	justify-content: center;
}

nav a {
	padding: 0.5rem 1rem;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.08);
	color: #c4b5fd;
	text-decoration: none;
	font-size: 0.9rem;
	font-weight: 500;
	transition: all 0.3s ease;
	border: 1px solid transparent;
}

nav a:hover,
nav a.active {
	background: rgba(167, 139, 250, 0.2);
	border-color: rgba(167, 139, 250, 0.4);
	color: #e0e0e0;
}

nav a.active {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
	border-color: transparent;
}

nav a.nav-logout {
	margin-left: auto;
	border-color: rgba(220, 38, 38, 0.3);
	color: #f87171;
}

nav a.nav-logout:hover {
	background: rgba(220, 38, 38, 0.2);
	border-color: rgba(220, 38, 38, 0.5);
}

/* Headings */
h2 {
	font-size: 1.5rem;
	font-weight: 600;
	margin-bottom: 1.5rem;
	color: #a78bfa;
	padding-bottom: 0.75rem;
	border-bottom: 2px solid rgba(167, 139, 250, 0.3);
}

h3 {
	font-size: 1.25rem;
	font-weight: 600;
	margin-bottom: 1rem;
	color: #c4b5fd;
}

/* Section Cards */
.section {
	background: rgba(255, 255, 255, 0.08);
	border-radius: 16px;
	padding: 2rem;
	margin-bottom: 2rem;
	backdrop-filter: blur(10px);
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Form Styles */
.form-row {
	display: grid;
	grid-template-columns: 180px 1fr auto;
	gap: 1rem;
	align-items: center;
	padding: 0.75rem 1rem;
	margin-bottom: 0.5rem;
	background: rgba(255, 255, 255, 0.05);
	border-radius: 8px;
	transition: background 0.3s ease;
}

.form-row:hover {
	background: rgba(255, 255, 255, 0.08);
}

.form-label {
	font-weight: 500;
	color: #c4b5fd;
	font-size: 0.95rem;
}

.form-inline {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	align-items: flex-end;
	margin-bottom: 1.5rem;
}

.form-group {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.form-group label {
	font-weight: 500;
	color: #c4b5fd;
	font-size: 0.85rem;
}

/* Input Fields */
input[type="text"],
input[type="number"],
textarea,
select {
	padding: 0.6rem 0.9rem;
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(167, 139, 250, 0.3);
	border-radius: 8px;
	color: #e0e0e0;
	font-size: 0.95rem;
	transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
	outline: none;
	border-color: #a78bfa;
	background: rgba(255, 255, 255, 0.15);
	box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.1);
}

select option {
	background: #1f1f2e;
	color: #e0e0e0;
}

input[type="checkbox"] {
	margin-right: 0.5rem;
	accent-color: #a78bfa;
}

/* Buttons */
button,
.button {
	padding: 0.6rem 1.25rem;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	border: none;
	border-radius: 8px;
	color: white;
	font-weight: 600;
	font-size: 0.9rem;
	cursor: pointer;
	transition: all 0.3s ease;
	white-space: nowrap;
	text-decoration: none;
	display: inline-block;
}

button:hover,
.button:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

button:active,
.button:active {
	transform: translateY(0);
}

button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

button.btn-sm {
	padding: 0.35rem 0.75rem;
	font-size: 0.8rem;
}

button.btn-outline {
	background: transparent;
	border: 1px solid rgba(167, 139, 250, 0.5);
	color: #c4b5fd;
}

button.btn-outline:hover {
	background: rgba(167, 139, 250, 0.15);
	box-shadow: none;
	transform: none;
}

/* Tables */
table {
	width: 100%;
	border-collapse: collapse;
	background: rgba(255, 255, 255, 0.05);
	border-radius: 8px;
	overflow: hidden;
	margin-bottom: 1rem;
}

th {
	background: rgba(167, 139, 250, 0.2);
	color: #c4b5fd;
	font-weight: 600;
	padding: 0.75rem 1rem;
	text-align: left;
	border-bottom: 2px solid rgba(167, 139, 250, 0.3);
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	cursor: pointer;
	user-select: none;
}

th:hover {
	background: rgba(167, 139, 250, 0.3);
}

th.sort-asc::after {
	content: ' \25B2';
	font-size: 0.7em;
}

th.sort-desc::after {
	content: ' \25BC';
	font-size: 0.7em;
}

td {
	padding: 0.6rem 1rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	font-size: 0.9rem;
}

tr:hover {
	background: rgba(255, 255, 255, 0.06);
}

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

/* Data Display (key-value pairs) */
.data-row {
	display: grid;
	grid-template-columns: 180px 1fr;
	gap: 1rem;
	padding: 0.6rem 1rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.data-row:last-child {
	border-bottom: none;
}

.data-label {
	font-weight: 600;
	color: #c4b5fd;
	font-size: 0.9rem;
}

.data-value {
	color: #e0e0e0;
}

/* Two-column detail layout */
.detail-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 2rem;
}

/* Links */
a {
	color: #a78bfa;
	text-decoration: none;
	transition: color 0.3s ease;
}

a:hover {
	color: #c4b5fd;
	text-decoration: underline;
}

/* Clickable row */
tr.clickable {
	cursor: pointer;
}

tr.clickable:hover {
	background: rgba(167, 139, 250, 0.12);
}

/* Alert / Notice */
.alert {
	padding: 0.75rem 1.25rem;
	border-radius: 8px;
	margin-bottom: 1rem;
	background: rgba(255, 255, 255, 0.08);
	border-left: 4px solid #a78bfa;
	font-size: 0.9rem;
}

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

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

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

/* Account type badges */
.badge {
	display: inline-block;
	padding: 0.15rem 0.5rem;
	border-radius: 4px;
	font-size: 0.8rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.badge-player   { background: rgba(204, 204, 0, 0.2); color: #cccc00; }
.badge-admin    { background: rgba(255, 204, 204, 0.2); color: #ffcccc; }
.badge-pmare    { background: rgba(187, 153, 187, 0.2); color: #bb99bb; }
.badge-nightmare { background: rgba(153, 153, 153, 0.2); color: #999; }
.badge-locked   { background: rgba(255, 255, 204, 0.2); color: #ffffcc; }
.badge-killed   { background: rgba(255, 255, 255, 0.2); color: #fff; }
.badge-expired  { background: rgba(204, 153, 204, 0.2); color: #cc99cc; }

/* Stat colors */
.stat-ds { color: #ff9966; }  /* Dreamsoul - orange */
.stat-wp { color: #66ccff; }  /* Willpower - blue */
.stat-in { color: #99ff99; }  /* Insight - green */
.stat-rs { color: #ffcc66; }  /* Resilience - gold */
.stat-lu { color: #cc99ff; }  /* Lucidity - purple */

/* Guild / House colors */
.guild-dol  { color: #ffe066; }
.guild-aoe  { color: #66d9ff; }
.guild-goe  { color: #99ff99; }
.guild-hc   { color: #ff9999; }
.guild-koes { color: #cc99ff; }
.guild-osm  { color: #c0c0c0; }
.guild-por  { color: #ffcc99; }
.guild-uoc  { color: #99ccff; }

/* Stats grid (for game stats page) */
.stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 1rem;
	margin-bottom: 1.5rem;
}

.stat-card {
	background: rgba(255, 255, 255, 0.08);
	border-radius: 12px;
	padding: 1.25rem;
	text-align: center;
	backdrop-filter: blur(5px);
}

.stat-card .stat-value {
	font-size: 2rem;
	font-weight: 700;
	background: linear-gradient(135deg, #667eea, #764ba2);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

.stat-card .stat-label {
	font-size: 0.85rem;
	color: #9ca3af;
	margin-top: 0.25rem;
}

/* Skill bars */
.skill-bar {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.skill-bar .bar-container {
	flex: 1;
	height: 8px;
	background: rgba(255, 255, 255, 0.1);
	border-radius: 4px;
	overflow: hidden;
}

.skill-bar .bar-fill {
	height: 100%;
	border-radius: 4px;
	background: linear-gradient(90deg, #667eea, #764ba2);
	transition: width 0.5s ease;
}

.skill-bar .bar-label {
	min-width: 2.5rem;
	text-align: right;
	font-size: 0.85rem;
	color: #c4b5fd;
	font-weight: 600;
}

/* Loading */
.spinner {
	border: 4px solid rgba(255, 255, 255, 0.1);
	border-left-color: #a78bfa;
	border-radius: 50%;
	width: 40px;
	height: 40px;
	animation: spin 1s linear infinite;
	margin: 2rem auto;
}

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

.loading-overlay {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 200px;
	flex-direction: column;
	gap: 1rem;
	color: #9ca3af;
}

/* Pagination */
.pagination {
	display: flex;
	gap: 0.5rem;
	justify-content: center;
	margin-top: 1.5rem;
}

.pagination button {
	padding: 0.4rem 0.8rem;
	font-size: 0.85rem;
}

/* Scrollbar */
::-webkit-scrollbar {
	width: 10px;
}

::-webkit-scrollbar-track {
	background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
	background: rgba(167, 139, 250, 0.5);
	border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
	background: rgba(167, 139, 250, 0.7);
}

/* Utility */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: #9ca3af; }
.text-sm     { font-size: 0.85rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.hidden { display: none !important; }

/* Responsive */
@media (max-width: 768px) {
	.form-row {
		grid-template-columns: 1fr;
		gap: 0.5rem;
	}

	.form-inline {
		flex-direction: column;
	}

	.detail-grid {
		grid-template-columns: 1fr;
	}

	.data-row {
		grid-template-columns: 1fr;
		gap: 0.25rem;
	}

	nav {
		gap: 0.35rem;
	}

	nav a {
		font-size: 0.8rem;
		padding: 0.4rem 0.75rem;
	}

	header h1 {
		font-size: 1.5rem;
	}

	h2 {
		font-size: 1.25rem;
	}

	.section {
		padding: 1.25rem;
	}

	.stats-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	table {
		font-size: 0.85rem;
	}

	th, td {
		padding: 0.5rem;
	}
}
