/* --- UNIVERSAL THEME VARIABLES --- */
:root {
	/* Base Dark Mode Theme (from schedule.html) */
	--brand-color: #D4AF37;
	--brand-text-color: #121212;
	/* Text on brand-colored buttons */
	/* --- PREMIUM DARK MODE (High Contrast) --- */
	--bg-primary: #000000;
	/* Pure Black: Page background */
	--bg-secondary: #1c1c1e;
	/* Dark Grey: Cards, Sidebar (Apple/Linear style) */
	--bg-tertiary: #2c2c2e;
	/* Lighter Grey: Inputs, Hovers */

	--text-primary: #ffffff;
	/* Pure White: Primary text */
	--text-muted: #a1a1aa;
	/* Zinc-400: Secondary text */

	--border-color: #3a3a3c;
	/* Solid Grey: Visible, distinct separation */

	/* Specific overrides for consistent UI */
	--card-border-color: #3a3a3c;
	--waitlist-input-bg-color: #1c1c1e;
	--footer-border-color: #3a3a3c;
}

/* --- UTILITIES --- */
.hover-scale {
	transition: transform 0.2s ease;
}

.hover-scale:hover {
	transform: scale(1.02);
}

html.light-mode {
	/* Base Light Mode Theme */
	--brand-color: #B8860B;
	--brand-text-color: #FFFFFF;
	--bg-primary: #FFFFFF;
	--bg-secondary: #F3F4F6;
	--text-primary: #1F2937;
	--text-muted: #6B7280;
	--border-color: #e5e7eb;
	/* Gray-200 */

	/* Light mode homepage overrides */
	--card-border-color: #e5e7eb;
	--waitlist-input-bg-color: #f9fafb;
	--footer-border-color: #e5e7eb;
}

/* --- GLOBAL STYLES & TYPOGRAPHY --- */
/* Ensure full height for app layouts, but allow scrolling on standard pages */
html,
body {
	height: 100%;
}

body {
	font-family: 'Inter', sans-serif;
	background-color: var(--bg-primary);
	color: var(--text-primary);
	overflow-x: hidden;
	transition: background-color 0.3s ease, color 0.3s ease;
}

.font-logo {
	font-family: 'Roboto Slab', serif;
}

/* --- REUSABLE UTILITY CLASSES (from your old style blocks) --- */
.text-primary {
	color: var(--text-primary);
}

.text-muted {
	color: var(--text-muted);
}

.text-brand {
	color: var(--brand-color);
}

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

.bg-secondary {
	background-color: var(--bg-secondary);
}

.border-color {
	border-color: var(--border-color);
}

.border-border-color {
	border-color: var(--border-color) !important;
}

/* --- BUTTONS & FORMS --- */
.cta-button {
	display: inline-block;
	font-weight: 700;
	padding: 0.75rem 2rem;
	border-radius: 0.5rem;
	background-color: var(--brand-color);
	color: var(--brand-text-color);
	transition: all 0.2s ease;
}

