/* ==========================================================================
   Chillacticos FC — modern layer
   Loaded after the Porto theme + custom.css on every page. Provides the
   shared header / mobile navigation, and modernises common Porto elements
   (page headers, buttons, forms, tables) so existing pages look consistent
   and work comfortably on phones.
   ========================================================================== */

:root {
	--cfc-ink: #141317;
	--cfc-ink-2: #24222a;
	--cfc-ink-3: #3a3741;
	--cfc-pink: #f3c7db;
	--cfc-pink-soft: #fbe9f1;
	--cfc-pink-strong: #e48db5;
	--cfc-pink-deep: #a83a6d;
	--cfc-bg: #f6f4f7;
	--cfc-surface: #ffffff;
	--cfc-line: #e7e2ea;
	--cfc-text: #1d1b21;
	--cfc-muted: #686370;
	--cfc-radius: 14px;
	--cfc-radius-sm: 10px;
	--cfc-shadow: 0 1px 2px rgba(20, 19, 23, .06), 0 6px 20px rgba(20, 19, 23, .06);
	--cfc-header-h: 64px;
	--cfc-tabbar-h: 64px;
	--cfc-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	--cfc-font-display: "Barlow Condensed", "Arial Narrow", "Inter", sans-serif;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
html { -webkit-text-size-adjust: 100%; }

html body {
	font-family: var(--cfc-font);
	background-color: var(--cfc-bg);
	color: var(--cfc-text);
	-webkit-font-smoothing: antialiased;
}

html body .body { background: var(--cfc-bg); }
html body .main { background: transparent; }

html body h1, html body h2, html body h3,
html body .h1, html body .h2, html body .h3 {
	font-family: var(--cfc-font-display);
	letter-spacing: .01em;
	color: var(--cfc-ink);
}

html body a { color: var(--cfc-pink-deep); }
html body a:hover { color: var(--cfc-ink); }

:focus-visible {
	outline: 3px solid var(--cfc-pink-strong);
	outline-offset: 2px;
}

/* Leave room for the mobile tab bar */
@media (max-width: 991.98px) {
	body:has(.cfc-tabbar) { padding-bottom: calc(var(--cfc-tabbar-h) + env(safe-area-inset-bottom)); }
	html .scroll-to-top { bottom: calc(var(--cfc-tabbar-h) + 16px + env(safe-area-inset-bottom)); }
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.cfc-header {
	position: sticky;
	top: 0;
	z-index: 1030;
	background: var(--cfc-ink);
	color: #fff;
	box-shadow: 0 1px 0 rgba(255, 255, 255, .06), 0 4px 16px rgba(0, 0, 0, .18);
}

.cfc-header__inner {
	display: flex;
	align-items: center;
	gap: 16px;
	max-width: 1240px;
	height: var(--cfc-header-h);
	margin: 0 auto;
	padding: 0 16px;
}

.cfc-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
	color: #fff !important;
	text-decoration: none !important;
}

.cfc-brand img {
	display: block;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: var(--cfc-pink);
	object-fit: cover;
}

.cfc-brand__name {
	font-family: var(--cfc-font-display);
	font-size: 1.35rem;
	font-weight: 700;
	line-height: 1;
	letter-spacing: .04em;
	text-transform: uppercase;
}

.cfc-brand__name span { color: var(--cfc-pink); }

/* Desktop nav */
.cfc-nav { margin-left: auto; }

.cfc-nav ul {
	display: flex;
	align-items: center;
	gap: 2px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.cfc-nav li { position: relative; margin: 0; }

.cfc-nav__link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 40px;
	padding: 0 12px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: rgba(255, 255, 255, .82) !important;
	font: 500 .9rem/1 var(--cfc-font);
	text-decoration: none !important;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color .15s, color .15s;
}

.cfc-nav__link:hover,
.cfc-nav__link[aria-expanded="true"] {
	background: rgba(255, 255, 255, .08);
	color: #fff !important;
}

.cfc-nav__link.is-active {
	background: var(--cfc-pink);
	color: var(--cfc-ink) !important;
}

.cfc-nav__link .fa-chevron-down { font-size: .65rem; opacity: .7; }

.cfc-nav__link--logout { color: rgba(255, 255, 255, .6) !important; }

.cfc-dropdown {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	min-width: 240px;
	padding: 6px !important;
	border-radius: var(--cfc-radius-sm);
	background: var(--cfc-surface);
	box-shadow: 0 12px 32px rgba(0, 0, 0, .22);
	display: none !important;
	flex-direction: column;
	align-items: stretch !important;
}

.cfc-dropdown.is-open { display: flex !important; }

.cfc-dropdown a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border-radius: 8px;
	color: var(--cfc-text) !important;
	font-size: .9rem;
	text-decoration: none !important;
}

