/*
 * options.css: options page style-sheet for Epichrome Runtime extension
 * Copyright (C) 2022 David Marmor.
 *
 * https://github.com/dmarmor/epichrome
 *
 * Full license at: http://www.gnu.org/licenses/ (V3,6/29/2007)
 *
 * This program 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.
 *
 * This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
 */


/* OVERALL STYLES */

body {
    padding: 0;
    margin: 0;
}

.invisible {
    display: none;
}

button {
    cursor: pointer;
}


/* HEADER - TITLE */

#title {
    height: 65px;
    top: 0;
    width: 100%;
    position: fixed;
    background-color: #d3d3d3;
    z-index: 1000;
}
#title img {
    position: absolute;
    left: 30px;
    top: 30px;
    transform: translate(0, -50%);
}
#title h1 {
    margin: 0;
    padding: 0;
    position: absolute;
    left: 90px;
    top: 30px;
    transform: translate(0, -50%);
}


/* HEADER - WORKING BAR */

#working {
    height: 5px;
    width: 100%;
    position: absolute;
    top: 60px;
    opacity: 0;
    transition: opacity .5s;
    /* (rainbow) background: repeating-linear-gradient(90deg, #ff2400, #e81d1d, #e8b71d, #e3e81d, #1de840, #1ddde8, #2b1de8, #dd00f3, #dd00f3, #ff2400); */
    background: repeating-linear-gradient(90deg, rgba(59,152,252,1), rgba(59,152,252,0.2), rgba(59,152,252,1));
    background-size: 400px 100%;
    animation-name: working;
    animation-duration: 5s;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
}
@keyframes working {
    0%{background-position:0% 0%}
    100%{background-position:1600px 0%}
}
.working #working {
    opacity: 1;
}


/* HEADER - BUTTON BAR */

#button_bar {
    vertical-align: middle;
    position: fixed;
    z-index: 999;
    width: 100%;
    top: 65px;
    transition: top .2s;
    box-shadow: 0 4px 23px 5px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(0,0,0,0.15);
    background-color: #f0f0f0;
}
.working #button_bar {
    top: 10px;
}
#button_bar.unsaved {
    background-color: #ff9a9a;
    transition: background-color 600ms ease-out, top .2s ease;
}

#button_bar button {
    display: inline-block;
    position: relative;
    margin-right: .75em;
}
#button_bar>div {
    position: relative;
    padding-right: 50px;
    padding-left: 50px;
    margin: 0;
}

/* import/export bar */
#importexport_bar {
    display: block;
    height: 50px;
}

#reset_button {
    margin-left: 1.5em;
}
.unsaved #importexport_bar, .dialog #importexport_bar {
    display: none;
}

/* save bar */
#save_bar {
    display: none;
    height: 50px;
}
.unsaved #save_bar {
    display: block;
}
.flash #save_bar {
    transition: none;
}

.dialog #save_bar {
    display: none;
}
#save_bar div {
    font-size: 110%;
    height: auto;
    display: inline-block;
    position: relative;
    vertical-align: top;
    margin: 0 0 0 15px;
    padding: 0;
    top: 50%;
    transform: translate(0, -50%);
}

/* import/export & save bars */
#save_bar button, #importexport_bar button {
    top: 50%;
    transform: translate(0, -50%);
}


/* HEADER - DIALOG BAR */

#dialog_bar {
    padding-top: 1.5em;
    padding-bottom: 1.5em;
    background: white;
    color: #333;
    display: none;
}
.dialog #dialog_bar {
    display: block;
}

#dialog_content {
    padding: 0;
}
#dialog_bar h3 {
    margin: 0;
    padding-bottom: 1em;
    border-bottom: 1px solid #d3d3d3;
}
#dialog_bar .content p {
    line-height: 150%;
}
#dialog_bar button {
    margin-top: .5em;
    display: none;
}
#dialog_bar button.active {
    display: inline-block;
}


/* DIALOG BAR CONTENT */

/* text content */
#text_content {
    margin-top: 1em;
    margin-bottom: 1em;
}

/* installation message */
#install_content {
    font-size: 110%;
    display: none;
}
#dialog_bar.install #install_content {
    display: block;
}

#install_content li {
    font-style: italic;
    margin-bottom: 1em;
}

