
/* Visual cues for schedule */
html[nextTimedChange="false"] #timed-change-message,
html[schedule='true'][nextTimedChange="false"] #disabled_message,
html[schedule='true'][nextTimedChange="false"] #turn_back_on,
html[schedule='false'] #disabled_message_schedule,
html[schedule='false'] #disabled_message_open_schedule,
html:not([nextTimedChange="false"]) #disabled_message_schedule,
html:not([nextTimedChange="false"]) #disabled_message_open_schedule,
html[foo="bar"] {
  display: none;
}

#disabled_message_container {
  text-align: center;
  height: var(--body-height);
  padding: 1px;

  font-size: 1rem;

  display: flex;
  justify-content: center;
  align-content: center;
  flex-direction: column;
  gap: 30px;
}

#turn_back_on, #disabled_message_open_schedule {
  width: fit-content;
  height: fit-content;
  margin: 0 auto;
  padding: 10px 25px;
  user-select: none;
  border: 2px solid var(--label-color);
  border-radius: 999px;
}
#turn_back_on:hover, #disabled_message_open_schedule:hover {
  background-color: var(--label-color);
  color: var(--body-background-color);
}


/* Status Overlay */
#status_overlay_container[hidden] {
  display: none;
}
#status_overlay_container {
  position: absolute;
  top: 8px;
  left: 0;
  right: 0;

  width: fit-content;
  min-height: fit-content;

  margin-left: auto;
  margin-right: auto;
  padding: 5px 20px;

  z-index: 110;

  color: var(--body-background-color);
  background-color: var(--body-color);
  box-shadow: 0px 0px .5px .5px var(--box-shadow-color);

  border: 1px solid rgba(0, 0, 0, 0.45);;
  border-radius: 99px;
}

#status_overlay {

  display: flex;
  flex-direction: column;
  gap: 3px;
  justify-content: space-evenly;
  align-items: center;
}

#status_message {
  color: var(--body-background-color);
}

/* Import modal */
#import_container_background {
  position: fixed;
  top: 0;
  left: 0;
  width: 105vw;
  height: 105vh;
  z-index: 100;

  background-color: rgba(0, 0, 0, 0.6);

  display: flex;
}

#import_container, #import_container * {
  color: var(--body-color);
}

#import_container {
  height: fit-content;
  width: min(50vw, 350px);
  margin-top: calc(3 * var(--header-height));
  margin-right: auto;
  margin-left: auto;
  padding-top: 20px;
  padding-bottom: 20px;

  text-align: center;

  background-color: var(--body-background-color);
  box-shadow: 0px 0px .5px .5px var(--box-shadow-color);

  border: 1px solid var(--box-shadow-color);
  border-radius: 2px;

  display: flex;
  gap: 15px;
  flex-direction: column;
  align-items: center;
}

#import_container input {
  width: min(75%, 200px);
  padding: 2px 7px;
  color: var(--body-color);
}
#import_container button {
  width: fit-content;
  padding: 2px 7px;
  color: black;
}


/* Scheduling Modal */
#schedule_container_background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100;

  background-color: rgba(0, 0, 0, 0.6);

  display: flex;
}

#schedule_container, #schedule_container * {
  color: var(--body-color);
}

#schedule_container {
  height: fit-content;
  width: min(90vw, 800px);
  margin-top: calc(1.2 * var(--header-height));
  margin-right: auto;
  margin-left: auto;
  padding: 20px;

  text-align: center;

  background-color: var(--body-background-color);
  box-shadow: 0px 0px .5px .5px var(--box-shadow-color);
  box-sizing: border-box;

  border: 1px solid var(--box-shadow-color);
  border-radius: 2px;

  display: flex;
  gap: 60px;
  flex-direction: column;
  align-items: center;
}

#schedule_modal_header {
  display: flex;
  gap: 15px;
  flex-direction: column;
  align-items: center;
}

#schedule_modal_header div:first-child {
  font-size: 1.1rem;
  font-weight: bold;
}

/* Gray out options when disabled */
html[schedule="false"] #schedule_container > *:not(#schedule_modal_header) {
  opacity: 0.2;
  pointer-events: none;
  user-select: none;
}

