/**
 * Programe Educationale — Frontend Styles
 * Landing (infobox grid) + Category (timeline with sidebar)
 */

/* ==========================================================================
   LANDING PAGE — Infobox Grid
   ========================================================================== */

.dpe-landing__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 24px;
	padding: 40px 0;
}

.dpe-landing__card {
	display: flex;
	flex-direction: column;
	border-radius: 16px;
	overflow: hidden;
	background: #fff;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	text-decoration: none;
	color: inherit;
}

.dpe-landing__card:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
	text-decoration: none;
	color: inherit;
}

.dpe-landing__card-img {
	height: 180px;
	background-size: cover;
	background-position: center;
	background-color: #f0f2f5;
}

.dpe-landing__card-img--placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
}

.dpe-landing__card-img--placeholder .dashicons {
	font-size: 48px;
	color: #c4c9d0;
}

.dpe-landing__card-body {
	padding: 20px;
}

.dpe-landing__card-title {
	font-size: 18px;
	font-weight: 600;
	margin: 0 0 6px;
	color: #1f222b;
}

.dpe-landing__card-count {
	font-size: 13px;
	color: #788291;
}

/* ==========================================================================
   CATEGORY NAV — Mini thumbnails for other categories
   ========================================================================== */

.dpe-category-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	padding: 0 0 20px;
	margin-bottom: 0;
}

.dpe-category-nav__item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 14px 8px 8px;
	border-radius: 10px;
	background: #fff;
	border: 1px solid rgba(124, 58, 237, 0.2);
	text-decoration: none;
	white-space: nowrap;
	transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.dpe-category-nav__item:hover {
	background: rgba(124, 58, 237, 0.05);
	border-color: rgba(124, 58, 237, 0.45);
	box-shadow: 0 2px 8px rgba(124, 58, 237, 0.1);
	text-decoration: none;
}

.dpe-category-nav__img {
	width: 36px;
	height: 36px;
	border-radius: 8px;
	object-fit: cover;
	flex-shrink: 0;
}

.dpe-category-nav__placeholder {
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f0f2f5;
	border-radius: 8px;
	color: #c4c9d0;
	font-size: 16px;
	flex-shrink: 0;
}

.dpe-category-nav__label {
	font-size: 13px;
	font-weight: 500;
	color: #41444b;
}

/* ==========================================================================
   CATEGORY NAV — Pulse hint on random items (every visit)
   ========================================================================== */

.dpe-category-nav__item.--pulse {
	animation: dpePulse 1.5s ease infinite;
}

@keyframes dpePulse {
	0%, 100% {
		border-color: rgba(124, 58, 237, 0.2);
		box-shadow: 0 0 0 0 rgba(124, 58, 237, 0);
	}
	50% {
		border-color: rgba(124, 58, 237, 0.5);
		box-shadow: 0 0 0 6px rgba(124, 58, 237, 0.08);
	}
}

/* ==========================================================================
   CATEGORY PAGE — Archive Layout (sidebar + main)
   ========================================================================== */

.dpe-archive {
	display: grid;
	grid-template-columns: 260px 1fr;
	gap: 32px;
	padding: 40px 0;
	position: relative;
}

.dpe-archive__filter-toggle {
	display: none;
	position: fixed;
	bottom: 20px;
	left: 20px;
	z-index: 9998;
	padding: 12px 20px;
	border-radius: 30px;
	border: none;
	background: #7c3aed;
	color: #fff;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
	align-items: center;
	gap: 8px;
}

/* Sidebar */
.dpe-archive__sidebar {
	position: sticky;
	top: 20px;
	align-self: start;
}

.dpe-archive__sidebar-close {
	display: none;
}

