/*
Theme Name: Mutual Promotion App
Theme URI: https://mutualpromotion.com
Description: App-like, installable (PWA) web client for Mutual Promotion — mirrors the Flutter app, same mutual/v1 REST API, same account.
Version: 1.0.0
Author: Indian Admin
Author URI: https://indianadmin.com
Text Domain: mutual-promotion-app
*/

:root {
	/* Exact values from lib/theme.dart's MP class, so the site matches the app
	   pixel-for-pixel on color, not just approximately. */
	--mp-primary: #1877F2;
	--mp-primary-deep: #0B4FB0;
	--mp-primary-light: #4DA3FF;
	--mp-secondary: #E7F0FE;
	--mp-button-primary: #283943; /* MP.buttonPrimary — every ElevatedButton uses THIS, not primary */
	--mp-gold: #D4A017;

	--mp-text: #1A1A1A;
	--mp-gray-200: #C8C8C8;
	--mp-gray-400: #919191;
	--mp-gray-500: #6E6E6E;
	--mp-gray-900: #212121;
	--mp-bg: #F5F7FA;
	--mp-card: #FFFFFF;

	--mp-radius: 16px;
	--mp-radius-sm: 10px;
	--mp-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
	--mp-wrap: 520px; /* this is a phone-shaped app, not a wide desktop site */
}

* {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	/* Slightly deeper than --mp-bg so the centered shell reads as a distinct app
	   "frame" on a wide desktop window instead of blending into the backdrop. */
	background: #E7EBF1;
	color: var(--mp-text);
	font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	min-height: 100vh;
	-webkit-tap-highlight-color: transparent;
}

[hidden] {
	display: none !important;
}

img {
	max-width: 100%;
	display: block;
}

a {
	color: inherit;
	text-decoration: none;
}

button {
	font: inherit;
}

/* App shell: centered phone-width column, like the Flutter app's own layout. On a
   wide desktop window it gets a visible shadow "frame" against the deeper body
   background instead of just thinning out into empty gray on both sides. */
.mp-shell {
	max-width: var(--mp-wrap);
	margin: 0 auto;
	min-height: 100vh;
	background: var(--mp-bg);
	position: relative;
	display: flex;
	flex-direction: column;
}

@media (min-width: 640px) {
	.mp-shell {
		box-shadow: 0 0 2px rgba(17, 24, 39, 0.08), 0 20px 60px rgba(17, 24, 39, 0.14);
	}
}

/* Pinned to the top, narrow and centered — same position:fixed + left:50% +
   translateX(-50%) + max-width technique as .mp-bottom-nav below, so header and
   footer "fit" consistently (neither spans the full browser width on desktop).
   Since fixed elements leave no space in normal flow, every caller (topBar/
   pageHeader) also appends a matching spacer div right after it to hold its place. */
.mp-topbar {
	background: #fff;
	position: fixed;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 100%;
	max-width: var(--mp-wrap);
	padding: 14px 16px;
	min-height: 36px;
	display: flex;
	align-items: center;
	gap: 10px;
	z-index: 20;
	border-bottom: 1px solid var(--mp-gray-200);
}

/* Reserves the fixed header's height in normal flow (65px = 36px content +
   2x14px padding + 1px border), appended as a sibling right after it. */
.mp-topbar-spacer {
	height: 65px;
	flex: 0 0 auto;
}

.mp-topbar img.mp-logo {
	height: 32px;
}

.mp-topbar .mp-spacer {
	flex: 1;
}

.mp-icon-btn {
	border: 0;
	background: transparent;
	width: 36px;
	height: 36px;
	border-radius: 999px;
	display: grid;
	place-items: center;
	color: var(--mp-gray-500);
	cursor: pointer;
	position: relative;
}

.mp-icon-btn:active {
	background: var(--mp-gray-200);
}

.mp-dot {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #e5484d;
	border: 1.5px solid #fff;
}

main#mp-app {
	flex: 1;
	padding: 16px 16px 90px;
}

/* Cards / buttons shared across every view */
.mp-card {
	background: var(--mp-card);
	border-radius: var(--mp-radius);
	box-shadow: var(--mp-shadow);
	padding: 16px;
}

