/**
 * VELYON Professional LMS - Advanced Notes (Google Slides).
 * Cards in the Workspace tab + the popup viewer. Colours come only from
 * --vln-* tokens, so dark/light mode follows the theme.
 */

/* ---------------------------------------------------------------
   Progress summary
--------------------------------------------------------------- */
.vln-notes {
	min-width: 0;
}

.vln-notes-summary {
	margin: 4px 0 20px;
	padding: 16px 18px;
	border: 1px solid color-mix(in srgb, var(--vln-accent) 25%, transparent);
	border-radius: var(--vln-radius-m);
	background: var(--vln-surface-alt);
}

.vln-notes-summary-text {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 4px 12px;
	margin-bottom: 10px;
}

.vln-notes-summary-text strong {
	color: var(--vln-text);
	font-size: 15px;
}

.vln-notes-summary-text span {
	color: color-mix(in srgb, var(--vln-text) 70%, transparent);
	font-size: 13px;
}

.vln-notes-summary-bar {
	height: 8px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--vln-text) 12%, transparent);
	overflow: hidden;
}

.vln-notes-summary-fill {
	display: block;
	height: 100%;
	border-radius: 999px;
	background: var(--vln-accent);
	transition: width 0.4s ease;
}

/* ---------------------------------------------------------------
   Cards
--------------------------------------------------------------- */
.vln-notes-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
	gap: 16px;
}

.vln-note-card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 10px;
	min-width: 0;
	padding: 20px 18px 18px;
	text-align: left;
	font-family: inherit;
	color: var(--vln-text);
	background: var(--vln-surface-alt);
	border: 1px solid color-mix(in srgb, var(--vln-accent) 22%, transparent);
	border-radius: var(--vln-radius-m);
	cursor: pointer;
	transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.vln-note-card:hover,
.vln-note-card:focus-visible {
	transform: translateY(-3px);
	border-color: var(--vln-accent);
	box-shadow: var(--vln-shadow);
	outline: none;
}

.vln-note-card-number {
	color: color-mix(in srgb, var(--vln-text) 55%, transparent);
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.08em;
}

.vln-note-card-status {
	position: absolute;
	top: 16px;
	right: 14px;
	display: inline-flex;
	align-items: center;
	gap: 3px;
	padding: 3px 9px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--vln-gold) 18%, transparent);
	color: var(--vln-gold-text);
	font-size: 11px;
	font-weight: 800;
}

.vln-note-card.is-completed .vln-note-card-status {
	background: color-mix(in srgb, var(--vln-accent) 16%, transparent);
	color: var(--vln-accent-text);
}

.vln-note-card-status .dashicons {
	width: 14px;
	height: 14px;
	font-size: 14px;
}

.vln-note-card-icon {
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
	color: var(--vln-accent-text);
	background: color-mix(in srgb, var(--vln-accent) 12%, transparent);
	border-radius: var(--vln-radius-s);
}

.vln-note-card-title {
	color: var(--vln-text);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.35;
	overflow-wrap: anywhere;
}

.vln-note-card-cta {
	margin-top: auto;
	display: inline-flex;
	align-items: center;
	gap: 2px;
	color: var(--vln-accent-text);
	font-size: 13px;
	font-weight: 700;
}

.vln-note-card-cta .dashicons {
	width: 16px;
	height: 16px;
	font-size: 16px;
	transition: transform 0.18s ease;
}

.vln-note-card:hover .vln-note-card-cta .dashicons {
	transform: translateX(3px);
}

/* ---------------------------------------------------------------
   Popup viewer
--------------------------------------------------------------- */
body.vln-note-viewer-open {
	overflow: hidden;
}

.vln-note-viewer {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	flex-direction: column;
	padding: 3vh 3vw;
	background: rgba(0, 0, 0, 0.82);
	backdrop-filter: blur(3px);
}

.vln-note-viewer[hidden] {
	display: none;
}

