/* Author Modal Styles */

/* Basic Author Section Styling */
.space-page-content-meta-author {
	position: relative;
	display: inline-block;
}

.space-page-content-meta-author a {
	text-decoration: none;
	color: inherit;
	transition: color 0.3s ease;
}

.space-page-content-meta-author a:hover {
	color: #007cba;
}

.author-hover-trigger {
	cursor: pointer;
	transition: color 0.3s ease;
	position: relative;
}

.author-hover-trigger:hover {
	color: #007cba;
}

/* Popover Container */
.author-modal {
	display: none;
	position: fixed !important; /* Force fixed positioning */
	z-index: 9999;
	top: 0;
	left: 0;
	background-color: #fff;
	border-radius: 8px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
	border: 1px solid #e1e5e9;
	width: 320px;
	opacity: 0;
	transform: translateX(-10px);
	transition: all 0.2s ease;
	pointer-events: none;
	visibility: hidden;
	/* Ensure no CSS interferes with positioning */
	margin: 0 !important;
	padding: 0 !important;
}

.author-modal.show {
	display: block;
	opacity: 1;
	transform: translateX(0);
	pointer-events: all;
	visibility: visible;
}

/* Popover Arrow - Default left-pointing arrow (for right-side positioning) */
.author-modal::before {
	content: '';
	position: absolute;
	left: -6px;
	top: 20px;
	width: 0;
	height: 0;
	border-top: 6px solid transparent;
	border-bottom: 6px solid transparent;
	border-right: 6px solid #fff;
}

.author-modal::after {
	content: '';
	position: absolute;
	left: -7px;
	top: 20px;
	width: 0;
	height: 0;
	border-top: 6px solid transparent;
	border-bottom: 6px solid transparent;
	border-right: 6px solid #e1e5e9;
}

/* Popover Content */
.author-modal-content {
	padding: 0;
	overflow: hidden;
}

/* Close Button */
.author-modal-close {
	position: absolute;
	right: 12px;
	top: 12px;
	width: 20px;
	height: 20px;
	background: #f8f9fa;
	border: 1px solid #e1e5e9;
	border-radius: 50%;
	color: #6c757d;
	font-size: 14px;
	line-height: 18px;
	text-align: center;
	cursor: pointer;
	transition: all 0.2s ease;
	z-index: 10;
}

.author-modal-close:hover {
	background: #e9ecef;
	color: #495057;
	border-color: #ced4da;
}

/* Popover Header */
.author-modal-header {
	padding: 20px 20px 15px;
	border-bottom: 1px solid #f1f3f4;
	background: #fafbfc;
}

.author-modal-avatar {
	text-align: center;
	margin-bottom: 12px;
}

.author-modal-avatar img {
	border-radius: 50%;
	border: 3px solid #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.author-modal-name {
	margin: 0 0 6px 0;
	font-size: 18px;
	font-weight: 600;
	color: #2c3e50;
	text-align: center;
}

.author-modal-role {
	font-size: 12px;
	color: #6c757d;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	font-weight: 500;
	text-align: center;
}

/* Popover Body */
.author-modal-bio {
	padding: 15px 20px;
	line-height: 1.5;
	color: #495057;
	max-height: 120px;
	overflow-y: auto;
	font-size: 14px;
}

.author-modal-bio p {
	margin: 0 0 10px 0;
}

.author-modal-bio p:last-child {
	margin-bottom: 0;
}

/* Social Media Section */
.author-modal-social {
	padding: 15px 20px;
	border-top: 1px solid #f1f3f4;
	background: #fafbfc;
}

.author-modal-social-title {
	font-size: 12px;
	font-weight: 600;
	color: #6c757d;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 12px;
	text-align: center;
}

.author-modal-social-icons {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.social-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: #fff;
	border: 1px solid #e1e5e9;
	color: #6c757d;
	text-decoration: none;
	transition: all 0.2s ease;
	font-size: 14px;
}

.social-icon:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	text-decoration: none;
}

/* Social Icon Colors */
.social-icon.website:hover {
	background: #007cba;
	border-color: #007cba;
	color: #fff;
}

.social-icon.twitter:hover {
	background: #1da1f2;
	border-color: #1da1f2;
	color: #fff;
}

.social-icon.facebook:hover {
	background: #1877f2;
	border-color: #1877f2;
	color: #fff;
}

.social-icon.linkedin:hover {
	background: #0077b5;
	border-color: #0077b5;
	color: #fff;
}

.social-icon.instagram:hover {
	background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
	border-color: #dc2743;
	color: #fff;
}

.social-icon.youtube:hover {
	background: #ff0000;
	border-color: #ff0000;
	color: #fff;
}

.social-icon.email:hover {
	background: #28a745;
	border-color: #28a745;
	color: #fff;
}

