/*
  This file is part of Dconf Editor

  Dconf Editor is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  Dconf Editor is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with Dconf Editor.  If not, see <https://www.gnu.org/licenses/>.
*/

/*
  THEMES HACKERS, you've got a ".dconf-editor" CSS target on the window, as all
  the things could not be solved generically. But don't hesitate to file a bug.
*/

/*\
* * bookmarks
\*/

/* no transition as it would start at popover's opening */

                      .bookmarks list > row { min-height:2.6rem; }
.small-bookmarks-rows .bookmarks list > row { min-height:1.3rem; }

.small-bookmarks-rows .bookmarks list > row > grid > button.circular.flat {
  min-height:0;
  padding-bottom:1px;
  padding-top:1px;
  margin-top:-2px;
  margin-bottom:-2px;
}

/*\
* * pending change list popover
\*/

.delayed-settings-popover { padding:6px; }

.delayed-list .list-row-header { padding:5px; padding-top:10px; }

.delayed-list          > row              { padding:10px; }
.delayed-list          > row .key-name    { padding-bottom:5px; }
.delayed-list:dir(ltr) > row .diff-bullet { padding-left:20px; padding-right:6px; }
.delayed-list:dir(rtl) > row .diff-bullet { padding-right:20px; padding-left:6px; }
.delayed-list:dir(ltr) > row .value-label { padding-right:6px; }
.delayed-list:dir(rtl) > row .value-label { padding-left:6px; }

/*\
* * lists rows height and icon
\*/

/* row height */
                                   .keys-list          > row         { transition:min-height 0.3s,
                                                                                  margin-left 0.3s, margin-right 0.3s,
                                                                                  padding-left 0.3s, padding-right 0.3s,
                                                                               /* margin 0.3s,
                                                                                  padding 0.3s, cause stuttering in the transition */
                                                                                  border-radius 0.3s; }
                                /* .keys-list          > row:hover,
                                   .keys-list          > row:selected{ transition:min-height 0.3s,
                                                                                  margin 0.3s,
                                                                                  padding 0.3s,
                                                                                  border-radius 0.3s; } stuttering of a single row is almost bearable */

                                   .keys-list          > .key-row    { min-height:4.2em; }
                                   .keys-list          > .folder-row { min-height:2.1em; }
                                   .keys-list          > row         { margin:0;      padding-top:0.25em; padding-bottom:0.25em; }
.large-window                      .keys-list          > row         { margin:0.25em; padding-top:0;      padding-bottom:0;      }

             .small-keys-list-rows .keys-list          > .key-row    { min-height:2.5em; }
             .small-keys-list-rows .keys-list          > .folder-row { min-height:1.5em; }
             .small-keys-list-rows .keys-list          > row         { margin:0; padding-top:0; padding-bottom:0; }
.large-window.small-keys-list-rows .keys-list          > row         { margin:0; padding-top:0; padding-bottom:0; }

    .hc-theme                      .keys-list          > row         { padding-top:0.5em; padding-bottom:0.5em; }
    .hc-theme.large-window         .keys-list          > row         { padding-top:calc(0.25em + 1px); padding-bottom:calc(0.25em + 1px); }
    .hc-theme.small-keys-list-rows .keys-list          > row         { padding-top:0.4em; padding-bottom:0.4em; }

/* round borders for large windows */

.large-window                      .keys-list          > row        { border-radius:0.5em;
                                                                      -gtk-outline-radius:calc(0.5em - 1px); }
.large-window.small-keys-list-rows .keys-list          > row        { border-radius:0;
                                                                      -gtk-outline-radius:2px; /* gtk+ defaults */ }

/* folder icon */
                                   .keys-list          > row        > .folder > grid {
                                                  background-repeat:no-repeat;
                                                  transition:background-position 0.3s,
                                                             background-size 0.3s,
                                                             padding-left 0.3s,
                                                             padding-right 0.3s; /* warning: ltr/rtl */
                                                }

                                   .keys-list          > row        > .folder > grid { background-image:-gtk-icontheme("folder-symbolic"); }
                                   .keys-list          > row:active > .folder > grid { background-image:-gtk-icontheme("folder-open-symbolic"); }

