:root {
	--primary: #4f46e5;
	/* Indigo */
	--primary-hover: #4338ca;
	--bg-gradient: linear-gradient(135deg, #1e3a8a 0%, #6366f1 100%);
	--glass-bg: rgba(255, 255, 255, 0.1);
	--glass-border: rgba(255, 255, 255, 0.2);
	--text-main: #f3f4f6;
	/* light gray */
	--text-muted: rgba(255, 255, 255, 0.7);
	--card-bg: rgba(255, 255, 255, 0.15);
	--success: #10b981;
	--danger: #ef4444;
	--font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
	font-family: var(--font-family);
	background: var(--bg-gradient);
	color: var(--text-main);
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	overflow-x: hidden;
	transition: background 0.3s ease, color 0.3s ease;
}

/* Glassmorphism */
.glass {
	background: var(--glass-bg);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border: 1px solid var(--glass-border);
	border-radius: 16px;
	box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

.container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px;
	width: 100%;
}

button {
	width: 100%;
	padding: 12px;
	background: var(--primary);
	border: none;
	border-radius: 8px;
	color: white;
	font-size: 16px;
	cursor: pointer;
	transition: background 0.3s, transform 0.2s ease-in-out;
	font-weight: 600;
}

button:hover {
	background: var(--primary-hover);
	transform: scale(1.02);
}

button:focus {
	outline: 2px solid var(--primary);
	outline-offset: 2px;
}

header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20px;
	margin-bottom: 30px;
}

.nav-links button {
	width: auto;
	margin-left: 10px;
	background: rgba(255, 255, 255, 0.2);
}

.dashboard-grid {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.top-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
}

@media (max-width: 768px) {
	.top-row {
		grid-template-columns: 1fr;
	}
}

.card-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 15px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	padding-bottom: 10px;
}

.task-list-scroll {
	max-height: 300px;
	overflow-y: auto;
	padding-right: 5px;
}

/* Calendar */
.calendar-container {
	padding: 0 !important;
	overflow: hidden;
	min-height: 500px;
}

.calendar-wrapper {
	display: flex;
	height: 100%;
	min-height: 500px;
}

.calendar-sidebar {
	width: 80px;
	background: #1e293b;
	color: white;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	font-weight: bold;
}

.calendar-content {
	flex: 1;
	padding: 5px;
}

#calendarGrid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 1px;
}

.calendar-day {
	min-height: 100px;
	background: #ffffff;
	padding: 5px;
	position: relative;
	transition: background 0.2s, transform 0.2s ease-in-out;
	color: #1e293b;
	border-right: 1px solid #e2e8f0;
	border-bottom: 1px solid #e2e8f0;
}

.calendar-day:hover {
	background: #f1f5f9;
	transform: scale(1.02);
}

.calendar-day:focus {
	outline: 2px solid var(--primary);
	outline-offset: 2px;
}

.calendar-day.weekend {
	background: #f8fafc;
}

.calendar-day.empty {
	background: #f1f5f9;
}

.calendar-day.today {
	background: #e0e7ff;
	box-shadow: inset 0 0 0 2px var(--primary);
}

.day-number {
	font-size: 14px;
	font-weight: bold;
	margin-bottom: 5px;
	display: block;
	color: #64748b;
}

.holiday-name {
	font-size: 10px;
	color: #d97706;
	margin-bottom: 5px;
	font-weight: bold;
}

/* Task Pills */
.task-pill {
	font-size: 10px;
	background: var(--primary);
	padding: 2px 4px;
	border-radius: 3px;
	margin-bottom: 2px;
	cursor: pointer;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: white;
}

.task-pill.done {
	background: var(--success);
	opacity: 0.7;
}

/* Task List */
.task-item {
	background: rgba(0, 0, 0, 0.2);
	padding: 15px;
	border-radius: 8px;
	margin-bottom: 10px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	transition: transform 0.2s;
}

.task-item:hover {
	transform: translateY(-2px);
}

.task-item.done {
	opacity: 0.6;
	text-decoration: line-through;
}

.task-actions button {
	width: auto;
	padding: 5px 10px;
	font-size: 12px;
	margin-left: 5px;
}

.btn-done {
	background: var(--success);
}

.btn-delete {
	background: var(--danger);
}

/* Modal */
.modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	justify-content: center;
	align-items: center;
	z-index: 1000;
}

.modal.active {
	display: flex;
}

.modal-content {
	width: 400px;
	padding: 30px;
	position: relative;
}

.close-btn {
	position: absolute;
	top: 10px;
	right: 15px;
	cursor: pointer;
	font-size: 20px;
	color: white;
}

/* Recurrence UI */
.week-days-selector {
	display: flex !important;
	flex-direction: row !important;
	justify-content: space-between;
	margin-top: 10px;
	width: 100%;
}

.day-circle {
	width: 35px;
	height: 35px;
	border-radius: 50%;
	border: 1px solid #555;
	display: flex;
	justify-content: center;
	align-items: center;
	cursor: pointer;
	font-size: 12px;
	color: #aaa;
	transition: 0.2s;
	background: transparent;
}

.day-circle.selected {
	background: white;
	color: black;
	border-color: white;
	font-weight: bold;
}

.radio-group {
	display: flex;
	flex-direction: column;
	gap: 15px;
	margin-top: 10px;
}

.radio-item {
	display: flex;
	align-items: center;
	cursor: pointer;
}

.radio-circle {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	border: 2px solid #555;
	margin-right: 10px;
	position: relative;
}

.radio-circle.selected {
	border-color: var(--primary);
}

.radio-circle.selected::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 10px;
	height: 10px;
	background: var(--primary);
	border-radius: 50%;
}

/* Tooltip */
#globalTooltip {
	position: absolute;
	background: rgba(0, 0, 0, 0.9);
	color: white;
	padding: 10px;
	border-radius: 5px;
	gap: 15px;
	text-align: center;
	z-index: 2000;
}

/* Mobile Overrides */
@media (max-width: 768px) {
	.dashboard-grid {
		gap: 12px;
	}

	.calendar-wrapper {
		flex-direction: column;
	}

	.calendar-sidebar {
		width: 100%;
		height: 60px;
		flex-direction: row;
		justify-content: space-around;
		align-items: center;
		border-right: none;
		border-bottom: 1px solid rgba(255, 255, 255, 0.1);
		padding: 4px 0;
	}

	.calendar-sidebar .nav-btn {
		font-size: 14px;
		padding: 6px 8px;
		margin: 0 4px;
	}

	.calendar-day {
		min-height: 80px;
		font-size: 13px;
		padding: 8px;
	}

	.day-number {
		font-size: 13px;
	}

	.holiday-name {
		font-size: 9px;
	}

	.task-pill {
		font-size: 8px;
		padding: 1px 2px;
	}

	.modal-content {
		width: 95%;
		padding: 20px;
	}

	.week-days-selector {
		gap: 5px;
	}

	.day-circle {
		width: 30px;
		height: 30px;
		font-size: 10px;
	}
}

/* ---------- Enhancements ---------- */

/* Focus outlines for accessibility */
button:focus,
.nav-btn:focus,
.calendar-day:focus {
	outline: 2px solid var(--primary);
	outline-offset: 2px;
}

/* Dark‑mode toggle support */
.light-mode {
	--primary: #4f46e5;
	--primary-hover: #4338ca;
	--bg-gradient: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
	--text-main: #1f2937;
	--glass-bg: rgba(0, 0, 0, 0.1);
	--glass-border: rgba(0, 0, 0, 0.2);
}

/* Transition for theme change (already on body) */