.cfc-dropdown a i { width: 18px; color: var(--cfc-muted); text-align: center; }
.cfc-dropdown a:hover { background: var(--cfc-pink-soft); }
.cfc-dropdown a.is-active { background: var(--cfc-pink-soft); font-weight: 600; }

/* Menu button (mobile) */
.cfc-menu-btn {
	display: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin-left: auto;
	border: 0;
	border-radius: 12px;
	background: rgba(255, 255, 255, .08);
	color: #fff;
	font-size: 1.15rem;
	cursor: pointer;
}

@media (max-width: 991.98px) {
	.cfc-nav { display: none; }
	.cfc-menu-btn { display: inline-flex; }
	.cfc-brand__name { font-size: 1.2rem; }
}

/* --------------------------------------------------------------------------
   Mobile drawer
   -------------------------------------------------------------------------- */
.cfc-drawer {
	position: fixed;
	inset: 0;
	z-index: 1050;
	visibility: hidden;
	pointer-events: none;
}

.cfc-drawer.is-open { visibility: visible; pointer-events: auto; }

.cfc-drawer__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 9, 12, .55);
	opacity: 0;
	transition: opacity .2s ease;
}

.cfc-drawer__panel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	width: min(86vw, 360px);
	background: var(--cfc-surface);
	transform: translateX(100%);
	transition: transform .25s ease;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.cfc-drawer.is-open .cfc-drawer__backdrop { opacity: 1; }
.cfc-drawer.is-open .cfc-drawer__panel { transform: none; }

.cfc-drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px;
	background: var(--cfc-ink);
	color: #fff;
}

.cfc-drawer__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 12px;
	background: rgba(255, 255, 255, .08);
	color: #fff;
	font-size: 1.1rem;
	cursor: pointer;
}

.cfc-drawer__body { padding: 8px 12px 24px; }

.cfc-drawer__label {
	margin: 16px 8px 6px;
	color: var(--cfc-muted);
	font-size: .72rem;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.cfc-drawer__list { margin: 0; padding: 0; list-style: none; }

.cfc-drawer__list a {
	display: flex;
	align-items: center;
	gap: 14px;
	min-height: 48px;
	padding: 10px 12px;
	border-radius: var(--cfc-radius-sm);
	color: var(--cfc-text) !important;
	font-size: 1rem;
	font-weight: 500;
	text-decoration: none !important;
}

.cfc-drawer__list a i {
	width: 22px;
	color: var(--cfc-muted);
	font-size: 1.05rem;
	text-align: center;
}

.cfc-drawer__list a:hover,
.cfc-drawer__list a:active { background: var(--cfc-bg); }

.cfc-drawer__list a.is-active { background: var(--cfc-pink-soft); font-weight: 600; }
.cfc-drawer__list a.is-active i { color: var(--cfc-pink-deep); }

.cfc-drawer__list--sub a { padding-left: 24px; font-size: .95rem; }

html.cfc-lock, html.cfc-lock body { overflow: hidden; }

/* --------------------------------------------------------------------------
   Mobile tab bar
   -------------------------------------------------------------------------- */
.cfc-tabbar {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 1020;
	display: none;
	padding-bottom: env(safe-area-inset-bottom);
	border-top: 1px solid var(--cfc-line);
	background: rgba(255, 255, 255, .96);
	backdrop-filter: saturate(1.4) blur(12px);
	-webkit-backdrop-filter: saturate(1.4) blur(12px);
}

.cfc-tabbar ul {
	display: grid;
	grid-auto-columns: 1fr;
	grid-auto-flow: column;
	height: var(--cfc-tabbar-h);
	margin: 0;
	padding: 0;
	list-style: none;
}

.cfc-tabbar a,
.cfc-tabbar button {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	width: 100%;
	height: 100%;
	padding: 0 2px;
	border: 0;
	background: none;
	color: var(--cfc-muted) !important;
	font: 500 .68rem/1.1 var(--cfc-font);
	text-align: center;
	text-decoration: none !important;
	cursor: pointer;
}

.cfc-tabbar i { font-size: 1.2rem; }

.cfc-tabbar .is-active { color: var(--cfc-ink) !important; font-weight: 600; }

.cfc-tabbar .is-active i {
	padding: 4px 16px;
	border-radius: 999px;
	background: var(--cfc-pink);
}

@media (max-width: 991.98px) {
	.cfc-tabbar { display: block; }
}

/* --------------------------------------------------------------------------
   Porto page header -> compact, branded banner
   -------------------------------------------------------------------------- */
html body .page-header {
	position: relative;
	margin: 0 0 24px !important;
	padding: 36px 0 32px !important;
	border: 0;
	background: var(--cfc-ink) !important;
	background-image:
		radial-gradient(circle at 100% 0, rgba(243, 199, 219, .22), transparent 45%),
		linear-gradient(135deg, var(--cfc-ink) 0%, var(--cfc-ink-2) 100%) !important;
	overflow: hidden;
}

html body .page-header::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 4px;
	background: var(--cfc-pink);
}