/* visual padding */
                                   .keys-list:dir(ltr) > row > .key    > grid { padding-left: 10px; padding-right:20px; } /* looks cool */
                                   .keys-list:dir(rtl) > row > .key    > grid { padding-right:10px; padding-left: 20px; }
                                   .keys-list          > row > .key    > grid { transition:padding-left 0.3s, padding-right 0.3s; }

                                   .keys-list:dir(ltr) > row > .folder > grid { background-position:            0.75rem  center; }
                                   .keys-list:dir(rtl) > row > .folder > grid { background-position:calc(100% - 0.75rem) center; }

                                   .keys-list:dir(ltr) > row > .key    > grid > :last-child { margin-left: 4em; }
                                   .keys-list:dir(rtl) > row > .key    > grid > :last-child { margin-right:4em; }

/* icon sizing */
                                   .keys-list          > row > .folder > grid { background-size:1.5rem; }
             .small-keys-list-rows .keys-list          > row > .folder > grid { background-size:1rem; }

/* technical padding: icon visual padding + icon size + some padding */
                                   .keys-list:dir(ltr) > row > .folder > grid,
                                   .keys-list:dir(ltr) > row > .key    > grid { padding-left:  3rem; }

             .small-keys-list-rows .keys-list:dir(ltr) > row > .folder > grid,
             .small-keys-list-rows .keys-list:dir(ltr) > row > .key    > grid { padding-left:  2.25rem; }

                                   .keys-list:dir(rtl) > row > .folder > grid,
                                   .keys-list:dir(rtl) > row > .key    > grid { padding-right: 3rem; }
             .small-keys-list-rows .keys-list:dir(rtl) > row > .folder > grid,
             .small-keys-list-rows .keys-list:dir(rtl) > row > .key    > grid { padding-right: 2.25rem; }

/* technical labels placing */
                                   .keys-list          > row                   label.key-name { transition:min-width 0.3s; }
                                   .keys-list          > row > .key    > grid  label.key-name { min-width:     222px; }
                                   .keys-list          > row > .folder > grid  label.key-name { min-width:calc(222px + 10px - 3rem); }
             .small-keys-list-rows .keys-list          > row > .folder > grid  label.key-name { min-width:calc(222px + 10px - 2.25rem); }

.large-window                      .keys-list          > row > .key    > grid  label.key-name { min-width:     250px; }
.large-window                      .keys-list          > row > .folder > grid  label.key-name { min-width:calc(250px + 10px - 3rem); }
.large-window.small-keys-list-rows .keys-list          > row > .folder > grid  label.key-name { min-width:calc(250px + 10px - 2.25rem); }

/* grid spacing and padding-end */
                                   .keys-list:dir(ltr) > row  grid > label { padding-right: 0.5em; }
                                   .keys-list:dir(rtl) > row  grid > label { padding-left:  0.5em; }

/* key icons */

                                   .keys-list          > row > .key         { transition:background-position 0.3s,
                                                                                         background-size     0.3s;
                                                                              background-repeat:no-repeat;
                                                                              background-size:1.5rem; }
             .small-keys-list-rows .keys-list          > row > .key         { background-size:1rem; }

                                   .keys-list:dir(ltr) > row > .key         { background-position:            0.75rem  center; }
                                   .keys-list:dir(rtl) > row > .key         { background-position:calc(100% - 0.75rem) center; }
             .small-keys-list-rows .keys-list:dir(ltr) > row > .key         { background-position:            0.75rem  center; }
             .small-keys-list-rows .keys-list:dir(rtl) > row > .key         { background-position:calc(100% - 0.75rem) center; }

/* icons */
.keys-list > row >                       .key.delayed,
.keys-list > row >             .dconf-key.key.delayed,
.keys-list > row >  .edited.gsettings-key.key.delayed          { background-image:-gtk-icontheme("document-open-recent-symbolic"); }

.keys-list > row >         .gsettings-key.key.delayed.conflict,
.keys-list > row >  .edited.gsettings-key.key.delayed.conflict { background-image:-gtk-icontheme("document-open-recent-symbolic"); }

.keys-list > row >         .gsettings-key.key.conflict,
.keys-list > row >  .edited.gsettings-key.key.conflict         { background-image:-gtk-icontheme("dialog-warning-symbolic"); }
.keys-list > row >         .gsettings-key.key.hard-conflict,
.keys-list > row >  .edited.gsettings-key.key.hard-conflict    { background-image:-gtk-icontheme("dialog-error-symbolic"); }

.keys-list > row >  .edited.gsettings-key.key                  { background-image:-gtk-icontheme("document-edit-symbolic"); }

