/**
* @package phpBB Extension - Copyright Panel
* @copyright (c) 2026 dmzx - https://www.dmzx-web.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
* Wraps the phpBB footer copyright section in a collapsible dashboard panel
* matching the System-Info / Stats-Info-Center visual language.
*
* Uses the same --sic-* CSS custom property values as Stats-Info-Center
* (no hard dependency -- fallbacks are provided for standalone use).
*
* Architecture:
*   overall_footer_after.html   fires once #page-footer .copyright is fully
*                                rendered by phpBB core + all extensions;
*                                JS reads every .footer-row inside it and
*                                rebuilds it as .cc-panel > .cc-body with
*                                .cc-notice / .cc-grid (credit cards) / .cc-nav
*                                (Privacy | Terms | ACP link). Order-independent
*                                -- no dependency on other extensions' listener
*                                priority on the shared copyright_prepend/append
*                                events.
*/

/* ── Reset phpBB's default .copyright wrapper ─────────────────────────── */
#page-footer .copyright {
	background: none !important;
	border: none !important;
	padding: 0 !important;
	margin: 0 !important;
	text-align: left !important;
}

/* ── Panel (matches System-Info .si-dashboard) ────────────────────────── */
.cc-panel {
	--cc-bg:           #0b0e14;
	--cc-panel:        rgba(255,255,255,0.04);
	--cc-panel-border: rgba(255,255,255,0.08);
	--cc-text:         #e8eaf0;
	--cc-text-dim:     #8b93a7;
	--cc-accent:       #6ea8fe;
	--cc-radius:       14px;

	background: var(--cc-bg);
	color: var(--cc-text);
	border-radius: var(--cc-radius);
	padding: 18px 20px;
	margin: 12px 0 8px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
}

/* ── Panel header ─────────────────────────────────────────────────────── */
.cc-hdr {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 14px;
}

.cc-hdr-icon { color: var(--cc-accent); }

.cc-title {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: .2px;
	color: var(--cc-text);
}

/* Collapse button — identical to .sic-collapse-btn */
.cc-collapse-btn {
	background: transparent;
	border: 1px solid var(--cc-panel-border);
	border-radius: 6px;
	color: var(--cc-text-dim);
	width: 24px;
	height: 24px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	margin-left: auto;
	transition: color .15s, border-color .15s;
	flex-shrink: 0;
}
.cc-collapse-btn:hover {
	color: var(--cc-text);
	border-color: rgba(255,255,255,0.2);
}

/* ── Body (hidden when collapsed) ─────────────────────────────────────── */
.cc-body {
	display: block;
}

/* ── Copyright notice block (spans full width) ────────────────────────── */
.cc-notice {
	background: rgba(255,255,255,0.03);
	border: 1px solid rgba(255,255,255,0.06);
	border-radius: 9px;
	padding: 10px 16px;
	margin-bottom: 10px;
	font-size: 12px;
	color: var(--cc-text-dim);
	line-height: 1.65;
	text-align: center;
}
.cc-notice a {
	color: var(--cc-accent);
	text-decoration: none;
}
.cc-notice a:hover { text-decoration: underline; }

/* ── Credit card grid ─────────────────────────────────────────────────── */
.cc-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	gap: 8px;
	margin-bottom: 0;
}

/* ── Individual credit card ───────────────────────────────────────────── */
.cc-card {
	background: var(--cc-panel);
	border: 1px solid var(--cc-panel-border);
	border-radius: 9px;
	padding: 9px 13px;
	transition: border-color .2s;
}
.cc-card:hover {
	border-color: rgba(255,255,255,0.16);
}

.cc-card-lbl {
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: .55px;
	color: var(--cc-text-dim);
	font-weight: 600;
	margin-bottom: 4px;
}

.cc-card-val {
	font-size: 12px;
	color: var(--cc-text);
	line-height: 1.5;
}
.cc-card-val a {
	color: var(--cc-accent);
	text-decoration: none;
}
.cc-card-val a:hover { text-decoration: underline; }

/* ── Nav row: Privacy | Terms | ACP link (inside the panel, below a divider) ── */
.cc-nav {
	margin-top: 14px;
	padding-top: 12px;
	border-top: 1px solid var(--cc-panel-border);
	text-align: center;
	font-size: 12px;
	color: var(--cc-text-dim);
}
.cc-nav a,
.cc-nav .footer-link {
	color: var(--cc-text-dim);
	text-decoration: none;
	transition: color .15s;
}
.cc-nav a:hover,
.cc-nav .footer-link:hover {
	color: var(--cc-accent);
}
.cc-nav .text-strong {
	color: #fbbf24 !important;
	font-weight: 600;
}
.cc-nav .cc-nav-sep {
	margin: 0 8px;
	color: var(--cc-panel-border);
}

@media (max-width: 600px) {
	.cc-grid { grid-template-columns: 1fr; }
}