.mp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border: 0;
	border-radius: 10px;
	min-height: 48px;
	padding: 13px 18px;
	font-weight: 700;
	font-size: 15px;
	cursor: pointer;
	width: 100%;
}

.mp-btn-primary {
	background: var(--mp-button-primary);
	color: #fff;
}

.mp-btn-primary:disabled {
	opacity: 0.6;
	cursor: default;
}

.mp-btn-outline {
	background: #fff;
	color: var(--mp-gray-900);
	border: 1px solid var(--mp-gray-200);
}

.mp-field {
	margin-bottom: 14px;
}

.mp-field label {
	display: block;
	font-size: 13px;
	color: var(--mp-gray-500);
	margin-bottom: 6px;
}

.mp-field input {
	width: 100%;
	padding: 13px 14px;
	border-radius: 12px;
	border: 1px solid var(--mp-gray-200);
	font-size: 15px;
	background: #fff;
}

.mp-field input:focus {
	outline: 2px solid var(--mp-primary);
	outline-offset: -1px;
}

.mp-error {
	color: #d6334c;
	font-size: 13.5px;
	margin: 6px 0 14px;
}

.mp-muted {
	color: var(--mp-gray-500);
	font-size: 13.5px;
}

.mp-link-btn {
	background: none;
	border: 0;
	color: var(--mp-primary);
	font-weight: 600;
	cursor: pointer;
	padding: 0;
	font-size: 14px;
}

.mp-center {
	text-align: center;
}

.mp-divider-row {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 16px 0;
	color: var(--mp-gray-400);
	font-size: 13px;
}

.mp-divider-row::before,
.mp-divider-row::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--mp-gray-200);
}

.mp-google-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	padding: 12px 16px;
	border-radius: 12px;
	border: 1px solid var(--mp-gray-200);
	background: #fff;
	font-weight: 600;
	cursor: pointer;
}

.mp-google-btn img {
	width: 20px;
	height: 20px;
}

/* Splash / loading */
.mp-splash {
	min-height: 100vh;
	display: grid;
	place-items: center;
	background: #fff;
}

.mp-spinner {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: 3px solid var(--mp-gray-200);
	border-top-color: var(--mp-primary);
	animation: mp-spin 0.8s linear infinite;
}

@keyframes mp-spin {
	to { transform: rotate(360deg); }
}

/* Coins header card + its overlapping white action bar — mirrors the Flutter Home
 * header's Stack(gradient card, Positioned white bar) exactly. */
.mp-coins-wrap {
	position: relative;
	margin: 0 0 32px; /* extra bottom space reserved for the bar hanging off the card */
}

.mp-coins-card {
	/* MP.headerGradient: topLeft -> bottomRight, [primaryDeep, primary, primaryLight]. */
	background: linear-gradient(135deg, var(--mp-primary-deep), var(--mp-primary), var(--mp-primary-light));
	border-radius: 24px;
	padding: 30px 22px 38px;
	min-height: 110px;
	color: #fff;
	display: flex;
	align-items: center;
}

.mp-coins-card .mp-coins-left {
	flex: 0 0 40%;
}

.mp-coins-card .mp-coins-right {
	flex: 1;
	text-align: right;
}

.mp-coins-card .mp-coins-amount {
	font-size: 28px;
	font-weight: 800;
}

.mp-coins-card .mp-coins-label,
.mp-coins-card .mp-greeting {
	font-size: 12.5px;
	opacity: 0.9;
}

.mp-coins-card .mp-name {
	font-weight: 700;
	font-size: 15px;
}

.mp-action-bar {
	position: absolute;
	left: 28px;
	right: 28px;
	bottom: -26px;
	height: 56px;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 6px 18px rgba(17, 24, 39, 0.12);
	display: flex;
	align-items: stretch;
}

.mp-action-divider {
	width: 1px;
	margin: 12px 0;
	background: var(--mp-gray-200);
}

.mp-action-btn {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border: 0;
	background: none;
	cursor: pointer;
	font: inherit;
	font-size: 12.5px;
	font-weight: 700;
	color: var(--mp-gray-900);
}

