/**
 * GENERAL CSS STYLE RULES
 */

/* *** QWidget ***
 * Base style for all QWidgets
 */

QWidget {
    /* font */
    font: 10pt "Gotham Rounded";
    color: rgb(227, 227, 227);

    /* brownish background color */
    background: rgb(56, 56, 56);
    selection-background-color: rgb(189, 155, 84);
}

/* Default disabled font color for all widgets */
QWidget:disabled {
    color: rgb(122, 122, 122);
}

/* *** QStatusBar ***
 * Font color for status bar
 */
QStatusBar {
    color: rgb(222, 158, 46)
}

/* *** QGroupBox ***
 * Base style for QGroupBox
 */
QGroupBox {
    border: 1px solid rgb(26, 26, 26); /* thin black border */
    border-radius: 5px; /* rounded */
    margin-top: 1ex; /* leave space at the top for the title */
}

/* Position to title of the QGroupBox */
QGroupBox::title {
    subcontrol-position: top center;
    subcontrol-origin: margin; /* vertical position */
    padding: 0px 3px; /* cover the border around the title */
}

/* *** QDoubleSpinBox ***
 * Base style for QDoubleSpinBox
 * This is the widget that allows users to select a value
 * and provides up/down arrows to adjust it.
 */
QDoubleSpinBox {
    background: rgb(34, 34, 34);
    padding: 2px;    /* make it a little bigger */
    border-radius: 7px;  /* make it very round like in presto */
    border-top: 2px solid rgb(19,19,19);   /* thick black border on top */
    border-left: 2px solid rgb(19,19,19);  /* and on the left */
}

/* Common style for the up and down buttons */
QDoubleSpinBox::up-button, QDoubleSpinBox::down-button {
    background: rgb(42, 42, 42);
    margin-right: -1px;  /* Move to the right a little */
}

/* Darken the background when button pressed down */
QDoubleSpinBox::up-button:pressed, QDoubleSpinBox::down-button:pressed {
    background: rgb(34, 34, 34);
}

/* Round the outside of the button like in presto */
QDoubleSpinBox::up-button {
    margin-top: -3px;  /* move higher to align */
    border-top-right-radius: 7px;
}

/* Round the outside of the button like in presto */
QDoubleSpinBox::down-button {
    margin-bottom: -3px;  /* move lower to align */
    border-bottom-right-radius: 7px;
}

/* Adjust size and color of both arrows (inside buttons) */
QDoubleSpinBox::up-arrow,
QDoubleSpinBox::down-arrow,
QComboBox::down-arrow {
    width: 6px;
    height: 3px;
    background: rgb(227, 227, 227);
}

/* Set the disabled color for the arrows */
QDoubleSpinBox::up-arrow:disabled,
QDoubleSpinBox::down-arrow:disabled,
QComboBox::down-arrow:disabled {
    background: rgb(88, 88, 88);
}

/* Shape the up arrow */
QDoubleSpinBox::up-arrow {
    border-top-right-radius: 3px;    /* round upper left and upper right */
    border-top-left-radius: 3px;    /* to form a triangle-ish shape */
    border-bottom: 1px solid rgb(122, 122, 122); /* decorative */
}


/* Shape the down arrow */
QDoubleSpinBox::down-arrow,
QComboBox::down-arrow{
    border-bottom-right-radius: 3px; /* round lower right and lower left */
    border-bottom-left-radius: 3px;  /* to form a triangle-ish shape */
    border-top: 1px solid rgb(122, 122, 122);    /* decorative */
}

/* *** QTextEdit ***
 * base style for QTextEdit
 */

/* font color for QTextEdit, QLineEdit and QDoubleSpinBox */
QTextEdit, QPlainTextEdit, QDoubleSpinBox, QlineEdit{
    color: rgb(227, 227, 227);
}


/* Border for QLineEdit as well as checkboxes and other widgets. */
QTextEdit, QPlainTextEdit, QLineEdit, QGraphicsView, Line{
    border: 2px solid rgb(47, 47, 47);
}

QCheckBox::indicator {
    border: 1px solid rgb(26, 26, 26);
}

/* Normal background for QLineEdit and checkboxes */
QLineEdit, QCheckBox::indicator {
    background: rgb(58, 58, 58);
    border-radius: 3px;
}

/* Disabled font color and background for QLineEdits */
QLineEdit:disabled, QSlider::groove:horizontal:disabled {
    background: rgb(50, 50, 50);
}