/* Email Tooltip */
.email-tooltip {
	position: fixed;
	z-index: 10000;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
	border: 1px solid #e1e5e9;
	padding: 0;
	overflow: hidden;
	min-width: 200px;
}

.email-tooltip-content {
	padding: 15px;
}

.email-tooltip-email {
	font-size: 14px;
	font-weight: 600;
	color: #2c3e50;
	text-align: center;
	margin-bottom: 12px;
	padding: 8px;
	background: #f8f9fa;
	border-radius: 4px;
	border: 1px solid #e9ecef;
}

.email-tooltip-actions {
	display: flex;
	gap: 8px;
	justify-content: center;
}

.email-tooltip-mailto,
.email-tooltip-copy {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 12px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 500;
	text-decoration: none;
	transition: all 0.2s ease;
	border: none;
	cursor: pointer;
}

.email-tooltip-mailto {
	background: #007cba;
	color: white;
}

.email-tooltip-mailto:hover {
	background: #005a87;
	color: white;
	text-decoration: none;
}

.email-tooltip-copy {
	background: #6c757d;
	color: white;
}

.email-tooltip-copy:hover {
	background: #495057;
}

/* Popover Footer */
.author-modal-footer {
	padding: 15px 20px;
	border-top: 1px solid #f1f3f4;
	background: #fafbfc;
	text-align: center;
}

.author-modal-posts-link {
	display: inline-block;
	padding: 8px 16px;
	background-color: #007cba;
	color: white;
	text-decoration: none;
	border-radius: 4px;
	transition: all 0.2s ease;
	font-weight: 500;
	font-size: 13px;
}

.author-modal-posts-link:hover {
	background-color: #005a87;
	color: white;
	text-decoration: none;
	transform: translateY(-1px);
}

/* Scrollbar styling for bio section */
.author-modal-bio::-webkit-scrollbar {
	width: 4px;
}

.author-modal-bio::-webkit-scrollbar-track {
	background: #f1f3f4;
	border-radius: 2px;
}

.author-modal-bio::-webkit-scrollbar-thumb {
	background: #c1c1c1;
	border-radius: 2px;
}

.author-modal-bio::-webkit-scrollbar-thumb:hover {
	background: #a8a8a8;
}

/* Responsive Design */
@media (max-width: 768px) {
	.author-modal {
		width: 280px;
	}
	
	.author-modal-header {
		padding: 15px 15px 12px;
	}
	
	.author-modal-name {
		font-size: 16px;
	}
	
	.author-modal-bio {
		padding: 12px 15px;
		max-height: 100px;
		font-size: 13px;
	}
	
	.author-modal-social {
		padding: 12px 15px;
	}
	
	.author-modal-social-icons {
		gap: 10px;
	}
	
	.social-icon {
		width: 32px;
		height: 32px;
		font-size: 13px;
	}
	
	.author-modal-footer {
		padding: 12px 15px;
	}
	
	.email-tooltip {
		min-width: 180px;
	}
	
	.email-tooltip-content {
		padding: 12px;
	}
	
	.email-tooltip-actions {
		flex-direction: column;
		gap: 6px;
	}
}

@media (max-width: 480px) {
	.author-modal {
		width: 260px;
	}
	
	.author-modal-header {
		padding: 12px 12px 10px;
	}
	
	.author-modal-name {
		font-size: 15px;
	}
	
	.author-modal-role {
		font-size: 11px;
	}
	
	.author-modal-bio {
		padding: 10px 12px;
		max-height: 80px;
		font-size: 12px;
	}
	
	.author-modal-social {
		padding: 10px 12px;
	}
	
	.author-modal-social-icons {
		gap: 8px;
	}
	
	.social-icon {
		width: 30px;
		height: 30px;
		font-size: 12px;
	}
	
	.author-modal-footer {
		padding: 10px 12px;
	}
	
	.author-modal-posts-link {
		padding: 6px 12px;
		font-size: 12px;
	}
	
	.email-tooltip {
		min-width: 160px;
	}
	
	.email-tooltip-content {
		padding: 10px;
	}
	
	.email-tooltip-email {
		font-size: 13px;
		padding: 6px;
	}
	
	.email-tooltip-mailto,
	.email-tooltip-copy {
		padding: 6px 10px;
		font-size: 11px;
	}
}

/* Right-aligned popover for left-side triggers */
.author-modal.right-aligned {
	/* Position will be set by JavaScript */
}

.author-modal.right-aligned::before {
	left: auto;
	right: -6px;
	border-left: 6px solid #fff;
	border-right: none;
}

.author-modal.right-aligned::after {
	left: auto;
	right: -7px;
	border-left: 6px solid #e1e5e9;
	border-right: none;
}

/* Bottom-aligned popover for top-side triggers */
.author-modal.bottom-aligned {
	/* Position will be set by JavaScript */
}

