/**
 * Material Design 3 (Material You) Styling for Mashreq Certificates Frontend
 * Clean, modern, accessible, and responsive.
 */

/* ==========================================================================
   0. Material Symbols & Design Tokens
   ========================================================================== */
.material-symbols-outlined {
	font-family: 'Material Symbols Outlined', sans-serif;
	font-weight: normal;
	font-style: normal;
	font-size: 20px;
	line-height: 1;
	letter-spacing: normal;
	text-transform: none;
	display: inline-block;
	white-space: nowrap;
	word-wrap: normal;
	direction: ltr;
	-webkit-font-feature-settings: 'liga';
	-webkit-font-smoothing: antialiased;
	vertical-align: middle;
}

:root {
	/* Brand Primary: Al Mashreq Warm Orange */
	--md-sys-color-primary: #f37023;
	--md-sys-color-on-primary: #ffffff;
	--md-sys-color-primary-hover: #d95e14;
	--md-sys-color-primary-container: #ffede3;
	--md-sys-color-on-primary-container: #772500;

	/* Brand Secondary: Mashreq Deep Corporate Blue */
	--md-sys-color-secondary: #0f2b48;
	--md-sys-color-on-secondary: #ffffff;
	--md-sys-color-secondary-container: #e6f0fa;
	--md-sys-color-on-secondary-container: #001d36;

	/* Neutral Surfaces */
	--md-sys-color-surface: #ffffff;
	--md-sys-color-surface-dim: #f8fafc;
	--md-sys-color-surface-container: #f1f4f9;
	--md-sys-color-surface-container-high: #e7ecf3;
	--md-sys-color-surface-container-highest: #dde3ec;

	/* Outlines & Borders */
	--md-sys-color-outline: #c5cad3;
	--md-sys-color-outline-variant: #e2e6ed;

	/* Typography Colors */
	--md-sys-color-on-surface: #191c20;
	--md-sys-color-on-surface-variant: #535964;
	--md-sys-color-inverse-surface: #2d3138;

	/* Status Colors */
	--md-sys-color-success: #0f7b3a;
	--md-sys-color-success-container: #e6f6ec;
	--md-sys-color-on-success-container: #064e22;

	--md-sys-color-error: #ba1a1a;
	--md-sys-color-error-container: #ffdad6;
	--md-sys-color-on-error-container: #410002;

	/* Material Elevation Shadows */
	--md-elevation-1: 0 1px 3px 0 rgba(15, 23, 42, 0.08), 0 1px 2px -1px rgba(15, 23, 42, 0.06);
	--md-elevation-2: 0 4px 8px -1px rgba(15, 23, 42, 0.10), 0 2px 4px -2px rgba(15, 23, 42, 0.06);
	--md-elevation-3: 0 10px 20px -3px rgba(15, 23, 42, 0.12), 0 4px 6px -4px rgba(15, 23, 42, 0.06);
	--md-elevation-4: 0 20px 28px -4px rgba(15, 23, 42, 0.14), 0 8px 10px -6px rgba(15, 23, 42, 0.06);

	/* Shape Radii */
	--md-shape-xs: 4px;
	--md-shape-sm: 8px;
	--md-shape-md: 12px;
	--md-shape-lg: 18px;
	--md-shape-xl: 24px;
	--md-shape-full: 9999px;
}

/* ==========================================================================
   1. Scope & Typography Reset
   ========================================================================== */
