/*
Midnight theme

Created by Pete Vickerstaff

THIS FILE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THIS FILE OR THE USE OR OTHER DEALINGS IN THIS FILE.

Updates------
v1 - 01/02/21 - Fix for Version and Units text background display in FlexPainter dialog.
v2 - 24/02/21 - Checkbox and Radio button icons revised
                Tab bar and Tabs improvements.
                General graphical and colour improvements.
                Added a ToolButton checked state for on/off tool buttons
                 in the Reset, Options and Snap toolbars, possibly other locations.
v3 - 16/03/21 - Move  all the bottom tabs right so first tab is not floating.
                Tooltips section removed.
v4 - 27/11/21 - min-width: 90px added to QComboBox section to fix some single character
                width comobo box lists width.
                
*/

/*-----QWidget-----*/
QWidget
{
    background-color: #353535;
    color: #f2f2f2;
    selection-background-color: #2A82DA;
    selection-color: #f2f2f2;
}

QDockWidget, QDockWidget:title
{
    font-weight: bold;
}


/*-----QLabel-----*/
QLabel
{
    background-color: transparent;
    color: #f2f2f2;
}

QLabel::disabled
{
    background-color: transparent;
    color: #737373;
}

/*-----QMenu-----*/
QMenuBar {
    background-color: #353535;
    color: #f2f2f2;
}

QMenuBar:item:selected {
    background: #2A82DA;
    color: #f2f2f2;
}

QMenu
{
    background-color: #353535;
    color: #f2f2f2;
}

QMenu::item:selected
{
    background-color: #2A82DA;
    color: #f2f2f2;

}

QMenu::item:disabled
{
    color: #a6a6a6;
}



/* Current tool icon in options tool bar */
QToolBar#Options QLabel#Icon {
    background-color: qlineargradient(x1:1, y1:0, x2:1, y2:1, stop:0 #595959,stop:1 #a6a6a6);
    border: 1px outset #808080;
    border-radius: 6px;
}

