:root {
	--bg-color: #f7f9fc;
	--card-bg: #ffffff;
	--text-main: #1a1f36;
	--text-muted: #697386;
	--primary: #2563eb;
	--primary-hover: #1d4ed8;
	--danger: #ef4444;
	--danger-hover: #dc2626;
	--success: #10b981;
	--warning: #f59e0b;
	--warning-hover: #d97706;
	--border: #e5e7eb;
	--active-bg: #eff6ff;
	--radius: 8px;
}

[data-theme="dark"] {
	--bg-color: #111827;
	--card-bg: #1f2937;
	--text-main: #f9fafb;
	--text-muted: #9ca3af;
	--border: #374151;
	--active-bg: #374151;
	--primary: #3b82f6;
	--primary-hover: #60a5fa;
	--warning: #fbbf24;
}

* {
	box-sizing: border-box;
}

body {
	font-family:
		-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
		sans-serif;
	background-color: var(--bg-color);
	color: var(--text-main);
	margin: 0;
	padding: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	transition:
		background-color 0.3s,
		color 0.3s;
}

/* Top Navigation Bar */
.top-bar {
	background: var(--card-bg);
	border-bottom: 1px solid var(--border);
	padding: 20px 40px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.brand {
	display: flex;
	align-items: center;
	gap: 20px;
}
h1 {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--text-main);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

/* Project Selector */
.project-controls {
	display: flex;
	align-items: center;
	gap: 10px;
	border-left: 1px solid var(--border);
	padding-left: 20px;
}
select {
	padding: 10px 16px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	font-size: 1rem;
	font-weight: 500;
	background-color: var(--bg-color);
	color: var(--text-main);
	outline: none;
	cursor: pointer;
	min-width: 250px;
}
select:focus {
	border-color: var(--primary);
}

.controls {
	display: flex;
	gap: 12px;
}
.main-content {
	flex: 1;
	padding: 40px;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 1400px;
	margin: 0 auto;
}

/* Buttons */
.btn {
	padding: 10px 20px;
	border: 1px solid transparent;
	border-radius: var(--radius);
	cursor: pointer;
	font-size: 0.9rem;
	font-weight: 600;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	transition: all 0.15s;
}
.btn-primary {
	background-color: var(--primary);
	color: white;
}
.btn-primary:hover {
	background-color: var(--primary-hover);
}
.btn-outline {
	background-color: transparent;
	border-color: var(--border);
	color: var(--text-main);
}
.btn-outline:hover {
	border-color: var(--text-main);
}
.btn-text {
	background: transparent;
	color: var(--text-muted);
	padding: 6px;
}
.btn-text:hover {
	color: var(--danger);
	background: var(--bg-color);
}

/* FIXED: Replaced min-width with fixed width to stop layout shifts */
.btn-start {
	background-color: var(--text-main);
	color: var(--card-bg);
	width: 95px;
}
.btn-start:hover {
	opacity: 0.8;
}
.btn-warning {
	background-color: var(--warning);
	color: #fff;
	width: 95px;
}
.btn-warning:hover {
	background-color: var(--warning-hover);
}
.btn-stop {
	background-color: var(--danger);
	color: white;
	width: 95px;
}
.btn-stop:hover {
	background-color: var(--danger-hover);
}

/* FIXED: Added missing danger class for modals */
.btn-danger {
	background-color: var(--danger);
	color: white;
}
.btn-danger:hover {
	background-color: var(--danger-hover);
}

/* Inputs */
input[type="text"],
textarea {
	flex-grow: 1;
	padding: 14px 20px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	font-size: 1rem;
	outline: none;
	background: var(--card-bg);
	color: var(--text-main);
	font-family: inherit;
}
input[type="text"]:focus,
textarea:focus {
	border-color: var(--primary);
}
.input-row {
	display: flex;
	gap: 12px;
	width: 100%;
}

/* Active Project Workspace */
.workspace-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	margin-bottom: 30px;
	padding-bottom: 20px;
	border-bottom: 2px solid var(--border);
}
.workspace-title {
	font-size: 2rem;
	font-weight: 800;
	margin: 0;
}
.workspace-total {
	font-family: monospace;
	font-size: 1.25rem;
	font-weight: 600;
	color: var(--text-muted);
}

/* Task List */
.task-list {
	padding: 0;
	margin: 0 0 30px 0;
	list-style: none;
	background: var(--card-bg);
	border: 1px solid var(--border);
	border-radius: var(--radius);
}
.task-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20px 30px;
	border-bottom: 1px solid var(--border);
	border-left: 4px solid transparent;
}
.task-item:last-child {
	border-bottom: none;
}
.task-item.active {
	border-left-color: var(--primary);
	background-color: var(--active-bg);
}
.task-item.paused {
	border-left-color: var(--warning);
	background-color: var(--active-bg);
}