#enable-schedule {
  cursor: default;
  user-select: none;

  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 15px;
}
#enable-schedule p {
  margin: 0;
  font-size: 0.9rem;
}

#times-container, #days-container {
  width: 100%;

  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
}

.label-container {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-start;
}

.label-container > div:first-child {
  font-weight: bold;
}

.predefined-options {
  display: flex;
  gap: 10px;
  user-select: none;
  font-size: 0.8rem;
}

#schedule-times {
  width: 100%;
  max-width: 215px;
  padding: 2px 5px;
  font-size: 0.8rem;
  box-sizing: border-box;
}
#schedule-times[invalid] {
  box-shadow: 0px 0px 1px 0.5px var(--red-color);
}
#schedule-times[invalid]:focus {
  box-shadow: 0px 0px 2px 0.5px var(--red-color);
}

#schedule-days {
  display: flex;
  gap: 3px;
  justify-content: right;
  user-select: none;
  box-sizing: border-box;
}
#schedule-days > div {
  width: 30px;
  padding: 1px 2px;
  border-radius: 2px;
  box-sizing: border-box;
  border: 2px solid var(--body-background-color);
  cursor: pointer;
}
#schedule-days > div[active] {
  color: white !important;
  background-color: var(--light-blue);
  border: 2px solid var(--blue-color);
}

.predefined-options a {
  cursor: pointer;
}


/* Password lock screen */
html:not([password='true']) #password_lock_container,
html[passwordentered='true'] #password_lock_container,
html[foo=bar] {
  display: none;
}
#password_lock_container {
  position: fixed;
  top: 0;
  left: 0;
  bottom: calc(var(--footer-height) + 3px);
  width: 100vw;
  z-index: 100;
  font-size: 1rem;

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

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
}
#password_lock_container button {
  color: var(--body-color);
}

/* Password Modal */
#password_container_background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100;

  background-color: rgba(0, 0, 0, 0.6);

  display: flex;
}

#password_container_background button {
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  background-color: var(--blue-color);
  color: white;
}
#password_container_background button:hover {
  opacity: 0.9;
}
#password_container_background button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

#enable_password_container, #enable_password_container * {
  color: var(--body-color);
}

#enable_password_container, #disable_password_container {
  position: relative;

  height: fit-content;
  width: min(90vw, 450px);
  margin-top: calc(1.2 * var(--header-height));
  margin-right: auto;
  margin-left: auto;
  padding: 20px 10px;

  text-align: center;

  background-color: var(--body-background-color);
  box-shadow: 0px 0px .5px .5px var(--box-shadow-color);
  box-sizing: border-box;

  border: 1px solid var(--box-shadow-color);
  border-radius: 2px;

  display: flex;
  gap: 20px;
  flex-direction: column;
  align-items: center;
}

#password_modal_header {
  display: flex;
  gap: 15px;
  flex-direction: column;
  align-items: center;
}

#password_modal_header div:first-child {
  font-size: 1.1rem;
  font-weight: bold;
}

#enable-password {
  display: flex;
  flex-direction: row;
  gap: 10px;
}

#password-entries {
  font-size: 0.85rem;

  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  grid-gap: 10px;
}

#password-entries > * {
  justify-self: start;
}

#disable_password_container a:first-child {
  font-weight: bold;
}


/* Logging Opt-in Banner */
#log_prompt_banner {
  position: fixed;
  bottom: 8px;
  left: 8px;
  right: 8px;
  z-index: 100;

  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;

  background: var(--body-color);
  border-radius: var(--border-radius);
  font-size: 12px;
  opacity: 0.9;
}

#log_prompt_banner * {
  color: var(--body-background-color);
}

#log_prompt_text {
  flex: 1;
}

#log_prompt_buttons {
  display: flex;
  gap: 6px;
}

#log_prompt_buttons button {
  padding: 4px 10px;
  border: none;
  border-radius: var(--border-radius);
  font-size: 12px;
  cursor: pointer;
}