/* shutdown message */
#shutdown_content {
    /* margin-top: 1em; */
    padding-bottom: .5em;
    display: none;
}
#dialog_bar.shutdown #shutdown_content {
    display: block;
}
#dialog_bar.shutdown #text_content {
    font-size: 110%;
    font-weight: bold;
}
#shutdown_help {
    margin: 0;
}
#nohost_message {
    font-style: italic;
    display: none;
}
#dialog_bar.nohost #nohost_message {
    display: block;
}
#nohost_message em {
    text-decoration: underline;
}

#nohost_prefix,#dialog_bar.nohost #host_prefix {
    display: none;
}
#dialog_bar.nohost #nohost_prefix,#host_prefix {
    display: inline;
}


/* MAIN FORM CONTAINER */

#container {
    margin-left: 50px;
    margin-top: 135px;
    width: 502px;
    position: absolute;
}


/* FORM OVERLAY */

#overlay {
    position: relative;
    background-color: #ffffff;
    z-index: 2;
    display: none;
}
.dialog #overlay {
    display: block;
    opacity: .75;
}
.working #overlay {
    display: block;
    opacity: 0;
}


/* OPTIONS FORM */

#options_form {
    position: absolute;
    z-index: 1;
    left: 0;
    top: 0;
    margin-bottom: 1.5em;
}

/* overall form elements */
.section-header {
    margin-top: 0;
    text-decoration: underline;
}
.subsection-header {
    margin-top: 2em;
    font-weight: bold;
}
.divider {
    width:100%;
    margin-top: 2em;
    margin-bottom: 2em;
    border-bottom: 1px solid #d3d3d3;
}

/* checkboxes */
.checkbox {
    display: block;
    margin-top: 1.5em;
}
input[type="checkbox"] {
    margin-right: .5em;
    display: inline-block;
    vertical-align: top;
}
.checkbox-text {
    display: inline-block;
    width: 90%;
}


/* RULES */

/* scroll box */
#rules_scroll {
    width: 500px;
    height: 159px;
    overflow-y: scroll;
    margin-bottom: 1em;
    border: 1px solid #C1C1C1
}
.advanced #rules_scroll {
    width: 630px;
}

/* rules list */
ul.rules-list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.rule {
    position: relative;
    vertical-align: middle;
    margin: 7px 0;
}

/* general rule field styles */
.rule-element,.rule-header-element {
    margin: 0 5px 0 0;
    display: inline-block;
}
.rule-header-element {
    font-style: italic;
    vertical-align: bottom;
}
.rule-element {
    vertical-align: middle;
}

/* drag handle */
.drag-handle-box {
    width: 16px;
    height: 12px;
    margin-left: 5px;
    display: inline-block;
}
.drag-handle {
    stroke: #C1C1C1;
    fill:none;
    stroke-width:2;
    stroke-linecap:round;
    cursor: move;
    cursor: -webkit-grabbing;  /* overrides 'move' */
}
.drag-handle:hover {
    stroke: #7D7D7D;
}

/* pattern text box */
.pattern {
    width: 160px;
}

/* target drop-down */
.target {
    width: 90px;
}
#options_form:not(.advanced) .target,.classPattern {
    margin-right: 10px;
}

/* class text box */
.classPattern {
    width: 120px;
    display: none;
}
.advanced .classPattern {
    display: inline-block;
}

/* per-row add and delete buttons */
.add-delete {
    display: inline-block;
    width: 55px;
    margin-left: 20px;
    margin-right: 0;
}
.delete-button, .add-after-button {
    padding: 0;
    fill: #C1C1C1;
    -webkit-transition: opacity .2s;
    transition: opacity .2s;
    opacity: 0;
    cursor: pointer;
    position: relative;
}
.rule:hover .delete-button, .rule:hover .add-after-button {
    opacity: 1;
}
.delete-button:hover {
    fill: #BF0000;
}
.add-after-button:hover {
    fill: #00BF00;
}
.add-after-button {
    margin-right: 5px;
}

/* empty-list add button */
#add_button {
    color: #C1C1C1;
    cursor: pointer;
}
#add_button:hover {
    color: #7D7D7D;
}


/* OTHER OPTIONS */
.redirectByDefault {
    margin-left: .5em;
}