.dpe-archive__sidebar-card {
	margin-bottom: 20px;
	background: #fff;
	border: 1px solid #f0f2f5;
	border-radius: 16px;
	padding: 20px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.dpe-archive__sidebar-title {
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: #7c3aed;
	margin: 0 0 12px;
}

.dpe-archive__checkbox-list {
	max-height: 240px;
	overflow-y: auto;
}

.dpe-archive__checkbox {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 4px 0;
	font-size: 14px;
	color: #41444b;
	cursor: pointer;
}

.dpe-archive__checkbox input {
	accent-color: #7c3aed;
}

.dpe-archive__select {
	width: 100%;
	padding: 8px 12px !important;
	border: 1px solid #e2e8f0 !important;
	border-radius: 8px !important;
	font-size: 13px !important;
	line-height: 1.4 !important;
	color: #41444b;
	background: #fff;
	max-width: 100% !important;
	height: auto !important;
	min-height: 0 !important;
}

/* Categories in sidebar (mobile only) */
.dpe-archive__sidebar-categories {
	display: none;
}

.dpe-archive__sidebar-cat-list {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.dpe-archive__sidebar-cat-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	border-radius: 8px;
	font-size: 14px;
	color: #41444b;
	text-decoration: none;
	transition: background 0.15s, color 0.15s;
}

.dpe-archive__sidebar-cat-item:hover {
	background: rgba(124, 58, 237, 0.06);
	color: #7c3aed;
	text-decoration: none;
}

.dpe-archive__sidebar-cat-img {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
}

.dpe-archive__sidebar-cat-placeholder {
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f0f2f5;
	border-radius: 50%;
	color: #c4c9d0;
	font-size: 14px;
	flex-shrink: 0;
}

.dpe-archive__sidebar-cat-label {
	font-size: 14px;
	font-weight: 500;
}

/* Main content */
.dpe-archive__main {
	min-width: 0;
}

.dpe-archive__search-bar {
	margin-bottom: 20px;
}

.dpe-archive__search-bar input {
	width: 100%;
	padding: 12px 16px !important;
	border: 1px solid #e2e8f0 !important;
	border-radius: 12px !important;
	font-size: 15px !important;
	line-height: 1.4 !important;
	background: #fff;
	transition: border-color 0.2s;
	height: auto !important;
}

.dpe-archive__search-bar input:focus {
	outline: none;
	border-color: #7c3aed !important;
	box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.dpe-archive__header {
	margin-bottom: 24px;
}

.dpe-archive__title {
	font-size: 24px;
	font-weight: 600;
	margin: 0 0 4px;
	color: #1f222b;
}

.dpe-archive__subtitle {
	font-size: 14px;
	color: #788291;
	margin: 0;
}

.dpe-archive__active-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
}

/* ==========================================================================
   TIMELINE
   ========================================================================== */

.dpe-timeline {
	position: relative;
	padding-left: 32px;
}

/* Vertical line */
.dpe-timeline::before {
	content: '';
	position: absolute;
	left: 8px;
	top: 0;
	bottom: 0;
	width: 2px;
	background: #e2e8f0;
}

/* Year marker */
.dpe-timeline__year {
	position: relative;
	margin: 32px 0 16px;
}

.dpe-timeline__year-label {
	position: relative;
	display: inline-block;
	padding: 4px 14px;
	background: #7c3aed;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	border-radius: 20px;
	margin-left: -8px;
}

/* Timeline entry */
.dpe-timeline__item {
	position: relative;
	padding: 16px 20px;
	margin-bottom: 12px;
	background: #fff;
	border: 1px solid #f0f2f5;
	border-radius: 12px;
	transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.dpe-timeline__item:hover {
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
	border-color: #e2e8f0;
}

/* Dot on timeline */
.dpe-timeline__item::before {
	content: '';
	position: absolute;
	left: -28px;
	top: 24px;
	width: 10px;
	height: 10px;
	background: #fff;
	border: 2px solid #7c3aed;
	border-radius: 50%;
}

.dpe-timeline__item-header {
	display: flex;
	align-items: flex-start;
	gap: 12px;
}

.dpe-timeline__item-thumb {
	width: 48px;
	height: 48px;
	border-radius: 8px;
	object-fit: cover;
	flex-shrink: 0;
}

.dpe-timeline__item-content {
	flex: 1;
	min-width: 0;
}

.dpe-timeline__item-title {
	font-size: 15px;
	font-weight: 500;
	color: #1f222b;
	margin: 0 0 6px;
	line-height: 1.4;
}

.dpe-timeline__item-title a {
	color: inherit;
	text-decoration: none;
}

.dpe-timeline__item-title a:hover {
	color: #7c3aed;
}

.dpe-timeline__item-meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	font-size: 13px;
	color: #788291;
}

.dpe-timeline__item-meta span::before {
	content: '•';
	margin-right: 8px;
	color: #c4c9d0;
}

.dpe-timeline__item-meta span:first-child::before {
	display: none;
}

/* Role badges */
.dpe-timeline__roles {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 10px;
}

.dpe-timeline__prof-photo {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: 2px solid #1d7bff;
	object-fit: cover;
	flex-shrink: 0;
}

.dpe-timeline__prof-name {
	font-size: 12px;
	font-weight: 600;
	color: #1f222b;
	margin-right: 4px;
}

.dpe-badge {
	display: inline-flex;
	align-items: center;
	padding: 3px 10px;
	border-radius: 12px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.dpe-badge--speaker {
	background: rgba(29, 123, 255, 0.1);
	color: #1d7bff;
}

.dpe-badge--organizer {
	background: rgba(46, 189, 111, 0.1);
	color: #2ebd6f;
}

.dpe-badge--chairman {
	background: rgba(124, 58, 237, 0.1);
	color: #7c3aed;
}

.dpe-badge--co-organizer {
	background: rgba(20, 184, 166, 0.1);
	color: #14b8a6;
}

.dpe-badge--co-chairman {
	background: rgba(249, 115, 22, 0.1);
	color: #f97316;
}

.dpe-badge--course-director {
	background: rgba(236, 72, 153, 0.1);
	color: #ec4899;
}

/* External link — positioned top-right */
.dpe-timeline__item-link {
	position: absolute;
	top: 16px;
	right: 20px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 5px 12px;
	font-size: 12px;
	font-weight: 500;
	color: #7c3aed;
	background: rgba(124, 58, 237, 0.06);
	border: 1px solid rgba(124, 58, 237, 0.15);
	border-radius: 6px;
	text-decoration: none;
	transition: background 0.15s, border-color 0.15s;
}

.dpe-timeline__item-link:hover {
	background: rgba(124, 58, 237, 0.12);
	border-color: rgba(124, 58, 237, 0.3);
	text-decoration: none;
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */

.dpe-archive__pagination {
	display: flex;
	justify-content: center;
	gap: 4px;
	margin-top: 32px;
}

.dpe-archive__pagination button {
	min-width: 36px;
	height: 36px;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	background: #fff;
	color: #41444b;
	font-size: 14px;
	cursor: pointer;
	transition: all 0.15s;
}

.dpe-archive__pagination button:hover {
	border-color: #7c3aed;
	color: #7c3aed;
}

.dpe-archive__pagination button.active {
	background: #7c3aed;
	border-color: #7c3aed;
	color: #fff;
}

.dpe-pagination-ellipsis {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	font-size: 14px;
	color: #6b7280;
	user-select: none;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1024px) {
	.dpe-archive {
		grid-template-columns: 1fr;
	}

	/* Hide category nav on mobile (moved to sidebar) */
	.dpe-category-nav {
		display: none;
	}

	/* Show categories section in sidebar on mobile */
	.dpe-archive__sidebar-categories {
		display: block;
	}

	.dpe-archive__sidebar {
		position: fixed;
		top: 0;
		left: 0;
		width: 280px;
		height: 100vh;
		background: #fff;
		z-index: 9999;
		padding: 24px;
		overflow-y: auto;
		transform: translateX(-100%);
		transition: transform 0.3s ease;
		box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
	}

	.dpe-archive__sidebar.--open {
		transform: translateX(0);
	}

	.dpe-archive__sidebar-close {
		display: block;
		position: absolute;
		top: 12px;
		right: 12px;
		width: 32px;
		height: 32px;
		border: none;
		background: #fee2e2;
		color: #ef4444;
		border-radius: 50%;
		font-size: 18px;
		cursor: pointer;
	}

	.dpe-archive__filter-toggle {
		display: flex;
	}
}

@media (max-width: 600px) {
	.dpe-landing__grid {
		grid-template-columns: 1fr;
		padding: 20px 0;
	}

	.dpe-timeline {
		padding-left: 24px;
	}

	.dpe-timeline__item-header {
		flex-direction: column;
	}

	.dpe-timeline__item-thumb {
		width: 40px;
		height: 40px;
	}
}