/* Orange border for QLineEdit and QCheckBox when focused/hovering */
QLineEdit:focus {
    border: 2px solid rgb(163, 135, 78);
}

QCheckBox::indicator:hover {
    border: 1px solid rgb(163, 135, 78);
}

/* *** QCheckBox ***
/* Make the checkbox orange when checked
 */
QCheckBox::indicator:checked {
    background: rgb(229, 162, 44);
}

/* Size of the checkbox */
QCheckBox::indicator {
    width : 12px;
    height: 12px;
}

/* *** QSplitter ***
 * Color the UI splitter lines
 */
QSplitter::handle {
    background-color: rgb(32, 32, 32);
}

/* Balance between making the splitters easier to find/grab, and
 * clean use of space. */
QSplitter::handle:horizontal {
    width: 4px;
}

QSplitter::handle:vertical {
    height: 4px;
}

/* Override the backround for labels, make them transparent */
QLabel {
    background: none;
}

/* *** QPushButton ***
 * Main Style for QPushButton
 */
QPushButton{
    /* gradient background */
    background-color: QLinearGradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 rgb(88, 88, 88), stop: 1 rgb(75, 75, 75));

    /* thin dark round border */
    border-width: 1px;
    border-color: rgb(42, 42, 42);
    border-style: solid;
    border-radius: 3;

    /* give the text enough space */
    padding: 4px;
    padding-right: 10px;
    padding-left: 10px;
}

/* Darker gradient when the button is pressed down */
QPushButton:pressed, QToolButton:pressed  {
    background-color: QLinearGradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 rgb(65, 65, 65), stop: 1 rgb(75, 75, 75));
}

/* Greyed-out colors when the button is disabled */
QPushButton:disabled, QToolButton:disabled {
    background-color: QLinearGradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 rgb(66, 66, 66), stop: 1 rgb(56, 56, 56));
}

/* *** QToolButton ***
 * Main Style for QToolButton
 */
QToolButton{
    /* gradient background */
    color: rgb(42, 42, 42);
    background-color: rgb(100, 100, 100);

    /* thin dark round border */
    border-width: 1px;
    border-color: rgb(42, 42, 42);
    border-style: solid;
    border-radius: 8;

    padding: 0px 1px 0px 1px;
}

/* *** QTreeView, QTableView ***
 * Style the tree view and table view
 */
QTreeView::item, QTableView::item {
    /* this border serves to separate the columns
     * since the grid is often invised */
    border-right: 1px solid rgb(41, 41, 41);
    height: 20px;
}

/* Selected items highlighted in orange */
.QTreeWidget::item:selected,
QTreeView::branch:selected,
QTableView::item:selected {
    background: rgb(189, 155, 84);
}

/* hover items a bit lighter */
.QTreeWidget::item:hover:!pressed:!selected,
QTreeView::branch:hover:!pressed:!selected,
QTableView::item:hover:!pressed:!selected {
    background: rgb(70, 70, 70);
}

.QTreeWidget::item:hover:!pressed:selected,
QTreeView::branch:hover:!pressed:selected,
QTableView::item:hover:!pressed:selected {
/*    background: rgb(132, 109, 59); */
    background: rgb(227, 186, 101);
}

/* Set the branch triangle icons */
QTreeView::branch:has-children:!has-siblings:closed,
QTreeView::branch:closed:has-children:has-siblings {
    border-image: none;
    image: url(RESOURCE_DIR/icons/branch-closed.png);
}

QTreeView::branch:open:has-children:!has-siblings,
QTreeView::branch:open:has-children:has-siblings  {
    border-image: none;
    image: url(RESOURCE_DIR/icons/branch-open.png);
}

QTreeView::branch:selected:has-children:!has-siblings:closed,
QTreeView::branch:selected:closed:has-children:has-siblings {
    border-image: none;
    image: url(RESOURCE_DIR/icons/branch-closed-selected.png);
}

QTreeView::branch:selected:open:has-children:!has-siblings,
QTreeView::branch:selected:open:has-children:has-siblings  {
    border-image: none;
    image: url(RESOURCE_DIR/icons/branch-open-selected.png);
}

/* give the tables and trees an alternating dark/clear blue background */
QTableView, QTableWidget, QTreeWidget, #primFrame, #attributeFrame{
    background: rgb(55, 55, 55);
    alternate-background-color: rgb(59, 59, 59);
}

