* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
	line-height: 1.6;
	color: #1a1a1a;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	min-height: 100vh;
	overflow-x: hidden;
}

/* Animated Background */
.bg-animation {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
	z-index: -1;
}

.bg-animation::before {
	content: '';
	position: absolute;
	top: -50%;
	left: -50%;
	width: 200%;
	height: 200%;
	background: linear-gradient(45deg, 
		rgba(255,255,255,0.1) 0%, 
		transparent 25%, 
		transparent 75%, 
		rgba(255,255,255,0.1) 100%);
	animation: shimmer 8s ease-in-out infinite;
}

@keyframes shimmer {
	0%, 100% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
	50% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* Loading Screen */
.loading-screen {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 9999;
	flex-direction: column;
}

.loading-content {
	text-align: center;
	color: white;
}

.loading-spinner {
	width: 80px;
	height: 80px;
	border: 4px solid rgba(255,255,255,0.3);
	border-left: 4px solid white;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	margin-bottom: 30px;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

.loading-text {
	font-size: 1.5em;
	margin-bottom: 10px;
	font-weight: 300;
}

.loading-subtext {
	font-size: 1em;
	opacity: 0.8;
	animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
	0%, 100% { opacity: 0.8; }
	50% { opacity: 0.4; }
}

.loading-steps {
	margin-top: 30px;
	text-align: left;
}

.loading-step {
	display: flex;
	align-items: center;
	margin: 10px 0;
	opacity: 0.3;
	transition: opacity 0.5s ease;
}

.loading-step.active {
	opacity: 1;
}

.loading-step.completed {
	opacity: 0.7;
}

.step-icon {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	border: 2px solid white;
	margin-right: 15px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
}

.step-icon.completed {
	background: white;
	color: #667eea;
}

/* Main Container */
.container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px;
	position: relative;
	z-index: 1;
}

/* Glassmorphism Card */
.glass-card {
	background: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(20px);
	border-radius: 24px;
	border: 1px solid rgba(255, 255, 255, 0.2);
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
	overflow: hidden;
	animation: slideUp 0.8s ease-out;
}

@keyframes slideUp {
	from {
		opacity: 0;
		transform: translateY(30px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Header */
.header {
	background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
	color: white;
	padding: 40px;
	text-align: center;
	position: relative;
	overflow: hidden;
}

.header::before {
	content: '';
	position: absolute;
	top: -50%;
	right: -50%;
	width: 200%;
	height: 200%;
	background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
	animation: rotate 20s linear infinite;
}

@keyframes rotate {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}

.header-content {
	position: relative;
	z-index: 2;
}

.header h1 {
    font-size: 3em;
    margin-bottom: 15px;
    font-weight: 700;
}

.header h1 .emoji {
    /* Keep emoji with normal color */
}

.header h1 .gradient-text {
    background: linear-gradient(45deg, #fff, #e3f2fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header p {
	font-size: 1.2em;
	opacity: 0.9;
	font-weight: 300;
}

/* Content Area */
.content {
	padding: 40px;
}

/* Form Sections */
.form-section {
	background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
	padding: 35px;
	border-radius: 20px;
	margin-bottom: 30px;
	border: 1px solid rgba(0,0,0,0.05);
	transition: all 0.3s ease;
	position: relative;
	overflow: hidden;
}

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

.form-section:hover::before {
	left: 100%;
}

.form-section:hover {
	transform: translateY(-2px);
	box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.form-section h2 {
	color: #2c3e50;
	margin-bottom: 20px;
	font-size: 1.8em;
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 10px;
}

.form-group {
	margin-bottom: 25px;
	position: relative;
}

label {
	display: block;
	margin-bottom: 10px;
	color: #555;
	font-weight: 500;
	font-size: 1.1em;
}

input[type="text"] {
	width: 100%;
	padding: 18px 24px;
	border: 2px solid #e0e0e0;
	border-radius: 12px;
	font-size: 16px;
	transition: all 0.3s ease;
	background: rgba(255,255,255,0.9);
	position: relative;
}

input[type="text"]:focus {
	outline: none;
	border-color: #667eea;
	box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
	transform: translateY(-2px);
}

/* Modern Button */
.btn {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
	padding: 16px 32px;
	border: none;
	border-radius: 12px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	position: relative;
	overflow: hidden;
	text-transform: uppercase;
	letter-spacing: 1px;
}

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

.btn:hover::before {
	left: 100%;
}

.btn:hover {
	transform: translateY(-3px);
	box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

.btn:active {
	transform: translateY(-1px);
}

/* Error Styling */
.error {
	background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
	color: white;
	padding: 20px;
	border-radius: 12px;
	margin-bottom: 20px;
	border-left: 5px solid #e74c3c;
	animation: shake 0.5s ease-in-out;
}

@keyframes shake {
	0%, 100% { transform: translateX(0); }
	25% { transform: translateX(-5px); }
	75% { transform: translateX(5px); }
}

/* Search Results */
.search-results {
	background: rgba(255,255,255,0.95);
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 10px 30px rgba(0,0,0,0.1);
	margin-top: 20px;
	backdrop-filter: blur(10px);
}

.search-item {
	padding: 20px 25px;
	border-bottom: 1px solid rgba(0,0,0,0.05);
	cursor: pointer;
	transition: all 0.3s ease;
	position: relative;
}

.search-item::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	width: 0;
	height: 100%;
	background: linear-gradient(135deg, #667eea, #764ba2);
	transition: width 0.3s ease;
	opacity: 0.1;
}

.search-item:hover::before {
	width: 100%;
}

.search-item:hover {
	transform: translateX(5px);
	color: #2c3e50;
}

/* Results Page */
.results-container {
	animation: fadeIn 1s ease-out;
}

@keyframes fadeIn {
	from { opacity: 0; transform: translateY(20px); }
	to { opacity: 1; transform: translateY(0); }
}

.results-header {
	background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
	color: white;
	padding: 40px;
	text-align: center;
	position: relative;
	overflow: hidden;
}

.results-header::before {
	content: '';
	position: absolute;
	top: -50%;
	left: -50%;
	width: 200%;
	height: 200%;
	background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
	animation: rotate 15s linear infinite reverse;
}

.results-header h2 {
	font-size: 2.5em;
	margin-bottom: 15px;
	font-weight: 300;
	position: relative;
	z-index: 2;
}

.results-content {
	padding: 10px;
}

/* Tablet and desktop padding for results content */
@media (min-width: 768px) {
	.results-content {
		padding: 40px;
	}
}

/* Metrics Grid */
.metrics-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 25px;
	margin-bottom: 40px;
}

.metric-card {
	background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
	padding: 30px;
	border-radius: 20px;
	text-align: center;
	border: 1px solid rgba(0,0,0,0.05);
	transition: all 0.4s ease;
	position: relative;
	overflow: hidden;
}

.metric-card::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #667eea, #764ba2);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.metric-card:hover::before {
	opacity: 0.1;
}

.metric-card:hover {
	transform: translateY(-10px) scale(1.02);
	box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.metric-value {
	font-size: 3em;
	font-weight: 700;
	color: #2c3e50;
	margin-bottom: 10px;
	position: relative;
	z-index: 2;
	background: linear-gradient(135deg, #2c3e50, #667eea);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

.metric-label {
	color: #7f8c8d;
	font-size: 0.9em;
	text-transform: uppercase;
	letter-spacing: 2px;
	font-weight: 600;
	position: relative;
	z-index: 2;
}

/* Section Styling */
.section {
	position: relative;
}

.section::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 4px;
	height: 100%;
}

.section h3 {
	color: #2c3e50;
	margin-bottom: 25px;
	font-size: 1.5em;
	font-weight: 600;
	padding-left: 20px;
}


/* Back Button */
.back-btn {
	position: fixed;
	top: 30px;
	left: 30px;
	background: rgba(255,255,255,0.9);
	color: #2c3e50;
	padding: 12px 20px;
	border: none;
	border-radius: 50px;
	cursor: pointer;
	transition: all 0.3s ease;
	font-weight: 600;
	backdrop-filter: blur(10px);
	box-shadow: 0 5px 15px rgba(0,0,0,0.1);
	z-index: 1000;
}

.back-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 25px rgba(0,0,0,0.15);
	background: white;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
	.header h1 { font-size: 2em; }
	.content { padding: 20px; }
	.form-section { padding: 25px; }
	.metrics-grid { grid-template-columns: 1fr; }
	.back-btn { 
		position: relative; 
		top: auto; 
		left: auto; 
		margin-bottom: 20px; 
		display: block;
		width: fit-content;
	}
}

/* Work Items */
.work-item {
	background: rgba(255,255,255,0.9);
	padding: 20px;
	margin-bottom: 15px;
	border-radius: 16px;
	border-left: 4px solid #667eea;
	transition: all 0.3s ease;
	backdrop-filter: blur(10px);
}

.work-item:hover {
	transform: translateX(10px);
	box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.work-citations {
	background: linear-gradient(135deg, #667eea, #764ba2);
	color: white;
	padding: 8px 16px;
	border-radius: 50px;
	font-size: 0.9em;
	display: inline-block;
	margin-bottom: 10px;
	font-weight: 600;
}

.work-title {
	color: #2c3e50;
	line-height: 1.5;
	font-weight: 500;
}

/* Distribution Items */
.distribution-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 15px 0;
	border-bottom: 1px solid rgba(0,0,0,0.1);
	transition: all 0.2s ease;
}

.distribution-item:hover {
	background: rgba(102, 126, 234, 0.05);
	transform: translateX(5px);
}

.distribution-item:last-child {
	border-bottom: none;
}

.distribution-label {
	font-weight: 500;
	color: #2c3e50;
}

.distribution-value {
	font-weight: 700;
	color: #667eea;
	background: rgba(102, 126, 234, 0.1);
	padding: 5px 12px;
	border-radius: 20px;
}

/* Year Items */
.year-item {
	display: inline-block;
	margin: 8px;
	padding: 10px 16px;
	background: linear-gradient(135deg, #ecf0f1, #bdc3c7);
	border-radius: 25px;
	font-size: 0.9em;
	font-weight: 500;
	color: #2c3e50;
	transition: all 0.3s ease;
	border: 1px solid rgba(0,0,0,0.05);
}

.year-item:hover {
	background: linear-gradient(135deg, #667eea, #764ba2);
	color: white;
	transform: translateY(-2px);
	box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* Animation for cards appearing */
.animate-in {
	animation: slideInUp 0.6s ease-out forwards;
	opacity: 0;
	transform: translateY(30px);
}

.animate-in:nth-child(1) { animation-delay: 0.1s; }
.animate-in:nth-child(2) { animation-delay: 0.2s; }
.animate-in:nth-child(3) { animation-delay: 0.3s; }
.animate-in:nth-child(4) { animation-delay: 0.4s; }
.animate-in:nth-child(5) { animation-delay: 0.5s; }
.animate-in:nth-child(6) { animation-delay: 0.6s; }

@keyframes slideInUp {
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.loading-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 10000;
	align-items: center;
	justify-content: center;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.loading-modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.8);
	backdrop-filter: blur(5px);
}

.loading-modal-content {
	position: relative;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	border-radius: 20px;
	width: 90%;
	max-width: 500px;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
	color: white;
	animation: modalSlideIn 0.5s ease-out;
}

@keyframes modalSlideIn {
	from {
		transform: translateY(-50px) scale(0.9);
		opacity: 0;
	}
	to {
		transform: translateY(0) scale(1);
		opacity: 1;
	}
}

.loading-header {
	text-align: center;
	padding: 30px 30px 20px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.loading-spinner-large {
	width: 60px;
	height: 60px;
	border: 4px solid rgba(255, 255, 255, 0.3);
	border-top: 4px solid white;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	margin: 0 auto 20px;
}

.loading-header h2 {
	margin: 0 0 10px;
	font-size: 1.8em;
	font-weight: 700;
}

.loading-subtitle {
	margin: 0;
	opacity: 0.9;
	font-size: 1.1em;
}

.loading-body {
	padding: 25px 30px;
}

.loading-status {
	font-size: 1.2em;
	font-weight: 600;
	margin-bottom: 15px;
	text-align: center;
	min-height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.loading-time-estimate {
	text-align: center;
	font-size: 1em;
	opacity: 0.8;
	margin-bottom: 25px;
	padding: 12px;
	background: rgba(255, 255, 255, 0.1);
	border-radius: 10px;
	border: 1px solid rgba(255, 255, 255, 0.2);
}

.loading-steps {
	margin: 25px 0;
}

.loading-step {
	display: flex;
	align-items: center;
	margin-bottom: 12px;
	padding: 8px 0;
	opacity: 0.5;
	transition: all 0.3s ease;
}

.loading-step.active {
	opacity: 1;
	transform: translateX(5px);
}

.loading-step.completed {
	opacity: 0.7;
	transform: translateX(0);
}

.step-icon {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.2);
	display: flex;
	align-items: center;
	justify-content: center;
	margin-right: 15px;
	font-weight: bold;
	font-size: 0.9em;
	transition: all 0.3s ease;
}

.loading-step.active .step-icon {
	background: white;
	color: #667eea;
	animation: pulse 2s infinite;
}

.loading-step.completed .step-icon {
	background: #4CAF50;
	color: white;
}

@keyframes pulse {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.1); }
}

.loading-footer {
	border-top: 1px solid rgba(255, 255, 255, 0.2);
	padding: 20px 30px;
	background: rgba(0, 0, 0, 0.1);
}

.powered-by {
	text-align: center;
	margin-bottom: 15px;
	font-size: 1.1em;
}

.crossref-logo {
	display: inline-block;
	background: white;
	color: #667eea;
	padding: 4px 8px;
	border-radius: 6px;
	font-weight: bold;
	margin-left: 8px;
	font-size: 0.9em;
}

.loading-note {
	font-size: 0.9em;
	opacity: 0.8;
	text-align: center;
	line-height: 1.4;
}

/* Enhanced form styling */
.btn-primary {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	border: none;
	color: white;
	padding: 15px 30px;
	font-size: 1.1em;
	font-weight: 600;
	border-radius: 12px;
	cursor: pointer;
	transition: all 0.3s ease;
	text-align: center;
	box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.analysis-info {
	display: flex;
	gap: 15px;
	margin-bottom: 20px;
	flex-wrap: wrap;
}

.info-item {
	background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
	color: white;
	padding: 8px 15px;
	border-radius: 20px;
	font-size: 0.9em;
	font-weight: 500;
	white-space: nowrap;
}

.analysis-features {
	margin-top: 25px;
	padding: 20px;
	background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
	border-radius: 12px;
	color: #2c3e50;
}

.analysis-features h4 {
	margin: 0 0 15px;
	font-size: 1.1em;
	font-weight: 600;
}

.features-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 12px;
}

.feature-item {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 500;
}

.feature-icon {
	font-size: 1.2em;
}

.footer-info {
	margin-top: 40px;
	padding-top: 30px;
	border-top: 2px solid #e0e0e0;
}

.crossref-attribution {
	background: #f8f9fa;
	padding: 20px;
	border-radius: 12px;
	color: #495057;
}

.crossref-attribution p {
	margin: 0 0 15px;
	line-height: 1.6;
}

.crossref-links {
	text-align: center;
}

.crossref-links a {
	color: #667eea;
	text-decoration: none;
	font-weight: 500;
	margin: 0 10px;
}

.crossref-links a:hover {
	text-decoration: underline;
}

.powered-by-header {
	margin-top: 15px;
	text-align: center;
	font-size: 0.9em;
	opacity: 0.8;
}

.analysis-badge {
	display: inline-block;
	background: linear-gradient(135deg, #4CAF50, #45a049);
	color: white;
	padding: 8px 16px;
	border-radius: 20px;
	font-size: 0.9em;
	font-weight: 500;
	margin-top: 10px;
}

@media (max-width: 768px) {
	.loading-modal-content {
		width: 95%;
		margin: 20px;
	}
	
	.loading-header, .loading-body, .loading-footer {
		padding-left: 20px;
		padding-right: 20px;
	}
	
	.analysis-info {
		flex-direction: column;
		align-items: center;
	}
	
	.features-grid {
		grid-template-columns: 1fr;
	}
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}