/**
 * DeutschTrack Student Portal - Frontend Styles
 *
 * All selectors are scoped under .dtsp-portal. Colors and corner radius
 * are driven by CSS custom properties on :root, set dynamically from the
 * saved Design & Branding settings (see DTSP_Assets). The values below
 * are safe fallback defaults in case the inline style fails to load.
 */

:root {
	--dtsp-portal-primary: #6D3DF5;
	--dtsp-portal-accent: #F4EFFF;
	--dtsp-portal-radius: 14px;
}

.dtsp-portal {
	display: block;
	font-family: inherit;
	color: #2b2440;
	max-width: 1100px;
	margin: 0 auto;
}

.dtsp-portal *,
.dtsp-portal *::before,
.dtsp-portal *::after {
	box-sizing: border-box;
}

/* Mobile menu toggle (hidden on desktop) */

.dtsp-portal__menu-toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 4px;
	width: 40px;
	height: 40px;
	border: 1px solid #ece7fb;
	border-radius: 8px;
	background: #ffffff;
	cursor: pointer;
	margin-bottom: 12px;
	padding: 0;
}

.dtsp-portal__menu-toggle-bar {
	display: block;
	height: 2px;
	background: var( --dtsp-portal-primary );
	border-radius: 2px;
}

/* Layout */

.dtsp-portal__layout {
	display: flex;
	gap: 24px;
	align-items: flex-start;
}

/* Sidebar */

.dtsp-portal__sidebar {
	width: 220px;
	flex-shrink: 0;
	border-radius: var( --dtsp-portal-radius );
	padding: 20px 16px;
	color: #ffffff;
}

.dtsp-portal[data-sidebar-style="gradient"] .dtsp-portal__sidebar {
	background: linear-gradient( 160deg, var( --dtsp-portal-primary ) 0%, #9b6bff 100% );
}

.dtsp-portal[data-sidebar-style="solid"] .dtsp-portal__sidebar {
	background: var( --dtsp-portal-primary );
}

.dtsp-portal__brand {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 24px;
}

.dtsp-portal__brand-logo {
	width: 36px;
	height: 36px;
	border-radius: 10px;
	object-fit: cover;
	background: #ffffff;
	display: block;
}

.dtsp-portal__brand-fallback {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	flex-shrink: 0;
	border-radius: 10px;
	background: #ffffff;
	color: var( --dtsp-portal-primary );
	font-weight: 700;
}

.dtsp-portal__brand-text {
	display: flex;
	flex-direction: column;
	line-height: 1.3;
	min-width: 0;
}

.dtsp-portal__brand-name {
	font-weight: 700;
	font-size: 14px;
	overflow-wrap: break-word;
}

.dtsp-portal__brand-tagline {
	font-size: 11px;
	color: rgba( 255, 255, 255, 0.75 );
}

.dtsp-portal__nav {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin-bottom: 24px;
}

.dtsp-portal__nav-item {
	font-size: 13px;
	padding: 8px 10px;
	border-radius: 8px;
	color: rgba( 255, 255, 255, 0.85 );
}

.dtsp-portal__nav-item.is-active {
	background: rgba( 255, 255, 255, 0.18 );
	color: #ffffff;
	font-weight: 700;
}

.dtsp-portal__nav-item--disabled {
	opacity: 0.55;
}

.dtsp-portal__user {
	display: flex;
	align-items: center;
	gap: 8px;
	padding-top: 16px;
	margin-top: 4px;
	border-top: 1px solid rgba( 255, 255, 255, 0.2 );
}

.dtsp-portal__user-avatar {
	border-radius: 50%;
	display: block;
}

.dtsp-portal__user-name {
	font-size: 12px;
	overflow-wrap: break-word;
}

/* Main content */

.dtsp-portal__main {
	flex: 1;
	min-width: 0;
}

.dtsp-portal__greeting {
	font-size: 18px;
	font-weight: 700;
	margin: 0 0 20px 0;
}

.dtsp-portal__section {
	margin-bottom: 28px;
}

.dtsp-portal__section-title {
	font-size: 15px;
	margin: 0 0 12px 0;
}

/* German level grid */

.dtsp-portal__level-grid {
	display: grid;
	grid-template-columns: repeat( 6, 1fr );
	gap: 10px;
}

.dtsp-portal__level-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	text-align: center;
	background: var( --dtsp-portal-accent );
	border: 1px solid #ece7fb;
	border-radius: var( --dtsp-portal-radius );
	padding: 14px 6px;
}

