/**
 * Teaching Portal — frontend (student) styles.
 * Modern dashboard layout in The Tutoring Company palette: deep-red gradient
 * sidebar with pill navigation, a welcome hero banner, and soft-shadowed cards
 * on an airy off-white content area.
 */

/* Normalise box-sizing inside the portal so padded full-width elements
   (empty states, grids, cards) measure consistently across tabs regardless
   of the active theme's defaults. */
.tp-portal,
.tp-portal *,
.tp-portal *::before,
.tp-portal *::after { box-sizing: border-box; }

.tp-portal {
	--tp-brand: #a80301;        /* primary brand red (matches website) */
	--tp-brand-dark: #700201;   /* darker red (hover / active) */
	--tp-brand-darker: #570201; /* deepest red */
	--tp-ink: #1b1530;          /* headings */
	--tp-text: #4a4651;         /* body text */
	--tp-bg: #faf4f1;           /* airy off-white content background */
	--tp-card: #ffffff;
	--tp-accent: #ffd1bf;       /* salmon accent */
	--tp-border: #f1e2db;       /* hairline card border */
	--tp-muted: #9a8c86;

	--tp-radius: 20px;          /* outer container / hero */
	--tp-radius-md: 16px;       /* cards */
	--tp-radius-sm: 10px;       /* controls */
	--tp-shadow: 0 10px 34px rgba(120, 1, 1, 0.10);
	--tp-shadow-card: 0 2px 14px rgba(27, 21, 48, 0.06);
	--tp-shadow-hover: 0 10px 26px rgba(27, 21, 48, 0.10);

	display: flex;
	font: inherit;
	color: var(--tp-text);
	background: var(--tp-bg);
	border-radius: var(--tp-radius);
	overflow: hidden;
	box-shadow: var(--tp-shadow);
	min-height: 600px;

	/* Fill the available page width rather than the theme's (often narrow)
	   prose column, while staying centred and capped on very wide screens. */
	width: 100%;
	max-width: 1280px;
	margin-inline: auto;
}

/* ---- Sidebar ---- */
.tp-portal__sidebar {
	flex: 0 0 256px;
	background: linear-gradient(165deg, var(--tp-brand) 0%, var(--tp-brand-dark) 60%, var(--tp-brand-darker) 100%);
	color: #fff;
	padding: 26px 18px;
	display: flex;
	flex-direction: column;
	gap: 22px;
}

.tp-portal__brand {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 6px 8px 20px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}
.tp-portal__brand::before {
	content: "";
	flex: 0 0 auto;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.16);
	box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25);
}
.tp-portal__brand-hello {
	display: block;
	font-size: 0.72em;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: rgba(255, 255, 255, 0.72);
}
.tp-portal__brand-name {
	display: block;
	font-size: 1.1em;
	font-weight: 700;
	color: #fff;
}

