/*
Much of this is taken from the Breeze Style Sheets,
which is under the MIT license:

Copyright © `<2013-2014>` `<Colin Duquesnoy>`
Copyright © `<2015-2016>` `<Alex Huszagh>`

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the “Software”), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE 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 THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
*/

/* Colors should be the same as the QPalette in gui/theme.cc, i.e.:
	window == darkgray == #353535;
	??? == gray == #808080;
	base == black == #191919;
	highlighted == blue = #2A82DA;
   We could include a preprocessor like sass to make these constants,
   but that's really lame :(
*/

AnimeListPage::pane {
	margin: 0.04em;
	border: 0.04em solid #808080;
	top: -0.04em;
	left: -0.04em;
}

QTabWidget::pane:top {
	border: 0.04em solid #808080;
	top: -0.04em;
}

QTabWidget::pane:bottom {
	border: 0.04em solid #808080;
	bottom: -0.04em;
}

QTabWidget::pane:left {
	border: 0.04em solid #808080;
	left: -0.04em;
}

QTabWidget::pane:right {
	border: 0.04em solid #808080;
	right: -0.04em;
}

QTabBar {
	qproperty-drawBase: 0;
	left: 0.23em;
	border-radius: 0.13em;
	selection-color: transparent;
}

QTabBar:focus {
	border: 0em transparent black;
}

QTabBar::tab:top,
QTabBar::tab:top:last,
QTabBar::tab:top:only-one {
	color: white;
	border: 0.04em transparent black;
	border-left: 0.04em solid #808080;
	border-right: 0.04em solid #808080;
	border-top: 0.04em solid #808080;
	background-color: #191919;
	min-width: 50px;
	padding-top: 0.23em;
	padding-bottom: 0.23em;
	padding-left: 0.78em;
	padding-right: 0.78em;
	border-radius: 0.09em;
	border-bottom-left-radius: 0em;
	border-bottom-right-radius: 0em;
}

QTabBar::tab:top:!selected {
	color: white;
	background-color: #191919;
	border: 0.04em solid #808080;
	border-radius: 0.09em;
	border-bottom-left-radius: 0em;
	border-bottom-right-radius: 0em;
	margin-top: 0.13em;
}

QTabBar::tab:top:next-selected {
	border-right: 0.04em transparent #191919;
	border-bottom-left-radius: 0em;
	border-bottom-right-radius: 0em;
}

QTabBar::tab:top:previous-selected {
	border-left: 0.04em transparent #191919;
	border-bottom-left-radius: 0em;
	border-bottom-right-radius: 0em;
}

QTabBar::tab:top:!selected:hover {
	background-color: rgba(42, 130, 218, 0.1);
	border-radius: 0.09em;
	border-bottom-left-radius: 0em;
	border-bottom-right-radius: 0em;
}

QTabBar::tab:top:!selected:first:hover {
	background-color: rgba(42, 130, 218, 0.1);
}

QGroupBox::title {
	color: white;
}

QComboBox,
QPushButton,
QDateEdit,
QSpinBox {
	background-color: #353535;
	color: white;
}

QComboBox,
QDateEdit,
QSpinBox {
	border: 0.04em solid #808080;
}

QComboBox:disabled,
QPushButton:disabled,
QDateEdit:disabled,
QSpinBox:disabled {
	color: #808080;
}

QPushButton:hover {
	background-color: #39424B;
}

/*
 * QLineEdit
 */

QLineEdit {
	background: transparent;
	color: white;
}

QLineEdit:!read-only {
	background-color: #191919;
	padding: 0.23em;
	border-style: solid;
	border: 0.04em solid #808080;
	border-radius: 0.09em;
}

/* QMenuBar */

QMenuBar {
	background-color: #353535;
	color: white;
}

QMenuBar::item:selected {
	background-color: #414141;
}

QMenuBar::item:disabled {
	color: #808080;
}

QMenuBar::item:pressed {
	background-color: #414141;
	margin-bottom: -0.09em;
	padding-bottom: 0.09em;
}

/* QMenu */

QMenu {
	color: white;
	background-color: #353535;
	padding: 0.18em 0.18em;
	border: 0.09em solid #A0A0A0;
}

QMenu::icon {
	margin: 0.23em;
}

QMenu::item {
	/* Add extra padding on the right for the QMenu arrow */
	padding: 0.23em 1.5em 0.23em 1.3em;
	border: 0.09em solid transparent;
	background: transparent;
}

QMenu::item:selected {
	color: white;
	background-color: #414141;
}

QMenu::item:selected:disabled {
	background-color: #353535;
}

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

QMenu::indicator {
	width: 0.8em;
	height: 0.8em;
	/* To align with QMenu::icon, which has a 0.23em margin. */
	margin-left: 0.3em;
	subcontrol-position: center left;
}

/*
 * QHeaderView:
 * Need this for the anime list, on Windows it gets screwed up.
*/

QHeaderView {
	background-color: #353535;
	border: 0.04em transparent;
	border-radius: 0em;
	margin: 0em;
	padding: 0em;
}

QHeaderView::section {
	background-color: #353535;
	border: 0.04em solid #808080;
	color: #eff0f1;
	border-radius: 0em;
	padding: 0em 0.23em 0em 0.23em;
	text-align: center;
}

QHeaderView::section::vertical::first,
QHeaderView::section::vertical::only-one {
	border-top: 0.04em solid #808080;
}

QHeaderView::section::vertical {
	border-top: transparent;
}

QHeaderView::section::horizontal::first,
QHeaderView::section::horizontal::only-one {
	border-left: 0.04em solid #808080;
}

QHeaderView::section::horizontal {
	border-left: transparent;
}

QHeaderView[showSortIndicator="true"]::section::horizontal {
	/* Same as the width of the arrow subcontrols below. */
	padding-right: 0.8em;
}

QHeaderView::section:checked {
	color: white;
	background-color: #808080;
}

/* Note that this doesn't work for QTreeView unless the header is clickable */
QHeaderView::section:hover,
QHeaderView::section::horizontal::first:hover,
QHeaderView::section::horizontal::only-one:hover,
QHeaderView::section::vertical::first:hover,
QHeaderView::section::vertical::only-one:hover {
	background-color: #353535;
}