#log_prompt_yes {
  background-color: var(--body-background-color);
  color: var(--body-color) !important;
}

#log_prompt_no {
  background-color: transparent;
  border: 1px solid var(--box-shadow-color) !important;
}

#log_prompt_buttons button:hover {
  opacity: 0.85;
}

#log_prompt_dismiss {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.7;
  line-height: 1;
}

#log_prompt_dismiss:hover {
  opacity: 1;
}


/* Menu Timer */
#timer_container {
  position: fixed;
  top: 0;
  left: 0;
  bottom: calc(var(--footer-height) + 3px);
  width: 100vw;
  z-index: 100;
  font-size: 1rem;

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

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15vh;
}

/* Code Entry */
#lock_code_container {
  position: fixed;
  top: 0;
  left: 0;
  bottom: calc(var(--footer-height) + 3px);
  width: 100vw;
  z-index: 100;
  font-size: 1rem;

  /* Disable text selection */
  user-select: none;

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

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 25px;
}


#main_container {
  display: flex;
  flex-direction: row;
}

#sidebar {
  height: calc(6px + var(--body-height));
  width: 160px;
  padding: 0 6px 8px;
  overflow: hidden;

  box-sizing: border-box;
  user-select: none;

  border-right: 1px solid var(--box-shadow-color);

  display: flex;
  flex-direction: column;
  gap: 2px;
}
#sidebar .sidebar_section {
  padding: 8px 10px;
  border-radius: 6px;
  box-sizing: border-box;

  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.15s ease;
}
#sidebar .sidebar_section:hover {
  background-color: var(--box-shadow-color);
}
#sidebar .sidebar_section[selected] {
  background-color: rgba(0, 0, 0, 0.12);
}
html[dark_mode='true'] #sidebar .sidebar_section[selected] {
  background-color: rgba(255, 255, 255, 0.12);
}
#sidebar_top_row {
  display: flex;
  justify-content: center;
  margin: 0 auto 2px;
  width: fit-content;
  border-bottom: 1px solid var(--box-shadow-color);
  border-radius: 0 0 6px 6px;
}
#sidebar_top_row .sidebar_section {
  font-size: 10px;
  font-weight: 400;
  text-transform: lowercase;
  opacity: 0.5;
  padding: 2px 6px;
  border-radius: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}
#sidebar_top_row .sidebar_section[selected] {
  opacity: 1;
}
#active_sidebar .active_count {
  font-size: 9px;
  min-width: 14px;
  height: 14px;
  line-height: 14px;
  text-align: center;
  border-radius: 7px;
  background-color: rgba(0, 0, 0, 0.15);
  color: var(--label-color);
}
html[dark_mode='true'] #active_sidebar .active_count {
  background-color: rgba(255, 255, 255, 0.2);
}
#sidebar #active_sidebar[selected] .active_count {
  background-color: var(--label-color);
  color: var(--body-background-color);
}

#primary_options {
  height: var(--body-height);
  width: 100%;
  overflow: scroll;
  overflow-x: hidden;

  padding: 1px;

  display: flex;
  flex-direction: column;
  gap: 1px;
}

#current_selection_indicator {
  position: sticky;
  top: 0;
  align-self: flex-end;
  margin-bottom: -28px;
  font-size: 0.8rem;
  color: var(--label-color);
  opacity: 0.75;
  padding: 4px 10px;
  background-color: var(--body-background-color);
  border-left: 1px solid var(--box-shadow-color);
  border-bottom: 1px solid var(--box-shadow-color);
  border-bottom-left-radius: 6px;
  pointer-events: none;
  z-index: 5;
}


/*************************************
 * SIGN-IN / ACCOUNT / UPGRADE MODALS
 * (Premium/Monetization Feature)
 *************************************/

#signin_container_background,
#account_container_background,
#upgrade_container_background,
#premium_required_container_background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100;

  background-color: rgba(0, 0, 0, 0.6);

  display: flex;
}

