/* Arena Masters AI - Base Stylesheet */
/* Define default color variables - will be overridden by dynamic-theme.css */

:root {
	--color-primary: #0074d9;
	--color-secondary: #f4f4f4;
	--color-accent: #e0ffe0;
	--color-header-bg: #222;
	--color-header-text: #fff;
	--color-sidebar-bg: #f8f8f8;
	--color-sidebar-text: #222;
	--color-button-bg: #0074d9;
	--color-button-text: #fff;
	--color-link: #0074d9;
	--color-success: #080;
	--color-error: #b00;
}

/* ==================== Global Styles ==================== */

body {
	font-family: Arial, sans-serif;
	background: var(--color-secondary);
	margin: 0;
}

/* ==================== Header Styles ==================== */

.header-bar {
	background: var(--color-header-bg);
	color: var(--color-header-text);
	padding: 1em;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1em;
}

/* Menu Toggle Button */
.menu-toggle {
	background: none;
	border: none;
	cursor: pointer;
	padding: 0.5em;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	width: 40px;
	height: 40px;
	border-radius: 4px;
	transition: background 0.3s ease;
}

.menu-toggle:hover {
	background: rgba(255, 255, 255, 0.1);
}

.menu-icon {
	width: 24px;
	height: 2px;
	background: var(--color-header-text);
	position: relative;
	transition: background 0.3s ease;
}

.menu-icon::before,
.menu-icon::after {
	content: '';
	position: absolute;
	width: 24px;
	height: 2px;
	background: var(--color-header-text);
	transition: transform 0.3s ease;
}

.menu-icon::before {
	top: -8px;
}

.menu-icon::after {
	top: 8px;
}

.menu-toggle.active .menu-icon {
	background: transparent;
}

/* Create chevron pointing right when collapsed */
.menu-toggle.active .menu-icon::before,
.menu-toggle.active .menu-icon::after {
	width: 14px;
	left: 5px;
}

.menu-toggle.active .menu-icon::before {
	top: -4px;
	transform: rotate(35deg);
}

.menu-toggle.active .menu-icon::after {
	top: 4px;
	transform: rotate(-35deg);
}

.user-info {
	font-weight: bold;
	color: var(--color-header-text);
}

.account-icon {
	font-size: 1.5em;
	cursor: pointer;
	margin-left: 1em;
}

.logout-link {
	color: var(--color-header-text);
	text-decoration: underline;
	margin-left: 2em;
}

/* Header Authentication Links */
.auth-links {
	display: flex;
	align-items: center;
	gap: 1em;
}

.auth-links .username {
	color: var(--color-header-text);
	font-weight: bold;
	margin-right: 0.5em;
}

.auth-links .auth-link {
	color: var(--color-header-text);
	text-decoration: none;
	padding: 0.4em 0.8em;
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.1);
	transition: background 0.3s ease;
}

.auth-links .auth-link:hover {
	background: rgba(255, 255, 255, 0.2);
	color: var(--color-header-text);
}

/* Bell alert icon in header */
.bell-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	padding: 0.3em 0.5em;
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.1);
	transition: background 0.3s ease;
	line-height: 1;
}

.bell-btn:hover {
	background: rgba(255, 255, 255, 0.2);
}

.bell-icon {
	font-size: 1.2em;
}

.bell-dot {
	position: absolute;
	top: 3px;
	right: 3px;
	width: 9px;
	height: 9px;
	background: #ff3b30;
	border-radius: 50%;
	border: 2px solid var(--color-header-bg);
}

.rules-header-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.3em 0.55em;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.1);
	color: var(--color-header-text);
	text-decoration: none;
	line-height: 1;
	transition: background 0.2s ease, border-color 0.2s ease;
}

.rules-header-btn:hover {
	background: rgba(255, 255, 255, 0.2);
	border-color: rgba(255, 255, 255, 0.55);
	color: #ffffff;
	opacity: 1;
}

.rules-header-icon {
	font-size: 1.1em;
}

/* ==================== Layout Styles ==================== */

.container {
	display: flex;
	min-height: 80vh;
}

.side-menu {
	width: 220px;
	background: var(--color-sidebar-bg);
	border-right: 1px solid #ddd;
	padding: 2em 1em;
	transition: width 0.3s ease, padding 0.3s ease, margin-left 0.3s ease;
	overflow: hidden;
}

.side-menu.collapsed,
html.menu-collapsed .side-menu {
	width: 0;
	padding: 0;
	margin-left: -1px;
	border-right: none;
}

/* Apply active state to menu toggle when menu is collapsed */
html.menu-collapsed .menu-toggle {
	/* Button state is handled by JavaScript adding .active class */
}

.side-menu ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

.side-menu li {
	margin-bottom: 1.5em;
}

.side-menu a {
	color: var(--color-sidebar-text);
	text-decoration: none;
	font-weight: bold;
	transition: color 0.2s ease;
}

.side-menu a:hover {
	color: var(--color-primary);
}