.cta-button:hover {
	filter: brightness(1.1);
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.form-input {
	display: block;
	width: 100%;
	padding: 0.75rem 1rem;
	border-radius: 0.5rem;
	transition: all 0.2s ease;
	background-color: var(--waitlist-input-bg-color);
	border: 1px solid var(--card-border-color);
	color: var(--text-primary);
}

.form-input::placeholder {
	color: var(--text-muted-color);
	opacity: 0.6;
}

.form-input:focus {
	outline: none;
	box-shadow: 0 0 0 2px var(--bg-color), 0 0 0 4px var(--brand-color);
}

/* Theme Toggle Button (from index.html) */
.theme-toggle-button {
	background-color: transparent;
	border: 1px solid var(--card-border-color);
	color: var(--text-muted-color);
	padding: 0.5rem;
	border-radius: 0.5rem;
	transition: color 0.2s, background-color 0.2s;
}

.theme-toggle-button:hover {
	color: var(--text-color);
	background-color: var(--waitlist-input-bg-color);
}

/* --- Homepage Specific Styles --- */
.hp-arena-card {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	text-align: center;
	padding: 1.5rem;
	border-radius: 1rem;
	overflow: hidden;
	transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
	aspect-ratio: 16 / 9;
	cursor: pointer;
}

.hp-arena-card:hover {
	transform: scale(1.05) rotate(-2deg);
	box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.hp-arena-card .card-subtitle {
	font-size: 0.875rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.hp-arena-card .card-title {
	margin-top: 0.5rem;
	font-size: 2.25rem;
	font-weight: 700;
	line-height: 1.1;
}

.hp-arena-card .card-status {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	font-size: 0.75rem;
	font-weight: 700;
	padding: 0.25rem 0.75rem;
	border-radius: 9999px;
	backdrop-filter: blur(4px);
	background: rgba(0, 0, 0, 0.2);
	border: 1px solid rgba(255, 255, 255, 0.1);
	color: white;
}

/* Themed Backgrounds */
.hp-theme-ryder {
	background: linear-gradient(135deg, #00205B 0%, #00338D 100%);
}

.hp-theme-ryder .card-subtitle {
	color: rgba(255, 255, 255, 0.7);
}

.hp-theme-ryder .card-title {
	color: #BF0A30;
	text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.hp-theme-bachelor {
	background: linear-gradient(135deg, #8B0000 0%, #A52A2A 100%);
}

.hp-theme-bachelor .card-subtitle {
	color: rgba(255, 255, 255, 0.7);
}

.hp-theme-bachelor .card-title {
	color: #FFC0CB;
	text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.hp-theme-egot {
	background: linear-gradient(135deg, #111 0%, #222 100%);
}

.hp-theme-egot .card-subtitle {
	color: rgba(255, 255, 255, 0.7);
}

.hp-theme-egot .card-title {
	color: var(--brand-color);
}

/* --- A helper for browsers like mobile Safari to correctly calculate viewport height --- */
.h-screen-ios-fix {
	height: 100vh;
	height: -webkit-fill-available;
}

/* --- APPLICATION & CHAT LAYOUT OVERHAUL (GRID) --- */
/* The main application grid in app.php (for mobile) */
.app-layout-grid {
	display: grid;
	/* Header (auto), Main Content (fills space), Footer/Nav (auto) */
	grid-template-rows: auto 1fr auto;
	height: 100%;
	overflow: hidden;
}

/* The scrolling container for standard pages (league, profile, etc.) */
.page-content-container {
	overflow-y: auto;
	/* Standard pages will scroll inside this container */
	padding: 1rem;
	/* p-4 for mobile */
}

@media (min-width: 768px) {
	.page-content-container {
		padding: 2rem;
	}
}

/* --- Toast Notification --- */
#toast-container {
	position: fixed;
	bottom: 5rem;
	/* Position above mobile nav */
	left: 50%;
	transform: translateX(-50%);
	z-index: 9999;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.toast {
	background-color: var(--bg-secondary);
	color: var(--text-primary);
	padding: 0.75rem 1.25rem;
	border-radius: 9999px;
	font-size: 0.875rem;
	font-weight: 500;
	border: 1px solid var(--border-color);
	box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
	opacity: 0;
	transform: translateY(20px);
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.show {
	opacity: 1;
	transform: translateY(0);
}

/* --- Chat Message Menu --- */
.message-menu {
	transition: transform 0.1s ease-out, opacity 0.1s ease-out;
	transform: translateY(5px) scale(0.95);
	opacity: 0;
	pointer-events: none;
}

.message-menu.is-open {
	transform: translateY(0) scale(1);
	opacity: 1;
	pointer-events: auto;
}

/* --- MOBILE NAVIGATION --- */
.mobile-nav-profile-menu {
	transition: transform 0.3s ease, opacity 0.3s ease;
	transform: translateY(10px) scale(0.95);
	opacity: 0;
	pointer-events: none;
}

.mobile-nav-profile-menu.is-open {
	transform: translateY(0) scale(1);
	opacity: 1;
	pointer-events: auto;
}

/* --- Universal Alpine.js class --- */
[x-cloak] {
	display: none !important;
}

/* --- TARGETED MOBILE LAYOUT FIX --- */
/* This class adds padding to the bottom of a container on mobile only,
   to prevent content from being hidden by the fixed mobile nav. */
.pb-mobile-nav {
	padding-bottom: 4rem;
	/* h-16, the height of the mobile nav */
}

@media (min-width: 768px) {

	/* md breakpoint */
	.pb-mobile-nav {
		padding-bottom: 0;
	}
}

/* --- NEW DESIGN SYSTEM UPDATES (Glassmorphism & Playbook) --- */

/* Glass Panel Utility */
.glass-panel {
	background: rgba(28, 28, 30, 0.7);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border: 1px solid rgba(255, 255, 255, 0.08);
	box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

html.light-mode .glass-panel {
	background: rgba(255, 255, 255, 0.8);
	border: 1px solid rgba(0, 0, 0, 0.05);
	box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

/* Glass Navigation (Sidebar/Mobile) */
.glass-nav {
	background: rgba(0, 0, 0, 0.85);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	border-right: 1px solid rgba(255, 255, 255, 0.08);
}

html.light-mode .glass-nav {
	background: rgba(255, 255, 255, 0.9);
	border-right: 1px solid rgba(0, 0, 0, 0.05);
}

/* Playbook Background Container */
.bg-playbook {
	position: fixed;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	overflow: hidden;
}

.bg-playbook-gradient {
	position: absolute;
	inset: 0;
	background: radial-gradient(circle at center, var(--bg-secondary), var(--bg-primary));
	opacity: 0.4;
}

/* Playbook Player Animation Classes */
.playbook-player {
	position: absolute;
	font-family: 'Roboto Slab', serif;
	font-weight: 900;
	font-size: 2rem;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 3rem;
	height: 3rem;
	transform: translate(-50%, -50%);
	opacity: 0;
	animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
	animation-iteration-count: infinite;
}

.playbook-player.offense .player-symbol {
	color: var(--brand-color);
	text-shadow: 0 0 15px var(--brand-color);
}

.playbook-player.defense .player-symbol {
	color: #ef4444;
	text-shadow: 0 0 15px #ef4444;
}

/* Animation Keyframes */
@keyframes play-go {
	0% {
		opacity: 0;
		transform: translate(0, 0) scale(0.8);
	}

	10% {
		opacity: 0.4;
		transform: translate(0, 0) scale(1);
	}

	80% {
		opacity: 0.4;
		transform: translate(0, -40vh) scale(1);
	}

	100% {
		opacity: 0;
		transform: translate(0, -45vh) scale(0.8);
	}
}

@keyframes play-slant {
	0% {
		opacity: 0;
		transform: translate(0, 0) scale(0.8);
	}

	10% {
		opacity: 0.4;
		transform: translate(0, 0) scale(1);
	}

	80% {
		opacity: 0.4;
		transform: translate(-20vw, -35vh) scale(1);
	}

	100% {
		opacity: 0;
		transform: translate(-22vw, -40vh) scale(0.8);
	}
}

@keyframes play-out {
	0% {
		opacity: 0;
		transform: translate(0, 0);
	}

	10% {
		opacity: 0.4;
	}

	40% {
		transform: translate(0, -5vh);
	}

	80% {
		opacity: 0.4;
		transform: translate(25vw, -5vh);
	}

	100% {
		opacity: 0;
		transform: translate(28vw, -5vh);
	}
}

@keyframes play-clash {
	0% {
		opacity: 0;
		transform: translate(0, 0);
	}

	10% {
		opacity: 0.4;
	}

	50% {
		opacity: 0.4;
		transform: translate(0, -2vh) scale(1.1);
	}

	100% {
		opacity: 0;
		transform: translate(0, -2vh);
	}
}

@keyframes play-qb {
	0% {
		opacity: 0;
		transform: translate(0, 0);
	}

	10% {
		opacity: 0.5;
	}

	80% {
		opacity: 0.5;
		transform: translate(0, 5vh);
	}

	100% {
		opacity: 0;
		transform: translate(0, 8vh);
	}
}

@keyframes play-blitz {
	0% {
		opacity: 0;
		transform: translate(0, 0);
	}

	10% {
		opacity: 0.4;
	}

	80% {
		opacity: 0.4;
		transform: translate(5vw, 20vh);
	}

	100% {
		opacity: 0;
		transform: translate(6vw, 22vh);
	}
}

@keyframes play-coverage {
	0% {
		opacity: 0;
		transform: translate(0, 0);
	}

	10% {
		opacity: 0.4;
	}

	80% {
		opacity: 0.4;
		transform: translate(0, 10vh);
	}

	100% {
		opacity: 0;
		transform: translate(0, 12vh);
	}
}

/* Animation Utility Classes */
.animate-play-go {
	animation-name: play-go;
}

.animate-play-slant {
	animation-name: play-slant;
}

.animate-play-out {
	animation-name: play-out;
}

.animate-play-clash {
	animation-name: play-clash;
}

.animate-play-clash-center {
	animation-name: play-clash;
}

.animate-play-qb {
	animation-name: play-qb;
}

.animate-play-blitz {
	animation-name: play-blitz;
}

.animate-play-coverage {
	animation-name: play-coverage;
}