:root {
	/* Light Theme Colors */
	--bg-primary: #ffffff;
	--bg-secondary: #f8f9fa;
	--bg-card: #ffffff;
	--text-primary: #1a1a1a;
	--text-secondary: #6c757d;
	--accent-primary: #2563eb;
	--accent-hover: #1d4ed8;
	--border-color: #e5e7eb;
	--shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
	--shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
	--shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
	--bg-tooltip: #1e293b;
	--text-tooltip: #ffffff;
}

[data-theme="dark"] {
	/* Dark Theme Colors */
	--bg-primary: #0f172a;
	--bg-secondary: #1e293b;
	--bg-card: #1e293b;
	--text-primary: #f1f5f9;
	--text-secondary: #94a3b8;
	--accent-primary: #06b6d4;
	--accent-hover: #0891b2;
	--border-color: #334155;
	--shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
	--shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
	--shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.3);
	--bg-tooltip: #f1f5f9;
	--text-tooltip: #0f172a;
}

/* Reset & Base Styles */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	background: var(--bg-primary);
	color: var(--text-primary);
	line-height: 1.6;
	transition: background-color 0.3s ease, color 0.3s ease;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

/* Header Controls */
.controls {
	position: fixed;
	top: 1.5rem;
	right: 1.5rem;
	display: flex;
	gap: 0.75rem;
	z-index: 1000;
}

.control-btn {
	background: var(--bg-card);
	border: 1px solid var(--border-color);
	color: var(--text-primary);
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1rem;
	transition: all 0.3s ease;
	box-shadow: var(--shadow-md);
}

.control-btn:hover {
	background: var(--accent-primary);
	color: white;
	transform: translateY(-2px);
	box-shadow: var(--shadow-lg);
}

.control-btn:active {
	transform: translateY(0);
}

.lang-text {
	font-weight: 600;
	font-size: 0.875rem;
}

/* Main Container */
.container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 2rem 1.5rem;
	flex: 1;
}

/* Profile Section */
.profile-section {
	text-align: center;
	padding: 2.5rem 0 1.5rem;
	margin-bottom: 2rem;
}

.profile-photo {
	width: 180px;
	height: 180px;
	margin: 0 auto 1.25rem;
	border-radius: 50%;
	overflow: hidden;
	border: 4px solid var(--accent-primary);
	box-shadow: var(--shadow-lg);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-photo:hover {
	transform: scale(1.05);
	box-shadow: 0 15px 30px rgba(37, 99, 235, 0.3);
}

.profile-photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.profile-name {
	font-size: clamp(2rem, 5vw, 2.75rem);
	font-weight: 700;
	margin-bottom: 0.5rem;
	color: var(--text-primary);
}

.profile-title {
	font-size: clamp(1rem, 2.5vw, 1.2rem);
	color: var(--text-secondary);
	margin-bottom: 0.5rem;
	font-weight: 400;
}

.profile-affiliation {
	font-size: clamp(0.9rem, 2vw, 1.05rem);
	color: var(--accent-primary);
	font-weight: 500;
}

/* Inline Links in Profile */
.inline-link {
	color: inherit;
	text-decoration: none;
	border-bottom: 1px solid transparent;
	transition: all 0.3s ease;
}

.inline-link:hover {
	border-bottom-color: currentColor;
	opacity: 0.8;
}

.profile-title .inline-link {
	color: var(--accent-primary);
	font-weight: 500;
}

.profile-affiliation .inline-link {
	color: var(--accent-primary);
}

/* Links Section */
.links-section {
	margin-bottom: 2rem;
}

.section-title {
	font-size: clamp(1.35rem, 3vw, 1.75rem);
	font-weight: 600;
	margin-bottom: 1.25rem;
	color: var(--text-primary);
	padding-bottom: 0.625rem;
	border-bottom: 2px solid var(--border-color);
}

.links-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 0.75rem;
}

/* Force multi-column on larger screens */
@media (min-width: 768px) {
	.links-grid {
		grid-template-columns: repeat(4, 1fr);
	}
}

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

.link-card {
	background: var(--bg-card);
	border: 1px solid var(--border-color);
	border-radius: 8px;
	padding: 0.75rem 1rem;
	text-decoration: none;
	color: var(--text-primary);
	display: flex;
	align-items: center;
	gap: 0.625rem;
	transition: all 0.3s ease;
	box-shadow: var(--shadow-sm);
	position: relative;
}

