/* ==================== THEME VARIABLES ==================== */

:root[data-theme="light"] {
	--text: #1a1a1a;
	--background: #fafaf8;
	--primary: #C44444;
	--secondary: #D65555;
	--accent: #E53935;
	--sidebar-bg: #e8e8e8;
	--card: #FFFFFF;
	--muted: #666666;
	--border: #e6e6e6;

	/* Spacing System */
	--spacing-section: 2.5rem;
	--spacing-subsection: 1.5rem;
	--spacing-content: 1rem;
	--spacing-small: 0.5rem;
}

:root[data-theme="dark"] {
	--text: #E0E0E0;
	--background: #121212;
	--primary: #E53935;
	--secondary: #525252;
	--accent: #E53935;
	--sidebar-bg: #1E1E1E;
	--card: #1E1E1E;
	--muted: #a0a0a0;
	--border: #2a2a2a;

	/* Spacing System */
	--spacing-section: 2.5rem;
	--spacing-subsection: 1.5rem;
	--spacing-content: 1rem;
	--spacing-small: 0.5rem;
}

/* ==================== BASE STYLES ==================== */

body {
	font-family: Arial, sans-serif;
	margin: 0;
	height: 100vh;
	color: var(--text);
	background-color: var(--background);
	overflow-x: hidden;
}

html {
	overflow-x: hidden;
}

/* ==================== TYPOGRAPHY ==================== */

h1 {
	font-size: 2em;
	margin: 0 0 var(--spacing-content) 0;
	text-align: center;
	color: var(--primary);
}

h2 {
	border-bottom: 2px solid var(--secondary);
	padding-bottom: 5px;
	margin: 0 0 var(--spacing-subsection) 0;
	width: 100%;
	box-sizing: border-box;
	text-align: center;
	color: var(--primary);
}

h3 {
	margin: 15px 0 5px 0;
	color: var(--text);
}

/* Global links */
a {
	color: var(--primary);
	text-decoration: none;
	transition: color 0.3s ease;
}

a:hover {
	color: var(--accent);
}

/* ==================== LAYOUT ==================== */

#cv {
	width: 100vw;
	max-width: 100%;
	height: 100vh;
	display: grid;
	grid-template-columns: 340px 1fr;
	gap: 10px;
	box-sizing: border-box;
	background-color: var(--background);
	overflow-x: hidden;
}

#sidebar {
	padding: 10px;
	background: var(--primary);
	color: #fff;
	text-align: justify;
	border-right: 1px solid var(--border);
	overflow-y: auto;
	overflow-x: hidden;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

#sidebar::-webkit-scrollbar {
	display: none;
}

#sidebar a {
	color: rgba(255, 255, 255, 0.95);
}

#sidebar h2 {
	color: #fff;
	border-bottom-color: rgba(255, 255, 255, 0.3);
	margin-top: var(--spacing-subsection);
}

#sidebar h2:first-of-type {
	margin-top: 0;
}

#sidebar h3 {
	color: #fff;
	border-bottom-color: rgba(255, 255, 255, 0.3);
}

#main {
	padding: var(--spacing-section) 15px 50px 5px;
	overflow-y: auto;
	overflow-x: hidden;
}

#main h2:first-of-type {
	margin-top: 0;
}

/* ==================== PROFILE SECTION ==================== */

#profile-section {
	margin-bottom: var(--spacing-section);
}

#profile-section h3 {
	color: var(--primary);
	margin-bottom: 10px;
	margin-top: 0;
}

#profile {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: 16px;
	padding: 20px 24px;
	font-weight: 400;
	font-size: 1em;
	line-height: 1.7;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
	position: relative;
	text-align: center;
}

#profile:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12),
		0 0 20px rgba(229, 57, 53, 0.08);
	border-color: var(--accent);
}

#info {
	font-style: italic;
	margin-bottom: 1em;
}

#summary {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: 18px 20px;
	margin-bottom: 1.5em;
	line-height: 1.7;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
	position: relative;
	overflow: hidden;
}

#summary::before {
	content: '';
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(90deg,
			transparent,
			rgba(229, 57, 53, 0.03),
			transparent);
	transition: left 0.5s ease;
}

#summary:hover::before {
	left: 100%;
}

#summary:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
	border-color: var(--accent);
}

/* Profile Picture */
#profile-pic {
	width: 150px;
	height: 150px;
	border-radius: 50%;
	display: block;
	margin: 0 auto 20px auto;
	border: 3px solid rgba(255, 255, 255, 0.3);
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
	transition: all 0.3s ease;
	object-fit: cover;
}

#profile-pic:hover {
	transform: scale(1.05);
	border-color: rgba(255, 255, 255, 0.6);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Profile Picture Placeholder (empty space) */
