/* ======================================================================
   ZAMPP FOOTER EXTENSION CSS
   ----------------------------------------------------------------------
   Purpose:
   - Control the extension-owned footer layout
   - Style the Administration Control Panel button/link
   - Style the external-link confirmation modal
   - Keep footer behavior documented for future maintenance

   Maintenance guide:
   1. File purpose
   2. Footer layout structure
   3. Footer layout selectors
   4. Footer row selectors
   5. ACP button selectors
   6. External modal selectors
   7. Modal state selectors
   8. Responsive adjustments
   ====================================================================== */

/* ======================================================================
   01. FILE PURPOSE
   ----------------------------------------------------------------------
   This stylesheet controls only the custom footer block injected by the
   extension and the external-link confirmation modal.

   It does:
   - Position the custom footer layout
   - Align the left, right, and centered footer sections
   - Style the ACP link as a button
   - Style the external-link modal and its controls
   - Adjust footer layout for small screens

   It does not:
   - Directly control native phpBB footer rows
   - Replace phpBB core footer template behavior
   - Remove native rows with CSS

   Native phpBB footer cleanup is handled by the companion script.
   ====================================================================== */

/* ======================================================================
   02. FOOTER LAYOUT STRUCTURE
   ----------------------------------------------------------------------
   The custom footer is organized into 3 visual sections:

   Left column:
   - Copyright © 2026 ZAMPP Community Forum.
   - Privacy | Terms

   Right column:
   - Site design and/or modifications by ZAMPP Development Team
   - Administration Control Panel

   Bottom centered row:
   - Powered by phpBB® Forum Software © phpBB Limited

   The goal is to keep this layout extension-owned and as style-agnostic
   as practical across phpBB styles.
   ====================================================================== */

/* ======================================================================
   03. FOOTER LAYOUT SELECTORS
   ----------------------------------------------------------------------
   Core structure rules for the injected footer block.
   ====================================================================== */

/*
   .copyright .zampp-footer-layout
   - Main wrapper for the entire custom footer block
   - Moves the whole footer block up/down relative to phpBB footer space
   - Edit here when the whole custom footer needs vertical repositioning
*/

/*
   .copyright .zampp-footer-layout__top
   - Top flex layout for the left and right columns
   - Handles column spacing, alignment, and wrapping
   - Edit here when adjusting the two-column layout behavior
*/

/*
   .copyright .zampp-footer-layout__column
   - Base style for footer columns
   - Stacks child rows vertically with consistent spacing
   - Edit here when changing spacing between rows inside a column
*/

/*
   .copyright .zampp-footer-layout__column--left
   - Left column layout
   - Holds copyright and privacy/terms
   - Flexible width and left aligned
*/

/*
   .copyright .zampp-footer-layout__column--right
   - Right column layout
   - Holds ZAMPP credit and ACP button
   - Right aligned and pushed to the far right
*/

/* ======================================================================
   04. FOOTER ROW SELECTORS
   ----------------------------------------------------------------------
   Row-level spacing and alignment inside the footer layout.
   ====================================================================== */

/*
   .copyright .zampp-footer-row
   - Base reset for all custom footer rows
   - Removes default paragraph margin
   - Keeps row spacing predictable
*/

/*
   .copyright .zampp-footer-row--acp
   - ACP row spacing control
   - Moves the Administration Control Panel row below the ZAMPP credit
   - Edit here to move the ACP row up/down
*/

/*
   .copyright .zampp-footer-row--powered
   - Powered-by phpBB row
   - Adds spacing below the top columns
   - Centers the powered-by line
   - Edit here to move the powered row up/down
*/

/*
   .copyright .zampp-footer-row__item--centered
   - Inner powered-row content wrapper
   - Forces centered content to behave as a full-width block
   - Helps reliable centering
*/

/* ======================================================================
   05. ACP BUTTON SELECTORS
   ----------------------------------------------------------------------
   ACP link/button styling and interaction states.
   ====================================================================== */

/*
   .copyright .zampp-footer-row--acp a.zampp-footer-row__button-link.footer-link,
   .copyright .zampp-footer-row--acp a.zampp-footer-row__button-link.footer-link:link,
   .copyright .zampp-footer-row--acp a.zampp-footer-row__button-link.footer-link:visited

   - Default ACP button states
   - Styles the ACP link as a button with:
     - blue background
     - white text
     - blue border
     - padding
     - rounded corners
     - transition effects
   - Scoped specifically to beat phpBB footer-link overrides
*/