.link-card::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 4px;
	height: 100%;
	background: var(--accent-primary);
	transform: scaleY(0);
	transition: transform 0.3s ease;
	border-radius: 8px 0 0 8px;
	z-index: 1;
}

.link-card:hover::before {
	transform: scaleY(1);
}

.link-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--shadow-lg);
	border-color: var(--accent-primary);
}

.link-card:active {
	transform: translateY(-2px);
}

.link-card i {
	font-size: 1.25rem;
	color: var(--accent-primary);
	min-width: 1.25rem;
	transition: transform 0.3s ease;
}

.link-card:hover i {
	transform: scale(1.1);
}

.link-card span {
	font-size: 0.875rem;
	font-weight: 500;
	overflow-wrap: break-word;
	line-height: 1.3;
}

/* Footer */
.footer {
	background: var(--bg-secondary);
	border-top: 1px solid var(--border-color);
	padding: 2rem 1.5rem;
	text-align: center;
	color: var(--text-secondary);
	margin-top: auto;
}

.footer p {
	font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
	.controls {
		top: 1rem;
		right: 1rem;
		gap: 0.5rem;
	}

	.control-btn {
		width: 2.5rem;
		height: 2.5rem;
		font-size: 0.9rem;
	}

	.container {
		padding: 1.5rem 1rem;
	}

	.profile-section {
		padding: 2rem 0 1.5rem;
		margin-bottom: 2rem;
	}

	.profile-photo {
		width: 150px;
		height: 150px;
		border-width: 3px;
	}

	.links-grid {
		grid-template-columns: 1fr;
		gap: 0.875rem;
	}

	.link-card {
		padding: 1rem 1.25rem;
	}

	.links-section {
		margin-bottom: 2rem;
	}
}

@media (max-width: 480px) {
	.profile-photo {
		width: 120px;
		height: 120px;
	}

	.link-card {
		padding: 0.875rem 1rem;
		gap: 0.75rem;
	}

	.link-card i {
		font-size: 1.25rem;
	}

	.link-card span {
		font-size: 0.9rem;
	}
}

/* Tooltip Styling */
[data-tooltip-en],
[data-tooltip-id] {
	position: relative;
}

.control-btn::after {
	content: '';
	position: absolute;
	bottom: -40px;
	left: 50%;
	transform: translateX(-50%) translateY(10px);
	background: var(--bg-tooltip);
	color: var(--text-tooltip);
	padding: 0.5rem 0.75rem;
	border-radius: 6px;
	font-size: 0.75rem;
	font-weight: 500;
	white-space: nowrap;
	opacity: 0;
	visibility: hidden;
	transition: all 0.2s ease;
	box-shadow: var(--shadow-md);
	border: 1px solid var(--border-color);
	z-index: 1001;
	pointer-events: none;
}

[lang="en"] .control-btn#langToggle::after {
	content: attr(data-tooltip-en);
}

[lang="id"] .control-btn#langToggle::after {
	content: attr(data-tooltip-id);
}

[lang="en"] .control-btn#themeToggle::after {
	content: attr(data-tooltip-en);
}

[lang="id"] .control-btn#themeToggle::after {
	content: attr(data-tooltip-id);
}

.control-btn:hover::after {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
}

/* Link Card Tooltips */
.link-card::after {
	content: '';
	position: absolute;
	top: -35px;
	left: 50%;
	transform: translateX(-50%) translateY(5px);
	background: var(--bg-tooltip);
	color: var(--text-tooltip);
	padding: 0.4rem 0.6rem;
	border-radius: 4px;
	font-size: 0.7rem;
	font-weight: 500;
	opacity: 0;
	visibility: hidden;
	transition: all 0.2s ease;
	box-shadow: var(--shadow-sm);
	border: 1px solid var(--border-color);
	white-space: nowrap;
	z-index: 10;
	pointer-events: none;
}

[lang="en"] .link-card::after {
	content: attr(data-tooltip-en);
}

[lang="id"] .link-card::after {
	content: attr(data-tooltip-id);
}

/* Only show link-card tooltips if they have content */
.link-card:hover::after {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
}

/* Smooth Transitions for Theme Toggle */
* {
	transition-property: background-color, border-color, color;
	transition-duration: 0.3s;
	transition-timing-function: ease;
}

/* Prevent transition on page load */
.preload * {
	transition: none !important;
}

/* Print Styles */
@media print {
	.controls {
		display: none;
	}

	.link-card {
		break-inside: avoid;
	}

	body {
		background: white;
		color: black;
	}
}