.mp-action-btn svg { width: 20px; height: 20px; }

/* Promotion / campaign card */
.mp-promo-card {
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 0 6px rgba(0, 0, 0, 0.05);
	padding: 14px;
	margin-bottom: 12px;
}

/* Matches the Flutter app's _Pill exactly: MP.secondary bg, MP.primary text,
 * 20px radius, 10px/4px padding, 12px normal-weight text. */
.mp-pill {
	display: inline-flex;
	align-items: center;
	padding: 4px 10px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 400;
	background: var(--mp-secondary);
	color: var(--mp-primary);
}

/* Bottom nav */
.mp-bottom-nav {
	position: fixed;
	left: 50%;
	transform: translateX(-50%);
	bottom: 0;
	width: 100%;
	max-width: var(--mp-wrap);
	background: #fff;
	border-top: 1px solid var(--mp-gray-200);
	display: flex;
	justify-content: space-around;
	padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
	z-index: 20;
}

.mp-bottom-nav button {
	background: none;
	border: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	color: var(--mp-gray-400);
	font-size: 10.5px;
	cursor: pointer;
	padding: 4px 10px;
}

.mp-bottom-nav button.mp-active {
	color: var(--mp-primary);
}

.mp-bottom-nav svg {
	width: 22px;
	height: 22px;
}

@media (max-width: 420px) {
	.mp-coins-card .mp-coins-amount { font-size: 19px; }
}

/* Floating "+" quick-actions button, docked above the bottom nav like the Flutter app's FAB. */
.mp-fab {
	position: fixed;
	left: 50%;
	transform: translateX(-50%);
	bottom: 48px;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--mp-primary);
	color: #fff;
	display: grid;
	place-items: center;
	box-shadow: 0 4px 14px rgba(24, 119, 242, 0.4);
	z-index: 21;
	border: 4px solid var(--mp-bg);
	cursor: pointer;
}

.mp-fab svg {
	width: 26px;
	height: 26px;
}

/* Bottom sheet (Quick Actions) + generic overlay, used for the FAB menu. */
.mp-overlay {
	position: fixed;
	inset: 0;
	background: rgba(17, 24, 39, 0.4);
	z-index: 30;
	display: flex;
	align-items: flex-end;
	justify-content: center;
}

.mp-sheet {
	background: #fff;
	width: 100%;
	max-width: var(--mp-wrap);
	border-radius: 24px 24px 0 0;
	padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
}

.mp-sheet-title {
	font-size: 17px;
	font-weight: 800;
	margin-bottom: 10px;
}

.mp-sheet-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 0;
	cursor: pointer;
	border: 0;
	background: none;
	width: 100%;
	text-align: left;
}

.mp-sheet-item .mp-sheet-icon {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--mp-secondary);
	color: var(--mp-primary);
	display: grid;
	place-items: center;
	flex: 0 0 40px;
}

.mp-sheet-item .mp-sheet-icon svg { width: 20px; height: 20px; }
.mp-sheet-item strong { display: block; font-size: 14.5px; }
.mp-sheet-item span.mp-sub { display: block; font-size: 12.5px; color: var(--mp-gray-500); }

/* Choice grid (categories / platform) — animated bordered cards, same idea as the Flutter app. */
.mp-choice-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin-bottom: 14px;
}

.mp-choice-row {
	display: flex;
	gap: 10px;
	margin-bottom: 14px;
}

.mp-choice {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px;
	border-radius: 14px;
	border: 1px solid var(--mp-gray-200);
	background: #fff;
	cursor: pointer;
	text-align: left;
	flex: 1;
}

.mp-choice.mp-choice-active {
	border-color: var(--mp-primary);
	border-width: 1.8px;
	background: var(--mp-secondary);
}

.mp-choice svg { width: 20px; height: 20px; color: var(--mp-gray-400); flex: 0 0 20px; }
.mp-choice.mp-choice-active svg { color: var(--mp-primary); }
.mp-choice strong { font-size: 13.5px; }

.mp-summary-row {
	display: flex;
	justify-content: space-between;
	padding: 5px 0;
	font-size: 14px;
}

