/** Custom plugin styles **/
#settings_text_formatting option[value=textile] {
  display: none !important;
}

/* Hide the syntax-highlight "language" preference in My account (deliberate:
   keeps the preferences screen minimal), and its now-empty container.

   Note: repositories are disabled at the data level (enabled_scm=[] + the
   repository module excluded from default project modules in provisioning), so
   no CSS is needed to hide repository tabs/module/permissions. The
   "manage related issues" permission is left visible (it is not
   repository-related). The Incoming-emails settings tab is shown, since the
   mail-handler API is now a provisioned feature. */
body.controller-my #pref_toolbar_language_options,
body.controller-my p:has(> #pref_toolbar_language_options) {
  display: none !important;
}


@media only screen and (max-width: 900px) {
  a.float-new {
    position: fixed;
    width: 50px;
    height: 50px;
    bottom: 15px;
    right: 15px;
    background-color: #05A418;
    color: #ffffff;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 2px 2px 3px #999;
    z-index: 100;
  }

  a.float-new:hover {
    text-decoration: none;
  }

  /* Tabler "plus" icon rendered by the custom-branding controller. */
  a.float-new svg {
    width: 28px;
    height: 28px;
    stroke: #ffffff;
  }
}

@media only screen and (min-width: 900px) {
  a.float-new {
    display: none;
  }
}


#header, #custom_color_preview  {
  background: #FFFFFF;
}

#top-menu {
  background: #393d3d;
}

#custom_color_preview {
  width: 100%;
}

#header {
  padding-left: 20px;
  padding-right: 20px;

  h1 {
    /* Logo + title on a single, left-aligned, vertically centred row. The
       logo is a flex ::before item (not a background) so it stays centred on
       the title regardless of the theme's header padding. display/direction/
       justify are forced because the bleuclair theme makes this h1 a centred
       column flex at some widths, which would otherwise stack and centre. */
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start !important;
    gap: 12px;
    color: white;

    &::before {
      content: "";
      flex: 0 0 36px;
      width: 36px;
      height: 36px;
      /* custom_branding_controller sets --brand-logo to the configured logo;
         falls back to the bundled Karida logo when none is set. */
      background-image: var(--brand-logo, url("/assets/plugin_assets/redmine_custom/logo-877d1603.svg"));
      background-size: contain;
      background-repeat: no-repeat;
      background-position: center;
    }
  }
}

@media screen and (max-width: 899px) {
  #header{
    padding-right: 0px;
  }
}

/* Prevent padding to be overriden by the bleuclair theme */
@media screen and (max-width: 899px) {
  .flyout-menu__search input[type='text'] {
    padding-left: 25px !important;
  }
}

#content {
  padding: 20px;

  div.issue {
    background: unset;
    padding: 0px;
    border: none;
  }

  div.box {
    background: unset;
    border: 1px solid #e5e5e5;
    padding-top: 15px;
    padding-bottom: 10px;
  }

  .tabs {
    margin-bottom: 0px;
  }

  .tab-content {
    padding: 1.2em;
  }
}

@media screen and (max-width: 899px) {
  #main.nosidebar #content, div#content {
    padding: 15px;

    fieldset {
      padding-left: 0px;
      padding-right: 0px;
    }

    div.box, .mypage-box {
      background-color: unset;
      border: 0px;
      padding: 5px 2px 2px 2px;
    }

    fieldset.box{
      background-color: unset;
      border: none;
      padding-top: 5px;

      legend {
        font-weight: bold;
        text-decoration: underline;
      }
    }
  }
}

@media screen and (max-width: 899px) {
  #content>.contextual>a, #content>.contextual .drdn, p.buttons a {
    padding: 5px 5px 5px 5px;
  }
}

#custom_logo_preview {
  width: 64px;
  height: 64px;
  background-image: url("/assets/plugin_assets/redmine_custom/logo-877d1603.svg");
  background-size: 36px;
  background-repeat: no-repeat;
  background-position: 12px 15px;
}

/* Quick-comment UX: keep the issue "Add note" form (#add_notes) open by default
   so users can comment without first clicking Edit. We force #update visible and
   show only its notes fieldset, hiding the property-change + attachment fieldsets
   and the heading. The custom_editing_tweaks controller re-reveals those hidden
   fieldsets when the user clicks Edit, keeps the page from auto-focusing the notes
   field on load, and reloads on Cancel (which would otherwise hide this
   always-open form). */
#update {
  display: block !important;
}
#update > h3,
#update div.box fieldset {
  display: none;
}
#update div.box fieldset#add_notes {
  display: block;
}
#update div.box fieldset legend {
  font-weight: bold;
}
#update .box {
  padding: 0;
}
#update .edit_issue fieldset {
  background: unset;
  border: none;
}
/* When Edit reveals the property fieldset, the description editor is collapsed
   (display:none) by default; force it open so the description is editable. */
#issue_description_and_toolbar {
  display: block !important;
}