/* Font setting for the table widget */
QTableWidget{
    font: 25 10pt "Gotham Rounded";
}

/* bump to the right to hide the extra line */
QTableWidget, QTreeWidget {
    margin-right: -1px;
}

/* *** QHeaderView ***
 * This style the headers for both QTreeView and QTableView
 */
QHeaderView::section {
    padding: 3px;
    border-right: 1px solid rgb(67, 67, 67);
    border-bottom: 1px solid rgb(42, 42, 42);

    border-top: none;
    border-left: none;

    /* clear blue color and darker background */
    color: rgb(201, 199, 195);
    background: rgb(78, 80, 84);
}

/* *** QTabWidget ***
 * Style the tabs for the tab widget
 */
QTabWidget::tab-bar:top {
    left: 10px; /* move to the right by 5px */
    top: 1px;
}

QTabWidget::tab-bar:left {
    right: 1px;
}

QTabWidget::top:pane {
    border: none;
    border-top: 1px solid rgb(42, 42, 42);
}

QTabBar {
    background: none;
}

/* Style the tab using the tab sub-control. Note that
 * it reads QTabBar _not_ QTabWidget */
QTabBar::tab:top {
    /* Gradient bg similar to pushbuttons */
    background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 rgb(89, 89, 89), stop: 1.0 rgb(74, 74, 74));

    /* Style the border */
    border: 1px solid rgb(42, 42, 42);
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;

    /* size properly */
    min-width: 8ex;
    padding-left: 10px;
    padding-right: 10px;
}

QTabBar::tab:left {
    /* Gradient bg similar to pushbuttons */
    background: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 rgb(89, 89, 89), stop: 1.0 rgb(74, 74, 74));

    /* Style the border */
    border: 1px solid rgb(42, 42, 42);
    border-bottom-right-radius: 3px;
    border-top-right-radius: 3px;

    /* size properly */
    min-height: 4ex;
    padding-top: 10px;
    padding-bottom: 10px;
}

/* Lighter background for the selected tab */
QTabBar::tab:selected, QTabBar::tab:hover {
    background: rgb(56, 56, 56);
}

/* make the seleted tab blend with the tab's container */
QTabBar::tab:top:selected {
    border-bottom: none; /* same as pane color */
}

QTabBar::tab:left:selected {
    border-left: none; /* name as pane color */
}

/* make non-selected tabs look smaller */
QTabBar::tab:top:!selected {
    margin-top: 2px;
}

QTabBar::tab:left:!selected {
    margin-right: 2px;
}

/* *** QSlider ***
 * Style the time slider
 * Style in inner groove 
 */
QSlider::groove:horizontal#frameSlider {
    border: 2px solid rgb(47, 47, 47);
    background: rgb(58, 58, 58);
    margin: 2px 2px;
}


/* Style the handle with orange background, border and heftier width */
QSlider::handle:horizontal#frameSlider {
    background: QLinearGradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 rgb(207, 151, 53), stop: 1 rgb(229, 162, 44));
    
    border: 2px solid rgb(42, 42, 42);
    border-radius: 10px;

    width:  22px;
}

/* Set the disabled background color for slider handle and checkbox */
QSlider::handle:horizontal:disabled#frameSlider,
QCheckBox::indicator:checked:disabled {
    background: QLinearGradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 rgb(177, 161, 134), stop: 1 rgb(188, 165, 125));
}

/* *** QScrollBar ***
 * Style the scroll bars menv30-style
 */

/* set up background and border (behind the handle) */
QScrollBar:horizontal, QScrollBar:vertical {
    background: rgb(42, 42, 42);
    border: 1px solid rgb(42, 42, 42);
}

/* Round the bottom corners behind a horizontal scrollbar */
QScrollBar:horizontal {
    border-bottom-right-radius: 12px;
    border-bottom-left-radius: 12px;
}