.dtsp-portal__level-card.is-enrolled {
	border-color: var( --dtsp-portal-primary );
}

.dtsp-portal__level-code {
	font-size: 16px;
	font-weight: 700;
	color: var( --dtsp-portal-primary );
}

.dtsp-portal__level-label {
	font-size: 10px;
	color: #6b6580;
}

.dtsp-portal__level-status {
	font-size: 9px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	padding: 2px 6px;
	border-radius: 999px;
}

.dtsp-portal__level-status--active {
	background: #e7f7ee;
	color: #1c7a45;
}

.dtsp-portal__level-status--locked {
	background: #f2eefe;
	color: #5629d6;
}

/* Course list */

.dtsp-portal__course-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.dtsp-portal__course-item {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	background: #ffffff;
	border: 1px solid #ece7fb;
	border-radius: var( --dtsp-portal-radius );
	padding: 12px 16px;
}

.dtsp-portal__course-title {
	font-weight: 600;
	font-size: 13px;
}

.dtsp-portal__course-level {
	font-size: 11px;
	font-weight: 700;
	padding: 2px 8px;
	border-radius: 999px;
	background: var( --dtsp-portal-accent );
	color: var( --dtsp-portal-primary );
}

.dtsp-portal__course-level--unmapped {
	background: #f4f4f4;
	color: #6b6580;
}

.dtsp-portal__course-link {
	margin-left: auto;
	font-size: 12px;
	font-weight: 600;
	color: var( --dtsp-portal-primary );
	text-decoration: none;
}

.dtsp-portal__course-link:hover,
.dtsp-portal__course-link:focus {
	text-decoration: underline;
}

.dtsp-portal__empty-state {
	font-size: 13px;
	color: #6b6580;
}

/* Preview mode banner */

.dtsp-portal__preview-banner {
	background: #fff8ec;
	border: 1px solid #f5dfad;
	color: #8a5a00;
	font-size: 12px;
	padding: 10px 14px;
	border-radius: 8px;
	margin-bottom: 16px;
}

/* Message states: logged out / not enrolled / LearnDash missing */

.dtsp-portal--message {
	display: flex;
	justify-content: center;
	padding: 40px 20px;
}

.dtsp-portal__message-card {
	max-width: 420px;
	width: 100%;
	text-align: center;
	background: #ffffff;
	border: 1px solid #ece7fb;
	border-radius: var( --dtsp-portal-radius );
	padding: 32px 28px;
}

.dtsp-portal__message-card h2 {
	margin: 0 0 8px 0;
	font-size: 18px;
}

.dtsp-portal__message-card p {
	margin: 0 0 8px 0;
	font-size: 13px;
	color: #6b6580;
}

.dtsp-portal__button {
	display: inline-block;
	margin-top: 12px;
	padding: 10px 22px;
	background: var( --dtsp-portal-primary );
	color: #ffffff;
	border-radius: 999px;
	text-decoration: none;
	font-weight: 600;
	font-size: 13px;
}

.dtsp-portal__button:hover,
.dtsp-portal__button:focus {
	opacity: 0.9;
	color: #ffffff;
}

/* Responsive: mobile sidebar drawer */

@media ( max-width: 782px ) {
	.dtsp-portal__menu-toggle {
		display: flex;
	}

	.dtsp-portal__layout {
		flex-direction: column;
	}

	.dtsp-portal__sidebar {
		width: 100%;
		display: none;
	}

	.dtsp-portal--menu-open .dtsp-portal__sidebar {
		display: block;
	}

	.dtsp-portal__level-grid {
		grid-template-columns: repeat( 2, 1fr );
	}
}
