/* ==========================================================================
   WP Exam Calendar — Front-end styles
   All colors/radius come from CSS variables written inline by PHP
   (see class-wpec-shortcode.php) so the admin panel can change them
   with zero code edits. Fonts inherit the theme unless overridden.
   ========================================================================== */

:root {
	--wpec-exam-color: #E51C23;
	--wpec-card-bg: #211855;
	--wpec-day-bg: #F4F6F8;
	--wpec-day-text: #333333;
	--wpec-today-border: #2196F3;
	--wpec-header-bg: #E51C23;
	--wpec-header-text: #FFFFFF;
	--wpec-muted-text: #C9C3E8;
	--wpec-radius: 12px;
}

.wpec-wrapper {
	box-sizing: border-box;
	width: 100%;
	max-width: 960px;
	margin: 0 auto;
	color: var(--wpec-day-text);
	font-size: 16px;
	/* Font-family intentionally NOT set here so it inherits the theme by default. */
}
.wpec-wrapper *,
.wpec-wrapper *::before,
.wpec-wrapper *::after {
	box-sizing: border-box;
}

.wpec-card {
	background: var(--wpec-card-bg);
	border-radius: calc(var(--wpec-radius) + 4px);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28), 0 1px 4px rgba(0, 0, 0, 0.18);
	overflow: hidden;
	padding-bottom: 24px;
}

/* ---------------- Header ---------------- */
.wpec-header {
	background: var(--wpec-header-bg);
	color: var(--wpec-header-text);
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 22px 24px;
}
.wpec-title {
	margin: 0;
	font-size: clamp(24px, 4.2vw, 38px);
	font-weight: 800;
	letter-spacing: 0.4px;
	text-align: center;
	flex: 1;
	line-height: 1.15;
}
.wpec-nav-btn {
	background: rgba(255, 255, 255, 0.2);
	border: none;
	color: var(--wpec-header-text);
	width: 44px;
	height: 44px;
	min-width: 40px;
	border-radius: 50%;
	cursor: pointer;
	font-size: 18px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.2s ease, background 0.25s ease;
}
.wpec-nav-btn:hover { background: rgba(255, 255, 255, 0.34); transform: scale(1.1); }
.wpec-nav-btn:active { transform: scale(0.95); }
.wpec-nav-btn:focus-visible { outline: 2px solid var(--wpec-header-text); outline-offset: 2px; }

/* ---------------- Weekdays ---------------- */
.wpec-weekdays {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	background: rgba(255, 255, 255, 0.06);
	border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.wpec-weekdays span {
	text-align: center;
	padding: 12px 4px;
	font-size: 15px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--wpec-muted-text);
}

/* ---------------- Grid ---------------- */
.wpec-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 10px;
	padding: 20px;
	animation: wpecFade 0.35s ease;
}
@keyframes wpecFade {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: translateY(0); }
}

.wpec-day {
	position: relative;
	background: var(--wpec-day-bg);
	color: var(--wpec-day-text);
	border-radius: var(--wpec-radius);
	min-height: 84px;
	padding: 10px 8px 8px;
	display: flex;
	flex-direction: column;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.wpec-day.wpec-empty { background: transparent; }
.wpec-day:not(.wpec-empty):hover {
	transform: translateY(-3px);
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
	z-index: 2;
}

.wpec-day-num {
	font-size: 15px;
	font-weight: 700;
	line-height: 1;
}

/* Today */
.wpec-day.wpec-today {
	border: 2px solid var(--wpec-today-border);
	box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.18);
}

/* Exam day — clickable link styled as a card */
a.wpec-day.wpec-exam {
	background: var(--wpec-exam-color);
	color: #fff;
	text-decoration: none;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
	cursor: pointer;
}
a.wpec-day.wpec-exam .wpec-day-num { color: #fff; }
a.wpec-day.wpec-exam:hover,
a.wpec-day.wpec-exam:focus-visible {
	transform: translateY(-4px) scale(1.02);
	box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
	outline: none;
}

.wpec-exam-list {
	margin-top: 4px;
	display: flex;
	flex-direction: column;
	gap: 3px;
	overflow: hidden;
}
.wpec-exam-pill {
	font-size: 12px;
	line-height: 1.3;
	font-weight: 600;
	background: rgba(255, 255, 255, 0.22);
	border-radius: 6px;
	padding: 3px 6px;
	word-break: break-word;
}

/* ---------------- Tooltip ---------------- */
.wpec-tooltip {
	position: fixed;
	z-index: 9999;
	max-width: 260px;
	background: #222;
	color: #fff;
	padding: 12px 14px;
	border-radius: 10px;
	font-size: 14px;
	line-height: 1.55;
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
	opacity: 0;
	visibility: hidden;
	transform: translateY(4px);
	transition: opacity 0.18s ease, transform 0.18s ease;
	pointer-events: none;
}
.wpec-tooltip.wpec-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.wpec-tooltip strong { display: block; font-size: 15px; margin-bottom: 4px; }
.wpec-tooltip .wpec-tt-row { opacity: 0.85; }

/* ---------------- Legend ---------------- */
.wpec-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	padding: 18px 24px 4px;
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	margin-top: 8px;
}
.wpec-legend-item {
	display: flex;
	align-items: center;
	gap: 7px;
	font-size: 14px;
	font-weight: 600;
	color: var(--wpec-muted-text);
}
.wpec-legend-swatch {
	width: 13px;
	height: 13px;
	border-radius: 3px;
	display: inline-block;
	flex: none;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 768px) {
	.wpec-grid { gap: 8px; padding: 14px; }
	.wpec-day { min-height: 74px; padding: 8px 5px 5px; }
	.wpec-header { padding: 16px 14px; }
	.wpec-nav-btn { width: 36px; height: 36px; font-size: 14px; }
	.wpec-exam-pill { font-size: 10.5px; }
	.wpec-day-num { font-size: 13px; }
	.wpec-weekdays span { font-size: 12px; }
}

@media (max-width: 480px) {
	.wpec-weekdays span { font-size: 11px; padding: 9px 2px; }
	.wpec-day { min-height: 58px; border-radius: calc(var(--wpec-radius) - 3px); }
	.wpec-day-num { font-size: 12px; }
	.wpec-exam-list { display: none; }
	a.wpec-day.wpec-exam::after {
		content: "";
		display: block;
		width: 6px;
		height: 6px;
		border-radius: 50%;
		background: #fff;
		margin-top: 4px;
	}
	.wpec-title { font-size: 20px; }
	.wpec-legend { gap: 12px; padding: 14px; justify-content: center; }
	.wpec-legend-item { font-size: 12.5px; }
}
