/*** HEADER ***/

/** Tab notification badges **/

/**
	color selection for header timer
	 */
.timesheet_timer, #egw_fw_topmenu_info_items #topmenu_info_timer #topmenu_timer {
  text-align: center;
  white-space: nowrap;
  color: var(--sl-color-neutral-600);

  &.running {
	color: var(--sl-color-primary-600);
  }

  &.running.overall {
	color: var(--sl-color-neutral-1000);
  }

  &.paused {
	color: var(--sl-color-orange-500);
  }
}

/** end color for timer*/

#egw_fw_topmenu_info_items {
  /*these are the icons on the right
  timer, darkmode, quickadd, notifications, account
  */
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  color: var(--sl-color-neutral-600);
  font-size: var(--header-icon-size);
  button{
	font-size: var(--header-icon-size);
	>a>img{
	  width: 1em;
	  height: 1em;
	}
  }

  & > * {
	border: none;
	background-color: transparent;
  }

  #topmenu_info_user_avatar {
	width: calc(calc(2 * var(--tab-icon-spacing, 2px)) + var(--icon-size));
	height: calc(calc(2 * var(--tab-icon-spacing, 2px)) + var(--icon-size));

	sl-button::part(label) {
	  padding: 0;
	}
	sl-button::part(base) {
	  border: none;
	}
	et2-avatar {
	  --size: calc(calc(2 * var(--tab-icon-spacing, 2px)) + var(--icon-size));
	}

	&::part(base) {
	  vertical-align: initial;
	}
  }

  .topmenu_info_item {
	height: var(--icon-size);
	width: var(--icon-size);
	display: inline-block;

	&:hover {
	  background-color: var(--sl-input-background-color-hover);
	}
  }

  et2-button-icon::part(base) {
	padding: 0;
  }

  #topmenu_info_timer {
	order: 1;
	position: relative;
	display: flex;
	align-items: center;
	padding: 0px;
	width: calc(calc(3 * var(--header-icon-size)) + 0.5rem);
	height: var(--header-icon-size);
	left: var(--sl-spacing-large);
	border: 1px solid var(--sl-color-neutral-600);
	border-radius: var(--sl-border-radius-pill);

	#timerIconRunning, #timerIconPaused {
	  padding-left: calc(1.6rem / 7);
	  font-size: var(--header-icon-size);

	}

	#timerIconRunning:has(~ div.paused) {
	  display: none;
	}

	#timerIconPaused:has(~ div:not(.paused)) {
	  display: none;
	}


	#topmenu_timer {
	  display: block;
	  width: 100%;
	  z-index: 2;
	}

	&:hover {
	  cursor: pointer;
	}
  }

  #topmenu_info_quick_add {
	position: relative;

	span#quick_add {
	  display: block;
	  background-image: url(../../node_modules/bootstrap-icons/icons/plus-circle.svg);
	  background-repeat: no-repeat;
	  background-size: 24px;
	  background-position: center;
	  width: 100%;
	  height: 100%;
	  padding-right: 3px;

	  &:before {
		content: " ";
		font-size: 2em;
		line-height: 0.6em;
		background-color: white;
	  }
	}

	#quick_add_selectbox {
	  height: 0px;
	  display: inline-block;
	  text-align: initial;

	  sl-option {
		white-space: nowrap;
	  }
	}

	#quick_add_selectbox::part(emptyLabel) {
	  /* do NOT show empty label, required for clearing value */
	  display: none;
	}

	#quick_add_selectbox::part(form-control-input), #timer_selectbox::part(form-control-input) {
	  border: none !important;
	}

	#quick_add_selectbox::part(form-control), #timer_selectbox::part(form-control) {
	  margin-left: -3em;
	}

	#quick_add_selectbox::part(listbox), #timer_selectbox::part(menu) {
	  max-height: 60vh;
	}

	#quick_add_selectbox {
	  height: 0px;
	  overflow: hidden;
	}

	#quick_add_selectbox::part(combobox) {
	  visibility: hidden;
	}
  }

  #topmenu_info_user_avatar {
	sl-menu-item et2-image {
	  width: 1em;
	}
  }

  button#topmenu_info_search {
	background-image: url(../../api/templates/default/images/topmenu_items/search.svg);
  }
}

#topmenu_info_print_title {
  background-image: url(../../../api/templates/default/images/print.svg);

  span {
	width: 45px;
	height: 45px;
	display: inline-block;
  }
}

