@import url('https://fonts.googleapis.com/css2?family=Inconsolata:wght@200..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Syne+Mono&display=swap');

:root {
	--background: #fffef3;
	--text: #2d2d2d;
	--text-light: #666;
	--accent: #8b5a83;
	--accent-light: #a67ca0;
	--accent-soft: #f0e6ed;
	--border: #e8e6e0;
	--card-bg: #ffffff;
	--success: #7c9885;
	--warning: #d4a574;
	--error: #c85a5a;
	--high-priority: #c85a5a;
	--medium-priority: #d4a574;
	--low-priority: #7c9885;
	--font-main: 'Syne Mono';
	--card-shadow: rgba(0, 0, 0, 0.08);
}

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

body {
	background-color: var(--background);
	font-family: var(--font-main), monospace;
	color: var(--text);
	line-height: 1.5;
	padding: 20px;
}

#main-content {
	width: 100%;
	max-width: 800px; /* Reduced width for compactness */
	margin: 0 auto;
}

.header-container { text-align: center; margin-bottom: 20px; }
.app-title { font-size: 32px; font-weight: 700; color: var(--text); }

/* Compact Settings Bar */
.settings-bar {
	display: flex;
	justify-content: center;
	gap: 20px;
	margin-bottom: 15px;
	padding: 10px;
	background: var(--card-bg);
	border: 2px solid var(--border);
	border-radius: 8px;
}

.setting-group { display: flex; align-items: center; gap: 8px; }
.setting-group label { font-weight: 600; font-size: 14px; }
.input-compact {
	width: 90px;
	padding: 4px 8px;
	border: 1px solid var(--border);
	border-radius: 4px;
	font-family: inherit;
	font-size: 14px;
}

/* Collapsible Panel */
.task-input-section {
	background-color: var(--card-bg);
	border: 2px solid var(--border);
	border-radius: 12px;
	margin-bottom: 20px;
	overflow: hidden;
	transition: all 0.3s ease;
}

.panel-header {
	padding: 12px 20px;
	background: var(--accent-soft);
	cursor: pointer;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.panel-header h2 { font-size: 18px; color: var(--accent); margin: 0; }
.toggle-icon {
	background: none;
	border: none;
	font-size: 14px;
	color: var(--accent);
	transition: transform 0.3s ease;
	cursor: pointer;
}

/* Minimized State */
.task-input-section.minimized .panel-content {
	max-height: 0;
	padding-top: 0;
	padding-bottom: 0;
}

.task-input-section.minimized .toggle-icon { transform: rotate(-90deg); }

.panel-content {
	padding: 20px;
	max-height: 1000px; /* Arbitrary large height for animation */
	transition: max-height 0.4s ease-in-out, padding 0.4s ease;
}

/* Compact Form */
.task-form-compact {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 20px;
	padding-bottom: 20px;
	border-bottom: 1px solid var(--border);
}

.primary-inputs { display: flex; gap: 10px; }
.constraint-inputs { display: flex; gap: 15px; align-items: center; flex-wrap: wrap;}

.input-field {
	padding: 8px 12px;
	border: 2px solid var(--border);
	border-radius: 6px;
	font-family: inherit;
	font-size: 14px;
}
.input-field:focus { outline: none; border-color: var(--accent); }

#task-name { flex: 2; }
.small { width: 110px; }
.tiny { width: 110px; padding: 6px; }

.c-group { display: flex; align-items: center; gap: 5px; font-size: 13px; }
.small-btn { padding: 8px 20px; margin-left: auto; }

.action-btn {
	background-color: var(--accent);
	color: white;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	font-family: inherit;
	font-weight: 600;
}
.action-btn:hover { background-color: var(--accent-light); }

/* Task List Items */
.tasks-list { display: flex; flex-direction: column; gap: 8px; }
.task-item {
	display: flex;
	align-items: center;
	padding: 8px 12px;
	background: var(--background);
	border: 1px solid var(--border);
	border-radius: 6px;
	font-size: 14px;
}

.task-priority-badge { width: 8px; height: 8px; border-radius: 50%; margin-right: 12px; flex-shrink: 0;}
.task-priority-badge.high { background: var(--high-priority); }
.task-priority-badge.medium { background: var(--medium-priority); }
.task-priority-badge.low { background: var(--low-priority); }

.task-info { flex: 1; display: flex; align-items: center; gap: 10px; overflow: hidden;}
.task-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}
.task-duration { color: var(--text-light); font-size: 12px; white-space: nowrap;}
.task-remove {
	margin-left: 10px;
	color: var(--error);
	background: none;
	border: none;
	cursor: pointer;
	font-size: 12px;
}

