<div class="panel panel-custom">
	<div class="modal-body wrap-modal wrap">
		<?php echo form_open(base_url('admin/calendar/save_settings'), array('id' => 'from_items', 'role' => 'form')); ?>

		<div class="grid gap-8">
			<div class="lg:col-span-2 space-y-4">
				<div class="bg-slate-50 p-4 rounded-xl border border-slate-200 dark:bg-slate-800 dark:border-slate-700">
					<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
						<?= form_input_group('gcal_api_key', lang('google_api'), config_item('gcal_api_key'), 'text', false); ?>
						<?= form_input_group('gcal_id', lang('calendar_id'), config_item('gcal_id'), 'text', false); ?>
					</div>

					<div class="mt-6">
						<h4 class="text-sm font-semibold text-foreground mb-3"><?= lang('show_on_calendar') ?></h4>
						<div class="grid gap-3 md:grid-cols-2">
							<div class="flex items-center justify-between rounded-lg border border-border bg-card px-3 py-2">
								<span class="text-sm font-medium text-foreground"><?= lang('project') ?></span>
								<div class="flex items-center gap-3">
									<div class="checkbox c-checkbox">
										<label class="needsclick">
											<input type="checkbox" <?php if (config_item('project_on_calendar') == 'on') { echo "checked=\"checked\""; } ?> name="project_on_calendar">
											
										</label>
									</div>
									<input type="color" value="<?= config_item('project_color') ?>" name="project_color"
										class="h-7 w-10 cursor-pointer rounded border border-border bg-transparent p-0" />
								</div>
							</div>

							<div class="flex items-center justify-between rounded-lg border border-border bg-card px-3 py-2">
								<span class="text-sm font-medium text-foreground"><?= lang('milestone') ?></span>
								<div class="flex items-center gap-3">
									<div class="checkbox c-checkbox">
										<label class="needsclick">
											<input type="checkbox" <?php if (config_item('milestone_on_calendar') == 'on') { echo "checked=\"checked\""; } ?> name="milestone_on_calendar">
											
										</label>
									</div>
									<input type="color" value="<?= config_item('milestone_color') ?>" name="milestone_color"
										class="h-7 w-10 cursor-pointer rounded border border-border bg-transparent p-0" />
								</div>
							</div>

							<div class="flex items-center justify-between rounded-lg border border-border bg-card px-3 py-2">
								<span class="text-sm font-medium text-foreground"><?= lang('tasks') ?></span>
								<div class="flex items-center gap-3">
									<div class="checkbox c-checkbox">
										<label class="needsclick">
											<input type="checkbox" <?php if (config_item('tasks_on_calendar') == 'on') { echo "checked=\"checked\""; } ?> name="tasks_on_calendar">
											
										</label>
									</div>
									<input type="color" value="<?= config_item('tasks_color') ?>" name="tasks_color"
										class="h-7 w-10 cursor-pointer rounded border border-border bg-transparent p-0" />
								</div>
							</div>

							<div class="flex items-center justify-between rounded-lg border border-border bg-card px-3 py-2">
								<span class="text-sm font-medium text-foreground"><?= lang('bugs') ?></span>
								<div class="flex items-center gap-3">
									<div class="checkbox c-checkbox">
										<label class="needsclick">
											<input type="checkbox" <?php if (config_item('bugs_on_calendar') == 'on') { echo "checked=\"checked\""; } ?> name="bugs_on_calendar">
											
										</label>
									</div>
									<input type="color" value="<?= config_item('bugs_color') ?>" name="bugs_color"
										class="h-7 w-10 cursor-pointer rounded border border-border bg-transparent p-0" />
								</div>
							</div>

							<div class="flex items-center justify-between rounded-lg border border-border bg-card px-3 py-2">
								<span class="text-sm font-medium text-foreground"><?= lang('invoice') ?></span>
								<div class="flex items-center gap-3">
									<div class="checkbox c-checkbox">
										<label class="needsclick">
											<input type="checkbox" <?php if (config_item('invoice_on_calendar') == 'on') { echo "checked=\"checked\""; } ?> name="invoice_on_calendar">
											
										</label>
									</div>
									<input type="color" value="<?= config_item('invoice_color') ?>" name="invoice_color"
										class="h-7 w-10 cursor-pointer rounded border border-border bg-transparent p-0" />
								</div>
							</div>

							<div class="flex items-center justify-between rounded-lg border border-border bg-card px-3 py-2">
								<span class="text-sm font-medium text-foreground"><?= lang('payments') ?></span>
								<div class="flex items-center gap-3">
									<div class="checkbox c-checkbox">
										<label class="needsclick">
											<input type="checkbox" <?php if (config_item('payments_on_calendar') == 'on') { echo "checked=\"checked\""; } ?> name="payments_on_calendar">
											
										</label>
									</div>
									<input type="color" value="<?= config_item('payments_color') ?>" name="payments_color"
										class="h-7 w-10 cursor-pointer rounded border border-border bg-transparent p-0" />
								</div>
							</div>

							<div class="flex items-center justify-between rounded-lg border border-border bg-card px-3 py-2">
								<span class="text-sm font-medium text-foreground"><?= lang('estimate') ?></span>
								<div class="flex items-center gap-3">
									<div class="checkbox c-checkbox">
										<label class="needsclick">
											<input type="checkbox" <?php if (config_item('estimate_on_calendar') == 'on') { echo "checked=\"checked\""; } ?> name="estimate_on_calendar">
											
										</label>
									</div>
									<input type="color" value="<?= config_item('estimate_color') ?>" name="estimate_color"
										class="h-7 w-10 cursor-pointer rounded border border-border bg-transparent p-0" />
								</div>
							</div>

							<div class="flex items-center justify-between rounded-lg border border-border bg-card px-3 py-2">
								<span class="text-sm font-medium text-foreground"><?= lang('opportunities') ?></span>
								<div class="flex items-center gap-3">
									<div class="checkbox c-checkbox">
										<label class="needsclick">
											<input type="checkbox" <?php if (config_item('opportunities_on_calendar') == 'on') { echo "checked=\"checked\""; } ?> name="opportunities_on_calendar">
											
										</label>
									</div>
									<input type="color" value="<?= config_item('opportunities_color') ?>" name="opportunities_color"
										class="h-7 w-10 cursor-pointer rounded border border-border bg-transparent p-0" />
								</div>
							</div>

							<div class="flex items-center justify-between rounded-lg border border-border bg-card px-3 py-2">
								<span class="text-sm font-medium text-foreground"><?= lang('goal_tracking') ?></span>
								<div class="flex items-center gap-3">
									<div class="checkbox c-checkbox">
										<label class="needsclick">
											<input type="checkbox" <?php if (config_item('goal_tracking_on_calendar') == 'on') { echo "checked=\"checked\""; } ?> name="goal_tracking_on_calendar">
											
										</label>
									</div>
									<input type="color" value="<?= config_item('goal_tracking_color') ?>" name="goal_tracking_color"
										class="h-7 w-10 cursor-pointer rounded border border-border bg-transparent p-0" />
								</div>
							</div>

							<div class="flex items-center justify-between rounded-lg border border-border bg-card px-3 py-2">
								<span class="text-sm font-medium text-foreground"><?= lang('holiday') ?></span>
								<div class="flex items-center gap-3">
									<div class="checkbox c-checkbox">
										<label class="needsclick">
											<input type="checkbox" <?php if (config_item('holiday_on_calendar') == 'on') { echo "checked=\"checked\""; } ?> name="holiday_on_calendar">
											
										</label>
									</div>
									<input type="color" value="#f59e0b" name="holiday_color"
										class="h-7 w-10 cursor-not-allowed rounded border border-border bg-transparent p-0 opacity-80" disabled />
								</div>
							</div>

							<div class="flex items-center justify-between rounded-lg border border-border bg-card px-3 py-2">
								<span class="text-sm font-medium text-foreground"><?= lang('absent') ?></span>
								<div class="flex items-center gap-3">
									<div class="checkbox c-checkbox">
										<label class="needsclick">
											<input type="checkbox" <?php if (config_item('absent_on_calendar') == 'on') { echo "checked=\"checked\""; } ?> name="absent_on_calendar">
											
										</label>
									</div>
									<input type="color" value="<?= config_item('absent_color') ?>" name="absent_color"
										class="h-7 w-10 cursor-pointer rounded border border-border bg-transparent p-0" />
								</div>
							</div>

							<div class="flex items-center justify-between rounded-lg border border-border bg-card px-3 py-2">
								<span class="text-sm font-medium text-foreground"><?= lang('on_leave') ?></span>
								<div class="flex items-center gap-3">
									<div class="checkbox c-checkbox">
										<label class="needsclick">
											<input type="checkbox" <?php if (config_item('on_leave_on_calendar') == 'on') { echo "checked=\"checked\""; } ?> name="on_leave_on_calendar">
											
										</label>
									</div>
									<input type="color" value="<?= config_item('on_leave_color') ?>" name="on_leave_color"
										class="h-7 w-10 cursor-pointer rounded border border-border bg-transparent p-0" />
								</div>
							</div>

							<div class="flex items-center justify-between rounded-lg border border-border bg-card px-3 py-2">
								<span class="text-sm font-medium text-foreground"><?= lang('leads') ?></span>
								<div class="flex items-center gap-3">
									<div class="checkbox c-checkbox">
										<label class="needsclick">
											<input type="checkbox" <?php if (config_item('leads_on_calendar') == 'on') { echo "checked=\"checked\""; } ?> name="leads_on_calendar">
											
										</label>
									</div>
									<input type="color" value="<?= config_item('leads_color') ?>" name="leads_color"
										class="h-7 w-10 cursor-pointer rounded border border-border bg-transparent p-0" />
								</div>
							</div>
						</div>
					</div>

					<div class="flex items-center gap-2 mt-6">
						<?= btn_update(lang('save'), 'md') ?>
					</div>
				</div>
			</div>
		</div>

		<?php echo form_close(); ?>
	</div>
</div>