/* Tool bar button icons in options tool bar */
QToolBar QToolButton {
    background-color: qlineargradient(x1:1, y1:0, x2:1, y2:1, stop:0 #595959,stop:1 #a6a6a6);
    border: 1px outset #808080;
    border-radius: 5px;
}


/*-----QToolButton-----*/
QToolButton
{
    background-color: qlineargradient(x1:1, y1:0, x2:1, y2:1, stop:0 #595959,stop:1 #a6a6a6);
    border: 1px outset #808080;
    border-radius: 5px;
}

QToolButton::disabled
{
    background-color: #737373;
    border: 1px solid #8c8c8c;
}

QToolButton::hover
{
    background-color: qlineargradient(x1:1, y1:0, x2:1, y2:1, stop:0 #a6a6a6,stop:1 #595959);
    border: 1px inset #808080;
}

/* checked state for on/off toolbar buttons */
QToolButton::checked {
    background-color: #666666;
    border: 1px inset #308CC6;
}

QToolButton::pressed
{
    background-color: qlineargradient(x1:1, y1:0, x2:1, y2:1, stop:0 #595959,stop:1 #a6a6a6);
    border: 2px inset #808080;
}

/*-----QPushButton-----*/
QPushButton
{
    background-color: qlineargradient(x1:1, y1:0, x2:1, y2:1, stop:0 #0d0d0d,stop:1 #a6a6a6);
    border: 1px outset #808080;
    border-radius: 5px;
    padding: 3px;
    min-width: 6em;
}

QPushButton::disabled
{
    background-color: #8c8c8c;
    color: #f1ddcf;
    border-color: #8c8c8c;
}

QPushButton::hover
{
    background-color: qlineargradient(x1:1, y1:0, x2:1, y2:1, stop:0 #a6a6a6,stop:1 #0d0d0d);
    border: 1px inset #808080;
}

QPushButton:focus {
    background-color: qlineargradient(x1:1, y1:0.845, x2:1, y2:0, stop:0 #0d0d0d,stop:1 #a6a6a6);
    border: 1px inset #308CC6;
}

QPushButton::pressed
{
    background-color: qlineargradient(x1:1, y1:0, x2:1, y2:1, stop:0 #a6a6a6,stop:1 #0d0d0d);
    border: 2px inset #808080;
}


/*-----QLineEdit-----*/
QLineEdit
{
    background-color: #191919;
    color: #f2f2f2;
    border: 1px solid #a6a6a6;
    border-radius: 3px;
}

QLineEdit::disabled
{
    background-color: #737373;
    color: #f9f1eb;
    border: 1px solid #a6a6a6;
}

/*-----QTextEdit-----*/
QTextEdit
{
    background-color: #d9d9d9;
    color: #353535;
    border: 1px groove #a6a6a6;
    border-radius: 3px;
}

QTextEdit::disabled
{
    background-color: #737373;
    color: #f9f1eb;
    border: 1px solid darkgrey;
}

/*-----QComboBox-----*/
QComboBox
{
    background-color: qlineargradient(x1:1, y1:0, x2:1, y2:1, stop:0 #0d0d0d,stop:1 #a6a6a6);
    border: 1px solid #a6a6a6;
    border-radius: 3px;
    min-width: 90px;
}

QComboBox::disabled
{
    background-color: #737373;
    color: #f9f1eb;
    border-color: #a6a6a6;
}

QComboBox:hover
{
    background-color: qlineargradient(x1:1, y1:0, x2:1, y2:1, stop:0 #a6a6a6,stop:1 #0d0d0d);
    border-color: #768995;
}

QComboBox:on, QListView QAbstractItemView:on
{
    color: #0d0d0d;
}


QComboBox QAbstractItemView
{
    background-color: #8c8c8c;
    color: #1a1a1a;
    border: 1px solid #cccccc;
    border-radius: 3px;
    selection-background-color: #2A82DA;
    selection-color: #f2f2f2;
}


/*-----QGroupBox-----*/
QGroupBox
{
    background-color: #343434;
    margin-top: 20px;
    font-weight: bold;
    border: 1px solid #a6a6a6;
    border-radius: 3px;
}


QGroupBox::title
{
    subcontrol-origin: margin;
    subcontrol-position: top left;
    font-weight: bold;
}


QGroupBox::disabled
{
    border-color: #737373;
}

QGroupBox::title::disabled
{
    border-color: #737373;
    color: #898988;
}



/*-----QCheckBox-----*/
QCheckBox {
    background-color: #343434;
}

QCheckBox::disabled
{
    color: #898988;
}

QCheckBox::indicator:checked
{
    image:url(icons/checkbox-checked.png);
}

QCheckBox::indicator:unchecked
{
    image:url(icons/checkbox-unchecked.png);
}

QCheckBox::indicator:checked:hover
{
    image:url(icons/checkbox-checked-hover.png);
}

QCheckBox::indicator:unchecked:hover
{
    image:url(icons/checkbox-unchecked-hover.png);
}

QCheckBox::indicator:checked:disabled
{
    image:url(icons/checkbox-checked-disabled.png);
}

QCheckBox::indicator:unchecked:disabled
{
    image:url(icons/checkbox-unchecked-disabled.png);
}



/*-----QRadioButton-----*/
QRadioButton
{
    background-color: #343434;
}

QRadioButton::disabled
{
    color: #898988;
}

QRadioButton::indicator:checked
{
    image:url(icons/radio-checked.png);
}

QRadioButton::indicator:unchecked
{
    image:url(icons/radio-unchecked.png);
}

QRadioButton::indicator:checked:disabled
{
    image:url(icons/radio-checked-disabled.png);
}

QRadioButton::indicator:unchecked:disabled
{
    image:url(icons/radio-unchecked-disabled.png);
}

QRadioButton::indicator:checked:hover
{
    image:url(icons/radio-checked-hover.png);
}

QRadioButton::indicator:unchecked:hover
{
    image:url(icons/radio-unchecked-hover.png);
}



/*-----QStatusBar-----*/
QStatusBar
{
    border: 1px solid #a6a6a6;
    border-radius: 3px;
}

QStatusBar::item {
    border-width: 0px;
}


/*-----QScrollBar-----*/
/*---Vertical---*/
QScrollBar:vertical
{
    background-color: #666666;
    width: 15px;
    margin: 18px 0 18px 0;
}

QScrollBar::handle:vertical
{
    background-color: #a6a6a6;
    border: 1px solid #d9d9d9;
    border-radius: 2px;
    min-height: 20px;
}

QScrollBar::add-line:vertical
{
    height: 18px;
    subcontrol-position: bottom;
    subcontrol-origin: margin;
}

QScrollBar::sub-line:vertical
{
    height: 18px;
    subcontrol-position: top;
    subcontrol-origin: margin;
}

/*---Horizontal---*/
QScrollBar:horizontal
{
    background-color: #666666;
    height: 15px;
    margin: 0px 18px 0 18px;
}


QScrollBar::handle:horizontal
{
    background-color: #a6a6a6;
    border: 1px solid #d9d9d9;
    border-radius: 2px;
    min-height: 20px;
}


QScrollBar::add-line:horizontal
{
    width: 18px;
    subcontrol-position: right;
    subcontrol-origin: margin;
}


QScrollBar::sub-line:horizontal
{
    width: 18px;
    subcontrol-position: left;
    subcontrol-origin: margin;
}


/* remove border from dockable widgets */
QWidget#PropertyEditor,
QWidget#ViewList,
QWidget#BlockList,
QWidget#EcmaScriptShell QFrame,
QWidget#LayerList,
QWidget#LayerListPro {
    border: 0px;
}

/* make sure certain elements still have a border */
QTreeView, QListView {
    alternate-background-color: #808080;
    border: 1px solid #a6a6a6;
    border-radius: 3px;
}


/* this breaks the layer list in Qt 6.11, possibly other Qt 6.x versions:
QTreeView::item:hover {
    background: #2A82DA;
    color: #f2f2f2;
}
*/

QTreeView#ToolMatrix {
    background-color: #808080;
    color: #fff;
}

/* border in Application Preferences>General>Tool Settings */
QTabWidget::pane {
    top: -1px;
    border: 1px solid #a6a6a6;
}

QTabWidget::pane:disabled {
    top: -1px;
    border: 1px solid #737373;
}

QTabBar::tab:top:disabled,
QTabBar::tab:top:!selected:disabled {
    border-left: 1px solid #737373;
    border-top: 1px solid #737373;
    border-right: 1px solid #737373;
    color: #898988;
}


/* move all the vertical tabs down so first tab is not floating */
QTabBar::tab:first:left,
QTabBar::tab:first:right {
    margin-top: 40px;
}

/* move all the bottom tabs right so first tab is not floating */
QTabBar::tab:first:bottom {
    margin-left: 10px;
}


/* VERTICAL LEFT TABS */
QTabBar::tab:left {
    border-left: 1px solid #a6a6a6;
    border-top: 1px solid #a6a6a6;
    border-bottom: 1px solid #a6a6a6;
    padding: 12px 3px;
    color: #f2f2f2;
    background: #353535;
    border-bottom-left-radius: 3px;
    border-top-left-radius: 3px;
    margin-right: 1px;
}

QTabBar::tab:left:!selected {
    border-left: 1px solid #999999;
    border-top: 1px solid #999999;
    border-bottom: 1px solid #999999;
    margin-left: 3px;
    padding: 12px 3px;
    color: #b3b3b3;
    background: #737373;
    background-color: qlineargradient(y1:1, x1:0, y2:1, x2:1, stop:0 #737373,stop:1 #353535);
}

QTabBar::tab:left:!selected:hover {
    border-left: 1px solid #a6a6a6;
    border-top: 1px solid #a6a6a6;
    border-bottom: 1px solid #a6a6a6;
    color: #f2f2f2;
    font: italic;
    margin-left: 0px;
}

/* VERTICAL RIGHT TABS */
QTabBar::tab:right {
    border-right: 1px solid #a6a6a6;
    border-top: 1px solid #a6a6a6;
    border-bottom: 1px solid #a6a6a6;
    padding: 12px 3px;
    color: #f2f2f2;
    background: #353535;
    border-bottom-right-radius: 3px;
    border-top-right-radius: 3px;
    margin-left: 1px;
}

QTabBar::tab:right:!selected {
    border-right: 1px solid #999999;
    border-top: 1px solid #999999;
    border-bottom: 1px solid #999999;
    margin-right: 3px;
    padding: 12px 3px;
    color: #b3b3b3;
    background-color: qlineargradient(y1:1, x1:0, y2:1, x2:1, stop:0 #353535,stop:1 #737373);
}

QTabBar::tab:right:!selected:hover {
    border-right: 1px solid #a6a6a6;
    border-top: 1px solid #a6a6a6;
    border-bottom: 1px solid #a6a6a6;
    color: #f2f2f2;
    font: italic;
    margin-right: 0px;
}


/* HORIZONTAL TOP TABS */
QTabBar::tab:top {
    border-left: 1px solid #a6a6a6;
    border-top: 1px solid #a6a6a6;
    border-right: 1px solid #a6a6a6;
    padding: 3px;
    color: #f2f2f2;
    background: #353535;
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
}

QTabBar::tab:top:!selected {
    border-left: 1px solid #999999;
    border-top: 1px solid #999999;
    border-right: 1px solid #999999;
    margin-top: 3px;
    margin-bottom: -1px;
    padding: 3px;
    color: #b3b3b3;
    background-color: qlineargradient(x1:1, y1:0, x2:1, y2:1, stop:0 #737373,stop:1 #353535);
}

QTabBar::tab:top:!selected:hover {
    border-left: 1px solid #a6a6a6;
    border-top: 1px solid #a6a6a6;
    border-right: 1px solid #a6a6a6;
    color: #f2f2f2;
    font: italic;
    margin-top: 0px;
}


/* HORIZONTAL BOTTOM TABS */
QTabBar::tab:bottom {
    border-left: 1px solid #a6a6a6;
    border-bottom: 1px solid #a6a6a6;
    border-right: 1px solid #a6a6a6;
    padding: 3px;
    color: #f2f2f2;
    background: #353535;
    border-bottom-left-radius: 3px;
    border-bottom-right-radius: 3px;
    margin-top: 1px;
}

QTabBar::tab:bottom:!selected {
    border-left: 1px solid #999999;
    border-bottom: 1px solid #999999;
    border-right: 1px solid #999999;
    margin-bottom: 3px;
    padding: 3px;
    color: #b3b3b3;
    background-color: qlineargradient(x1:1, y1:0, x2:1, y2:1, stop:0 #353535,stop:1 #737373);
}

QTabBar::tab:bottom:!selected:hover {
    border-left: 1px solid #a6a6a6;
    border-bottom: 1px solid #a6a6a6;
    border-right: 1px solid #a6a6a6;
    color: #f2f2f2;
    font: italic;
    margin-bottom: 0px;
}


/* Fix for Version and Units text background display in FlexPainter dialog. */
QObject#FlexPainterDialog QLineEdit#lineEdit,
QObject#FlexPainterDialog QLineEdit#UnitsLabel
{
    padding: 0px;
    margin: 0px;
    border: 0px;
    border-style: none;
    background-color: transparent;
    color: #f2f2f2;
}