.main-area {
	flex: 1;
	padding: 2em;
}

/* ==================== Breadcrumbs ==================== */

.breadcrumbs {
	display: flex;
	align-items: center;
	padding: 0.75em 0;
	margin-bottom: 1.5em;
	font-size: 0.9em;
	color: #666;
	border-bottom: 1px solid #e0e0e0;
}

.breadcrumb-item {
	color: #666;
	text-decoration: none;
	transition: color 0.2s ease;
}

.breadcrumb-item:hover {
	color: var(--color-link);
	text-decoration: underline;
}

.breadcrumb-current {
	color: #333;
	font-weight: 600;
	cursor: default;
}

.breadcrumb-separator {
	margin: 0 0.5em;
	color: #999;
	user-select: none;
}

/* ==================== Authentication Styles ==================== */

.login-container {
	background: #fff;
	padding: 2em;
	margin: 5em auto;
	width: 300px;
	border-radius: 8px;
	box-shadow: 0 2px 8px #aaa;
}

.login-container h2 {
	margin-top: 0;
}

.login-container .error {
	color: var(--color-error);
	margin-bottom: 1em;
}

.login-container .success {
	color: var(--color-success);
	margin-bottom: 1em;
}

.login-links {
	margin-top: 1em;
	text-align: center;
}

.login-links a {
	color: var(--color-link);
	text-decoration: none;
	margin: 0 0.5em;
	transition: color 0.2s ease;
}

.login-links a:hover {
	color: var(--color-primary);
	text-decoration: underline;
}

/* ==================== Message/Alert Styles ==================== */

.announcement {
	background: var(--color-accent);
	border: 1px solid var(--color-announcement-border, #b2ffb2);
	padding: 1em;
	margin: 2em 0;
	border-radius: 6px;
}

/* ==================== Link Styles ==================== */

a {
	color: var(--color-link);
	transition: color 0.2s ease;
}

a:hover {
	color: var(--color-primary);
}

/* ==================== Button Styles ==================== */


button,
input[type="submit"],
.btn {
	display: inline-block;
	padding: 0.5em 1em;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 1em;
	font-weight: bold;
	text-decoration: none;
	line-height: 1.2;
	transition: opacity 0.3s ease;
}

button,
input[type="submit"],
.btn-primary {
	background: var(--color-button-bg);
	color: var(--color-button-text);
}

button:hover,
input[type="submit"]:hover,
.btn:hover {
	opacity: 0.8;
}

.btn-primary:hover {
	opacity: 0.8;
}

/* Standard pencil edit control used across interfaces */
.pencil-edit-btn {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	padding: 0 !important;
	line-height: 1 !important;
	font-size: 0.95em !important;
	width: 36px !important;
	height: 36px !important;
	min-width: 36px !important;
	min-height: 36px !important;
	background: transparent !important;
	border: 1px solid var(--color-button-bg) !important;
	border-radius: 4px !important;
	color: var(--color-button-text) !important;
	fill: none !important;
	text-decoration: none;
}

.pencil-edit-btn svg,
.pencil-edit-btn svg * {
	fill: none !important;
}

.pencil-edit-btn:hover {
	background: rgba(0, 0, 0, 0.04) !important;
	opacity: 0.85;
	text-decoration: none;
}

.btn-secondary {
	background: #6c757d;
	color: #fff;
}

.btn-secondary:link,
.btn-secondary:visited,
.btn-secondary:hover,
.btn-secondary:active {
	color: #fff !important;
}

.btn-secondary:hover {
	opacity: 0.8;
}

.btn-danger {
	background: var(--color-error);
	color: #fff;
}

.btn-danger:link,
.btn-danger:visited,
.btn-danger:hover,
.btn-danger:active {
	color: #fff !important;
}

.btn-danger:hover {
	opacity: 0.8;
}

.btn-sm {
	padding: 0.3em 0.7em;
	font-size: 0.9em;
}
/* ==================== Dropdown Styles ==================== */

.dropdown {
	position: relative;
	display: inline-block;
}

.dropdown-toggle {
	cursor: pointer;
}

.dropdown-content {
	display: none;
	position: fixed;
	background-color: #fff;
	min-width: 200px;
	box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
	z-index: 1000;
	border-radius: 4px;
	border: 1px solid #ddd;
	margin-top: 2px;
	max-height: 300px;
	overflow-y: auto;
}

.dropdown.open .dropdown-content {
	display: block;
}

.dropdown-content .role-toggle-form {
	margin: 0;
	padding: 0;
}

.dropdown-content .dropdown-item {
	width: 100%;
	padding: 10px 15px;
	text-align: left;
	border: none;
	background: none;
	cursor: pointer;
	display: block;
	transition: background-color 0.2s;
	font-size: 14px;
}

.dropdown-content .dropdown-item:hover {
	background-color: #f1f1f1;
}

.dropdown-content .dropdown-item.active {
	background-color: #e8f5e9;
	font-weight: bold;
}