/* Round the right corners behind a vertical scrollbar */
QScrollBar:vertical {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* set the color and border for the actual bar */
QScrollBar::handle:horizontal, QScrollBar::handle:vertical {
    background: rgb(90, 90, 90);
    border: 1px solid rgb(90, 90, 90);
}

/* Round the bottom corners for the horizontal scrollbar handle */
QScrollBar::handle:horizontal {
    border-bottom-right-radius: 12px;
    border-bottom-left-radius: 12px;
    border-top-color: rgb(126, 126, 126);
    min-width:45px;
}

/* Round the right corners for the vertical scrollbar handle */
QScrollBar::handle:vertical {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
    border-left-color: rgb(126, 126, 126);
    min-height:45px;
}

/* Make the scroll bar arrows invisible */
QScrollBar:left-arrow:horizontal, QScrollBar::right-arrow:horizontal,
QScrollBar:left-arrow:vertical, QScrollBar::right-arrow:vertical  {
    background: transparent;
}

QScrollBar::add-line:horizontal,      QScrollBar::add-line:vertical {
    background: transparent;
}

QScrollBar::sub-line:horizontal,      QScrollBar::sub-line:vertical {
    background: transparent;
}

QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal,
QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {
    background: none;
}

/* *** QMenuBar ***
 * Style the menu bar 
 */
QMenuBar#menubar {
    font-size: 10pt;
    background: rgb(80, 80, 80);
    border: 2px solid rgb(41, 41, 41);
}

QMenuBar#primViewMenuBar {
    font-size: 8pt;
    background: rgb(80, 80, 80);
    border: 2px solid rgb(41, 41, 41);
}

/* Style the menu bar sections like presto, with rounded top corners */
QMenuBar::item {
    spacing: 6px; 
    padding: 2px 5px;
    background: transparent;
    border-top-right-radius: 3px;
    border-top-left-radius: 3px;
}

QMenuBar::item:selected { /* when selected using mouse or keyboard */
    background: rgb(59, 59, 59);
}

/* dark background when pressed */
QMenuBar::item:pressed {
    background: rgb(42, 42, 42);
}

/* *** QMenu ***
 * style the actual menu (when you click on a section in the menu bar) */
QMenu,
QComboBox QAbstractItemView {
    /* dark border */
    border: 2px solid rgb(19, 19, 19);
}

QMenu::item {
    /* Transparent menu item background because we want it to match
     * the menu's background color when not selected.
     */
    background: none;
}

/* When user selects menu item using mouse or keyboard */
QMenu::item:selected {
    background: rgb(190, 156, 85);
    color: rgb(54, 54, 54);
}

/* Thin separator between menu sections */
QMenu::separator {
    height: 1px;
    background: rgb(42, 42, 42);
}

/* Use a custom submenu arrow so it is not affected by the user's theme. */
QMenu::right-arrow:enabled {
    image: url(RESOURCE_DIR/icons/right-arrow.png);
}

QMenu::right-arrow:disabled {
    image: url(RESOURCE_DIR/icons/right-arrow-disabled.png);
}

/* *** QComboBox ***
 * Style the drop-down menus
 * Note: The down arrow is style in the QSpinBox style
 */
QComboBox {
    color: rgb(227, 227, 227); /* Weird, if we dont specify, its back */
    height: 22px;
    background: rgb(41, 41, 41);
    border:none;
    border-radius: 5px;
    padding: 1px 0px 1px 3px; /*This makes text colour work*/
}

QComboBox::drop-down {
    background: rgb(41, 41, 41);
    border:none;
    border-radius: 5px;
}

/**
 * USDVIEW SPECIFIC STYLES
 */

/* Add border around the 4 main panels (prim browser,
 * stage view, attribute inspector, attribute editor)
 */
#primFrame, #glFrame {
    border-top: 2px solid rgb(32, 32, 32);
}

#attributeBrowserFrame, #propertyInspectorFrame {
    border-bottom: 2px solid rgb(32, 32, 32);
}

#primFrame, #attributeBrowserFrame {
    border-left: 2px solid rgb(32, 32, 32);
}

#glFrame, #propertyInspectorFrame {
    border-right: 2px solid rgb(32, 32, 32);
}

#propertyInspectorContainer {
    background: rgb(78, 80, 84);
}

/* Borders are not necessary */
#attributeEditor { 
    border: none;
}

#infoLabel1, #infoLabel2 {
    color: rgb(222, 158, 46);
}

#errorLabel {
    color: rgb(230, 66, 65);
}

QToolTip {
    padding-left: 7px;
    padding-right: 7px;
}

/* We want select widgets' tooltips to have the dark background so that
   we can show colored text from the GUI in context */
QPushButton#primViewHelp QToolTip, QTreeWidget#primView QHeaderView QToolTip {
    background:  rgb(56, 56, 56);
    color: rgb(227, 227, 227);
}

QDialog#primViewHelpDlg QLabel {
    font-size: 11pt;
}