html body .page-header .container {
	margin-top: 0;
	margin-bottom: 0;
	padding-top: 0;
	padding-bottom: 0;
}

html body .page-header h1 {
	margin: 0;
	padding: 0;
	border: 0;
	color: #fff !important;
	font-family: var(--cfc-font-display) !important;
	font-size: clamp(1.8rem, 5vw, 2.6rem) !important;
	font-weight: 700 !important;
	line-height: 1.05;
	letter-spacing: .02em;
	text-transform: uppercase;
}

html body .page-header .breadcrumb {
	margin: 0 0 6px;
	padding: 0;
	background: none;
	font-size: .78rem;
	letter-spacing: .06em;
	text-transform: uppercase;
}

html body .page-header .breadcrumb,
html body .page-header .breadcrumb a,
html body .page-header .breadcrumb li { color: var(--cfc-pink) !important; }

html body .page-header .breadcrumb > li + li::before { color: rgba(255, 255, 255, .4); }

@media (max-width: 767.98px) {
	html body .page-header { padding: 24px 0 22px !important; margin-bottom: 16px !important; }
}

/* --------------------------------------------------------------------------
   Layout containers
   -------------------------------------------------------------------------- */
html body .main > .container,
html body .main .container.pt-3 {
	max-width: 1180px;
}