/* popup copied from pixelegg */
#egwpopup {
  top: 46px;
  right: 0 !important;
  left: auto !important;
  height: calc(100% - 69px);
  width: 277px !important;
  position: absolute;
  background: var(--sl-color-neutral-50);
  border: 1px solid var(--sl-color-neutral-300);
  border-top: none;
  border-bottom: none;
  padding: 1em;
  /*Button*/

  input#egwpopup_ok_button,
  button#desktop_perms {
	padding: 0 5px;
  }

  #egwpopup_list::-webkit-scrollbar-track {
	-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
	background-color: var(--sl-color-neutral-100);
  }

  #egwpopup_list::-webkit-scrollbar {
	width: 4px;
	background-color: var(--sl-color-neutral-100);
  }

  #egwpopup_list::-webkit-scrollbar-thumb {
	background-color: var(--sl-color-neutral-500);
  }

  #egwpopup_list {
	overflow-y: auto;
	height: ~"calc(100% - 52px)";

	.egwpopup_time_label {
	  width: 100%;
	  color: var(--sl-color-neutral-50);
	  text-align: center;
	  font-style: italic;
	  opacity: 0.5;
	  font-size: 10pt;
	  background: var(--sl-color-primary-800);
	  font-weight: bold;
	}

	span.egwpopup_delete {
	  display: inline-block;
	  float: right;
	  width: 24px;
	  height: 24px;
	  font-size: 12px;
	  margin: 6px;
	  cursor: pointer;
	  color: var(--sl-color-neutral-950);
	  &:before {
		font-family: bootstrap-icons !important;
		content: "\f78b" //Trash3
	  }
	}

	.egwpopup_mark {
	  display: inline-block;
	  float: right;
	  width: 10px;
	  height: 10px;
	  border: 1px solid #b9436c;
	  border-radius: 50%;
	  margin: 7px;
	  background: #b9436c;
	  cursor: pointer;
	}

	.egwpopup_message {
	  height: auto;
	  overflow: hidden;
	  padding: 10px;
	  background-color: var(--sl-color-neutral-50);
	  margin-bottom: 5px;

	  &:not(.egwpopup_expanded):hover {
		background-color: rgba(103, 159, 210, 0.2);
	  }

	  .egwpopup_message_inner_container {
		height: 63px;
		overflow: hidden;

		a {
		  max-width: 60em;
		  display: inline-block;
		  overflow-wrap: break-word;
		  vertical-align: text-top;
		}
	  }

	  .egwpopup_message_top_toolbar {
		display: inline-block;
		width: 100%;

		.egwpopup_message_date {
		  float: left;
		  color: var(--sl-color-neutral-500);
		}

		.egwpopup_message_open {
		  display: inline-block;
		  float: right;
		  width: 24px;
		  height: 24px;
		  font-size: 12px;
		  margin: 6px;
		  cursor: pointer;
		}

		.egwpopup_collapse {
		  display: none;
		}
	  }

	  .egwpopup_actions_container {
		text-align: center;

		& > button {
		  height: 24px;
		  width: 80px;
		  border: none;
		  background: var(--sl-color-neutral-200);
		  cursor: pointer;
		  &::before{
			vertical-align: text-top;
			padding-right: 4px;
		  }
		}
	  }
	  .egwpopup_message_more_info {
		color: var(--sl-color-neutral-400);
		padding-top: 5px;
		padding-bottom: 5px;
	  }

	  span.egwpopup_nav_prev, span.egwpopup_nav_next {
		display: none;
	  }
	}

	.egwpopup_message.egwpopup_expanded {
	  position: fixed;
	  top: 85px;
	  height: ~"calc(100% - 130px)";
	  left: 20vw;
	  width: 60vw;
	  box-shadow: 0 0 40px var(--sl-color-neutral-500);
	  overflow: auto;

	  .egwpopup_message_inner_container {
		height: ~"calc(100% - 62px)";
		overflow: auto;
	  }

	  .egwpopup_collapse {
		float: right;
		width: 24px;
		height: 24px;
		background-image: url(../../node_modules/bootstrap-icons/icons/x-lg.svg);
		background-repeat: no-repeat;
		background-position: center;
		background-size: 12px;
		cursor: pointer;
		display: inline-block
	  }

	  .egwpopup_message_more_info {
		display: none;
	  }

	  span.egwpopup_nav_prev {
		display: inline-block;
		float: right;
		width: 24px;
		height: 24px;
		background-image: url(../../node_modules/bootstrap-icons/icons/arrow-bar-left.svg);
		background-repeat: no-repeat;
		background-position: center;
		background-size: 16px;
		cursor: pointer;
	  }

	  .egwpopup_nav_disable {
		opacity: 0.5;
		pointer-events: none;
	  }

	  span.egwpopup_nav_next {
		display: inline-block;
		float: right;
		width: 24px;
		height: 24px;
		background-image: url(../../node_modules/bootstrap-icons/icons/arrow-bar-right.svg);
		background-repeat: no-repeat;
		background-position: center;
		background-size: 16px;
		cursor: pointer;
	  }
	}

	.egwpopup_message_seen {
	  .egwpopup_mark {
		cursor: auto;
		background: none;
		border-color: var(--sl-color-neutral-300);
	  }
	}

	.egwpopup_message_clone {
	  border: 2px dashed silver;
	  opacity: 0.3;
	  height: 125px;
	}
  }

  div#egwpopup_header {
	font-size: 16px;
	color: silver;
	text-align: center;
	padding: 15px;

	.egwpopup_seenall {
	  float: right;
	  width: 1em;
	  height: 1em;
	  border: 1px solid var(--sl-color-neutral-500);
	  border-radius: 50%;
	  cursor: pointer;

	  &:hover {
		border-color: gray;
		background: rgba(103, 159, 210, 0.2);
	  }
	}

	.egwpopup_deleteall {
	  // background-image: url(../../node_modules/bootstrap-icons/icons/trash3.svg);
	  &:before {
		font-family: bootstrap-icons !important;
		content: "\f78b"; //Trash3
	  }

	  color: var(--sl-color-neutral-950);
	  width: 1em;
	  height: 1em;
	  font-size: 1em;
	  float: right;
	  margin-right: 15px;
	  cursor: pointer;
	  display: inline-block;
	}
  }
}

/*** END HEADER ***/