#signin_container,
#account_container,
#upgrade_container,
#premium_required_container {
  height: fit-content;
  max-height: calc(100vh - 20px);
  width: min(90vw, 380px);
  margin-top: calc(1.2 * var(--header-height));
  margin-right: auto;
  margin-left: auto;
  padding: 20px;
  overflow-y: auto;

  text-align: center;

  background-color: var(--body-background-color);
  color: var(--body-color);
  box-shadow: 0px 0px .5px .5px var(--box-shadow-color);
  box-sizing: border-box;

  border: 1px solid var(--box-shadow-color);
  border-radius: 2px;

  display: flex;
  gap: 15px;
  flex-direction: column;
  align-items: center;
}

#account_header {
  font-size: 1.1rem;
  font-weight: bold;
}

#signin_header,
#upgrade_header,
#premium_required_header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

#signin_header_brand,
#upgrade_header_brand,
#premium_required_header_brand {
  display: flex;
  align-items: center;
  gap: 6px;
}

#signin_header_logo,
#upgrade_header_logo,
#premium_required_header_logo {
  width: 20px;
  height: 20px;
}

#signin_header_rys,
#upgrade_header_rys,
#premium_required_header_rys {
  font-size: 1.3rem;
  font-weight: normal;
}

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

#signin_email_form,
#signin_error {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

#signin_waiting {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

#signin_email_form p,
#signin_waiting p {
  font-size: 0.85rem;
  margin: 0;
}

#signin-email-input {
  width: 100%;
  padding: 8px 10px;
  font-size: 0.85rem;
  box-sizing: border-box;
  background-color: var(--body-background-color);
  color: var(--body-color);
}

#signin-email-input::placeholder {
  color: var(--body-color);
  opacity: 0.4;
}

#signin_container button,
#account_container button,
#upgrade_container button,
#premium_required_container button {
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  background-color: var(--blue-color);
  color: white;
}

#signin_container button:hover,
#account_container button:hover,
#upgrade_container button:hover,
#premium_required_container button:hover {
  opacity: 0.9;
}

#signin_container button:disabled,
#account_container button:disabled,
#upgrade_container button:disabled,
#premium_required_container button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

#signin-send-button,
#upgrade-checkout-button,
#premium-required-signin-button {
  background-color: transparent !important;
  color: var(--blue-color) !important;
  border: 1px solid var(--blue-color) !important;
}

#signin_email_row {
  display: flex;
  width: 100%;
}

#signin_email_row #signin-email-input {
  flex: 1;
  border-right: none;
  border-radius: var(--border-radius) 0 0 var(--border-radius);
}

#signin-send-button {
  padding: 8px 10px;
  border-radius: 0 var(--border-radius) var(--border-radius) 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

#signin-send-button svg {
  width: 16px;
  height: 16px;
}

#signin-send-button:hover,
#premium-required-signin-button:hover {
  background-color: rgba(6, 0, 251, 0.05) !important;
}

#signin-cancel-button,
#upgrade-cancel-button,
#premium-required-cancel-button,
#account-signout-button {
  background-color: transparent !important;
  color: var(--body-color) !important;
  border: 1px solid var(--box-shadow-color) !important;
}

#signin-cancel-button:hover,
#upgrade-cancel-button:hover,
#premium-required-cancel-button:hover,
#account-signout-button:hover {
  background-color: var(--box-shadow-color) !important;
}

#signin-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

#signin-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--box-shadow-color);
  border-top-color: var(--blue-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#signin-waiting-email {
  font-weight: bold;
  word-break: break-all;
  font-size: 0.85rem;
}

#signin-status {
  font-size: 0.8rem;
  opacity: 0.7;
}

#signin-error-message {
  color: var(--red-color);
}

/* Account Modal */
#account_container {
  width: auto;
  padding: 16px 20px;
  gap: 16px;
}

#account_row_1 {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}

#account-email-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

#account-email-label {
  font-size: 0.65rem;
  opacity: 0.6;
}

#account-email {
  font-size: 0.85rem;
}

#account-premium-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

#account-premium-label[data-status="free"] {
  color: var(--body-color);
  opacity: 0.6;
}

#account-premium-label[data-status="premium"] {
  color: var(--blue-color);
}

