/**
 * Copyright 2016-2022 the authors (see README.md).
 *
 * This file is part of cloogle-web.
 *
 * Cloogle-web is free software: you can redistribute it and/or modify it under
 * the terms of the GNU Affero General Public License as published by the Free
 * Software Foundation, version 3 of the License.
 *
 * Cloogle-web 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 Affero General Public License
 * for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with cloogle-web. If not, see <https://www.gnu.org/licenses/>.
 *
 * The software is licensed under additional terms under section 7 of the GNU
 * Affero General Public License; see the LICENSE file for details.
 */

td, th {
	vertical-align: top;
}

th {
	text-align: left;
}

a {
	color: #26c;
}

.parbreak:before {
	content: '';
	display: block;
	height: 0;
	margin-top: .5em;
}

#header {
	margin-top: 10%;
	text-align: center;
	width: 100%;
}

#header.result-view {
	margin-top: 0%;
	text-align: left;
}

#header.result-view > * {
	vertical-align: top;
}

#logo {
	display: inline-block;
	margin: 20px;
	width: 200px;
}

#header.result-view #logo {
	margin-bottom: 0;
}

#search {
	display: block;
	text-align: center;
}

#header.result-view #search {
	display: inline-block;
	margin-top: 65px;
	text-align: left;
}

#search-str, #search button {
	border: 1px solid #ccc;
	border-radius: 2px;
	box-sizing: content-box;
	display: inline-block;
	height: 20px;
	padding: 2px .5em;
	vertical-align: middle;
}

#search-str {
	font-family: monospace;
	font-size: 14px;
	height: auto;
	max-height: 10ex;
	max-width: calc(100vw - 20px - 200px - 20px - 7em - 20px);
	min-height: 20px;
	min-width: 20em;
	outline: none;
	overflow-x: auto;
	padding-top: 4px;
	padding-bottom: 0;
	position: relative;
	text-align: left;
}

#search-str #caret-spacer {
	left: .4em;
	position: absolute;
	top: 4px;
}

#search-str.placeholder:before {
	color: #aaa;
	content: 'See "How to use" for query examples';
	cursor: text;
	font-family: sans-serif;
}

#searchlinks {
	display: inline-block;
	font-size: 90%;
	list-style-type: none;
	padding: 0;
}

#header.result-view #searchlinks {
	margin: .3em 0 0;
}

#searchlinks li {
	cursor: pointer;
	color: #6f7c91;
	display: inline-block;
	text-decoration: underline;
}

#searchlinks li.active {
	color: #373e48;
}

#searchlinks li.disabled {
	cursor: default;
	text-decoration: none;
}

#searchlinks li.separator {
	cursor: default;
	color: #939dac;
	padding: 0 .5em;
	text-decoration: none;
}

.tooltip {
	background: #f8f8f8;
	display: block;
	height: 0;
	opacity: 0;
	overflow: hidden;
	transition: opacity 0.25s ease-out;
}

#header.result-view .tooltip {
	padding-left: calc(245px - 1em);
}

.tooltip.visible {
	border-width: 1px 0;
	border-color: #ccc;
	border-style: solid;
	margin-top: 1em;
}

.tooltip > div {
	display: inline-block;
	margin: 0 1em;
	text-align: left;
}

.visible {
	height: auto;
	opacity: 1;
}

#advanced.visible {
	padding-bottom: .6em;
	padding-top: .6em;
}

#advanced #libraries #library-list {
	column-count: 4;
}

#helptext code, #helptext .code {
	background-color: #eeeeee;
	font-family: monospace;
	font-size: 90%;
	margin-right: .2em;
	padding: 1px 4px;
	border: 1px solid #d0d0d0;
	border-radius: 2px;
}

#helptext .description {
	padding-left: .3em;
}

table#search-examples {
	border-spacing: 0 1px;
}

#search-results {
	margin-top: 1em;
}

#warnings, #suggestions {
	padding: 0 1em 1em 1em;
}

#warnings ul {
	margin: .2em;
	padding-left: 1.5em;
}

#search-results p {
	padding-left: 1em;
}

.core-module {
	font-style: italic;
}

.result-basic {
	background-color: #e8e8e8;
	display: flow-root;
	padding: .2em .2em .2em 1em;
}

.result-basic .license {
	color: #888;
	font-size: 85%;
	text-decoration: none;
}

.result-basic .usages-link, .problem-license {
	float: right;
	margin: 0 1em;
	font-size: 85%;
}

.result-extra {
	background-color: #f4f4f4;
	font-size: 85%;
	overflow: auto; /* may contain pre, which has margin and should get a background color */
	padding-left: 1em;
}

.result-extra-space {
	padding-bottom: .5em;
}

.result-extra code, .result-extra pre {
	font-size: 110%;
}

.result-extra .togglee ul {
	margin: 0;
	padding-left: 2em;
}

.result-extra.toggle-container {
	padding-left: 2.2em;
}

.result-extra .toggler {
	margin-left: -1em;
}

.result-code {
	margin: 0 0 0.5em 0;
	max-height: 40ex;
	overflow-x: auto;
	padding: 1em;
}

/* Right padding; see https://alexandergottlieb.com/2018/02/22/overflow-scroll-and-the-right-padding-problem-a-css-only-solution/ */
.result-code > :last-child:after {
	content: '';
	display: inline-block;
	width: 1em;
}

.general-help {
	padding: 0 1em;
}

#more {
	padding-left: 1em;
}

.examples {
	padding-bottom: .5em;
}

.example {
	font-size: initial;
	margin: .5em;
}

.keyword.optional {
	color: #777;
}

.punctuation-ellipsis {
	margin: 0 .2em 0 .4em;
}

@media (max-width: 800px) {
	#advanced #libraries #library-list {
		column-count: 3;
	}
}

@media (max-width: 600px) {
	#header.result-view #logo {
		margin-bottom: 20px;
	}

	#advanced #libraries #library-list {
		column-count: 2;
	}

	#search {
		margin: 0 1em 1em !important;
	}

	.tooltip {
		padding-left: 1em !important;
	}
}
