:root {
	--ink-900: #102417;
	--ink-700: #2f4b3a;
	--ink-500: #54715f;
	--paper: #f8fbf6;
	--card: #ffffff;
	--line: #d7e5d5;
	--mint-100: #e8f8e8;
	--mint-300: #c2eec2;
	--mint-500: #4fa86e;
	--mint-700: #247044;
	--gold-500: #d39b34;
	--berry-500: #b34b5e;
	--sky-500: #3f8bbd;
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

body {
	background: var(--paper);
	color: var(--ink-900);
	font-family: "Outfit", "Segoe UI", sans-serif;
	position: relative;
}

.notes-wrapper {
	padding: 18px 14px 28px;
}

.notes-container {
	max-width: 1180px;
	margin: 0 auto;
	animation: fadeIn 560ms ease both;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.page-hero {
	border: 1px solid #cae4cf;
	border-radius: 22px;
	padding: 28px;
	background: linear-gradient(120deg, #f2fbef 0%, #e4f4f7 52%, #f9fff6 100%);
	box-shadow: 0 14px 34px rgba(37, 87, 56, 0.12);
	margin-bottom: 24px;
}

.page-hero h1 {
	font-family: "Sora", "Segoe UI", sans-serif;
	font-size: clamp(1.6rem, 5vw, 2.2rem);
	line-height: 1.1;
	margin-bottom: 8px;
	color: var(--ink-900);
}

.page-hero p {
	color: var(--ink-700);
	font-size: 1.01rem;
	line-height: 1.5;
}

.notes-filters {
	margin-bottom: 24px;
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

#noteSearch {
	flex: 1;
	min-width: 250px;
	padding: 12px 16px;
	border: 2px solid var(--line);
	border-radius: 12px;
	font-family: inherit;
	font-size: 0.98rem;
	color: var(--ink-900);
	background: var(--card);
	transition: border-color 200ms ease;
}

#noteSearch:focus {
	outline: none;
	border-color: var(--mint-500);
	box-shadow: 0 0 0 3px rgba(79, 168, 110, 0.1);
}

#noteSearch::placeholder {
	color: var(--ink-500);
}

.notes-section {
	margin-bottom: 32px;
}

.notes-section h2 {
	font-family: "Sora", "Segoe UI", sans-serif;
	font-size: 1.4rem;
	margin-bottom: 18px;
	color: var(--ink-900);
}

.notes-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 16px;
	animation: gridReveal 600ms ease both;
}

@keyframes gridReveal {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

.note-card {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 16px;
	padding: 20px;
	box-shadow: 0 8px 20px rgba(24, 55, 36, 0.08);
	transition: all 200ms ease;
	display: flex;
	flex-direction: column;
	gap: 12px;
	height: 100%;
}

.note-card:hover {
	transform: translateY(-4px);
	border-color: var(--mint-500);
	box-shadow: 0 12px 32px rgba(79, 168, 110, 0.15);
}

.note-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 10px;
	margin-bottom: 4px;
}

.note-title {
	font-family: "Sora", "Segoe UI", sans-serif;
	font-size: 1.1rem;
	line-height: 1.3;
	color: var(--ink-900);
	word-break: break-word;
	flex: 1;
	margin: 0;
}

.note-date {
	display: inline-block;
	padding: 4px 8px;
	background: var(--mint-100);
	color: var(--mint-700);
	border-radius: 6px;
	font-size: 0.8rem;
	font-weight: 600;
	white-space: nowrap;
	flex-shrink: 0;
}

.note-description {
	color: var(--ink-700);
	font-size: 0.92rem;
	line-height: 1.5;
	margin: 4px 0;
	word-break: break-word;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.note-actions {
	display: flex;
	gap: 10px;
	margin-top: auto;
	padding-top: 12px;
	border-top: 1px solid var(--line);
}

.note-download-btn,
.note-view-btn {
	flex: 1;
	padding: 10px 12px;
	text-align: center;
	text-decoration: none;
	border-radius: 10px;
	font-size: 0.9rem;
	font-weight: 600;
	transition: all 200ms ease;
	border: 1px solid transparent;
}

.note-download-btn {
	background: var(--mint-100);
	color: var(--mint-700);
	border-color: var(--mint-300);
}

.note-download-btn:hover {
	background: var(--mint-500);
	color: white;
	transform: translateY(-2px);
}

.note-view-btn {
	background: var(--sky-500);
	color: white;
}

.note-view-btn:hover {
	background: #2f6fa0;
	transform: translateY(-2px);
}

.loading-message,
.error-message,
.empty-message {
	grid-column: 1 / -1;
	padding: 40px;
	text-align: center;
	border-radius: 16px;
	background: var(--card);
	border: 1px solid var(--line);
}

.loading-message {
	color: var(--ink-700);
	font-size: 1.05rem;
	min-height: 200px;
	display: flex;
	align-items: center;
	justify-content: center;
	animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.6; }
}

.error-message {
	color: var(--berry-500);
	background: rgba(179, 75, 94, 0.05);
	border-color: rgba(179, 75, 94, 0.2);
	min-height: 150px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.05rem;
}

.empty-message {
	color: var(--ink-700);
	background: var(--mint-100);
	border-color: var(--mint-300);
	min-height: 200px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.05rem;
}

/* Responsive Design */
@media (max-width: 768px) {
	.notes-wrapper {
		padding: 12px 10px 20px;
	}

	.page-hero {
		padding: 18px;
		margin-bottom: 16px;
	}

	.page-hero h1 {
		font-size: 1.4rem;
	}

	.notes-filters {
		margin-bottom: 16px;
	}

	#noteSearch {
		min-width: 100%;
	}

	.notes-grid {
		grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
		gap: 12px;
	}

	.note-card {
		padding: 16px;
	}

	.note-actions {
		flex-direction: column;
	}

	.note-download-btn,
	.note-view-btn {
		width: 100%;
	}
}

@media (max-width: 480px) {
	.notes-grid {
		grid-template-columns: 1fr;
	}

	.page-hero {
		padding: 14px;
	}

	.page-hero h1 {
		font-size: 1.2rem;
	}

	.page-hero p {
		font-size: 0.95rem;
	}
}
