/*** HEADER ***/

/** Tab notification badges **/

/**
	color selection for header timer
	 */
.timesheet_timer, #egw_fw_topmenu_info_items #topmenu_info_timer #topmenu_timer {
  text-align: center;
  font-size: 20px;
  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);

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

  #topmenu_info_user_avatar {
	width: calc(calc(2 * var(--sl-spacing-2x-small)) + var(--icon-size));
	height: calc(calc(2 * var(--sl-spacing-2x-small)) + var(--icon-size));

	sl-button::part(label) {
	  padding: 0;
	}
	sl-button::part(base) {
	  border: none;
	}
	et2-avatar {
	  --size: calc(0.6rem + 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(1.8 * var(--icon-size));
	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;
	  font-size: larger;
	}

	&: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: #fff;
  border: 1px solid silver;
  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: #fafafa;
  }

  #egwpopup_list::-webkit-scrollbar {
	width: 4px;
	background-color: #fafafa;
  }

  #egwpopup_list::-webkit-scrollbar-thumb {
	background-color: #6a6f71;
  }

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

	.egwpopup_time_label {
	  width: 100%;
	  color: #fafafa;
	  text-align: center;
	  font-style: italic;
	  opacity: 0.5;
	  font-size: 10pt;
	  background: #255ea5;
	  font-weight: bold;
	}

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

	.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: #fafafa;
	  margin-bottom: 5px;

	  &: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: #767676;
		}

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

		.egwpopup_collapse {
		  display: none;
		}
	  }

	  .egwpopup_actions_container {
		text-align: center;
	  }

	  .egwpopup_actions_container > button {
		height: 24px;
		width: 80px;
		border: none;
		background: #e6e6e6;
		background-size: 16px;
		background-position: 12px center;
		background-repeat: no-repeat;
		padding-left: 26px;
	  }

	  .egwpopup_message_more_info {
		color: #767676;
		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 #666;
	  overflow: auto;

	  &:hover {
		background-color: #fafafa;
	  }

	  .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: #666c6e;
	  }
	}

	.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: 10px;
	  height: 10px;
	  border: 1px solid silver;
	  border-radius: 50%;
	  cursor: pointer;
	  margin: 4px 0px 0px 0px;

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

	.egwpopup_deleteall {
	  background-image: url(../../node_modules/bootstrap-icons/icons/trash3.svg);
	  width: 12px;
	  height: 12px;
	  background-position: center;
	  background-size: 12px;
	  float: right;
	  background-repeat: no-repeat;
	  margin-right: 15px;
	  margin-top: 4px;
	  cursor: pointer;
	  display: inline-block;
	  opacity: 0.5;

	  &:hover {
		opacity: 1;
	  }
	}
  }
}

/*** END HEADER ***/