/* Support chat */
.mp-chat-wrap {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 16px;
	padding-bottom: 90px;
}

.mp-bubble {
	max-width: 78%;
	padding: 10px 14px;
	border-radius: 16px;
	font-size: 14px;
	line-height: 1.4;
}

.mp-bubble-user {
	align-self: flex-end;
	background: var(--mp-primary);
	color: #fff;
	border-bottom-right-radius: 4px;
}

.mp-bubble-admin {
	align-self: flex-start;
	background: #fff;
	color: var(--mp-text);
	border: 1px solid var(--mp-gray-200);
	border-bottom-left-radius: 4px;
}

.mp-chat-input-row {
	position: fixed;
	left: 50%;
	transform: translateX(-50%);
	bottom: 0;
	width: 100%;
	max-width: var(--mp-wrap);
	background: #fff;
	border-top: 1px solid var(--mp-gray-200);
	display: flex;
	gap: 8px;
	padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
	z-index: 20;
}

.mp-chat-input-row input {
	flex: 1;
	padding: 11px 14px;
	border-radius: 20px;
	border: 1px solid var(--mp-gray-200);
	font-size: 14px;
}

.mp-chat-input-row button {
	border: 0;
	background: var(--mp-primary);
	color: #fff;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	cursor: pointer;
	flex: 0 0 42px;
}

/* Notifications */
.mp-notif-item {
	display: flex;
	gap: 10px;
	padding: 14px;
	background: #fff;
	border-radius: var(--mp-radius);
	box-shadow: var(--mp-shadow);
	margin-bottom: 10px;
	cursor: pointer;
	position: relative;
}

.mp-notif-item.mp-unread::before {
	content: "";
	position: absolute;
	left: 6px;
	top: 18px;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--mp-primary);
}

.mp-notif-item .mp-notif-body { flex: 1; padding-left: 8px; }
.mp-notif-item .mp-notif-title { font-weight: 700; font-size: 14px; margin-bottom: 3px; }
.mp-notif-item .mp-notif-msg { font-size: 13px; color: var(--mp-gray-500); }
.mp-notif-item .mp-notif-time { font-size: 11px; color: var(--mp-gray-400); margin-top: 4px; }

/* Leaderboard */
.mp-rank-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	background: #fff;
	border-radius: var(--mp-radius-sm);
	margin-bottom: 8px;
}

.mp-rank-row.mp-rank-me {
	border: 1.5px solid var(--mp-primary);
	background: var(--mp-secondary);
}

.mp-rank-num {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--mp-secondary);
	color: var(--mp-primary);
	font-weight: 800;
	font-size: 13px;
	display: grid;
	place-items: center;
	flex: 0 0 28px;
}

/* Plain legal/marketing pages (Privacy Policy, Terms & Conditions) — rendered server-side by
   page.php, not the JS app, so they need their own simple typography instead of relying on
   app.js to style anything. */
.mp-static-page {
	flex: 1;
	display: flex;
	flex-direction: column;
}

.mp-static-header {
	padding: 16px 20px;
	border-bottom: 1px solid var(--mp-gray-200);
	background: var(--mp-card);
}

.mp-static-logo {
	font-weight: 800;
	font-size: 16px;
	color: var(--mp-primary);
}

.mp-static-content {
	flex: 1;
	padding: 24px 20px 48px;
}

.mp-static-content h1 {
	font-size: 22px;
	font-weight: 800;
	color: var(--mp-gray-900);
	margin: 0 0 16px;
}

.mp-static-body {
	font-size: 14.5px;
	line-height: 1.7;
	color: var(--mp-text);
}

.mp-static-body h2 {
	font-size: 17px;
	font-weight: 700;
	margin: 24px 0 10px;
	color: var(--mp-gray-900);
}

.mp-static-body h3 {
	font-size: 15px;
	font-weight: 700;
	margin: 18px 0 8px;
}

.mp-static-body p,
.mp-static-body ul,
.mp-static-body ol {
	margin: 0 0 14px;
}

.mp-static-body ul,
.mp-static-body ol {
	padding-left: 22px;
}

.mp-static-body a {
	color: var(--mp-primary);
	text-decoration: underline;
}
