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

/* Accessibility - Visually Hidden */
.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border-width: 0;
}

:root {
	/* Light Mode Colors */
	--primary-color: #6366f1;
	--primary-hover: #4f46e5;
	--secondary-color: #8b5cf6;
	--background: #ffffff;
	--surface: #ffffff;
	--surface-hover: #f8fafc;
	--bg-secondary: #f8fafc;
	--border: #e2e8f0;
	--text-primary: #0f172a;
	--text-secondary: #64748b;
	--success: #10b981;
	--error: #ef4444;
	--warning: #f59e0b;

	/* Shadows */
	--shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
	--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
	--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

	/* Spacing */
	--header-height: 60px;
	--sidebar-width: 280px;

	/* Transitions */
	--transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
	--primary-color: #6366f1;
	--primary-hover: #818cf8;
	--secondary-color: #8b5cf6;
	--background: #0f172a;
	--surface: #1e293b;
	--surface-hover: #334155;
	--bg-secondary: #334155;
	--border: #334155;
	--text-primary: #f1f5f9;
	--text-secondary: #94a3b8;
	--success: #10b981;
	--error: #ef4444;
	--warning: #f59e0b;

	--shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
	--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
	--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

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

/* Header */
.header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: var(--header-height);
	background-color: var(--surface);
	border-bottom: 1px solid var(--border);
	z-index: 100;
	box-shadow: var(--shadow-sm);
}

.header-content {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 100%;
	padding: 0 24px;
	max-width: 100%;
}

.logo {
	font-size: 24px;
	font-weight: 700;
	background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

.header-actions {
	display: flex;
	gap: 12px;
}

/* Page Navigation */
.page-nav {
	display: flex;
	gap: 1rem;
	margin-left: 2rem;
}

.page-nav-link {
	color: var(--text-primary);
	text-decoration: none;
	padding: 0.5rem 1rem;
	border-radius: 6px;
	transition: all 0.3s;
	white-space: nowrap;
}

.page-nav-link:hover {
	background: var(--surface-hover);
}

.page-nav-link.active {
	background: var(--primary-color);
	color: white;
}

/* Container */
.container {
	display: flex;
	min-height: calc(100vh - var(--header-height));
	flex: 1;
}

/* Sidebar */
.sidebar {
	position: fixed;
	width: var(--sidebar-width);
	height: calc(100vh - var(--header-height));
	background-color: var(--surface);
	border-right: 1px solid var(--border);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	overflow-y: auto;
	transition: var(--transition);
}

.sidebar-header {
	padding: 20px;
	border-bottom: 1px solid var(--border);
	flex-shrink: 0;
}

.tool-list {
	flex: 1;
	overflow-y: auto;
	overflow-x: hidden;
}

/* Main Content */
.main-content {
	flex: 1;
	overflow-y: auto;
	background-color: var(--background);
}

.tool-content {
	display: none;
	padding: 40px;
	max-width: 1200px;
	margin: 0 auto;
	animation: fadeIn 0.3s ease-in-out;
}

.tool-content.active {
	display: block;
}

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

.tool-header {
	margin-bottom: 32px;
}

.tool-header h2 {
	font-size: 32px;
	font-weight: 700;
	margin-bottom: 8px;
	color: var(--text-primary);
}

.tool-description {
	font-size: 16px;
	color: var(--text-secondary);
}

.tool-body {
	display: grid;
	gap: 24px;
}

/* Scrollbar */
::-webkit-scrollbar {
	width: 8px;
	height: 8px;
}

::-webkit-scrollbar-track {
	background: var(--surface);
}

::-webkit-scrollbar-thumb {
	background: var(--border);
	border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
	background: var(--text-secondary);
}

/* Selection */
::selection {
	background-color: var(--primary-color);
	color: white;
}

/* Responsive Design */
@media (max-width: 1024px) {
	.sidebar {
		width: 240px;
	}

	.tool-content {
		padding: 24px;
	}
}

@media (max-width: 768px) {
	.header-content {
		padding: 0 12px;
		gap: 8px;
	}

	.header-left {
		display: flex;
		align-items: center;
		gap: 8px;
		flex: 1;
		min-width: 0;
	}

	.logo {
		font-size: 18px;
		flex-shrink: 0;
	}

	/* 모바일에서 페이지 네비게이션 숨기기 - 모바일 메뉴에서 접근 */
	.page-nav {
		display: none;
	}

	.header-actions {
		gap: 6px;
		flex-shrink: 0;
	}

	/* 공유 버튼 텍스트 숨기기 (모바일에서) */
	.share-button span {
		display: none;
	}

	.language-select {
		height: 34px;
		padding: 0 6px;
		font-size: 1rem;
		margin-right: 0;
		min-width: auto;
		width: auto;
	}

	.theme-toggle {
		width: 34px;
		height: 34px;
	}

	.theme-toggle svg {
		width: 16px;
		height: 16px;
	}

	.sidebar {
		position: fixed;
		left: -280px;
		top: var(--header-height);
		height: calc(100vh - var(--header-height));
		z-index: 90;
		box-shadow: var(--shadow-lg);
		overflow-y: auto;
		overflow-x: hidden;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior: contain;
	}

	.sidebar.active {
		left: 0;
	}

	.main-content {
		width: 100%;
	}

	.tool-content {
		padding: 20px;
	}

	.tool-header h2 {
		font-size: 24px;
	}
}

@media (max-width: 480px) {
	.header-content {
		padding: 0 8px;
		gap: 6px;
	}

	.header-left {
		gap: 6px;
	}

	.logo {
		font-size: 15px;
	}

	.header-actions {
		gap: 4px;
	}

	.language-select {
		height: 32px;
		padding: 0 4px;
		font-size: 0.7rem;
		min-width: 60px;
	}

	.theme-toggle {
		width: 32px;
		height: 32px;
	}

	.theme-toggle svg {
		width: 14px;
		height: 14px;
	}

	.mobile-menu-toggle {
		width: 32px;
		height: 32px;
	}

	.tool-content {
		padding: 16px;
	}
}