#profile-pic-placeholder {
	width: 150px;
	height: 150px;
	display: block;
	margin: 0 auto 20px auto;
}

/* ==================== SIDEBAR SECTIONS ==================== */

/* Contact items */
.contact-container {
	margin-bottom: var(--spacing-subsection);
}

.contact-item {
	margin-bottom: 6px;
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 0.95rem;
	padding: 4px 0;
	transition: transform 0.2s ease;
}

.contact-item:hover {
	transform: scale(1.07) translateX(20px);
	z-index: 2;
}

.contact-item i {
	font-size: 1.15rem;
	min-width: 22px;
	color: rgba(255, 255, 255, 0.9);
}

.contact-item a {
	color: rgba(255, 255, 255, 0.95);
	text-decoration: none;
	transition: color 0.2s ease;
	border-bottom: 1px solid transparent;
}

.contact-item a:hover {
	color: #fff;
	border-bottom-color: rgba(255, 255, 255, 0.5);
}

/* Age display - show full version on screen, simple in print */
.age-simple {
	display: none;
}

.age-full {
	display: inline;
}

/* Skills & Interest badges - Glassmorphism */
#skills {
	margin-bottom: var(--spacing-subsection);
}

.skills-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 15px;
}

.skill-badge {
	background: rgba(255, 255, 255, 0.15);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	color: #fff;
	padding: 10px 16px;
	border-radius: 25px;
	font-size: 0.9rem;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	border: 1px solid rgba(255, 255, 255, 0.2);
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.skill-badge:hover {
	transform: translateY(-3px);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Language cards - Glassmorphism */
.langues-grid {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 15px;
}

.langue-card {
	background: rgba(255, 255, 255, 0.15);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 12px;
	padding: 12px 16px;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
	position: relative;
	overflow: hidden;
}

.langue-card::before {
	content: '';
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(90deg,
			transparent,
			rgba(255, 255, 255, 0.1),
			transparent);
	transition: left 0.5s ease;
}

.langue-card:hover::before {
	left: 100%;
}

.langue-card:hover {
	transform: translateX(5px);
	background: rgba(255, 255, 255, 0.25);
	border-color: rgba(255, 255, 255, 0.4);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.langue-name {
	font-weight: 600;
	font-size: 1rem;
	margin-bottom: 4px;
	color: #fff;
}

.langue-level {
	font-size: 0.85rem;
	color: rgba(255, 255, 255, 0.8);
	font-style: italic;
}

/* Interest badges */
.other-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 15px;
}

.interest-badge {
	position: relative;
	background: rgba(255, 255, 255, 0.15);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	color: #fff;
	padding: 10px 16px;
	border-radius: 30px;
	font-size: 0.9rem;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	border: 1px solid rgba(255, 255, 255, 0.2);
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.interest-badge:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Liquid glass tooltip on hover */
.interest-badge::after {
	content: attr(data-tooltip);
	position: absolute;
	bottom: 100%;
	left: 0;
	margin-bottom: 8px;
	background: rgba(255, 255, 255, 0.98);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	color: #1a1a1a;
	padding: 8px 12px;
	border-radius: 20px;
	font-size: 0.8rem;
	max-width: 180px;
	white-space: normal;
	word-wrap: break-word;
	text-align: left;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease, margin-bottom 0.3s ease;
	z-index: 1000;
	border: 1px solid rgba(0, 0, 0, 0.1);
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* Arrow pointer for tooltip */
.interest-badge::before {
	content: "";
	position: absolute;
	bottom: 100%;
	left: 16px;
	margin-bottom: 1px;
	width: 0;
	height: 0;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	border-top: 5px solid rgba(255, 255, 255, 0.98);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease, margin-bottom 0.3s ease;
	z-index: 999;
}

.interest-badge:hover::after {
	opacity: 1;
	margin-bottom: 10px;
}

.interest-badge:hover::before {
	opacity: 1;
	margin-bottom: 3px;
}

/* ==================== MAIN CONTENT SECTIONS ==================== */

/* All major sections have consistent top spacing */
#github-repos,
#experiences,
#formations {
	margin-top: var(--spacing-section);
}

/* GitHub repos grid */
#github-repos .selected-repos {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 16px;
	margin-top: 20px;
	align-items: stretch;
}

/* GitHub repo cards */
.selected-repo-card {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: 16px 16px 70px 16px;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
	position: relative;
	overflow: hidden;
	min-height: 180px;
}

/* Card hover effects (repos, experiences, formations) */
.selected-repo-card::before,
.experience-item::before,
.formation-item::before {
	content: '';
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(90deg, transparent, rgba(229, 57, 53, 0.03), transparent);
	transition: left 0.5s ease;
}

.selected-repo-card:hover::before,
.experience-item:hover::before,
.formation-item:hover::before {
	left: 100%;
}

.selected-repo-card:hover,
#profile:hover,
#summary:hover,
.experience-item:hover,
.formation-item:hover {
	transform: translateY(-3px);
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
	border-color: var(--accent);
}

.selected-repo-card h3 {
	margin: 0 0 10px 0;
}

.selected-repo-card h3 a {
	color: var(--accent);
	font-weight: 700;
	transition: color 0.3s ease;
}

.selected-repo-card h3 a:hover {
	color: var(--primary);
}

/* Repo card content positioning */
.selected-repo-card p {
	margin: 8px 0;
	color: var(--text);
	line-height: 1.5;
}

.selected-repo-card p:nth-of-type(1) {
	margin-bottom: 16px;
}

.selected-repo-card p:nth-of-type(2) {
	position: absolute;
	bottom: 35px;
	left: 16px;
	right: 16px;
	color: var(--muted);
	font-size: 0.85rem;
	margin: 0;
}

.selected-repo-card p:nth-of-type(3) {
	position: absolute;
	bottom: 10px;
	left: 16px;
	right: 16px;
	color: var(--muted);
	font-size: 0.85rem;
	margin: 0;
}

/* Experiences & Formations */
.experiences-grid,
.formations-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
	align-items: stretch;
}

.experience-item,
.formation-item {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: 16px;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
	position: relative;
	overflow: hidden;
}

.experience-item {
	min-height: 120px;
	display: flex;
	flex-direction: column;
}

.formation-item {
	padding: 12px 16px;
}

.missions-list {
	margin-top: 10px;
	padding-left: 20px;
	margin-bottom: 0;
}

.missions-list li {
	color: var(--text);
	line-height: 1.6;
}

/* Formation structure */
.formation-title {
	display: inline;
}

.formation-item strong {
	display: inline;
	color: var(--text);
	font-size: 1rem;
}

.formation-details {
	display: inline;
	color: var(--text);
	font-size: 0.95rem;
	margin-left: 8px;
}

.formation-school {
	color: var(--text);
	font-size: 0.9rem;
}

.formation-duration {
	color: var(--muted);
	font-size: 0.85rem;
}

/* Discord elements */
.discord-vignette {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 12px;
}

.discord-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
}

