/* Print Styles for PDF Export
 * Optimizes all pages and CV for printing as PDF
 */

@media print {
	/* Page Setup */
	@page {
		size: A4;
		margin: 1.5cm 1cm;
	}

	/* Reset basic styles */
	*,
	*::before,
	*::after {
		background: transparent !important;
		color: #000 !important;
		box-shadow: none !important;
		text-shadow: none !important;
	}

	/* Body and basic elements */
	html,
	body {
		width: 100%;
		height: auto;
		font-size: 12pt;
		line-height: 1.4;
		background: white !important;
		color: black !important;
	}

	/* Hide elements not needed in print */
	nav,
	.navbar,
	.nav,
	.navigation,
	header.navbar,
	footer.footer,
	.btn,
	.cta-buttons,
	.social-links,
	.theme-toggle,
	button,
	#navbarHeader,
	.collapse,
	[role="navigation"],
	.footer-links,
	.social-media-icons,
	.contact-methods,
	.back-to-top,
	[href="#"],
	script,
	noscript {
		display: none !important;
	}

	/* Show important content */
	main,
	article,
	section,
	.content,
	.main-content {
		display: block !important;
		width: 100%;
	}

	/* Typography */
	h1,
	h2,
	h3,
	h4,
	h5,
	h6 {
		page-break-after: avoid;
		page-break-inside: avoid;
		font-weight: bold;
		color: #000 !important;
	}

	h1 {
		font-size: 20pt;
		margin-top: 0;
		margin-bottom: 12pt;
	}

	h2 {
		font-size: 16pt;
		margin-top: 12pt;
		margin-bottom: 8pt;
	}

	h3 {
		font-size: 14pt;
		margin-top: 10pt;
		margin-bottom: 6pt;
	}

	p,
	li {
		orphans: 3;
		widows: 3;
		line-height: 1.5;
	}

	/* Links */
	a {
		color: #000 !important;
		text-decoration: underline;
	}

	/* Show URLs for important external links only */
	a[href^="http"]:not([href*="localhost"]):not([href*="#"]):after,
	a[href^="mailto:"]:after {
		content: " (" attr(href) ")";
		font-size: 90%;
		color: #666;
		word-break: break-all;
	}

	/* Don't show URLs for internal links, anchors, or javascript */
	a[href^="#"]:after,
	a[href^="javascript:"]:after,
	a[href=""]:after {
		content: "";
	}

	/* Images */
	img {
		max-width: 100% !important;
		page-break-inside: avoid;
		display: block;
	}

	.profile-image,
	.img-fluid {
		border: 1px solid #ddd !important;
		max-width: 150px !important;
		height: auto !important;
	}

	/* Lists */
	ul,
	ol {
		page-break-inside: avoid;
	}

	li {
		page-break-inside: avoid;
	}

	/* Tables */
	table {
		border-collapse: collapse;
		width: 100%;
		page-break-inside: avoid;
	}

	thead {
		display: table-header-group;
	}

	tr {
		page-break-inside: avoid;
	}

	td,
	th {
		border: 1px solid #ddd;
		padding: 8pt;
	}

	/* Sections and Cards */
	.hero-section,
	.services-section,
	.skills-section,
	.tools-section,
	.contact-section {
		page-break-inside: avoid;
		padding: 0 !important;
		margin-bottom: 20pt;
		background: white !important;
	}

	.service-card,
	.skill-category,
	.card {
		page-break-inside: avoid;
		border: 1px solid #ddd !important;
		box-shadow: none !important;
		margin-bottom: 10pt;
		padding: 10pt;
		background: white !important;
	}

	.card-body {
		padding: 10pt;
	}

	/* Containers */
	.container,
	.container-fluid {
		width: 100% !important;
		max-width: 100% !important;
		padding: 0 !important;
		margin: 0 !important;
	}

	.row {
		display: block !important;
		width: 100% !important;
	}

	.col,
	.col-md-1,
	.col-md-2,
	.col-md-3,
	.col-md-4,
	.col-md-5,
	.col-md-6,
	.col-md-7,
	.col-md-8,
	.col-md-9,
	.col-md-10,
	.col-md-11,
	.col-md-12 {
		width: 100% !important;
		float: none !important;
		display: block !important;
	}

	/* CV Specific Styles */
	.list-group-item {
		border: 1px solid #ddd !important;
		padding: 8pt;
		margin-bottom: 2pt;
	}

	.badge {
		border: 1px solid #000 !important;
		padding: 2pt 4pt;
	}

	/* Skills and tags */
	.skill-tags,
	.skills-grid {
		display: block !important;
	}

	.skill-tag {
		display: inline-block;
		border: 1px solid #ddd !important;
		padding: 2pt 6pt;
		margin: 2pt;
		background: white !important;
	}

	/* Avoid breaking */
	pre,
	blockquote,
	img,
	figure {
		page-break-inside: avoid;
	}

	/* Hero section for CV */
	.hero-title {
		margin-bottom: 10pt;
	}

	.hero-subtitle {
		margin-bottom: 8pt;
	}

	.hero-description {
		margin-bottom: 12pt;
	}

	/* Icon handling */
	.fa,
	.fas,
	.far,
	.fab,
	i[class*="fa-"] {
		color: #000 !important;
		font-size: 10pt;
	}

	/* Grid layouts */
	.services-grid,
	.tools-grid {
		display: block !important;
	}

	.service-card,
	.tool-item {
		margin-bottom: 10pt;
	}

	/* Remove animations and transitions */
	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
	}

	/* Contact info */
	.contact-method {
		page-break-inside: avoid;
		margin-bottom: 10pt;
		border: 1px solid #ddd !important;
		padding: 8pt;
	}

	/* Better spacing for print */
	.py-5,
	.my-5 {
		padding-top: 15pt !important;
		padding-bottom: 15pt !important;
	}

	.mt-3,
	.my-3 {
		margin-top: 10pt !important;
	}

	.mb-3,
	.my-3 {
		margin-bottom: 10pt !important;
	}

	/* Section titles */
	.section-title {
		font-size: 18pt;
		margin-bottom: 10pt;
		color: #000 !important;
	}

	.section-subtitle {
		font-size: 12pt;
		margin-bottom: 8pt;
		color: #333 !important;
	}

	/* Background colors to white */
	.bg-primary,
	.bg-secondary,
	.bg-dark,
	.bg-light,
	.bg-warning,
	.bg-info,
	.bg-success,
	.bg-danger {
		background-color: white !important;
		color: #000 !important;
	}

	/* Footer info - keep only essential text */
	.footer {
		border-top: 1px solid #ddd;
		padding-top: 10pt;
		margin-top: 20pt;
	}

	/* Ensure good contrast */
	.text-light,
	.text-muted {
		color: #333 !important;
	}

	/* LinkedIn and social media sections */
	.list-group {
		border: none !important;
	}

	/* Make sure logos are visible but not too large */
	.tool-item img,
	img[src*="logo"] {
		max-width: 80px !important;
		height: auto !important;
		filter: grayscale(100%) !important;
	}

	/* Page breaks for better layout */
	.page-break {
		page-break-after: always;
	}

	.page-break-before {
		page-break-before: always;
	}

	.no-page-break {
		page-break-inside: avoid;
	}
}

/* Print button styles - visible on screen only */
@media screen {
	.print-button {
		position: fixed;
		bottom: 20px;
		right: 20px;
		padding: 12px 24px;
		background-color: #2563eb;
		color: white;
		border: none;
		border-radius: 8px;
		font-size: 16px;
		font-weight: 600;
		cursor: pointer;
		box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
		z-index: 1000;
		transition: all 0.3s ease;
	}

	.print-button:hover {
		background-color: #1d4ed8;
		transform: translateY(-2px);
		box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
	}

	.print-button i {
		margin-right: 8px;
	}

	/* Alternative inline print link style */
	.print-link {
		display: inline-flex;
		align-items: center;
		padding: 8px 16px;
		background-color: #f3f4f6;
		color: #1f2937;
		text-decoration: none;
		border-radius: 6px;
		font-size: 14px;
		font-weight: 500;
		transition: all 0.2s ease;
		border: 1px solid #e5e7eb;
	}

	.print-link:hover {
		background-color: #e5e7eb;
		color: #111827;
		text-decoration: none;
	}

	.print-link i {
		margin-right: 6px;
	}
}
