/* LearnDash Progress Tracker & Analytics Pro Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

.ldt-container,
.ldt-admin-wrap {
	font-family: 'Inter', system-ui, -apple-system, sans-serif;
	color: var(--ldt-text, #f8fafc);
	background: var(--ldt-bg, #0f172a);
	border-radius: var(--ldt-radius, 12px);
	padding: 24px;
	box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
	margin: 20px 0;
	box-sizing: border-box;
}

.ldt-container *,
.ldt-admin-wrap * {
	box-sizing: border-box;
}

/* Header */
.ldt-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 20px;
	padding-bottom: 16px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ldt-header-title h3 {
	margin: 0;
	font-size: 1.35rem;
	font-weight: 700;
	color: var(--ldt-text, #f8fafc);
}

/* Buttons */
.ldt-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 18px;
	font-size: 0.9rem;
	font-weight: 600;
	border-radius: 8px;
	text-decoration: none;
	cursor: pointer;
	transition: all 0.2s ease-in-out;
	border: none;
}

.ldt-btn-primary {
	background: linear-gradient(135deg, var(--ldt-primary, #6366f1), var(--ldt-secondary, #4f46e5));
	color: #ffffff;
}

.ldt-btn-primary:hover {
	opacity: 0.92;
	transform: translateY(-1px);
}

.ldt-btn-secondary {
	background: rgba(255, 255, 255, 0.08);
	color: var(--ldt-text, #f8fafc);
	border: 1px solid rgba(255, 255, 255, 0.15);
}

.ldt-btn-secondary:hover {
	background: rgba(255, 255, 255, 0.15);
}

/* Tabs */
.ldt-tabs {
	display: flex;
	gap: 8px;
	margin-bottom: 20px;
	flex-wrap: wrap;
}

.ldt-tab-btn {
	background: rgba(255, 255, 255, 0.05);
	color: var(--ldt-text, #f8fafc);
	border: 1px solid rgba(255, 255, 255, 0.1);
	padding: 10px 18px;
	border-radius: 8px;
	font-weight: 600;
	font-size: 0.9rem;
	cursor: pointer;
	transition: all 0.2s ease;
}

.ldt-tab-btn:hover {
	background: rgba(255, 255, 255, 0.12);
}

.ldt-tab-btn.active {
	background: var(--ldt-primary, #6366f1);
	border-color: var(--ldt-primary, #6366f1);
	color: #ffffff;
	box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

/* Filter Bar */
.ldt-filter-bar {
	display: flex;
	gap: 12px;
	margin-bottom: 24px;
	flex-wrap: wrap;
}

.ldt-search-wrapper {
	flex: 1;
	min-width: 240px;
}

.ldt-input,
.ldt-select {
	width: 100%;
	padding: 10px 14px;
	background: var(--ldt-card-bg, #1e293b);
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 8px;
	color: var(--ldt-text, #f8fafc);
	font-size: 0.9rem;
	outline: none;
	transition: border-color 0.2s;
}

.ldt-input:focus,
.ldt-select:focus {
	border-color: var(--ldt-primary, #6366f1);
}

/* Grid & Cards */
.ldt-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 18px;
}

.ldt-card {
	background: var(--ldt-card-bg, #1e293b);
	border-radius: var(--ldt-radius, 12px);
	padding: 18px;
	border: 1px solid rgba(255, 255, 255, 0.08);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ldt-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.ldt-card-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 10px;
	margin-bottom: 14px;
}

.ldt-title-link {
	font-weight: 700;
	font-size: 1.05rem;
	color: var(--ldt-text, #f8fafc);
	text-decoration: none;
}

.ldt-title-link:hover {
	color: var(--ldt-primary, #6366f1);
}

/* Student Clickable Link */
.ldt-user-link {
	color: var(--ldt-primary, #818cf8);
	text-decoration: underline;
	cursor: pointer;
	font-weight: 600;
}

.ldt-user-link:hover {
	color: #a5b4fc;
}

/* Badges & Tags */
.ldt-badge {
	padding: 4px 10px;
	border-radius: 20px;
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	white-space: nowrap;
}

.ldt-badge-primary { background: rgba(99, 102, 241, 0.2); color: #818cf8; }
.ldt-badge-success { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.ldt-badge-warning { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.ldt-badge-danger  { background: rgba(239, 68, 68, 0.2); color: #f87171; }

.ldt-tag {
	display: inline-block;
	padding: 3px 8px;
	border-radius: 6px;
	font-size: 0.8rem;
	font-weight: 600;
	margin-right: 4px;
}

.ldt-tag-success { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.ldt-tag-danger  { background: rgba(239, 68, 68, 0.15); color: #f87171; }

/* Progress Bar */
.ldt-progress-wrapper {
	margin-bottom: 12px;
}

.ldt-progress-info {
	display: flex;
	justify-content: space-between;
	font-size: 0.85rem;
	margin-bottom: 6px;
	opacity: 0.9;
}

.ldt-progress-bar {
	width: 100%;
	height: 10px;
	background: rgba(255, 255, 255, 0.1);
	border-radius: 999px;
	overflow: hidden;
}

.ldt-progress-fill {
	height: 100%;
	background: linear-gradient(90deg, var(--ldt-primary, #6366f1), var(--ldt-success, #10b981));
	border-radius: 999px;
	transition: width 0.6s ease;
}

/* Stats Mini Grid */
.ldt-stats-mini-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
}

.ldt-stat-pill {
	background: rgba(255, 255, 255, 0.04);
	border-radius: 8px;
	padding: 8px;
	text-align: center;
}

.ldt-stat-pill span {
	display: block;
	font-size: 0.72rem;
	opacity: 0.75;
	margin-bottom: 2px;
}

.ldt-stat-pill strong {
	font-size: 0.95rem;
	font-weight: 700;
}

.ldt-stat-success strong { color: var(--ldt-success, #10b981); }
.ldt-stat-warning strong { color: var(--ldt-warning, #f59e0b); }
.ldt-stat-danger strong  { color: var(--ldt-danger, #ef4444); }
.ldt-stat-primary strong { color: var(--ldt-primary, #6366f1); }

/* Tables */
.ldt-table {
	width: 100%;
	border-collapse: collapse;
	background: var(--ldt-card-bg, #1e293b);
	border-radius: 8px;
	overflow: hidden;
}

.ldt-table th,
.ldt-table td {
	padding: 12px 16px;
	text-align: left;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	font-size: 0.9rem;
}

.ldt-table th {
	background: rgba(255, 255, 255, 0.05);
	font-weight: 600;
	color: rgba(255, 255, 255, 0.85);
}

.ldt-user-list {
	margin-top: 12px;
	padding-top: 10px;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	font-size: 0.85rem;
}

.ldt-user-list-title {
	font-weight: 600;
	margin-bottom: 6px;
	opacity: 0.8;
}

.ldt-user-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.ldt-user-chip {
	background: rgba(255, 255, 255, 0.06);
	padding: 3px 8px;
	border-radius: 12px;
	font-size: 0.8rem;
}

.ldt-inline-progress {
	display: flex;
	align-items: center;
	gap: 10px;
}

.ldt-inline-progress .ldt-progress-bar {
	width: 100px;
}

/* Modal for Student Drill-Down */
.ldt-modal-backdrop {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.75);
	backdrop-filter: blur(4px);
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.ldt-modal-content {
	background: var(--ldt-bg, #0f172a);
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 14px;
	max-width: 720px;
	width: 100%;
	max-height: 85vh;
	overflow-y: auto;
	padding: 24px;
	position: relative;
	box-shadow: 0 20px 40px rgba(0,0,0,0.5);
	color: var(--ldt-text, #f8fafc);
}

.ldt-modal-close {
	position: absolute;
	top: 14px;
	right: 18px;
	background: none;
	border: none;
	color: var(--ldt-text, #f8fafc);
	font-size: 1.8rem;
	cursor: pointer;
	opacity: 0.7;
}

.ldt-modal-close:hover {
	opacity: 1;
}

.ldt-student-detail-header {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: 20px;
	padding-bottom: 16px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ldt-student-avatar {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	border: 3px solid var(--ldt-primary, #6366f1);
}

.ldt-student-detail-header h3 {
	margin: 0 0 4px 0;
	font-size: 1.3rem;
}

.ldt-student-detail-header p {
	margin: 0;
	opacity: 0.75;
	font-size: 0.85rem;
}

.ldt-detail-section {
	margin-bottom: 24px;
}

.ldt-detail-section h4 {
	margin: 0 0 12px 0;
	font-size: 1.05rem;
	color: var(--ldt-primary, #818cf8);
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	padding-bottom: 6px;
}

/* User Profile Widget */
.ldt-user-card {
	background: var(--ldt-card-bg, #1e293b);
}

.ldt-user-header {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: 20px;
}

.ldt-avatar {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	border: 3px solid var(--ldt-primary, #6366f1);
}

.ldt-user-info h3 {
	margin: 0 0 4px 0;
	font-size: 1.25rem;
}

.ldt-user-info p {
	margin: 0;
	opacity: 0.75;
	font-size: 0.85rem;
}

.ldt-user-badge {
	margin-left: auto;
	background: rgba(99, 102, 241, 0.15);
	border: 1px solid var(--ldt-primary, #6366f1);
	padding: 8px 16px;
	border-radius: 20px;
	font-weight: 700;
	color: var(--ldt-primary, #6366f1);
}

.ldt-user-stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 12px;
}

.ldt-stat-card {
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 10px;
	padding: 14px;
	text-align: center;
}

.ldt-stat-number {
	display: block;
	font-size: 1.6rem;
	font-weight: 800;
}

.ldt-stat-label {
	font-size: 0.78rem;
	opacity: 0.75;
}

.ldt-stat-success-border { border-top: 3px solid var(--ldt-success, #10b981); }
.ldt-stat-warning-border { border-top: 3px solid var(--ldt-warning, #f59e0b); }
.ldt-stat-primary-border { border-top: 3px solid var(--ldt-primary, #6366f1); }

/* Loading & Notices */
.ldt-loading-spinner {
	text-align: center;
	padding: 40px 0;
	opacity: 0.8;
}

.ldt-spinner {
	width: 32px;
	height: 32px;
	border: 3px solid rgba(255, 255, 255, 0.1);
	border-top-color: var(--ldt-primary, #6366f1);
	border-radius: 50%;
	animation: ldt-spin 0.8s linear infinite;
	margin: 0 auto 12px auto;
}

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

.ldt-notice {
	padding: 12px 18px;
	border-radius: 8px;
	margin: 10px 0;
	font-weight: 500;
}

.ldt-notice-warning {
	background: rgba(245, 158, 11, 0.15);
	border: 1px solid #f59e0b;
	color: #fbbf24;
}

/* Admin Specific */
.ldt-form-box {
	background: #1e293b;
	border-radius: 12px;
	padding: 24px;
	color: #f8fafc;
	margin-top: 20px;
}

.ldt-form-box th, .ldt-form-box label {
	color: #f8fafc !important;
}

.ldt-shortcode-item {
	background: rgba(255, 255, 255, 0.05);
	padding: 14px;
	border-radius: 8px;
	margin-bottom: 12px;
}

.ldt-shortcode-item code {
	background: #0f172a;
	color: #818cf8;
	padding: 4px 8px;
	border-radius: 4px;
	font-size: 0.95rem;
}