#account-premium-label[data-status="grandfathered"] {
  color: #b8860b;
}

#account_row_2 {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

#account_row_2 button {
  padding: 6px 12px;
  font-size: 0.75rem;
  white-space: nowrap;
}

#account-billing-button {
  background-color: transparent !important;
  color: var(--blue-color) !important;
  border: 1px solid var(--blue-color) !important;
}

#account-billing-button:hover {
  background-color: rgba(6, 0, 251, 0.05) !important;
}

#account-signout-button {
  background-color: transparent !important;
  color: var(--body-color) !important;
  border: 1px solid var(--box-shadow-color) !important;
}

#account-signout-button:hover {
  background-color: var(--box-shadow-color) !important;
}

/* Upgrade Modal */
#upgrade_container {
  width: auto;
  max-width: min(90vw, 380px);
  padding: 24px;
  gap: 18px;
  align-items: flex-start;
}


#upgrade_header_action {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--body-color);
  opacity: 0.5;
}

#premium_required_description {
  margin: 0;
  text-align: center;
}

#upgrade_slot_limit_note {
  color: var(--body-color);
  text-align: center;
  padding: 0 8px;
}

.premium-note-main,
.premium-note-sub {
  display: block;
  line-height: 1.4;
}
.premium-note-main {
  font-size: 0.9rem;
  opacity: 0.85;
}
.premium-note-sub {
  font-size: 0.8rem;
  opacity: 0.55;
  margin-top: 4px;
}

#upgrade_plans {
  display: flex;
  gap: 12px;
  width: 100%;
}

.upgrade-plan {
  width: 120px;
  padding: 12px;
  border: 1px solid var(--box-shadow-color);
  border-radius: var(--border-radius);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.upgrade-plan:hover {
  border-color: var(--light-blue);
}

.upgrade-plan[selected] {
  border-color: var(--blue-color);
  background-color: rgba(6, 0, 251, 0.08);
}
html[dark_mode='true'] .upgrade-plan[selected] {
  background-color: rgba(74, 108, 247, 0.15);
}

.plan-name {
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--body-color);
}

.plan-price {
  font-size: 0.9rem;
  font-weight: bold;
  color: var(--label-color);
}

.plan-price-period {
  font-size: 0.7rem;
  font-weight: normal;
  opacity: 0.7;
}


#upgrade_buttons,
#premium_required_buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  width: 100%;
}

#upgrade_buttons button,
#premium_required_buttons button {
  padding: 6px 12px;
  font-size: 0.75rem;
  white-space: nowrap;
}

#upgrade-checkout-button {
  width: fit-content;
}

#upgrade-checkout-button:hover {
  background-color: rgba(6, 0, 251, 0.05) !important;
}

#upgrade-cancel-button {
  width: fit-content;
}

#upgrade_footer {
  font-size: 0.7rem;
  color: var(--label-color);
  opacity: 0.6;
  align-self: flex-end;
}

/* Premium options: dim slightly for non-premium users, full opacity for premium */
html:not([tier='premium']) .option[data-premium='true'] {
  opacity: 0.65;
}
html[tier='premium'] .option[data-premium='true'],
#active_section .option[data-premium='true'] {
  opacity: 1;
}

/* Blue dot at the right edge of premium options (only shown for non-premium users). */
.option[data-premium='true'] {
  position: relative;
}
html:not([tier='premium']) .option[data-premium='true']::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--blue-color, #4a6cf7);
  opacity: 0.85;
}

/* Premium marker for settings-menu / power-options items (same dot as main list) */
html:not([tier='premium']) #settings-menu div[data-premium='true'],
html:not([tier='premium']) #power-options div[data-premium='true'] {
  opacity: 0.65;
  position: relative;
}

html:not([tier='premium']) #settings-menu div[data-premium='true']::after,
html:not([tier='premium']) #power-options div[data-premium='true']::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--blue-color, #4a6cf7);
  opacity: 0.85;
}

html[tier='premium'] #settings-menu div[data-premium='true'],
html[tier='premium'] #power-options div[data-premium='true'] {
  opacity: 1;
}