.discord-projects {
	display: grid;
	gap: 10px;
}

.discord-project-card {
	border: 1px solid var(--border);
	padding: 12px;
	border-radius: 8px;
	background: var(--card);
}

.discord-project-card .small {
	font-size: 0.9rem;
	color: var(--muted);
}

.discord-name {
	font-size: 0.9rem;
	font-weight: 600;
}

/* ==================== BUTTONS ==================== */

/* Theme toggle switch */
#theme-toggle {
	position: fixed;
	top: 12px;
	right: 220px;
	z-index: 999;
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 0;
}

.toggle-track {
	position: relative;
	width: 44px;
	height: 22px;
	background: var(--card);
	border: 2px solid var(--border);
	border-radius: 22px;
	padding: 0 4px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
	transition: border-color 0.3s ease;
}

#theme-toggle:hover .toggle-track {
	border-color: var(--primary);
}

.toggle-thumb {
	position: absolute;
	width: 16px;
	height: 16px;
	background: var(--primary);
	border-radius: 50%;
	left: 2px;
	transition: left 0.3s ease;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .toggle-thumb {
	left: 33px;
}

.sun-icon,
.moon-icon {
	font-size: 11px;
	color: var(--text);
	opacity: 0.5;
	transition: opacity 0.3s ease;
}

[data-theme="light"] .sun-icon,
[data-theme="dark"] .moon-icon {
	opacity: 1;
}

/* Print PDF button */
#print-pdf-btn {
	position: fixed;
	top: 8px;
	right: 50px;
	z-index: 999;
	background: var(--primary);
	color: white;
	border: none;
	border-radius: 8px;
	padding: 8px 16px;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 6px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

#print-pdf-btn:hover {
	background: var(--secondary);
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ==================== PDF FOOTER ==================== */

#pdf-footer {
	display: none;
}

/* ==================== RESPONSIVE - MOBILE ==================== */

@media (max-width: 720px) {
	body {
		overflow-y: auto;
		height: auto;
	}

	#cv {
		display: flex;
		flex-direction: column;
		height: auto;
		overflow: visible;
	}

	#sidebar {
		order: 2;
		overflow-y: visible;
		height: auto;
	}

	#main {
		order: 1;
		padding-top: 60px;
		padding-bottom: 30px;
		overflow-y: visible;
		height: auto;
	}

	#print-pdf-btn {
		right: 10px;
	}

	#github-repos .selected-repos {
		grid-template-columns: 1fr;
	}

	.formations-grid,
	.experiences-grid {
		grid-template-columns: 1fr;
	}
}

@media (min-width: 1200px) {
	.formations-grid,
	.experiences-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}