/*
   .copyright .zampp-footer-row--acp a.zampp-footer-row__button-link.footer-link:hover,
   .copyright .zampp-footer-row--acp a.zampp-footer-row__button-link.footer-link:focus,
   .copyright .zampp-footer-row--acp a.zampp-footer-row__button-link.footer-link:active

   - ACP interactive states
   - Reverses the ACP button appearance on hover/focus/active:
     - transparent background
     - blue text
     - blue border
     - shadow feedback
   - Edit here when changing ACP button hover behavior
*/

/* ======================================================================
   06. EXTERNAL MODAL SELECTORS
   ----------------------------------------------------------------------
   External-link confirmation popup structure and presentation.
   ====================================================================== */

/*
   .zampp-external-modal
   - Full-screen modal wrapper
   - Fixed overlay above page content
*/

/*
   .zampp-external-modal__backdrop
   - Modal overlay behind the dialog
   - Darkens the page background
*/

/*
   .zampp-external-modal__dialog
   - Main popup panel
   - Controls width, spacing, colors, border radius, and shadow
*/

/*
   .zampp-external-modal__close
   - Top-right close button
   - Positions and styles the dismiss control
*/

/*
   .zampp-external-modal__icon
   - Icon container in the modal
   - Creates the circular icon background
*/

/*
   .zampp-external-modal__title
   - Modal heading
   - Controls heading size and spacing
*/

/*
   .zampp-external-modal__text
   - Modal body text
   - Controls paragraph size, spacing, and line-height
*/

/*
   .zampp-external-modal__actions
   - Action button row inside the modal
   - Right-aligns buttons with spacing
*/

/*
   .zampp-external-modal__button
   - Individual modal action buttons
   - Sets minimum width for visual balance
*/

/* ======================================================================
   07. MODAL STATE SELECTORS
   ----------------------------------------------------------------------
   State management for modal visibility and page scroll locking.
   ====================================================================== */

/*
   .zampp-external-modal[hidden]
   - Hidden modal state
   - Removes modal from display
*/

/*
   html.zampp-external-modal-open,
   html.zampp-external-modal-open body
   - Page state while modal is open
   - Disables background scrolling
*/

/* ======================================================================
   08. RESPONSIVE ADJUSTMENTS
   ----------------------------------------------------------------------
   Small-screen footer layout behavior.
   ====================================================================== */

/*
   @media (max-width: 700px)
   - Changes top layout from side-by-side columns to stacked columns
   - Left-aligns both columns for mobile readability
   - Removes right-push behavior from the right column
   - Left-aligns the powered-by row on small screens
*/

/* ======================================================================
   QUICK MAINTENANCE REFERENCE
   ----------------------------------------------------------------------
   To move the whole footer block:
   - edit .zampp-footer-layout

   To move only the ACP row:
   - edit .zampp-footer-row--acp

   To move only the powered-by row:
   - edit .zampp-footer-row--powered

   To change ACP default button colors:
   - edit the ACP default/link/visited selector block

   To change ACP hover colors:
   - edit the ACP hover/focus/active selector block

   To adjust mobile behavior:
   - edit the @media (max-width: 700px) section
   ====================================================================== */

.copyright .zampp-footer-layout {
	margin-top: -1.55rem;
}

.copyright .zampp-footer-layout__top {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 0.75rem 2rem;
	flex-wrap: wrap;
}

.copyright .zampp-footer-layout__column {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	min-width: 0;
}

.copyright .zampp-footer-layout__column--left {
	flex: 1 1 18rem;
	align-items: flex-start;
	text-align: left;
}

.copyright .zampp-footer-layout__column--right {
	flex: 0 1 auto;
	align-items: flex-end;
	text-align: right;
	margin-left: auto;
}

.copyright .zampp-footer-row {
	margin: 0;
}

.copyright .zampp-footer-row--acp {
	margin-top: 0.5rem;
}

.copyright .zampp-footer-row--powered {
	margin-top: 0.75rem;
	text-align: center;
}

.copyright .zampp-footer-row__item--centered {
	display: block;
	width: 100%;
}

