QMainWindow {
    color: #[foreground];
    background-color: #[background];
}

QMainWindow::separator {
    background-color: #[background_dim];
    width: 3px;
}

QMainWindow::separator:hover {
    background-color: #[highlight_dim];
    width: 3px;
}

QWidget {
    background-color: #[background];
    color: #[foreground];
}

QWidget[emphasized="true"] {
    background-color: #[highlight_dim];
}

QWidget[emphasized="true"] > QFrame {
    background-color: #[highlight_dim];
}

QWidget:!enabled {
    background-color: #[background];
    color: #[foreground_dim];
}

QFrame:!enabled {
    background-color: #[background];
    color: #[foreground_dim];
    border-color: #[foreground_dim];
}

/* QPushButton */

QPushButton {
    background-color: #[background_dim];
    color: #[foreground];
    border-radius: 2px;
    padding: 4px;
    border: 0px;
}

QPushButton:hover {
    background-color: #[highlight_dim];
}

QPushButton:pressed {
    background-color: #[highlight_strong];
}

QPushButton:checked {
    background-color: #[highlight_strong];
}

QPushButton:disabled {
    background-color: #[background];
    color: #[foreground_dim];
    border-radius: 2px;
    padding: 4px;
    border: 0px;
}

QPushButton#profileButton {
    background-color: #[background];
    color:: #[foreground_dim];
    margin: 1px;
}
QPushButton#profileButton:hover {
    background-color: #[highlight_dim];
}

QPushButton#profileButton:pressed {
    background-color: #[highlight_strong];
}

_QSliderButton {
    background-color: #[background];
    padding: 1px;
    margin: 0px;
}

QCollapsible > QPushButton {
    color: #[foreground];
    background-color: #[background];
}

QCollapsible > QPushButton:hover {
    background-color: #[background];
}

QCollapsible > QPushButton:pressed {
    background-color: #[background];
}

QCollapsible > QPushButton:checked {
    background-color: #[background];
}

/* ----- QSpinBox ----- */

QSpinBox {
    border: 1px solid #[foreground_dim];
    border-radius: 4px;
    background-color: #[background];
    color: #[foreground];
    padding: 1px;
}

/* ----- Qt6 needs these styles ----- */
QSpinBox::down-button  {
    subcontrol-position: bottom right;
}

QSpinBox::up-button  {
    subcontrol-position: top right;
}

/* ----- QComboBox ----- */

QComboBox {
    border: 1px solid #[foreground_dim];
    border-radius: 4px;
    background-color: #[background];
    color: #[foreground];
    padding: 1px;
}

QSearchableComboBox {
    border: 1px solid #[foreground_dim];
    border-radius: 4px;
    background-color: #[background];
    color: #[foreground];
    padding: 1px;
}

/* QScrollBar */

QScrollBar {
    border: none;
    border-radius: 2px;
    background: #[background_dim];
}

QScrollBar:horizontal {
    min-height: 6px;
    max-height: 10px;
    margin: 0px 2px;
}

QScrollBar:vertical {
    min-width: 6px;
    max-width: 10px;
    margin: 2px 0px;
}

QScrollBar::handle {
    background: #[highlight_dim];
    border-radius: 5px;
    border: 1px solid #[highlight_strong];
}

QScrollBar::handle:hover {
    background: #[highlight_strong];
    border-radius: 5px;
    border: 1px solid #[highlight_strong];
}

QScrollBar::handle:horizontal {
    min-width: 26px;
}

QScrollBar::handle:vertical {
    min-height: 26px;
}

QScrollBar::add-line,
QScrollBar::sub-line {
    height: 0px;
    width: 0px;
    background-color: #[background_dim];
}

QScrollBar::add-page,
QScrollBar::sub-page {
    height: 0px;
    width: 0px;
    background-color: #[background_dim];
}


/* ----------------- QSlider ------------------ */


QSlider {
   background-color: none;
}

QSlider::groove:horizontal {
   border: 0px;
   background-color: #[background_dim];
   height: 6px;
   border-radius: 2px;
}

QSlider::groove:vertical {
   border: 0px;
   background-color: #[background_dim];
   width: 6px;
   border-radius: 2px;
}

QSlider::handle:horizontal {
   background-color: #[highlight];
   border: 0px;
   width: 16px;
   margin-top: -5px;
   margin-bottom: -5px;
   border-radius: 8px;
}

QSlider::handle:vertical {
   background-color: #[highlight];
   border: 0px;
   height: 16px;
   margin-left: -5px;
   margin-right: -5px;
   border-radius: 8px;
}

QSlider::handle:hover {
   background-color: #[highlight_strong];
}

/* ----------------- QToolBar ------------------ */

QToolBar {
    border-bottom: 1px solid #[foreground_dim];
    background-color: #[background];
    color: #[foreground];
    margin: 1px;
    padding: 1px;
}