.mashreq-cert-frontend {
	max-width: 960px;
	margin: 36px auto;
	padding: 0 16px;
	font-family: 'Roboto', 'Tajawal', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	color: var(--md-sys-color-on-surface);
	box-sizing: border-box;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

.mashreq-cert-frontend *,
.mashreq-cert-frontend *::before,
.mashreq-cert-frontend *::after {
	box-sizing: border-box;
}

/* ==========================================================================
   2. Material Admin Notice Bar
   ========================================================================== */
.mashreq-admin-notice-bar {
	background: var(--md-sys-color-surface);
	border: 1px solid var(--md-sys-color-outline-variant);
	border-left: 5px solid var(--md-sys-color-primary);
	border-radius: var(--md-shape-md);
	padding: 12px 20px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 24px;
	box-shadow: var(--md-elevation-1);
	transition: box-shadow 0.2s;
	flex-wrap: wrap;
	gap: 12px;
}

.mashreq-admin-notice-bar:hover {
	box-shadow: var(--md-elevation-2);
}

.mashreq-admin-notice-left {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.mashreq-admin-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: var(--md-sys-color-primary-container);
	color: var(--md-sys-color-on-primary-container);
	padding: 5px 12px;
	border-radius: var(--md-shape-full);
	font-size: 12.5px;
	font-weight: 600;
	letter-spacing: 0.3px;
}

.mashreq-admin-chip .material-symbols-outlined {
	font-size: 17px;
}

.mashreq-admin-notice-text {
	font-size: 13.5px;
	font-weight: 500;
	color: var(--md-sys-color-on-surface-variant);
}

.btn-toggle-admin-form {
	background: var(--md-sys-color-primary) !important;
	color: var(--md-sys-color-on-primary) !important;
	border: none !important;
	padding: 8px 18px !important;
	border-radius: var(--md-shape-full) !important;
	font-size: 13.5px !important;
	font-weight: 600 !important;
	letter-spacing: 0.3px !important;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	box-shadow: var(--md-elevation-1);
	transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
	text-decoration: none !important;
}

.btn-toggle-admin-form:hover {
	background: var(--md-sys-color-primary-hover) !important;
	box-shadow: var(--md-elevation-2);
	transform: translateY(-1px);
}

.btn-toggle-admin-form .material-symbols-outlined {
	font-size: 18px;
}

/* ==========================================================================
   3. Material Outlined Text Fields & Admin Form Card
   ========================================================================== */
.mashreq-admin-form-card {
	background: var(--md-sys-color-surface);
	border: 1px solid var(--md-sys-color-outline);
	border-radius: var(--md-shape-xl);
	padding: 28px 32px;
	margin-bottom: 30px;
	box-shadow: var(--md-elevation-3);
	animation: mdFadeIn 0.25s cubic-bezier(0, 0, 0.2, 1);
}

@keyframes mdFadeIn {
	from { opacity: 0; transform: translateY(-6px) scale(0.99); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

.mashreq-admin-form-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 22px;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.mashreq-admin-form-header h3 {
	margin: 0;
	font-size: 19px;
	font-weight: 700;
	color: var(--md-sys-color-on-surface);
	display: flex;
	align-items: center;
	gap: 10px;
}

.mashreq-admin-form-header h3 .material-symbols-outlined {
	font-size: 24px;
}

.md-icon-btn {
	background: none !important;
	border: none !important;
	border-radius: var(--md-shape-full) !important;
	width: 36px;
	height: 36px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: var(--md-sys-color-on-surface-variant) !important;
	transition: background 0.15s, color 0.15s;
	padding: 0 !important;
}

.md-icon-btn:hover {
	background: var(--md-sys-color-surface-container-high) !important;
	color: var(--md-sys-color-on-surface) !important;
}

.md-text-field {
	margin-bottom: 18px;
}

.md-text-field label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--md-sys-color-on-surface-variant);
	margin-bottom: 6px;
	letter-spacing: 0.2px;
}

.md-text-field input[type="text"],
.md-text-field input[type="date"],
.md-text-field select {
	width: 100% !important;
	height: 48px !important;
	padding: 0 16px !important;
	border-radius: var(--md-shape-md) !important;
	border: 1.5px solid var(--md-sys-color-outline) !important;
	background: var(--md-sys-color-surface) !important;
	color: var(--md-sys-color-on-surface) !important;
	font-size: 15px !important;
	font-family: inherit !important;
	transition: border-color 0.2s, box-shadow 0.2s;
	box-shadow: none !important;
}

.md-text-field input:focus,
.md-text-field select:focus {
	outline: none !important;
	border-color: var(--md-sys-color-primary) !important;
	box-shadow: 0 0 0 3px rgba(243, 112, 35, 0.18) !important;
}

.md-ref-panel {
	background: var(--md-sys-color-surface-dim);
	border: 1px solid var(--md-sys-color-outline-variant);
	border-radius: var(--md-shape-md);
	padding: 18px 20px;
	margin-bottom: 22px;
}

/* ==========================================================================
   4. Material Search Hero & Search Bar
   ========================================================================== */
.mashreq-search-hero {
	background: var(--md-sys-color-surface);
	border: 1px solid var(--md-sys-color-outline-variant);
	border-radius: var(--md-shape-xl);
	padding: 44px 32px 38px 32px;
	box-shadow: var(--md-elevation-1);
	text-align: center;
	margin-bottom: 32px;
	transition: box-shadow 0.25s ease;
}

.mashreq-search-hero:hover {
	box-shadow: var(--md-elevation-2);
}

.mashreq-icon-avatar {
	width: 64px;
	height: 64px;
	background: var(--md-sys-color-primary-container);
	color: var(--md-sys-color-primary);
	border-radius: var(--md-shape-full);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 18px;
	box-shadow: 0 2px 8px rgba(243, 112, 35, 0.2);
}

.mashreq-icon-avatar .material-symbols-outlined {
	font-size: 32px;
}

.mashreq-hero-title {
	margin: 0 0 10px 0;
	font-size: 26px;
	font-weight: 800;
	color: var(--md-sys-color-on-surface);
	letter-spacing: -0.3px;
}

.mashreq-hero-desc {
	margin: 0 auto 28px auto;
	max-width: 580px;
	color: var(--md-sys-color-on-surface-variant);
	font-size: 15px;
	line-height: 1.6;
}

/* Material 3 Pill Search Box */
.md-search-bar {
	display: flex;
	align-items: center;
	max-width: 720px;
	margin: 0 auto;
	background: var(--md-sys-color-surface);
	border: 2px solid var(--md-sys-color-outline-variant);
	border-radius: var(--md-shape-full);
	padding: 5px 6px 5px 20px;
	box-shadow: var(--md-elevation-1);
	transition: border-color 0.2s, box-shadow 0.2s;
}

.md-search-bar:focus-within {
	border-color: var(--md-sys-color-primary);
	box-shadow: var(--md-elevation-3), 0 0 0 4px rgba(243, 112, 35, 0.12);
}

.md-search-leading-icon {
	color: var(--md-sys-color-on-surface-variant);
	display: flex;
	align-items: center;
	margin-right: 12px;
}

.md-search-leading-icon .material-symbols-outlined {
	font-size: 22px;
}

.md-search-input {
	flex: 1;
	border: none !important;
	background: transparent !important;
	font-size: 15.5px !important;
	color: var(--md-sys-color-on-surface) !important;
	font-family: inherit !important;
	padding: 10px 0 !important;
	outline: none !important;
	box-shadow: none !important;
}

.md-search-input::placeholder {
	color: #7b818d;
	font-size: 14.5px;
}

.md-search-clear-btn {
	background: none !important;
	border: none !important;
	color: var(--md-sys-color-on-surface-variant) !important;
	cursor: pointer;
	padding: 6px !important;
	margin-right: 6px;
	border-radius: var(--md-shape-full) !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-decoration: none !important;
	transition: background 0.15s, color 0.15s;
}

.md-search-clear-btn:hover {
	background: var(--md-sys-color-surface-container-high) !important;
	color: var(--md-sys-color-on-surface) !important;
}

.md-search-clear-btn .material-symbols-outlined {
	font-size: 18px;
}

.md-search-btn {
	background: var(--md-sys-color-primary) !important;
	color: var(--md-sys-color-on-primary) !important;
	border: none !important;
	border-radius: var(--md-shape-full) !important;
	padding: 12px 24px !important;
	font-size: 14.5px !important;
	font-weight: 700 !important;
	letter-spacing: 0.3px !important;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	box-shadow: var(--md-elevation-1);
	transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
	text-decoration: none !important;
	white-space: nowrap;
}

.md-search-btn:hover {
	background: var(--md-sys-color-primary-hover) !important;
	box-shadow: var(--md-elevation-2);
	transform: translateY(-1px);
}

.md-search-btn .material-symbols-outlined {
	font-size: 19px;
}

/* Interactive Filter Assist Chips */
.md-chips-container {
	margin-top: 22px;
}

.md-chips-hint {
	display: block;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--md-sys-color-on-surface-variant);
	text-transform: uppercase;
	letter-spacing: 0.6px;
	margin-bottom: 10px;
}