.tp-portal__nav {
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.tp-portal__navitem {
	display: flex;
	align-items: center;
	gap: 13px;
	width: 100%;
	padding: 12px 15px;
	background: none;
	border: 0;
	border-radius: 12px;
	color: rgba(255, 255, 255, 0.85);
	font: inherit;
	font-weight: 600;
	text-align: left;
	cursor: pointer;
	transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.tp-portal__navitem:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.tp-portal__navitem:focus-visible { outline: 2px solid var(--tp-accent); outline-offset: 2px; }
.tp-portal__navitem.is-active {
	background: #fff;
	color: var(--tp-brand);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}
.tp-portal__navitem.is-active .tp-icon { color: var(--tp-brand); }
.tp-portal__navicon { display: inline-flex; flex: 0 0 auto; }
.tp-portal__navlabel { white-space: nowrap; }

/* ---- Main ---- */
.tp-portal__main {
	flex: 1 1 auto;
	width: 100%;
	padding: 26px 30px 32px;
	min-width: 0;
}
/* Every tab panel and its content fill the main column edge to edge. */
.tp-portal__panel { width: 100%; }
.tp-portal__section-body { width: 100%; }
.tp-portal__section-body > .tp-empty,
.tp-reports, .tp-uploads, .tp-resources, .tp-documents, .tp-app-grid { width: 100%; }

/* ---- Welcome hero ---- */
.tp-portal__hero {
	position: relative;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 26px;
	padding: 24px 28px;
	border-radius: var(--tp-radius);
	background: linear-gradient(120deg, var(--tp-brand) 0%, var(--tp-brand-dark) 100%);
	color: #fff;
	box-shadow: 0 12px 28px rgba(174, 0, 1, 0.22);
}
.tp-portal__hero::before,
.tp-portal__hero::after {
	content: "";
	position: absolute;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.10);
	pointer-events: none;
}
.tp-portal__hero::before { width: 180px; height: 180px; top: -70px; right: 64px; }
.tp-portal__hero::after  { width: 120px; height: 120px; bottom: -60px; right: -20px; background: rgba(255, 255, 255, 0.07); }
.tp-portal__hero-content { position: relative; z-index: 1; }
.tp-portal__hero-eyebrow {
	margin: 0 0 6px;
	font-size: 0.74em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: rgba(255, 255, 255, 0.78);
}
.tp-portal__hero-title { margin: 0; font-size: 1.6em; font-weight: 800; line-height: 1.15; color: #fff; }
.tp-portal__hero-sub { margin: 8px 0 0; font-size: 0.96em; color: rgba(255, 255, 255, 0.85); }
.tp-portal__hero-art {
	position: relative;
	z-index: 1;
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 76px;
	height: 76px;
	border-radius: 18px;
	background: rgba(255, 255, 255, 0.16);
}
.tp-portal__hero-art .tp-icon { width: 38px; height: 38px; color: #fff; }

.tp-portal__section-title {
	margin: 0 0 16px;
	color: var(--tp-ink);
	font-size: 1.25em;
	font-weight: 800;
	letter-spacing: 0;
}
.tp-portal__section-intro {
	margin: -6px 0 20px;
	max-width: 62ch;
	color: var(--tp-text);
	font-size: 0.98em;
	line-height: 1.6;
}
.tp-portal__section-body { font-size: 0.98em; }

/* Guest / notice states keep a simple card look. */
.tp-portal--guest,
.tp-portal--notice {
	display: block;
	min-height: 0;
	padding: 30px 32px;
	background: var(--tp-card);
}

.tp-empty {
	color: var(--tp-muted);
	font-style: italic;
	padding: 18px 20px;
	background: var(--tp-card);
	border: 1px dashed var(--tp-border);
	border-radius: var(--tp-radius-md);
}

.tp-reports, .tp-uploads, .tp-resources, .tp-documents { list-style: none; margin: 0; padding: 0; }

.tp-button {
	display: inline-block;
	padding: 11px 20px;
	background: var(--tp-brand);
	color: #fff;
	border-radius: var(--tp-radius-sm);
	text-decoration: none;
	font-weight: 700;
	box-shadow: 0 4px 12px rgba(174, 0, 1, 0.20);
	transition: background-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}
.tp-button:hover, .tp-button:focus { background: var(--tp-brand-dark); color: #fff; transform: translateY(-1px); }

/* ---- Weekly Feedback ---- */
.tp-report {
	border: 1px solid var(--tp-border);
	border-radius: var(--tp-radius-md);
	padding: 18px 20px;
	margin-bottom: 14px;
	background: var(--tp-card);
	box-shadow: var(--tp-shadow-card);
}
.tp-report__head {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	font-size: 0.9em;
	color: var(--tp-muted);
	margin-bottom: 8px;
}
.tp-report__date { font-weight: 700; color: var(--tp-ink); }

/* Assessment-result files attached to a feedback entry */
.tp-report__files {
	margin: 12px 0 4px;
	padding: 12px 14px;
	background: var(--tp-bg);
	border-radius: var(--tp-radius-sm);
}
.tp-report__files-label {
	display: block;
	margin-bottom: 6px;
	font-size: 0.78em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--tp-muted);
}
.tp-filelist { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tp-file {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 12px;
	background: var(--tp-card);
	border: 1px solid var(--tp-border);
	border-radius: 999px;
	color: var(--tp-brand);
	font-weight: 700;
	font-size: 0.9em;
	text-decoration: none;
}
.tp-file::before { content: "\1F4C4"; /* 📄 */ font-size: 1em; }
.tp-file:hover { background: var(--tp-accent); border-color: var(--tp-accent); }

/* ---- Assessment Results / Documents ---- */
.tp-upload, .tp-document {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	background: var(--tp-card);
	border: 1px solid var(--tp-border);
	border-radius: var(--tp-radius-md);
	margin-bottom: 10px;
	box-shadow: var(--tp-shadow-card);
	transition: transform 0.12s ease, box-shadow 0.15s ease;
}
.tp-upload:hover, .tp-document:hover { transform: translateY(-1px); box-shadow: var(--tp-shadow-hover); }
.tp-upload__date, .tp-document__file { font-size: 0.85em; color: var(--tp-muted); }
.tp-upload__link, .tp-document__link { font-weight: 700; color: var(--tp-brand); text-decoration: none; }
.tp-upload__link:hover, .tp-document__link:hover { text-decoration: underline; }

/* ---- Resources (per class) / Applications ---- */
.tp-resource {
	padding: 18px 20px;
	margin-bottom: 14px;
	background: var(--tp-card);
	border: 1px solid var(--tp-border);
	border-radius: var(--tp-radius-md);
	box-shadow: var(--tp-shadow-card);
}
.tp-resource__link { font-weight: 700; color: var(--tp-brand); }
.tp-resource__desc { color: var(--tp-text); font-size: 0.95em; margin: 6px 0; }
.tp-resource__title { margin: 0 0 6px; font-size: 1.05em; color: var(--tp-ink); }
.tp-resource__embed { margin: 10px 0; }
.tp-resource__embed iframe { width: 100%; min-height: 480px; border: 1px solid var(--tp-border); border-radius: var(--tp-radius-sm); }
.tp-resource__fallback { margin: 6px 0 0; font-size: 0.9em; }
.tp-resource__fallback a { color: var(--tp-brand); }

/* ---- Applications grid ---- */
/* Applications are split into sections (premium / free); each has a heading,
   an intro line, and its own grid of white logo tiles. */
.tp-app-section { margin: 0 0 28px; }
.tp-app-section:last-child { margin-bottom: 0; }
.tp-app-section__title {
	margin: 0 0 4px;
	font-size: 1.1em;
	font-weight: 800;
	color: var(--tp-ink);
}
.tp-app-section__intro {
	margin: 0 0 16px;
	max-width: 62ch;
	color: var(--tp-text);
}

.tp-app-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 18px;
}
.tp-app { margin: 0; }
.tp-app__link {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	height: 100%;
	padding: 22px 14px;
	text-align: center;
	text-decoration: none;
	color: var(--tp-ink);
	background: var(--tp-card);
	border: 1px solid var(--tp-border);
	border-radius: var(--tp-radius-md);
	box-shadow: var(--tp-shadow-card);
	transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}
.tp-app__link:hover,
.tp-app__link:focus-visible {
	transform: translateY(-3px);
	border-color: var(--tp-accent);
	box-shadow: var(--tp-shadow-hover);
}
.tp-app__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 104px;
	height: 104px;
}
.tp-app__icon img {
	max-width: 104px;
	max-height: 104px;
	width: auto;
	height: auto;
	border-radius: 14px;
	object-fit: contain;
}
.tp-app__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 104px;
	height: 104px;
	border-radius: 14px;
	background: linear-gradient(145deg, var(--tp-brand) 0%, var(--tp-brand-dark) 100%);
	color: #fff;
	font-size: 1.8em;
	font-weight: 800;
	line-height: 1;
}
.tp-app__label { font-weight: 700; font-size: 0.95em; line-height: 1.3; }

/* ---- Support ---- */
.tp-support { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.tp-support__whatsapp { background: #25d366; box-shadow: 0 4px 12px rgba(37, 211, 102, 0.28); }
.tp-support__whatsapp:hover, .tp-support__whatsapp:focus { background: #1da851; }
.tp-support__email { background: var(--tp-brand); }
.tp-support__email:hover, .tp-support__email:focus { background: var(--tp-brand-dark); }

/* ---- Pagination ---- */
.tp-pagination { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.tp-pagination .page-numbers {
	padding: 7px 12px;
	border: 1px solid var(--tp-border);
	border-radius: var(--tp-radius-sm);
	text-decoration: none;
	color: var(--tp-ink);
	background: var(--tp-card);
	transition: background-color 0.12s ease, color 0.12s ease;
}
.tp-pagination .page-numbers:hover { background: var(--tp-accent); }
.tp-pagination .page-numbers.current {
	background: var(--tp-brand);
	border-color: var(--tp-brand);
	color: #fff;
}
.tp-pagination .page-numbers.dots { border-color: transparent; background: transparent; }

/* ---- Reply threads ---- */
.tp-thread {
	list-style: none;
	margin: 14px 0 0;
	padding: 14px 0 0;
	border-top: 1px dashed var(--tp-border);
}
.tp-reply { padding: 11px 13px; margin-bottom: 8px; background: var(--tp-bg); border-radius: var(--tp-radius-sm); }
.tp-reply--tutor { background: #fff2ec; }
.tp-reply__meta {
	font-size: 0.85em;
	color: var(--tp-muted);
	margin-bottom: 4px;
	display: flex;
	gap: 8px;
	align-items: center;
	flex-wrap: wrap;
}
.tp-reply__badge {
	background: var(--tp-brand);
	color: #fff;
	font-size: 0.75em;
	padding: 1px 8px;
	border-radius: 10px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}
.tp-reply__body { font-size: 0.95em; }

.tp-reply-form { margin-top: 12px; display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.tp-reply-form textarea {
	flex: 1 1 240px;
	min-height: 48px;
	padding: 10px 12px;
	border: 1px solid var(--tp-border);
	border-radius: var(--tp-radius-sm);
	font: inherit;
	resize: vertical;
}
.tp-reply-form textarea:focus { outline: 2px solid var(--tp-accent); outline-offset: 1px; border-color: var(--tp-accent); }
.tp-reply-form button {
	padding: 10px 18px;
	border: 0;
	background: var(--tp-brand);
	color: #fff;
	border-radius: var(--tp-radius-sm);
	cursor: pointer;
	font-weight: 700;
}
.tp-reply-form button:hover { background: var(--tp-brand-dark); }
.tp-reply-form button:disabled { opacity: 0.6; cursor: progress; }
.tp-reply-status { font-size: 0.85em; color: var(--tp-muted); align-self: center; }

/* ---- Login splash ---- */
.tp-splash {
	--tp-brand: #a80301;
	--tp-brand-dark: #700201;
	--tp-ink: #1b1530;
	--tp-text: #4a4651;
	--tp-bg: #faf4f1;
	--tp-card: #ffffff;
	--tp-accent: #ffd1bf;
	--tp-border: #f1e2db;
	--tp-muted: #9a8c86;

	font: inherit;
	color: var(--tp-text);
	max-width: 900px;
	margin: 0 auto;
	padding: 8px;
}
.tp-splash__head { text-align: center; margin-bottom: 26px; }
.tp-splash__eyebrow {
	margin: 0 0 6px;
	font-size: 0.78em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--tp-brand);
}
.tp-splash__title { margin: 0; font-size: 1.7em; font-weight: 800; color: var(--tp-ink); line-height: 1.2; }

.tp-splash__cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 22px;
}
.tp-splash-card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 10px;
	padding: 28px 26px;
	text-decoration: none;
	color: var(--tp-ink);
	background: var(--tp-card);
	border: 1px solid var(--tp-border);
	border-radius: 20px;
	box-shadow: 0 2px 14px rgba(27, 21, 48, 0.06);
	transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}
a.tp-splash-card:hover,
a.tp-splash-card:focus-visible {
	transform: translateY(-4px);
	border-color: var(--tp-brand);
	box-shadow: 0 14px 32px rgba(27, 21, 48, 0.12);
}
.tp-splash-card__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	border-radius: 16px;
	color: #fff;
	background: linear-gradient(145deg, var(--tp-brand) 0%, var(--tp-brand-dark) 100%);
}
.tp-splash-card__title { font-size: 1.2em; font-weight: 800; color: var(--tp-ink); }
.tp-splash-card__desc { font-size: 0.95em; color: var(--tp-text); line-height: 1.5; }
.tp-splash-card__cta { margin-top: 6px; font-weight: 700; color: var(--tp-brand); }
.tp-splash-card__cta--warn { color: var(--tp-muted); font-weight: 600; font-size: 0.9em; }
.tp-splash-card--disabled { opacity: 0.7; cursor: not-allowed; }

/* ---- Responsive: stack the sidebar above the content ---- */
@media (max-width: 782px) {
	.tp-portal { flex-direction: column; min-height: 0; }
	.tp-portal__sidebar { flex-basis: auto; }
	.tp-portal__brand { padding-bottom: 14px; }
	.tp-portal__nav { flex-direction: row; flex-wrap: wrap; }
	.tp-portal__navitem { width: auto; }
	.tp-portal__navlabel { font-size: 0.92em; }
	.tp-portal__main { padding: 22px 18px 26px; }
	.tp-portal__hero { padding: 20px 22px; }
	.tp-portal__hero-title { font-size: 1.35em; }
	.tp-portal__hero-art { width: 60px; height: 60px; }
}