QMenuBar > QToolBar {
    border: 0px;
    background-color: #[background];
    color: #[foreground];
    margin: 0px;
    padding: 0px;
}

QToolButton {
    border: none;
    border-radius: 4px;
    padding: 2px;
    background-color: #[background];
    color: #[foreground];
}

QToolButton:hover {
    border: 2px solid lightgray;
    border-radius: 4px;
    padding: 2px;
    background-color: #[highlight_dim];
    color: #[foreground];
}

QToolButton:checked {
    border: 1px solid lightgray;
    border-radius: 4px;
    padding: 2px;
    background-color: #[highlight_dim];
    color: #[foreground];
}

/* Text including QtConsole */
QPlainTextEdit, QTextEdit {
    background-color: #[background];
    background-clip: padding;
    color: #[foreground];
    min-height: 35px;
    padding: 2px;
    border-radius: 2px;
    border: 1px solid #[highlight_strong];
    selection-background-color: #[highlight_strong];
}
.inverted {
    background-color: #[highlight_dim];
    color: #[background];
}
.error { color: red; }
.in-prompt-number { font-weight: bold; }
.out-prompt-number { font-weight: bold; }
.in-prompt { color: #[base_color]; }
.out-prompt { color: #[base_color]; }

/* the area behind the scrollbar */
QTextEdit > QWidget {
    background-color: #[background];
}

QPlainTextEdit > QWidget {
    background-color: #[background];
}

QAbstractItemView {
    background-color: #[background];
    color: #[foreground];
    border: 1px solid #[highlight_strong];
    border-radius: 2px;
    selection-background-color: #[highlight_dim];
}

QAbstractItemView:item:hover {
    background-color: #[highlight_dim];
    color: #[foreground];
}

QAbstractItemView:item:selected {
    background-color: #[highlight_dim];
    color: #[foreground];
}

/* ----------------- QMenuBar ------------------ */

QMenuBar {
    border-bottom: 1px solid #[foreground_dim];
}

QMenuBar::item {
    margin: 1px;
    border-radius: 4px;
    padding-top: 4px;
    padding-bottom: 4px;
    padding-left: 7px;
    padding-right: 7px;
}

QMenuBar::item:selected {
   background-color: #[highlight_dim];
}

QMenu {
    border: 1px solid gray;
}

QMenu::item:hover {
    background-color: #[highlight_dim];
}

QMenu::item:selected {
    background-color: #[highlight_dim];
}

QMenu:!enabled {
    color: gray;
}

/* ----------------- other builtins ------------------ */
QStatusBar::item{
    border: none;
}

QLabel {
    background-color: none;
}

QLabel#indexLabel {
    color: gray;
}

QLineEdit {
    background-color: #[background_dim];
    color: #[foreground];
    min-height: 16px;
    padding: 1px;
    border-radius: 2px;
    selection-color: #[foreground];
    selection-background-color: #[highlight_strong];
}

QLineEdit:hover {
    border-bottom: 2px solid #[highlight_dim];
}

QKeySequenceEdit {
    background-color: #[background_dim];
    color: #[foreground];
    min-height: 16px;
    padding: 1px;
    border-radius: 1px;
    selection-color: #[foreground];
    selection-background-color: #[highlight_strong];
}

QGroupBox {
    border: 1px solid #[highlight_dim];
    border-radius: 2px;
    margin-top: 1ex;
    background-color: #[background];
    color: #[foreground];
}

QGroupBox::title {
    subcontrol-origin: margin;
    subcontrol-position: top left;
    left: 5px;
    background-color: #[background];
    color: #[base_color];
}

QRadioButton {
    background: none;
}

QProgressBar {
    border: 1px solid #[highlight_dim];
    border-radius: 2px;
    background-color: #[background];
    color: #[foreground];
    text-align: center;
}

QProgressBar::chunk {
    background-color: #[highlight_dim];
    width: 20px;
}

QToolTip {
    background-color: #[background];
    color: #[foreground];
    padding: 1px;
    border-radius: 2px;
}

/* ----------------- QTabWidget ------------------ */


QTabWidget {
    background-color: #[background];
    color: #[foreground];
    padding: 0px;
}

QTabWidget::pane {
    border: 1px solid #[background_dim];
    background-color: #[background];
    top: -1px;
}

/* In MacOS, the positions of tabs are centered. */
QTabWidget::tab-bar {
    left: 0;
    background-color: #[background];
    color: #[highlight_dim];
}

QTabBar::tab:top {
    border: 1px solid #[foreground_dim];
    border-bottom: 0px;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    padding: 3px 6px;
    height: 10px;
    margin-top: 4px;
    background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #[background_dim], stop:1 #[background]);
    color: #[foreground];
}

QTabBar::tab:top:hover {
    height: 12px;
    margin-top: 2px;
    background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #[background_dim], stop:1 #[highlight_strong]);
    color: #[foreground];
}

QTabBar::tab:top:selected {
    height: 14px;
    margin-top: 0px;
    background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #[highlight_strong], stop:1 #[highlight_dim]);
    color: #[foreground];
}

QTabBar::tab:bottom {
    border: 1px solid #[foreground_dim];
    border-top: 0px;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
    padding: 3px 6px;
    height: 10px;
    margin-bottom: 4px;
    background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #[background_strong], stop:1 #[background_dim]);
    color: #[foreground];
}

QTabBar::tab:bottom:hover {
    height: 12px;
    margin-bottom: 2px;
    background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #[highlight_dim], stop:1 #[background_dim]);
    color: #[foreground];
}

QTabBar::tab:bottom:selected {
    height: 14px;
    margin-bottom: 0px;
    background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #[highlight_strong], stop:1 #[highlight_dim]);
    color: #[foreground];
}

/* ----------------- QTableView / QHeaderView ----------------- */

QHeaderView {
    border: none;
}

QHeaderView:section {
    border: 1px solid #[foreground_dim];
    background-color: #[highlight];
    color: #[foreground];
    margin: 0px;
}

QHeaderView:section:hover {
    border: 1px solid #[foreground_dim];
    background-color: #[highlight_strong];
    color: #[foreground];
}

QHeaderView:section:checked {
    border: 1px solid #[foreground_dim];
    background-color: #[highlight_strong];
    color: #[foreground];
}

QTableView {
    border: 1px solid gray;
    background-color: #[background];
    color: #[foreground];
    gridline-color: #[foreground_dim];
}

QTableView
QTableCornerButton::section {  /* the top left corner button */
    background-color: #[highlight_dim];
}

QTableView:focus {
    border: 2px solid gray;
    background-color: #[background];
    color: #[foreground];
}

QTableView:item:hover {
    background-color: #[highlight_dim];
    color: #[foreground];
}

QTableView:item:focus {
    background-color: #[highlight_dim];
    color: #[foreground];
}

QTableView:item:selected {
    background-color: #[highlight_dim];
    color: #[foreground];
}

QTableView:item:checked {
    background-color: #[highlight_dim];
    color: #[foreground];
}

/* ----------------- QGraphicsXX ----------------- */
QGraphicsView {
    background-color: #[background];
}

/* ----------------- others ------------------ */

QMdiArea {
    qproperty-background: #[background_dim];
}

QSubWindow {
    background-color: #[background_dim];
}

QSubWindowTitleBar[isCurrent=false] {
    background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #[background], stop:1 #[background_dim]);
}

QSubWindowTitleBar[isCurrent=true] {
    background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #[highlight_strong], stop:1 #[background_dim]);
}

QTitleBarToolButton:hover {
    border: 1px solid #[highlight_dim];
    border-radius: 3px;
}

QCommandLabel:hover {
    background-color: #[highlight_dim];
    color: #[foreground];
}

QClickableLabel {
    color: #[base_color];
}

QToggleSwitch {
    qproperty-onColor: #[highlight_strong];
    qproperty-offColor: #[background_dim];
    qproperty-handleColor: #[background_dim];
}

QTitleBarToolButton {
    background-color: transparent;
}

QDockWidgetTitleFrame {
    border: 0px;
    border-bottom: 1px solid #[foreground_dim];
    background-color: none;
}

QCloseTabToolButton {
    color: transparent;
    background-color: transparent;
    margin: 0px;
}

QCloseTabToolButton:hover {
    color: #[foreground_dim];
    border: 1px solid #[foreground_dim];
    border-radius: 4px;
    margin: 0px;
    padding: 1px;
}

QSelectionRangeEdit {
    margin: 0px;
}

QIntLineEdit#TableIndex {
    background-color: #[background];
}

_QHistogram {
    border: 1px solid #[foreground_dim];
}

QToolButton#QCommandHistory-RunButton {
    background-color: transparent;
    margin: 0px;
}

QToolButton#QCommandHistory-RunButton:hover {
    background-color: transparent;
    margin: 0px;
    padding: 1px;
}

NavigationToolbar2QT {
    border: none;
}

_QOverlayBase {
    border: 2px solid #[highlight_dim];
    border-radius: 6px;
    background-color: #[background];
}

QColorSwatch {
    border: 1px solid #[foreground_dim];
}

QDrawCanvas {
    background-color: #[background_dim];
}

QTableBase {
    qproperty-selectionColor: #[base_color];
}

QWorkflowTree {
    qproperty-selectionColor: #[base_color];
}

QCircularProgressBar {
    qproperty-color: #[highlight];
    qproperty-grooveColor: #[background_dim];
}

QModelDrop {
    border-radius: 8px;
}

QChannelToggleSwitch {
    qproperty-handleSize: 14;
    qproperty-offColor: #[background_dim];
}