.copyright .zampp-footer-row--acp a.zampp-footer-row__button-link.footer-link,
.copyright .zampp-footer-row--acp a.zampp-footer-row__button-link.footer-link:link,
.copyright .zampp-footer-row--acp a.zampp-footer-row__button-link.footer-link:visited {
	display: inline-block;
	padding-top: 6.4px;
	padding-right: 13.6px;
	padding-bottom: 6.4px;
	padding-left: 13.6px;
	border: 1px solid #4985cb;
	border-radius: 0.4rem;
	line-height: 1.2;
	text-decoration: none;
	background: #4985cb;
	color: #FFFFFF !important;
	transition: box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.copyright .zampp-footer-row--acp a.zampp-footer-row__button-link.footer-link:hover,
.copyright .zampp-footer-row--acp a.zampp-footer-row__button-link.footer-link:focus,
.copyright .zampp-footer-row--acp a.zampp-footer-row__button-link.footer-link:active {
	text-decoration: none;
	background: transparent;
	border-color: #4985cb;
	color: #4985cb !important;
	box-shadow: 0 0.2rem 0.45rem rgba(0, 0, 0, 0.16);
	outline: none;
}

.zampp-external-modal[hidden] {
	display: none !important;
}

.zampp-external-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
}

.zampp-external-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
}

.zampp-external-modal__dialog {
	position: relative;
	z-index: 1;
	max-width: 480px;
	margin: 10vh auto 0;
	background: #ffffff;
	color: #1f2d3d;
	border-radius: 12px;
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
	padding: 22px 22px 18px;
	border: 1px solid rgba(0, 0, 0, 0.12);
}

.zampp-external-modal__close {
	position: absolute;
	top: 10px;
	right: 12px;
	background: transparent;
	border: 0;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	color: #6b7280;
}

.zampp-external-modal__icon {
	width: 42px;
	height: 42px;
	border-radius: 999px;
	background: #f1f5f9;
	color: #334155;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 22px;
	font-weight: 700;
	margin-bottom: 12px;
}

.zampp-external-modal__title {
	margin: 0 0 8px;
	font-size: 22px;
	line-height: 1.2;
}

.zampp-external-modal__text {
	margin: 0;
	font-size: 14px;
	line-height: 1.6;
}

.zampp-external-modal__actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-top: 18px;
}

.zampp-external-modal__button {
	min-width: 110px;
}

html.zampp-external-modal-open,
html.zampp-external-modal-open body {
	overflow: hidden;
}

@media (max-width: 700px) {
	.copyright .zampp-footer-layout {
	margin-top: -1.55rem;
}

.copyright .zampp-footer-layout__top {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 0.75rem 2rem;
	flex-wrap: wrap;
}

.copyright .zampp-footer-layout__column {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	min-width: 0;
}

.copyright .zampp-footer-layout__column--left {
	flex: 1 1 18rem;
	align-items: flex-start;
	text-align: left;
}

.copyright .zampp-footer-layout__column--right {
	flex: 0 1 auto;
	align-items: flex-end;
	text-align: right;
	margin-left: auto;
}

.copyright .zampp-footer-row {
	margin: 0;
}

.copyright .zampp-footer-row--acp {
	margin-top: 0.5rem;
}

.copyright .zampp-footer-row--powered {
	margin-top: 0.75rem;
	text-align: center;
}

.copyright .zampp-footer-row__item--centered {
	display: block;
	width: 100%;
}

.copyright .zampp-footer-row--acp a.zampp-footer-row__button-link.footer-link,
.copyright .zampp-footer-row--acp a.zampp-footer-row__button-link.footer-link:link,
.copyright .zampp-footer-row--acp a.zampp-footer-row__button-link.footer-link:visited {
	display: inline-block;
	padding: 0.4rem 0.85rem;
	border: 1px solid #4985cb;
	border-radius: 0.4rem;
	line-height: 1.2;
	text-decoration: none;
	background: #4985cb;
	color: #FFFFFF !important;
	transition: box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.copyright .zampp-footer-row--acp a.zampp-footer-row__button-link.footer-link:hover,
.copyright .zampp-footer-row--acp a.zampp-footer-row__button-link.footer-link:focus,
.copyright .zampp-footer-row--acp a.zampp-footer-row__button-link.footer-link:active {
	text-decoration: none;
	background: transparent;
	border-color: #4985cb;
	color: #4985cb !important;
	box-shadow: 0 0.2rem 0.45rem rgba(0, 0, 0, 0.16);
	outline: none;
}

.zampp-external-modal[hidden] {
	display: none !important;
}

.zampp-external-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
}

.zampp-external-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
}

