/**
 * Padma Study Material — Frontend Styles
 * Text-only, light theme, smooth UI.
 *
 * @package Padma_Study_Material
 */

/* ===== Variables ===== */
.psm-container {
	--psm-accent: #6e42f5;
	--psm-accent-hover: #5a35d1;
	--psm-accent-glow: rgba(110, 66, 245, 0.12);
	--psm-accent-light: rgba(110, 66, 245, 0.05);
	--psm-bg: #ffffff;
	--psm-surface: #f7f7f9;
	--psm-surface-2: #eeeff2;
	--psm-surface-hover: #ece8f8;
	--psm-text: #1a1a2e;
	--psm-text-sec: #4a4a6a;
	--psm-text-muted: #8c8ca4;
	--psm-border: rgba(0, 0, 0, 0.07);
	--psm-border-accent: rgba(110, 66, 245, 0.22);
	--psm-radius: 12px;
	--psm-radius-sm: 8px;
	--psm-radius-lg: 18px;
	--psm-success: #16a34a;
	--psm-error: #dc2626;
}

/* ===== Animations ===== */
@keyframes psmFadeInUp {
	from { opacity: 0; transform: translateY(16px); }
	to   { opacity: 1; transform: translateY(0); }
}
@keyframes psmScaleIn {
	from { opacity: 0; transform: scale(0.96); }
	to   { opacity: 1; transform: scale(1); }
}
@keyframes psmSlideLeft {
	from { opacity: 0; transform: translateX(40px); }
	to   { opacity: 1; transform: translateX(0); }
}
@keyframes psmSlideRight {
	from { opacity: 0; transform: translateX(-40px); }
	to   { opacity: 1; transform: translateX(0); }
}
@keyframes psmShimmer {
	0%   { background-position: -200% 0; }
	100% { background-position: 200% 0; }
}
@keyframes psmModalIn {
	from { opacity: 0; transform: translateY(-12px) scale(0.97); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes psmSpin {
	to { transform: rotate(360deg); }
}

/* ===== Container ===== */
.psm-container {
	font-family: inherit;
	background: var(--psm-bg);
	color: var(--psm-text);
	border-radius: var(--psm-radius-lg);
	overflow: hidden;
	max-width: 880px;
	margin: 36px auto;
	border: 1px solid var(--psm-border);
	box-shadow: 0 4px 24px rgba(0,0,0,0.05);
	line-height: 1.5;
}
.psm-container *, .psm-container *::before, .psm-container *::after { box-sizing: border-box; }

/* ===== Header ===== */
.psm-header {
	position: relative;
	padding: 28px 28px 22px;
	border-bottom: 1px solid var(--psm-border);
	background: linear-gradient(135deg, #faf8ff 0%, #fff 100%);
	overflow: hidden;
}
.psm-header-glow {
	position: absolute; top: -60px; right: -20px;
	width: 200px; height: 200px;
	background: radial-gradient(circle, rgba(110,66,245,0.06), transparent 70%);
	pointer-events: none;
}
.psm-header-content { position: relative; z-index: 1; }
.psm-title {
	font-size: 20px; font-weight: 700; margin: 0;
	color: var(--psm-text); letter-spacing: -0.3px; line-height: 1.2;
}
.psm-subtitle {
	font-size: 13px; color: var(--psm-text-muted);
	margin: 4px 0 0; line-height: 1.4;
}

/* ===== Stepper ===== */
.psm-stepper {
	padding: 18px 28px; position: relative;
	border-bottom: 1px solid var(--psm-border);
}
.psm-stepper-track {
	position: absolute; top: 50%; left: 52px; right: 52px;
	height: 2px; background: var(--psm-surface-2);
	border-radius: 2px; transform: translateY(-50%); z-index: 0;
}
.psm-stepper-fill {
	height: 100%; width: 0%;
	background: linear-gradient(90deg, var(--psm-accent), #8b5cf6);
	border-radius: 2px;
	transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
	position: relative;
}
.psm-stepper-fill::after {
	content: ''; position: absolute; right: -3px; top: -3px;
	width: 8px; height: 8px; background: var(--psm-accent);
	border-radius: 50%; box-shadow: 0 0 6px var(--psm-accent-glow);
}
.psm-stepper-steps {
	display: flex; justify-content: space-between;
	position: relative; z-index: 1;
}
.psm-step-indicator {
	display: flex; flex-direction: column; align-items: center;
	gap: 4px; background: none; border: none; cursor: pointer;
	padding: 0; color: var(--psm-text-muted);
	transition: color 0.3s; font-family: inherit;
}
.psm-step-indicator.active,
.psm-step-indicator.completed { color: var(--psm-text); }
.psm-step-num {
	width: 30px; height: 30px; border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	font-size: 12px; font-weight: 700;
	background: var(--psm-bg); border: 2px solid var(--psm-surface-2);
	transition: all 0.3s; color: var(--psm-text-muted);
}
.psm-step-indicator.active .psm-step-num {
	background: var(--psm-accent); border-color: var(--psm-accent);
	color: #fff; box-shadow: 0 2px 8px var(--psm-accent-glow);
}
.psm-step-indicator.completed .psm-step-num {
	background: var(--psm-success); border-color: var(--psm-success); color: #fff;
}
.psm-step-label { font-size: 11px; font-weight: 500; white-space: nowrap; }

/* ===== Viewport ===== */
.psm-viewport { min-height: 260px; position: relative; overflow: hidden; }
.psm-step-panel { display: none; padding: 22px 28px 28px; }
.psm-step-panel.active { display: block; animation: psmFadeInUp 0.3s ease-out both; }
.psm-step-panel.slide-left  { animation-name: psmSlideLeft; }
.psm-step-panel.slide-right { animation-name: psmSlideRight; }
.psm-panel-title {
	font-size: 16px; font-weight: 600; margin: 0 0 16px;
	display: flex; align-items: center; gap: 8px; color: var(--psm-text);
}
.psm-breadcrumb {
	font-size: 11px; font-weight: 500; color: var(--psm-accent);
	background: var(--psm-accent-light); padding: 2px 10px; border-radius: 20px;
}

/* ===== Back Button ===== */
.psm-back-btn {
	display: inline-flex; align-items: center; gap: 4px;
	background: var(--psm-surface); border: 1px solid var(--psm-border);
	color: var(--psm-text-sec); font-size: 12px; font-weight: 500;
	padding: 5px 12px; border-radius: 6px;
	cursor: pointer; margin-bottom: 12px;
	transition: all 0.2s; font-family: inherit;
}
.psm-back-btn:hover {
	color: var(--psm-accent); border-color: var(--psm-border-accent);
	background: var(--psm-accent-light);
}

/* ===== Card Grid (text-only) ===== */
.psm-card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 8px;
}
.psm-card {
	display: flex; align-items: center; justify-content: space-between;
	padding: 13px 16px;
	background: var(--psm-surface);
	border: 1px solid transparent;
	border-radius: var(--psm-radius-sm);
	cursor: pointer; color: var(--psm-text);
	font-size: 13px; font-weight: 500;
	font-family: inherit; text-align: left;
	transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
	animation: psmScaleIn 0.25s ease-out both;
	line-height: 1.3; gap: 8px;
}
.psm-card:hover {
	background: var(--psm-surface-hover);
	border-color: var(--psm-border-accent);
	transform: translateY(-1px);
	box-shadow: 0 3px 12px var(--psm-accent-glow);
}
.psm-card:active { transform: translateY(0); box-shadow: none; }
.psm-card-label { flex: 1; }
.psm-card-arrow {
	opacity: 0; transform: translateX(-4px);
	transition: all 0.2s; color: var(--psm-accent);
	flex-shrink: 0; display: flex; align-items: center;
}
.psm-card:hover .psm-card-arrow { opacity: 1; transform: translateX(0); }

/* ===== Results ===== */
.psm-results-grid { display: flex; flex-direction: column; gap: 6px; }
.psm-result-item {
	display: flex; align-items: center; gap: 12px;
	padding: 13px 16px;
	background: var(--psm-surface);
	border: 1px solid transparent;
	border-radius: var(--psm-radius-sm);
	cursor: pointer; transition: all 0.2s;
	animation: psmFadeInUp 0.25s ease-out both;
	text-decoration: none; color: var(--psm-text);
}
.psm-result-item:hover {
	background: var(--psm-surface-hover);
	border-color: var(--psm-border-accent);
	transform: translateX(2px);
}
.psm-result-body { flex: 1; min-width: 0; }
.psm-result-title {
	font-size: 13px; font-weight: 600; margin: 0 0 2px;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
	color: var(--psm-text);
}
.psm-result-meta {
	display: flex; gap: 8px; flex-wrap: wrap;
	font-size: 11px; color: var(--psm-text-muted);
}
.psm-result-meta span { display: inline-flex; align-items: center; gap: 3px; }
.psm-result-badge {
	font-size: 10px; padding: 1px 6px; border-radius: 4px;
	font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px;
}
.psm-badge-easy   { background: rgba(22,163,74,0.08); color: #16a34a; }
.psm-badge-medium { background: rgba(217,119,6,0.08); color: #d97706; }
.psm-badge-hard   { background: rgba(220,38,38,0.08); color: #dc2626; }

.psm-result-lock,
.psm-result-open {
	width: 32px; height: 32px;
	display: flex; align-items: center; justify-content: center;
	border-radius: 6px; flex-shrink: 0;
}
.psm-result-lock { background: rgba(220,38,38,0.05); color: var(--psm-error); }
.psm-result-open { background: rgba(22,163,74,0.05); color: var(--psm-success); transition: background 0.2s; }
.psm-result-item:hover .psm-result-open { background: rgba(22,163,74,0.1); }

/* ===== Empty / Skeleton ===== */
.psm-empty {
	text-align: center; padding: 36px 20px;
	color: var(--psm-text-muted); font-size: 13px;
	grid-column: 1 / -1;
}
.psm-skeleton-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 8px;
}
.psm-skeleton {
	height: 44px; border-radius: var(--psm-radius-sm);
	background: linear-gradient(90deg, var(--psm-surface) 25%, var(--psm-surface-2) 50%, var(--psm-surface) 75%);
	background-size: 200% 100%; animation: psmShimmer 1.5s infinite;
}
.psm-skeleton-row {
	height: 48px; border-radius: var(--psm-radius-sm);
	background: linear-gradient(90deg, var(--psm-surface) 25%, var(--psm-surface-2) 50%, var(--psm-surface) 75%);
	background-size: 200% 100%; animation: psmShimmer 1.5s infinite;
	margin-bottom: 6px;
}

/* ===== Modal ===== */
.psm-modal-overlay {
	position: fixed; inset: 0;
	background: rgba(0,0,0,0.4);
	backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
	z-index: 999999;
	display: flex; align-items: center; justify-content: center;
	padding: 20px;
}
.psm-modal {
	background: #fff; border: 1px solid rgba(0,0,0,0.06);
	border-radius: var(--psm-radius-lg);
	width: 100%; max-width: 380px; padding: 28px 24px;
	position: relative;
	box-shadow: 0 20px 50px rgba(0,0,0,0.12);
	animation: psmModalIn 0.25s ease-out;
}
.psm-modal-close {
	position: absolute; top: 12px; right: 12px;
	background: none; border: none; color: #bbb; cursor: pointer;
	padding: 4px; border-radius: 4px; transition: all 0.15s;
}
.psm-modal-close:hover { color: #555; background: #f5f5f5; }
.psm-modal-header { text-align: center; margin-bottom: 20px; }
.psm-modal-icon {
	width: 48px; height: 48px;
	background: linear-gradient(135deg, var(--psm-accent), #8b5cf6);
	border-radius: 12px;
	display: inline-flex; align-items: center; justify-content: center;
	color: #fff; margin-bottom: 12px;
	box-shadow: 0 3px 12px var(--psm-accent-glow);
}
.psm-modal-header h3 { font-size: 18px; font-weight: 700; margin: 0 0 3px; color: var(--psm-text); }
.psm-modal-header p { font-size: 12px; color: #999; margin: 0; }

/* ===== Form ===== */
.psm-form-group { margin-bottom: 12px; }
.psm-form-group label {
	display: block; font-size: 11px; font-weight: 600;
	color: #777; margin-bottom: 4px;
	text-transform: uppercase; letter-spacing: 0.3px;
}
.psm-input {
	width: 100%; padding: 9px 12px;
	background: #f8f8fa; border: 1px solid #e2e2e8;
	border-radius: 7px; color: var(--psm-text);
	font-size: 13px; font-family: inherit;
	transition: border-color 0.15s, box-shadow 0.15s;
	outline: none; box-sizing: border-box;
}
.psm-input::placeholder { color: #bbb; }
.psm-input:focus {
	border-color: var(--psm-accent);
	box-shadow: 0 0 0 2px var(--psm-accent-glow);
	background: #fff;
}
.psm-input-wrap { position: relative; }
.psm-input-wrap .psm-input { padding-right: 38px; }
.psm-toggle-pass {
	position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
	background: none; border: none; color: #bbb; cursor: pointer; padding: 2px;
}
.psm-toggle-pass:hover { color: #777; }
.psm-form-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.psm-checkbox {
	display: flex; align-items: center; gap: 5px;
	font-size: 12px; color: #777; cursor: pointer;
}
.psm-checkbox input { accent-color: var(--psm-accent); }

/* ===== Buttons ===== */
.psm-btn {
	width: 100%; padding: 10px;
	border: none; border-radius: 8px;
	font-size: 13px; font-weight: 600;
	cursor: pointer; font-family: inherit;
	display: flex; align-items: center; justify-content: center; gap: 6px;
	transition: all 0.2s;
}
.psm-btn-primary {
	background: linear-gradient(135deg, var(--psm-accent), #8b5cf6);
	color: #fff; box-shadow: 0 3px 10px var(--psm-accent-glow);
}
.psm-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(110,66,245,0.25); }
.psm-btn-primary:active { transform: translateY(0); }
.psm-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
.psm-btn-spinner {
	width: 14px; height: 14px;
	border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff;
	border-radius: 50%; animation: psmSpin 0.6s linear infinite;
}

/* ===== Alert ===== */
.psm-modal-alert {
	padding: 8px 12px; border-radius: 6px; font-size: 12px; margin-bottom: 12px;
}
.psm-modal-alert.error { background: rgba(220,38,38,0.05); color: #dc2626; border: 1px solid rgba(220,38,38,0.1); }
.psm-modal-alert.success { background: rgba(22,163,74,0.05); color: #16a34a; border: 1px solid rgba(22,163,74,0.1); }

.psm-modal-switch { text-align: center; margin-top: 16px; font-size: 12px; color: #999; }
.psm-modal-switch button {
	background: none; border: none; color: var(--psm-accent); cursor: pointer;
	font-weight: 600; font-size: 12px; padding: 0; text-decoration: underline; font-family: inherit;
}

/* ===== Footer ===== */
.psm-footer {
	text-align: center; padding: 12px;
	border-top: 1px solid var(--psm-border); font-size: 11px;
	background: var(--psm-surface);
}
.psm-footer a { color: var(--psm-text-muted); text-decoration: none; transition: color 0.15s; }
.psm-footer a:hover { color: var(--psm-accent); }

/* ===== Responsive ===== */
@media (max-width: 640px) {
	.psm-container { margin: 10px; border-radius: var(--psm-radius); }
	.psm-header, .psm-stepper, .psm-step-panel { padding-left: 16px; padding-right: 16px; }
	.psm-card-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
	.psm-card { padding: 10px 12px; font-size: 12px; }
	.psm-step-label { display: none; }
	.psm-modal { padding: 22px 18px; }
	.psm-title { font-size: 17px; }
}
@media (max-width: 380px) {
	.psm-card-grid { grid-template-columns: 1fr; }
}