.keys-list > row >             .dconf-key.key                  { background-image:-gtk-icontheme("dialog-question-symbolic"); }
.keys-list > row >       .erase.dconf-key.key.delayed          { background-image:-gtk-icontheme("user-trash-symbolic"); }
.keys-list > row >       .erase.dconf-key.key                  { background-image:-gtk-icontheme("action-unavailable-symbolic"); }

.keys-list > row >       .erase.dconf-key.key:not(.delayed) label.key-value { font-style:italic; }

.keys-list > row > :not(.erase).dconf-key.key               label.key-name,
.keys-list > row >       .erase.dconf-key.key.delayed       label.key-name,
.keys-list > row >  .edited.gsettings-key.key               label.key-name  { font-weight:bold; }

/*\
* * pathbar
\*/

.root-button > label {
  background-image:-gtk-icontheme("ca.desrt.dconf-editor-symbolic");
  background-position:center;
  background-size:1.1rem;
  background-repeat:no-repeat;
  min-width:1.1rem;
}

.pathbar {
  margin:0 4px;
}

.pathbar > label {
  padding-left:0.1em;
  padding-right:0.1em;
  color:alpha(currentColor,0.8);
}
.pathbar > label:backdrop {
  color:alpha(currentColor,0.9);
}

.pathbar > button {
  padding-left:0.1em;
  padding-right:0.1em;
  margin-left:0.1em;
  margin-right:0.1em;

  outline-offset:0;

  border:none;
  border-color:transparent;
  box-shadow:none;
  background:none;
  background-color:transparent;
  color:currentColor;
}

/* underline selected label */
.pathbar > button > .item {
  border-width:2px 0px;
  border-style:solid;
  border-color:transparent;
  transition:border-bottom-color 0.3s;
}

.pathbar > button:hover > .item {
  border-bottom-color:alpha(currentColor,0.5);
}

.pathbar          > button.active       > .item,
.pathbar          > button.active:hover > .item {
  border-bottom-color:@theme_selected_bg_color;
}

/* inexistent items */
.pathbar > label,
.pathbar > button.inexistent > label.item {
  color:@insensitive_fg_color;
}

.pathbar > button.inexistent:hover > label.item {
  border-bottom-color:transparent;
}

/* search changes */
.pathbar.greyed-pathbar {
  color:@insensitive_fg_color;
}

.pathbar.greyed-pathbar          > button.active       > .item,
.pathbar.greyed-pathbar          > button.active:hover > .item {
  border-bottom-color:alpha(currentColor,0.6);
}

.pathbar.greyed-pathbar:backdrop > button.active       > .item,
.pathbar.greyed-pathbar:backdrop > button.active:hover > .item {
  border-bottom-color:alpha(currentColor,0.4);
}

/*\
* * lists headers
\*/

.header-label { margin:0.45em 0.75em 0.2em; font-weight:bold; }

/*\
* * properties list
\*/

/* cool list background and padding */
            list.properties-list {
  background-color:initial;
  padding:0.3em 0;
}

            list.properties-list          > row {
  padding:0;
}

/* rows usual height */
            list.properties-list          > row > grid > label {
  min-height:1.5rem;
  padding-top:0.6rem;
  padding-bottom:0.6rem;
  transition:padding-top 0.3s, padding-bottom 0.3s;
}
.small-rows list.properties-list          > row > grid > label {
  padding-top:0.3rem;
  padding-bottom:0.3rem;
}

/* rows content placement */
            list.properties-list          > row > grid > :first-child {
  min-width:12.5rem;
}
            list.properties-list:dir(ltr) > row > grid > label { padding-right:1em; }
            list.properties-list:dir(rtl) > row > grid > label { padding-left:1em; }

/* key-editor-child properties */

.key-editor-child-array {
  min-height:10em;
}

.key-editor-child-array textview.view {
  padding:0.2em 0.3em;
}

.key-editor-child-array:dir(ltr),
.key-editor-child-entry:dir(ltr) {
  margin-right:1em;
}
.key-editor-child-array:dir(rtl),
.key-editor-child-entry:dir(rtl) {
  margin-left:1em;
}

/*\
* * text formating
\*/

.italic-label {
  font-style:italic;
}

.greyed-label {
  color:@theme_fg_color;
}
.greyed-label:backdrop {
  color:@theme_unfocused_fg_color;
}
.greyed-label:disabled {
  color:@insensitive_fg_color;
}
.greyed-label:disabled:backdrop {
  color:@unfocused_insensitive_color;
}

.warning-label {
  margin-right:8em;
  margin-left:8em;
}

.big-popover {
  font-size:144%;
}
