/* --- UNIVERSAL THEME VARIABLES --- */
:root {
	/* Base Dark Mode Theme (from schedule.html) */
	--brand-color: #D4AF37;
	--brand-text-color: #121212; /* Text on brand-colored buttons */
	--bg-primary: #121212;   /* Main background */
	--bg-secondary: #18181b; /* Contrasting background, cards */
	--text-primary: #F5F5F5;
	--text-muted: #A9A9A9;
	--border-color: rgba(255, 255, 255, 0.1);

	/* Specific overrides for the homepage glass effect */
	--card-border-color: rgba(255, 255, 255, 0.1);
	--waitlist-input-bg-color: rgba(0, 0, 0, 0.2);
	--footer-border-color: rgba(255, 255, 255, 0.1);
}

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: rgba(0, 0, 0, 0.1);

	/* Light mode homepage overrides */
	--card-border-color: rgba(0, 0, 0, 0.1);
	--waitlist-input-bg-color: rgba(0, 0, 0, 0.05);
	--footer-border-color: rgba(0, 0, 0, 0.1);
}

/* --- 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); }

/* --- 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;
	}
}