.md-chips-row {
	display: flex;
	justify-content: center;
	gap: 10px;
	flex-wrap: wrap;
}

.md-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 14px !important;
	border-radius: var(--md-shape-full) !important;
	border: 1px solid var(--md-sys-color-outline-variant) !important;
	background: var(--md-sys-color-surface-dim) !important;
	color: var(--md-sys-color-on-surface-variant) !important;
	font-size: 12.5px !important;
	font-weight: 500 !important;
	cursor: default !important;
	user-select: none;
	font-family: inherit !important;
	box-shadow: none !important;
	line-height: normal !important;
	opacity: 0.9;
}

.md-chip-guide {
	pointer-events: none;
}

.md-chip-icon {
	font-size: 17px !important;
	color: var(--md-sys-color-primary);
}

.md-chip:hover .md-chip-icon {
	color: var(--md-sys-color-on-primary-container);
}

/* ==========================================================================
   5. Results Container & Summary
   ========================================================================== */
.mashreq-results-container {
	margin-top: 24px;
}

.md-results-summary {
	margin-bottom: 20px;
	font-size: 14.5px;
	font-weight: 600;
	color: var(--md-sys-color-on-surface-variant);
	display: flex;
	align-items: center;
	gap: 8px;
}

.md-results-summary .text-success {
	color: var(--md-sys-color-success);
	font-size: 22px;
}