.author-modal.bottom-aligned::before {
	top: auto;
	bottom: 20px;
}

.author-modal.bottom-aligned::after {
	top: auto;
	bottom: 20px;
}

/* Animation for popover appearance */
@keyframes popoverFadeIn {
	from {
		opacity: 0;
		transform: translateX(-10px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

.author-modal.show {
	animation: popoverFadeIn 0.2s ease-out;
}

/* Hover effects for interactive elements */
.author-modal-avatar img:hover {
	transform: scale(1.02);
	transition: transform 0.2s ease;
}

/* Co-Authors Feature Styles */

/* Author blocks container */
.space-page-content-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 5px;
}

/* Individual author block */
.space-page-content-meta-author-block {
    display: flex;
    align-items: flex-start;
    min-width: 150px;
    flex: 1;
    position: relative;
    padding: 0;
    gap: 0.5rem;
}

/* Ensure proper spacing when only main author exists */
.space-page-content-meta-author-block:only-child {
    flex: none;
    min-width: auto;
}

/* Alternative for browsers that don't support :only-child */
.space-page-content-meta:not(.has-co-authors) .space-page-content-meta-author-block {
    flex: none;
    min-width: auto;
}

/* Co-author specific styling */
.co-author-block {
    margin-left: 0;
}

/* Author role text styling */
.author-role {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
    margin-bottom: 2px;
    display: block;
    line-height: 1.1;
}

/* Author name styling */
.space-page-content-meta-author a {
    display: block;
    margin-top: 0;
    line-height: 1.2;
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

.space-page-content-meta-author a:hover {
    color: #007cba;
}

/* Role icons styling */
.author-role i {
    margin-right: 3px;
    font-size: 14px;
    color: #666;
    opacity: 0.8;
}

/* Hover effects for icons */
.author-role:hover i {
    opacity: 1;
    transform: scale(1.1);
    transition: all 0.2s ease;
}

/* Meta data positioning */
.space-page-content-meta-data {
    flex-basis: 100%;
    margin-top: 5px;
    clear: both;
}

/* Ensure avatar positioning is correct */
.space-page-content-meta-author-block .space-page-content-meta-avatar {
    position: relative;
    margin-right: 2px;
}

.space-page-content-meta-author-block .space-page-content-meta-ins {
    flex: 1;
}

/* Responsive design for co-authors */
@media (max-width: 768px) {
    .space-page-content-meta {
        flex-direction: column;
        gap: 12px;
    }
    
    .space-page-content-meta-author-block {
        min-width: auto;
        width: 100%;
    }
    
    .co-author-block {
        margin-left: 0;
    }
    
    .space-page-content-meta-data {
        margin-top: 8px;
    }
    
    .space-page-content-meta-author-block .space-page-content-meta-avatar {
        margin-right: 2px;
    }
}

@media (max-width: 480px) {
    .space-page-content-meta {
        gap: 8px;
    }
    
    .space-page-content-meta-author-block {
        padding: 8px 0;
    }
    
    .author-role {
        font-size: 11px;
        margin-bottom: 2px;
    }
    
    .space-page-content-meta-author-block .space-page-content-meta-avatar {
        margin-right: 2px;
    }
}

/* Responsive adjustments for small screens */
@media screen and (max-width: 768px) {
    .author-popover {
        max-width: calc(100vw - 20px) !important;
        width: calc(100vw - 20px) !important;
        left: 10px !important;
        right: 10px !important;
        position: fixed !important;
    }
    
    .author-modal-content {
        padding: 15px;
    }
    
    .author-modal-avatar {
        width: 80px;
        height: 80px;
        margin: 0 auto 15px;
    }
    
    .author-modal-name {
        font-size: 18px;
        margin-bottom: 10px;
        text-align: center;
    }
    
    .author-modal-bio {
        font-size: 14px;
        line-height: 1.4;
        margin-bottom: 15px;
    }
    
    .author-modal-social {
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
    }
    
    .social-media-link {
        min-width: 120px;
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .author-modal-posts-link {
        text-align: center;
        margin-top: 15px;
    }
}

@media screen and (max-width: 480px) {
    .author-popover {
        max-width: calc(100vw - 16px) !important;
        width: calc(100vw - 16px) !important;
        left: 8px !important;
        right: 8px !important;
    }
    
    .author-modal-content {
        padding: 12px;
    }
    
    .author-modal-avatar {
        width: 70px;
        height: 70px;
        margin-bottom: 12px;
    }
    
    .author-modal-name {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .author-modal-bio {
        font-size: 13px;
        margin-bottom: 12px;
    }
    
    .author-modal-social {
        gap: 8px;
    }
    
    .social-media-link {
        min-width: 100px;
        padding: 6px 10px;
        font-size: 12px;
    }
}