@media (max-width: 767.98px) {
	html body .container,
	html body .container-fluid,
	html body .container-xl-custom {
		padding-left: 16px;
		padding-right: 16px;
	}
	html body .main > .container { margin-top: 0; }
	html body .row { --bs-gutter-x: 1rem; }
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
html body .btn {
	min-height: 44px;
	border-radius: 999px !important;
	font-weight: 600;
	letter-spacing: .01em;
	box-shadow: none;
}

html body .btn-sm { min-height: 36px; }

html body .btn-group > .btn,
html body .input-group > .btn { border-radius: var(--cfc-radius-sm) !important; }

html body .btn-primary,
html body .btn-dark {
	border-color: var(--cfc-ink) !important;
	background-color: var(--cfc-ink) !important;
	color: #fff !important;
}

html body .btn-primary:hover,
html body .btn-primary:focus,
html body .btn-dark:hover {
	border-color: var(--cfc-ink-3) !important;
	background-color: var(--cfc-ink-3) !important;
	color: #fff !important;
}

html body .btn-secondary,
html body .btn-light {
	border-color: var(--cfc-line) !important;
	background-color: var(--cfc-surface) !important;
	color: var(--cfc-ink) !important;
}

html body .btn-outline-primary {
	border-color: var(--cfc-ink) !important;
	color: var(--cfc-ink) !important;
}

html body .btn-outline-primary:hover {
	background-color: var(--cfc-ink) !important;
	color: #fff !important;
}

/* Pink accent button */
.cfc-btn-pink,
html body .btn.cfc-btn-pink {
	border-color: var(--cfc-pink) !important;
	background-color: var(--cfc-pink) !important;
	color: var(--cfc-ink) !important;
}

html body .btn.cfc-btn-pink:hover { background-color: #fff !important; border-color: #fff !important; }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
html body .form-control,
html body .form-select,
html body .main input[type="text"],
html body .main input[type="search"],
html body .main input[type="email"],
html body .main input[type="password"],
html body .main input[type="number"],
html body .main input[type="date"],
html body .main input[type="tel"],
html body .main select,
html body .main textarea {
	min-height: 44px;
	padding: 10px 14px;
	border: 1px solid var(--cfc-line);
	border-radius: var(--cfc-radius-sm);
	background-color: var(--cfc-surface);
	color: var(--cfc-text);
	box-shadow: none;
	transition: border-color .15s, box-shadow .15s;
}

html body .main textarea { min-height: 96px; }

html body .form-control:focus,
html body .form-select:focus,
html body .main input:not([type="checkbox"]):not([type="radio"]):focus,
html body .main select:focus,
html body .main textarea:focus {
	border-color: var(--cfc-pink-strong);
	box-shadow: 0 0 0 4px rgba(228, 141, 181, .22);
	outline: 0;
}

html body .main input[type="search"] { width: 100%; max-width: 480px; margin: 8px 0; }

html body label,
html body .form-label { font-weight: 500; color: var(--cfc-ink-2); }

/* 16px inputs stop iOS Safari zooming in on focus */
@media (max-width: 767.98px) {
	html body .form-control,
	html body .form-select,
	html body .main input,
	html body .main select,
	html body .main textarea { font-size: 16px !important; }
}

/* --------------------------------------------------------------------------
   Cards & surfaces
   -------------------------------------------------------------------------- */
html body .card {
	border: 1px solid var(--cfc-line);
	border-radius: var(--cfc-radius);
	box-shadow: var(--cfc-shadow);
	overflow: hidden;
}

html body .card-header {
	border-bottom: 1px solid var(--cfc-line);
	background: var(--cfc-surface);
	font-weight: 600;
}

html body .alert { border: 0; border-radius: var(--cfc-radius-sm); }

/* --------------------------------------------------------------------------
   Tables — rounded, readable, and scrollable sideways on phones
   -------------------------------------------------------------------------- */
html body .main table.table {
	background: var(--cfc-surface);
	border-color: var(--cfc-line);
}

html body .main table.table > thead th {
	border-bottom-width: 1px;
	background: var(--cfc-ink);
	color: #fff;
	font-size: .78rem;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	vertical-align: middle;
}

html body .main table.table td { vertical-align: middle; }

html body .dataTables_wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Added around tables by include/header.php so wide tables scroll sideways on phones */
.cfc-table-scroll {
	width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.cfc-table-scroll > table { min-width: 100%; }

@media (max-width: 767.98px) {
	html body .main table.table td,
	html body .main table.table th { padding: .55rem .6rem; font-size: .9rem; }
	html body .dataTables_wrapper .dataTables_filter,
	html body .dataTables_wrapper .dataTables_length { text-align: left !important; }
	html body .dataTables_wrapper .dataTables_filter input { width: 100% !important; margin-left: 0 !important; }
}

/* --------------------------------------------------------------------------
   Live search (see include/header.php)
   -------------------------------------------------------------------------- */
.cfc-search {
	position: sticky;
	top: var(--cfc-header-h);
	z-index: 5;
	display: flex;
	align-items: center;
	width: 100%;
	margin: 0 0 8px;
	padding-top: 8px;
	padding-bottom: 8px;
	background: linear-gradient(var(--cfc-bg) 75%, transparent);
}

.cfc-search > i {
	position: absolute;
	left: 18px;
	color: var(--cfc-muted);
	pointer-events: none;
}

html body .main .cfc-search input[type="search"] {
	width: 100%;
	max-width: none;
	min-height: 50px;
	margin: 0;
	padding-left: 44px;
	padding-right: 84px;
	border-radius: 999px;
	box-shadow: var(--cfc-shadow);
	font-weight: 500;
}

.cfc-search__count {
	position: absolute;
	right: 18px;
	color: var(--cfc-muted);
	font-size: .8rem;
	font-weight: 600;
	pointer-events: none;
}

.cfc-search-hidden { display: none !important; }

.cfc-search-empty {
	padding: 24px 16px;
	color: var(--cfc-muted);
	text-align: center;
}

tr.cfc-search-empty td { padding: 24px 16px; color: var(--cfc-muted); text-align: center; }

/* A player block in a filterable list */
.cfc-list-item {
	width: 100%;
	margin-bottom: 12px;
	padding: 4px 16px 16px;
	border: 1px solid var(--cfc-line);
	border-radius: var(--cfc-radius);
	background: var(--cfc-surface);
	box-shadow: var(--cfc-shadow);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.cfc-footer {
	padding: 40px 0 32px;
	background: var(--cfc-ink);
	color: rgba(255, 255, 255, .7);
	font-size: .9rem;
}

.cfc-footer a { color: #fff !important; text-decoration: none; }
.cfc-footer a:hover { color: var(--cfc-pink) !important; }

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */
.cfc-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.cfc-skip {
	position: absolute;
	top: -100px;
	left: 16px;
	z-index: 2000;
	padding: 10px 16px;
	border-radius: 8px;
	background: var(--cfc-pink);
	color: var(--cfc-ink) !important;
	font-weight: 600;
}

.cfc-skip:focus { top: 12px; }

@media (prefers-reduced-motion: reduce) {
	.cfc-drawer__panel, .cfc-drawer__backdrop { transition: none; }
}