.zampp-external-modal__dialog {
	position: relative;
	z-index: 1;
	width: min(100% - 2rem, 480px);
	margin: 10vh auto 0;
	background: #ffffff;
	color: #1f2d3d;
	border-radius: 12px;
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
	padding: 22px 22px 18px;
	border: 1px solid rgba(0, 0, 0, 0.12);
	box-sizing: border-box;
}

.zampp-external-modal__close {
	position: absolute;
	top: 10px;
	right: 12px;
	background: transparent;
	border: 0;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	color: #6b7280;
}

.zampp-external-modal__icon {
	width: 42px;
	height: 42px;
	border-radius: 999px;
	background: #f1f5f9;
	color: #334155;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 22px;
	font-weight: 700;
	margin-bottom: 12px;
}

.zampp-external-modal__title {
	margin: 0 0 8px;
	font-size: 22px;
	line-height: 1.2;
	word-wrap: break-word;
	overflow-wrap: break-word;
}

.zampp-external-modal__text {
	margin: 0;
	font-size: 14px;
	line-height: 1.6;
	word-wrap: break-word;
	overflow-wrap: break-word;
}

.zampp-external-modal__actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-top: 18px;
	flex-wrap: wrap;
}

.zampp-external-modal__button {
	min-width: 110px;
	max-width: 100%;
}

html.zampp-external-modal-open,
html.zampp-external-modal-open body {
	overflow: hidden;
}

/* Tablets */
@media (max-width: 768px) {
	.copyright .zampp-footer-layout {
		margin-top: 0;
	}

	.copyright .zampp-footer-layout__top {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.75rem;
	}

	.copyright .zampp-footer-layout__column,
	.copyright .zampp-footer-layout__column--right {
		width: 100%;
		align-items: flex-start;
		text-align: left;
		margin-left: 0;
	}

	.copyright .zampp-footer-row--powered {
		text-align: left;
	}

	.zampp-external-modal__dialog {
		width: min(100% - 1.5rem, 480px);
		margin-top: 8vh;
		padding: 20px 18px 16px;
	}

	.zampp-external-modal__title {
		font-size: 20px;
	}

	.zampp-external-modal__actions {
		justify-content: stretch;
	}

	.zampp-external-modal__button {
		flex: 1 1 auto;
	}
}

/* Mobile */
@media (max-width: 480px) {
	.copyright .zampp-footer-layout {
		margin-top: 0;
	}

	.copyright .zampp-footer-layout__top {
		gap: 0.5rem;
	}

	.copyright .zampp-footer-layout__column,
	.copyright .zampp-footer-layout__column--left,
	.copyright .zampp-footer-layout__column--right {
		width: 100%;
		flex: 1 1 100%;
		align-items: flex-start;
		text-align: left;
		margin-left: 0;
	}

	.copyright .zampp-footer-row--acp a.zampp-footer-row__button-link.footer-link,
	.copyright .zampp-footer-row--acp a.zampp-footer-row__button-link.footer-link:link,
	.copyright .zampp-footer-row--acp a.zampp-footer-row__button-link.footer-link:visited {
		width: 100%;
		text-align: center;
		box-sizing: border-box;
	}

	.copyright .zampp-footer-row--powered {
		text-align: left;
	}

	.zampp-external-modal__dialog {
		width: calc(100% - 1rem);
		margin-top: 5vh;
		padding: 18px 14px 14px;
		border-radius: 10px;
	}

	.zampp-external-modal__close {
		top: 8px;
		right: 10px;
		font-size: 24px;
	}

	.zampp-external-modal__icon {
		width: 38px;
		height: 38px;
		font-size: 20px;
		margin-bottom: 10px;
	}

	.zampp-external-modal__title {
		font-size: 18px;
	}

	.zampp-external-modal__text {
		font-size: 13px;
		line-height: 1.5;
	}

	.zampp-external-modal__actions {
		flex-direction: column;
		align-items: stretch;
		gap: 8px;
	}

	.zampp-external-modal__button {
		width: 100%;
		min-width: 0;
	}
}