.vln-note-viewer-topbar,
.vln-note-viewer-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 14px;
	background: var(--vln-surface);
	color: var(--vln-text);
}

.vln-note-viewer-topbar {
	border-radius: var(--vln-radius-m) var(--vln-radius-m) 0 0;
	border-bottom: 1px solid color-mix(in srgb, var(--vln-accent) 25%, transparent);
}

.vln-note-viewer-footer {
	border-radius: 0 0 var(--vln-radius-m) var(--vln-radius-m);
	border-top: 1px solid color-mix(in srgb, var(--vln-accent) 25%, transparent);
	font-size: 12.5px;
}

.vln-note-viewer-title {
	min-width: 0;
	flex: 1;
	font-size: 15px;
	font-weight: 700;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.vln-note-viewer-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

.vln-note-viewer-mark-read,
.vln-note-viewer-fullscreen,
.vln-note-viewer-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 38px;
	padding: 0 14px;
	font-family: inherit;
	font-size: 13px;
	font-weight: 700;
	color: var(--vln-text);
	background: transparent;
	border: 1px solid color-mix(in srgb, var(--vln-text) 25%, transparent);
	border-radius: var(--vln-radius-s);
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.vln-note-viewer-fullscreen,
.vln-note-viewer-close {
	width: 38px;
	padding: 0;
}

.vln-note-viewer-close {
	font-size: 22px;
	line-height: 1;
}

.vln-note-viewer-mark-read:hover,
.vln-note-viewer-fullscreen:hover,
.vln-note-viewer-close:hover,
.vln-note-viewer-mark-read:focus-visible,
.vln-note-viewer-fullscreen:focus-visible,
.vln-note-viewer-close:focus-visible {
	border-color: var(--vln-accent);
	background: color-mix(in srgb, var(--vln-accent) 12%, transparent);
	outline: none;
}

.vln-note-viewer-mark-read.is-read {
	background: var(--vln-accent);
	border-color: var(--vln-accent);
	color: var(--vln-on-accent);
}

.vln-note-viewer-mark-read .dashicons,
.vln-note-viewer-fullscreen .dashicons {
	width: 18px;
	height: 18px;
	font-size: 18px;
}

.vln-note-viewer-stage {
	position: relative;
	flex: 1;
	min-height: 0;
	background: #111;
}

.vln-note-viewer-frame {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	background: #fff;
}

.vln-note-viewer-spinner {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 40px;
	height: 40px;
	margin: -20px 0 0 -20px;
	border: 4px solid rgba(255, 255, 255, 0.25);
	border-top-color: var(--vln-accent);
	border-radius: 50%;
	animation: vln-note-spin 0.8s linear infinite;
}

.vln-note-viewer-stage.is-loaded .vln-note-viewer-spinner {
	display: none;
}

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

.vln-note-viewer-hint {
	min-width: 0;
	color: color-mix(in srgb, var(--vln-text) 75%, transparent);
}

.vln-note-viewer-newtab {
	flex-shrink: 0;
	color: var(--vln-accent-text);
	font-weight: 700;
	text-decoration: none;
}

.vln-note-viewer-newtab:hover {
	text-decoration: underline;
}

@media (max-width: 782px) {
	.vln-notes-summary {
		padding: 14px;
	}

	.vln-notes-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	/* Phones: the popup takes the whole screen, with room for the
	   theme's bottom menu hidden behind it. */
	.vln-note-viewer {
		padding: 0;
		backdrop-filter: none;
	}

	.vln-note-viewer-topbar,
	.vln-note-viewer-footer {
		border-radius: 0;
		padding: 8px 10px;
	}

	.vln-note-viewer-topbar {
		padding-top: calc(8px + env(safe-area-inset-top, 0px));
	}

	.vln-note-viewer-footer {
		padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
	}

	.vln-note-viewer-mark-read {
		padding: 0 10px;
	}

	.vln-note-viewer-fullscreen {
		display: none;
	}
}
