
/* Visual cues for dark mode */
html[dark_mode='false'] { --svg-color: #464646 }
html[dark_mode='true']  { --svg-color: #E9E9E9 }

#header-toggle path,
.dark_mode circle, .dark_mode path
{
  fill: var(--svg-color);
}

#header-settings path,
#header-settings circle {
  stroke: var(--svg-color);
}

/* Dark mode styling */
html[dark_mode='true']  #header-dark  { display: none }
html[dark_mode='false'] #header-light { display: none }

#header {
  height: var(--header-height);
  padding: var(--header-padding) 8px;

  border-bottom: 1px solid var(--box-shadow-color);
  background-color: var(--body-background-color);

  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;

  --icon-dim: 28px;
}

#header-logo-link {
  display: flex;
  align-items: center;
}
#header-logo {
  height: var(--icon-dim);
  max-height: var(--icon-dim);
  max-width: var(--icon-dim);
}
#header-text {
  font-size: 1.3rem;
  color: var(--label-color);
}

#header-premium-badge {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--blue-color, #4a6cf7);
  letter-spacing: 0.02em;
}

#header-slot-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
}
#header-slot-indicator .slot-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--label-color);
  opacity: 0.25;
}
#header-slot-indicator .slot-dot[filled] {
  background-color: var(--blue-color, #4a6cf7);
  opacity: 0.85;
}

#search_bar {
  margin-left: auto;
  margin-right: auto;
}
#search_bar input {
  padding: 4px 12px;
  font-size: 0.9rem;

  background-color: var(--body-background-color);

  border: 1px solid var(--box-shadow-color);
  border-radius: 6px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
#search_bar input:focus {
  border-color: var(--light-blue);
  box-shadow: 0 0 0 2px rgba(117, 102, 204, 0.15);
}

#power-icon {
  display: flex;
  justify-content: center;
  position: relative;
}
#power-pop-up {
  position: absolute;
  font-size: 0.85rem;
  width: 200px;
  top: 115%;
  right: -75%;
  border-radius: var(--border-radius);
  user-select: none;

  padding: 10px;
  background-color: var(--body-color);
  color: var(--body-background-color);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
html[schedule='true'] #power-icon,
html[schedule='true'] #power-icon svg {
  cursor: default;
}
html[schedule='true'] #power-icon:active {
  pointer-events: none;
}
html[schedule='true'] #power-icon:hover #power-pop-up {
  opacity: 1;
  visibility: visible;
}
#power-icon svg {
  cursor: pointer;

  --power-icon-dim: calc(var(--icon-dim) - 6px);
  height: var(--power-icon-dim);
  max-height: var(--power-icon-dim);
  max-width: var(--power-icon-dim);
}
#power-options {
  font-size: 14px;

  position: fixed;
  z-index: 10;

  top: calc(5px + var(--header-height) + 2 * var(--header-padding));
  padding: 6px;

  user-select: none;
  background-color: var(--body-background-color);
  color: var(--body-color);
  border-radius: 8px;
  border: 1px solid var(--box-shadow-color);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);

  display: flex;
  flex-direction: column;
}
#power-options hr {
  width: 100%;
  margin: 4px 0;
  border: none;
  border-top: 1px solid var(--box-shadow-color);
}
#power-options > *:not(hr) {
  border-radius: 6px;
  padding: 6px 10px;
  cursor: default;
  transition: background-color 0.15s ease;
}
#power-options > *:not(hr):hover,
#power-options > *:not(hr):hover * {
  background-color: var(--blue-color);
  color: white !important;
}
#power-options a, #power-options span {
  text-decoration: none;
}
html[schedule="false"] #power-options #resume-schedule,
html[nextTimedChange="false"] #power-options #resume-schedule,
html[schedule="true"]:not([nextTimedChange="false"]) #power-options *:not(#resume-schedule),
html[schedule="true"] #power-options #global_enable,
html[schedule="false"] #power-options #open-schedule,
html[global_enable="true"] #power-options span.on,
html[global_enable="false"] #power-options span.off,
html[foo=bar]
{
  display: none
}

#dark_mode {
  display: flex;
  align-items: center;
}
#dark_mode a {
  display: flex;
  align-items: center;
}
#header-light, #header-dark {
  cursor: pointer;
  height: var(--icon-dim);
  max-height: var(--icon-dim);
  max-width: var(--icon-dim);
}
#header-settings {
  cursor: pointer;
  height: calc(var(--icon-dim) - 6px);
  max-height: calc(var(--icon-dim) - 6px);
  max-width: calc(var(--icon-dim) - 6px);
}
#settings-menu {
  font-size: 14px;

  position: fixed;
  z-index: 10;

  top: calc(5px + var(--header-height) + 2 * var(--header-padding));
  padding: 6px;

  user-select: none;
  background-color: var(--body-background-color);
  color: var(--body-color);
  border-radius: 8px;
  border: 1px solid var(--box-shadow-color);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);

  display: flex;
  flex-direction: column;
}
#settings-menu hr {
  width: 100%;
  margin: 4px 0;
  border: none;
  border-top: 1px solid var(--box-shadow-color);
}
#settings-menu > *:not(hr) {
  border-radius: 6px;
  padding: 6px 10px;
  cursor: default;
  transition: background-color 0.15s ease;
}
#settings-menu > *:not(hr):hover {
  background-color: var(--blue-color);
  color: white;
}
#settings-menu a {
  text-decoration: none;
}
html[log_enabled="true"] #log-enable,
html[log_enabled="false"] #log-disable,
html[foo=bar]
{
  display: none
}