/* ==========================================================================
   6. Material 3 Elevated Certificate Result Card
   ========================================================================== */
.mashreq-result-card {
	background: var(--md-sys-color-surface);
	border: 1px solid var(--md-sys-color-outline-variant);
	border-radius: var(--md-shape-xl);
	padding: 30px;
	margin-bottom: 26px;
	box-shadow: var(--md-elevation-1);
	transition: box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s;
	position: relative;
	overflow: hidden;
}

.mashreq-result-card:hover {
	box-shadow: var(--md-elevation-3);
	transform: translateY(-2px);
}

.mashreq-card-top-bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 22px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.md-verified-badge {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	background: var(--md-sys-color-success-container);
	color: var(--md-sys-color-success);
	padding: 6px 16px;
	border-radius: var(--md-shape-full);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.2px;
}

.md-verified-badge .material-symbols-outlined {
	font-size: 19px;
}

.md-ref-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-family: 'Roboto Mono', monospace, sans-serif;
	font-size: 13.5px;
	font-weight: 700;
	color: var(--md-sys-color-secondary);
	background: var(--md-sys-color-secondary-container);
	padding: 6px 14px;
	border-radius: var(--md-shape-md);
	letter-spacing: 0.5px;
}

/* Details Surface Grid */
.md-details-surface {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
	gap: 18px;
	background: var(--md-sys-color-surface-dim);
	border: 1px solid var(--md-sys-color-outline-variant);
	border-radius: var(--md-shape-lg);
	padding: 22px 26px;
	margin-bottom: 24px;
}

.md-detail-cell {
	display: flex;
	flex-direction: column;
}

.md-detail-label {
	font-size: 11.5px;
	font-weight: 700;
	color: var(--md-sys-color-on-surface-variant);
	text-transform: uppercase;
	letter-spacing: 0.6px;
	margin-bottom: 5px;
	display: inline-flex;
	align-items: center;
	gap: 5px;
}

.md-detail-label .material-symbols-outlined {
	font-size: 15px;
	color: var(--md-sys-color-primary);
}

.md-detail-value {
	font-size: 15.5px;
	font-weight: 600;
	color: var(--md-sys-color-on-surface);
	line-height: 1.4;
}

.md-detail-value.name {
	font-size: 20px;
	font-weight: 800;
	color: var(--md-sys-color-secondary);
}