/* Task Name & Notes */
.task-name-container {
	display: flex;
	align-items: center;
	gap: 15px;
	flex-grow: 1;
}
.task-name {
	font-size: 1.1rem;
	font-weight: 500;
	color: var(--text-main);
}
.note-btn {
	opacity: 0.3;
	padding: 4px;
	transition:
		opacity 0.2s,
		color 0.2s;
}
.note-btn.has-notes {
	opacity: 1;
	color: var(--primary);
}
.note-btn:hover {
	opacity: 1;
	color: var(--primary);
	background: transparent;
}

.task-meta {
	display: flex;
	align-items: center;
	gap: 20px;
}
.time-block {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	min-width: 90px;
}
.time-label {
	font-size: 0.75rem;
	text-transform: uppercase;
	color: var(--text-muted);
	font-weight: 600;
	letter-spacing: 0.05em;
	margin-bottom: 4px;
}
.time-value {
	font-family: monospace;
	font-size: 1.2rem;
	font-weight: 600;
	color: var(--text-main);
}
.session-time {
	color: var(--primary);
}
.task-item.paused .session-time {
	color: var(--warning);
}

/* Empty State */
.empty-state {
	text-align: center;
	padding: 60px 20px;
	color: var(--text-muted);
}
.icon {
	width: 16px;
	height: 16px;
	fill: currentColor;
}

/* Modals */
.modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(2px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1000;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s;
}
.modal-overlay.active {
	opacity: 1;
	pointer-events: auto;
}
.modal-card {
	background: var(--card-bg);
	padding: 30px;
	border-radius: 12px;
	width: 90%;
	max-width: 420px;
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
	transform: translateY(20px);
	transition: transform 0.2s;
	border: 1px solid var(--border);
}
.modal-overlay.active .modal-card {
	transform: translateY(0);
}
.modal-card h3 {
	margin: 0 0 10px 0;
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--text-main);
}
.modal-card p {
	margin: 0 0 20px 0;
	font-size: 1rem;
	color: var(--text-muted);
	line-height: 1.5;
}
.modal-highlight {
	font-family: monospace;
	font-size: 2.5rem;
	font-weight: 800;
	color: var(--primary);
	text-align: center;
	margin: 20px 0;
	padding: 15px;
	background: var(--bg-color);
	border-radius: var(--radius);
	border: 1px dashed var(--border);
}
.modal-card input,
.modal-card textarea {
	width: 100%;
	margin-bottom: 20px;
	box-sizing: border-box;
} /* FIXED: added box-sizing */
.modal-card textarea {
	resize: vertical;
	max-height: 250px;
	min-height: 80px;
} /* FIXED: restricted resize to stay inside modal */
.modal-actions {
	display: flex;
	justify-content: flex-end;
	gap: 12px;
	margin-top: 10px;
}
.hidden {
	display: none !important;
}

/* Settings elements */
.settings-menu {
	display: flex;
	flex-direction: column;
	margin-bottom: 20px;
}
.settings-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 0;
	font-weight: 500;
}

/* Toggle Switch */
.switch {
	position: relative;
	display: inline-block;
	width: 46px;
	height: 24px;
}
.switch input {
	opacity: 0;
	width: 0;
	height: 0;
}
.slider {
	position: absolute;
	cursor: pointer;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: var(--border);
	transition: 0.2s;
	border-radius: 24px;
}
.slider:before {
	position: absolute;
	content: "";
	height: 18px;
	width: 18px;
	left: 3px;
	bottom: 3px;
	background-color: white;
	transition: 0.2s;
	border-radius: 50%;
}
input:checked + .slider {
	background-color: var(--primary);
}
input:checked + .slider:before {
	transform: translateX(22px);
}

@media (max-width: 900px) {
	.top-bar {
		flex-direction: column;
		gap: 15px;
		align-items: stretch;
	}
	.brand {
		flex-direction: column;
		align-items: stretch;
	}
	.project-controls {
		border-left: none;
		padding-left: 0;
	}
	.task-item {
		flex-direction: column;
		align-items: flex-start;
		gap: 20px;
	}
	.task-meta {
		width: 100%;
		justify-content: space-between;
		flex-wrap: wrap;
	}
	.task-name-container {
		width: 100%;
		justify-content: space-between;
	}
}
