/* Viral Marketer AI — frontend pages
 * Re-creates the wp-admin building blocks (buttons, spinner, notices,
 * list table, form table) that admin.css relies on, scoped under
 * .vmai-frontend so theme styles cannot break the tools.
 */

.vmai-frontend,
.vmai-frontend * { box-sizing: border-box; }

.vmai-frontend {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	font-size: 14px;
	line-height: 1.5;
	color: #1d2327;
	max-width: 1240px;
	margin: 0 auto;
	padding: 8px 4px 40px;
}

.vmai-frontend .wrap.vmai-wrap { margin: 10px 0 0; }
.vmai-frontend .vmai-title { color: #1d2327; }
.vmai-frontend p.description,
.vmai-frontend .description { color: #646970; font-size: 13px; font-style: normal; }
.vmai-frontend .vmai-hub-sub { font-size: 15px; margin-top: -8px; }

/* --- Buttons (wp-admin lookalike) --- */
.vmai-frontend .button,
.vmai-frontend button.button,
.vmai-frontend a.button {
	display: inline-block;
	padding: 6px 14px;
	border: 1px solid #2271b1;
	border-radius: 6px;
	background: #f6f7f7;
	color: #2271b1;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
	cursor: pointer;
	text-decoration: none;
	vertical-align: middle;
	transition: background .15s ease, color .15s ease;
}
.vmai-frontend .button:hover { background: #f0f0f1; border-color: #0a4b78; color: #0a4b78; }
.vmai-frontend .button:disabled { opacity: .6; cursor: not-allowed; }
.vmai-frontend .button-primary,
.vmai-frontend button.button-primary,
.vmai-frontend a.button-primary {
	background: #2271b1;
	border-color: #2271b1;
	color: #fff;
}
.vmai-frontend .button-primary:hover { background: #135e96; border-color: #135e96; color: #fff; }
.vmai-frontend .button-small { padding: 3px 10px; font-size: 12px; }
.vmai-frontend .button-hero { padding: 10px 22px; font-size: 15px; }
.vmai-frontend .button .dashicons { font-size: 16px; width: 16px; height: 16px; vertical-align: text-bottom; }

/* --- Spinner (admin uses a gif; we draw our own) --- */
.vmai-frontend .spinner {
	display: inline-block;
	width: 18px;
	height: 18px;
	border: 2.5px solid #c3c4c7;
	border-top-color: #2271b1;
	border-radius: 50%;
	vertical-align: middle;
	opacity: 0;
	animation: vmai-spin .7s linear infinite;
}
.vmai-frontend .spinner.is-active { opacity: 1; }
@keyframes vmai-spin { to { transform: rotate(360deg); } }

/* --- Notices --- */
.vmai-frontend .notice {
	background: #fff;
	border: 1px solid #c3c4c7;
	border-left: 4px solid #dba617;
	border-radius: 6px;
	padding: 10px 14px;
	margin: 12px 0;
	max-width: 1200px;
}
.vmai-frontend .notice p { margin: 0; }
.vmai-frontend .notice a { color: #2271b1; }

/* --- Form elements --- */
.vmai-frontend input.regular-text,
.vmai-frontend textarea.large-text,
.vmai-frontend input[type="search"],
.vmai-frontend input[type="url"],
.vmai-frontend input[type="text"],
.vmai-frontend input[type="password"],
.vmai-frontend select {
	background: #fff;
	color: #2c3338;
	font-size: 14px;
	line-height: 1.4;
	box-shadow: none;
}
.vmai-frontend textarea.large-text { width: 100%; }

/* --- Settings form table --- */
.vmai-frontend .form-table { border-collapse: collapse; width: 100%; }
.vmai-frontend .form-table th {
	width: 220px;
	text-align: left;
	vertical-align: top;
	padding: 16px 12px 16px 0;
	font-weight: 600;
	color: #1d2327;
}
.vmai-frontend .form-table td { padding: 12px 0; }
.vmai-frontend .form-table input.regular-text { width: 100%; max-width: 460px; padding: 8px 12px; border-radius: 8px; border: 1px solid #8c8f94; }
.vmai-frontend .form-table select { max-width: 460px; width: 100%; padding: 8px 12px; border-radius: 8px; border: 1px solid #8c8f94; }
.vmai-frontend .form-table h2 { margin: 18px 0 4px; }

/* --- Library list table (wp-list-table lookalike) --- */
.vmai-frontend .vmai-table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
	border: 1px solid #dcdcde;
	font-size: 14px;
}
.vmai-frontend .vmai-table th,
.vmai-frontend .vmai-table td {
	padding: 10px 12px;
	text-align: left;
	vertical-align: middle;
	border-bottom: 1px solid #e2e4e7;
}
.vmai-frontend .vmai-table thead th,
.vmai-frontend .vmai-table thead td {
	font-weight: 600;
	color: #2c3338;
	border-bottom: 1px solid #c3c4c7;
}
.vmai-frontend .vmai-table.striped tbody tr:nth-child(odd) { background: #f9f9f9; }
.vmai-frontend .vmai-table .check-column { width: 34px; text-align: center; }
.vmai-frontend .vmai-table.fixed { table-layout: fixed; }
.vmai-frontend .vmai-table.fixed td { word-break: break-word; }
.vmai-frontend .vmai-table .vmai-thumb { width: 90px; }
.vmai-frontend .vmai-actions { min-width: 230px; }

/* --- Tabs / chips / cards need pointer + no theme underline --- */
.vmai-frontend a { text-decoration: none; }
.vmai-frontend .vmai-tab,
.vmai-frontend .vmai-chip,
.vmai-frontend .vmai-kw-chip { user-select: none; }

/* --- Frontend nav (links the five tool pages) --- */
.vmai-front-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 6px 0 18px;
	padding: 10px;
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 12px;
	box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.vmai-front-nav-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	border-radius: 999px;
	border: 1px solid #c3c4c7;
	background: #f6f7f7;
	color: #3c434a;
	font-size: 13px;
	font-weight: 600;
	transition: all .15s ease;
}
.vmai-front-nav-link:hover { border-color: #4f46e5; color: #3730a3; }
.vmai-front-nav-link .dashicons { font-size: 16px; width: 16px; height: 16px; }
.vmai-front-nav-active {
	background: #4f46e5;
	border-color: #4f46e5;
	color: #fff;
}
.vmai-front-nav-active:hover { color: #fff; }

/* --- Access gate (logged out / no permission) --- */
.vmai-gate {
	max-width: 520px;
	margin: 40px auto;
	text-align: center;
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 16px;
	padding: 44px 36px;
	box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.vmai-gate .dashicons {
	font-size: 52px;
	width: 52px;
	height: 52px;
	color: #4f46e5;
	margin-bottom: 8px;
}
.vmai-gate h2 { margin: 8px 0 10px; }
.vmai-gate p { color: #646970; margin: 0 0 22px; }
.vmai-gate-btn {
	display: inline-block;
	background: #2271b1;
	color: #fff;
	font-weight: 600;
	padding: 10px 28px;
	border-radius: 8px;
	text-decoration: none;
}
.vmai-gate-btn:hover { background: #135e96; color: #fff; }

/* --- AI Marketing Hub dashboard --- */
.vmai-hub-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 14px;
	max-width: 1200px;
	margin: 18px 0 22px;
}
.vmai-hub-stat {
	background: linear-gradient(135deg, #4f46e5, #7c3aed);
	color: #fff;
	border-radius: 14px;
	padding: 18px 20px;
	box-shadow: 0 2px 8px rgba(79,70,229,.25);
}
.vmai-hub-stat strong { display: block; font-size: 30px; line-height: 1.1; }
.vmai-hub-stat span { font-size: 13px; opacity: .9; }
.vmai-hub-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 18px;
	max-width: 1200px;
}
.vmai-hub-card {
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 14px;
	padding: 24px;
	box-shadow: 0 1px 4px rgba(0,0,0,.05);
	transition: box-shadow .15s ease, transform .15s ease;
}
.vmai-hub-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,.1); transform: translateY(-2px); }
.vmai-hub-card .dashicons {
	font-size: 34px;
	width: 34px;
	height: 34px;
	color: #4f46e5;
}
.vmai-hub-card h3 { margin: 10px 0 8px; font-size: 17px; }
.vmai-hub-card p { color: #50575e; font-size: 13.5px; margin: 0 0 14px; }
.vmai-hub-link { color: #2271b1; font-weight: 600; font-size: 14px; }
.vmai-hub-link:hover { color: #135e96; }

/* --- Toasts: no wp-admin bar offset on the frontend --- */
body:not(.admin-bar) #vmai-toasts { top: 20px; }

/* --- Small screens --- */
@media (max-width: 782px) {
	.vmai-frontend .form-table th { display: block; width: 100%; padding-bottom: 0; }
	.vmai-frontend .vmai-table thead { display: none; }
	.vmai-frontend .vmai-table,
	.vmai-frontend .vmai-table tbody,
	.vmai-frontend .vmai-table tr,
	.vmai-frontend .vmai-table td,
	.vmai-frontend .vmai-table th { display: block; width: 100%; }
	.vmai-frontend .vmai-table .check-column { width: 100%; text-align: left; }
	.vmai-frontend .vmai-actions { min-width: 0; }
}

/* --- v26.0: notice variants (frontend.css only had the warning tint) --- */
.vmai-frontend .notice-success { border-left-color: #00a32a; }
.vmai-frontend .notice-error { border-left-color: #d63638; }

/* --- v26.0: inline login form inside the access gate --- */
.vmai-gate-form { margin: 0 auto 6px; max-width: 320px; text-align: left; }
.vmai-gate-form label { display: block; font-weight: 600; font-size: 13px; margin: 12px 0 4px; color: #1d2327; }
.vmai-gate-form input[type="text"],
.vmai-gate-form input[type="password"] {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid #8c8f94;
	border-radius: 8px;
	font-size: 14px;
	background: #fff;
}
.vmai-gate-form .login-remember { margin-top: 10px; }
.vmai-gate-form .login-remember label { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; margin: 0; }
.vmai-gate-form .login-submit { margin-top: 14px; text-align: center; }
.vmai-gate-form .login-submit .button,
.vmai-gate-form input[type="submit"] {
	background: #2271b1;
	border: 1px solid #2271b1;
	border-radius: 8px;
	color: #fff;
	font-weight: 600;
	padding: 10px 28px;
	font-size: 14px;
	cursor: pointer;
}
.vmai-gate-form input[type="submit"]:hover { background: #135e96; }

/* --- v26.2: native password form on protected portal pages --- */
.vmai-frontend .post-password-form,
body .post-password-form { max-width: 520px; margin: 40px auto; }
.vmai-frontend .post-password-form input[type="password"] {
	padding: 8px 12px; border: 1px solid #8c8f94; border-radius: 8px; font-size: 14px;
}