.md-detail-value.course {
	font-size: 16.5px;
	font-weight: 700;
	color: var(--md-sys-color-primary);
}

.md-detail-value.cpr {
	font-family: 'Roboto Mono', monospace, sans-serif;
	letter-spacing: 0.5px;
}

/* ==========================================================================
   7. Material 3 Action Buttons (Filled, Outlined, Tonal)
   ========================================================================== */
.md-actions-row {
	display: flex;
	justify-content: flex-end;
	gap: 12px;
	flex-wrap: wrap;
}

.md-btn {
	display: inline-flex !important;
	align-items: center !important;
	gap: 8px !important;
	padding: 11px 24px !important;
	border-radius: var(--md-shape-full) !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	letter-spacing: 0.3px !important;
	text-decoration: none !important;
	cursor: pointer;
	border: none !important;
	transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
	line-height: 1.2 !important;
	box-shadow: none !important;
}

.md-btn:hover {
	text-decoration: none !important;
}

.md-btn .material-symbols-outlined {
	font-size: 19px;
}

/* Filled Button (Primary Download) */
.md-btn-filled {
	background: var(--md-sys-color-primary) !important;
	color: #ffffff !important;
	box-shadow: var(--md-elevation-1) !important;
}

.md-btn-filled:hover {
	background: var(--md-sys-color-primary-hover) !important;
	box-shadow: var(--md-elevation-2) !important;
	transform: translateY(-1px);
}

/* Outlined Button (Print) */
.md-btn-outlined {
	background: transparent !important;
	color: var(--md-sys-color-on-surface) !important;
	border: 1.5px solid var(--md-sys-color-outline) !important;
}

.md-btn-outlined:hover {
	background: var(--md-sys-color-surface-container-high) !important;
	border-color: var(--md-sys-color-on-surface) !important;
	color: var(--md-sys-color-on-surface) !important;
}

/* Tonal Button (View) */
.md-btn-tonal {
	background: var(--md-sys-color-surface-container-high) !important;
	color: var(--md-sys-color-on-surface) !important;
}

.md-btn-tonal:hover {
	background: var(--md-sys-color-surface-container-highest) !important;
	color: var(--md-sys-color-on-surface) !important;
}

/* ==========================================================================
   8. Not Found State Card
   ========================================================================== */
.md-not-found-card {
	background: var(--md-sys-color-surface);
	border: 1px solid var(--md-sys-color-outline-variant);
	border-radius: var(--md-shape-xl);
	padding: 48px 24px;
	text-align: center;
	box-shadow: var(--md-elevation-1);
}

.md-not-found-icon {
	width: 58px;
	height: 58px;
	border-radius: var(--md-shape-full);
	background: var(--md-sys-color-surface-container-high);
	color: #64748b;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 16px;
}

.md-not-found-icon .material-symbols-outlined {
	font-size: 30px;
}

.md-not-found-title {
	margin: 0 0 10px 0;
	font-size: 20px;
	font-weight: 700;
	color: var(--md-sys-color-on-surface);
}

.md-not-found-desc {
	margin: 0 auto;
	max-width: 500px;
	color: var(--md-sys-color-on-surface-variant);
	font-size: 15px;
	line-height: 1.6;
}

/* ==========================================================================
   9. Responsive Design
   ========================================================================== */
@media (max-width: 768px) {
	.mashreq-search-hero {
		padding: 32px 20px 28px 20px;
	}

	.md-search-bar {
		border-radius: var(--md-shape-lg);
		flex-direction: column;
		padding: 14px;
		gap: 12px;
	}

	.md-search-leading-icon {
		display: none;
	}

	.md-search-input {
		width: 100% !important;
		text-align: center;
	}

	.md-search-btn {
		width: 100% !important;
		justify-content: center;
	}

	.md-actions-row {
		flex-direction: column;
	}

	.md-btn {
		width: 100% !important;
		justify-content: center !important;
	}

	.mashreq-admin-notice-bar {
		flex-direction: column;
		align-items: flex-start;
	}

	.btn-toggle-admin-form {
		width: 100%;
		justify-content: center;
	}
}