.constraint-badge {
	font-size: 10px;
	padding: 2px 6px;
	border-radius: 4px;
	background: var(--accent-soft);
	color: var(--accent);
}

/* Schedule */
.menu-btn-large {
	width: 100%;
	padding: 15px;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 10px;
	font-size: 16px;
}
.icon { width: 20px; height: 20px; }

.day-schedule {
	margin-top: 20px;
	background: var(--card-bg);
	border: 2px solid var(--border);
	border-radius: 8px;
	padding: 20px;
}
.day-header { font-size: 18px; font-weight: 700; color: var(--accent); margin-bottom: 15px; display: flex; justify-content: space-between;}

.time-block {
	display: flex;
	margin-bottom: 8px;
	padding: 10px;
	background: var(--background);
	border-left: 4px solid #ccc;
	border-radius: 4px;
	font-size: 14px;
}

/* Add this utility class */
.hidden {
    display: none !important;
}

/* Ensure the new day selector fits */
#task-specific-day {
    min-width: 90px;
}

.time-block .time-label { width: 110px; font-weight: 600; flex-shrink: 0; }
.time-block.high-priority { border-left-color: var(--high-priority); }
.time-block.medium-priority { border-left-color: var(--medium-priority); }
.time-block.low-priority { border-left-color: var(--low-priority); }
.time-block.free-time { border-left-color: var(--border); opacity: 0.6; }

/* Status */
.status-message {
	position: fixed;
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%) translateY(20px);
	opacity: 0;
	padding: 12px 24px;
	border-radius: 50px;
	color: white;
	font-weight: 600;
	transition: all 0.3s ease;
	pointer-events: none;
	box-shadow: 0 4px 12px rgba(0,0,0,0.15);
	z-index: 100;
}
.status-message.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.status-message.error { background-color: var(--error); }
.status-message.success { background-color: var(--success); }
.status-message.warning { background-color: var(--warning); }

/* Responsive */
@media (max-width: 600px) {
	.settings-bar, .primary-inputs, .constraint-inputs { flex-direction: column; align-items: stretch; }
	.input-compact, .tiny, .small { width: 100%; }
	.c-group { flex-direction: row; justify-content: space-between; }

	/* Fix widths for inputs in groups */
    .input-field, .small, .tiny { width: 100%; min-width: 0; }
    .c-group { display: flex; flex-direction: row; justify-content: space-between; align-items: center; width: 100%; }
    .c-group label { min-width: 50px; }
    .c-group .input-with-clear, .c-group .input-field { width: 70%; }
	
}


.primary {
	padding: 12px 24px;
	font-family: var(--font-main), monospace;
	font-size: 16px;
	font-weight: 600;
	border: 2px solid var(--border);
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s ease;
	background-color: var(--card-bg);
	color: var(--text);
}

.primary {
	background-color: var(--accent);
	color: white;
	border-color: var(--accent);
}

.primary:hover {
	background-color: var(--accent-light);
	border-color: var(--accent-light);
	transform: translateY(-2px);
	box-shadow: 0 4px 12px var(--hover-shadow);
}

/* NEW: Wrapper for input + clear button */
.input-with-clear {
    position: relative;
    display: flex;
    align-items: center;
}

/* NEW: The X button style */
.clear-time-btn {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 18px;
    cursor: pointer;
    padding: 0 6px;
    margin-left: -30px; /* Pull it over the input */
    z-index: 2;
    line-height: 1;
    font-weight: bold;
}

.clear-time-btn:hover {
    color: var(--error);
}

/* Adjust padding on the time inputs so text doesn't hit the X button */
.input-with-clear input[type="time"] {
    padding-right: 25px;
}


.secondary {

		padding: 12px 24px;
	font-family: var(--font-main), monospace;
	font-size: 16px;
	font-weight: 600;
	border: 2px solid var(--border);
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s ease;

	background-color: transparent;
	border-color: var(--accent);
	color: var(--accent);

}

.secondary:hover {
	background-color: var(--accent-soft);
}

/* Optional Label */
.optional-label {
    color: var(--text-light);
    font-size: 11px;
    font-style: italic;
    margin-right: 2px;
    letter-spacing: 0.2px;
    vertical-align: middle;
}

/* Home Button */
.home-button {
	position: fixed;
	top: 24px;
	left: 24px;
	width: 48px;
	height: 48px;
	background-color: var(--card-bg);
	border: 1px solid var(--border);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
	color: var(--text);
	text-decoration: none;
	transition: all 0.2s ease;
	z-index: 1000;
}

.home-button:hover {
	background-color: var(--accent);
	color: white;
	border-color: var(--accent);
	transform: scale(1.05);
}