* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	outline: solid 1px transparent;
	outline-offset: 2px;
}

/* Global styles */
body {
	margin: 0;
	padding: 0;
	background-color: #f5f5f5;
	width: max-content;
}

html {
	font-size: 13px;
	tab-size: 4;
}
body, input, textarea, select, button, h1, h2, h3, h4, h5, h6 {
	font-family: "SF Pro", "Avenir Next", Arial, sans-serif;
	font-size: 1rem;
}

h1, h2, h3, h4, h5, h6 {
    margin-block-start: 1rem;
    margin-block-end: 1rem;
    margin-inline-start: 0;
    margin-inline-end: 0;
}
h1:first-child, h2:first-child, h3:first-child, h4:first-child, h5:first-child, h6:first-child {
	margin-block-start: 0;
}
h1 {
	font-size: 2rem;
}
h2 {
	font-size: 1.5rem;
}
h3 {
	font-size: 1.25rem;
}
h4, h5, h6 {
	font-size: 1rem;
}


/* Layout */
.top-menu {
	background-color: #333;
	padding: 1rem;
	color: white;
    position: sticky;
    left: 0;
    top: 0;
    width: 100vw;
}

.top-menu ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 1rem;
}

.top-menu a {
	color: white;
	text-decoration: none;
	padding: 0.5rem 1rem;
	border-radius: 4px;
}

.top-menu a:hover {
	background-color: #444;
}

.top-menu a.active {
	background-color: #007bff;
}

.content {
	padding: 2rem;
	width: 100vw;
	margin: 0 auto;
}

/* Container */
.container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 2rem;
}

/* Header */
.header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 2rem;
}

/* Footer */
.app-footer {
	width: 100vw;
	text-align: center;
	padding: 0.5rem;
	background-color: #333;
	font-size: 0.9em;
	color: #aaa;
}

/* Buttons */
input[type="button"], input[type="submit"], button, .btn {
	display: inline-block;
	padding: 0.5rem 1rem;
	border-radius: 4px;
	text-decoration: none;
	cursor: pointer;
	border: none;
	font-size: 1rem;
	background-color: #6c757d;
	color: white;
}

.btn-primary {
	background-color: #007bff;
}

.btn-sm {
	padding: 0.25rem 0.5rem;
	font-size: 0.875rem;
}

.btn-danger {
	background-color: #dc3545;
}

/* Forms */
.form {
	background: white;
	padding: 2rem;
	border-radius: 8px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-group {
	margin-bottom: 1.5rem;
}

label {
	display: block;
	margin-bottom: 0.5rem;
	font-weight: bold;
}

input[type="text"],
input[type="password"],
textarea,
select {
	width: 100%;
	padding: 0.5rem;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 1rem;
}
code, pre, .code {
	font-family: monospace;
	font-size: 0.8em;
}

.radio-group {
	display: flex;
	gap: 1rem;
}

.radio-group label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-weight: normal;
}

.help-text {
	margin-top: 0.5rem;
	color: #6c757d;
	font-size: 0.875rem;
}

.form-actions {
	margin-top: 2rem;
	text-align: right;
}


/* Tables */
table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 1rem;
}

th, td {
	padding: 0.75rem;
	text-align: left;
	border-bottom: 1px solid #dee2e6;
}

th {
	background-color: #f8f9fa;
}

/* Code */
code {
	background-color: #f8f9fa;
	padding: 0.2rem 0.4rem;
	border-radius: 3px;
}

pre {
	background: #f8f9fa;
	padding: 1rem;
	border-radius: 4px;
	overflow-x: auto;
	margin: 0;
}

/* Grid */
.grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 1.5rem;
}

/* Shortcuts */

.list-container {
	width: 100%;
	overflow-x: auto;
}

form.shortcuttype-url .shortcuttype-js,
form.shortcuttype-url .shortcuttype-cmd,
form.shortcuttype-js .shortcuttype-url,
form.shortcuttype-js .shortcuttype-cmd,
form.shortcuttype-cmd .shortcuttype-url,
form.shortcuttype-cmd .shortcuttype-js {
	display: none;
}

.shortcuts-edit #content {
	white-space: pre;
}

form.shortcuttype-url #content, form.shortcuttype-cmd #content {
	height: 2.1rem;
}

form.shortcuttype-js #content {
	height: 20rem;
	padding-left: 2rem;
	width: calc(100% - 1.5rem - 2px);
	resize: vertical;
}

form.shortcuttype-js label[for="content"] {
	font-weight: normal;
}

.grey {
	color: #c8c8c8;
}

tr.shortcut-disabled {
	color: #c8c8c8;
}
/* tr.shortcut-disabled>td {
	position: relative;
}
tr.shortcut-disabled>td::before {
	content: "";
	display: inline-block;
	position: absolute;
	width: 100%;
	height: 1px;
	left: 0;
	top: 50%;
	background-color: #c8c8c8;
} */


/* Scriptlets */

.scriptlets-edit #code {
	white-space: pre;
	height: 20rem;
	padding-left: 2rem;
	width: calc(100% - 1.5rem - 2px);
	resize: vertical;
}

.scriptlet-card {
	background: white;
	border-radius: 8px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	overflow: hidden;
}

.scriptlet-header {
	padding: 1rem;
	background: #f8f9fa;
	border-bottom: 1px solid #dee2e6;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.scriptlet-header h3 {
	margin: 0;
}

.scriptlet-content {
	padding: 1rem;
}

.scriptlet-info {
	margin-bottom: 1rem;
	color: #6c757d;
}

/* Lists */
.scriptlets-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 1rem;
}

.scriptlet-item {
	background: #f8f9fa;
	padding: 1rem;
	border-radius: 4px;
	font-weight: normal;
	display: flex;
	align-items: center;
	gap: 0.3rem;
}

.scriptlet-description {
	font-size: 0.875rem;
	color: #6c757d;
	margin-top: 0.5rem;
}

/* Messages */
.error-message {
	color: #dc3545;
	margin-top: 0.5rem;
}

.no-items {
	text-align: center;
	color: #6c757d;
	padding: 2rem;
}

/* Actions */
.actions {
	display: flex;
	gap: 0.5rem;
}

/* Login page */
.login-container {
	background: white;
	padding: 2rem;
	border-radius: 8px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	/* width: 100%; */
	max-width: 400px;
	margin: 2rem auto;
}

.login-container .error-message {
	margin-bottom: 1rem;
}


/* Search page */
.search-container {
	background: white;
	padding: 2rem;
	border-radius: 8px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	/* width: 100%; */
	max-width: 600px;
	margin: 2rem auto;
	text-align: center;
}

.search-container h1:has(+ h3) {
	margin-block-end: 0;
}
.search-container h3 {
	margin-block-start: 0;
	font-weight: normal;
}
.search-container .error-message {
	margin-bottom: 1rem;
}

.search-provider-url {
	white-space: pre;
	display: inline-block;
	max-width: 100%;
	overflow-x: auto;
	position: relative;
}
.search-provider-url .btn {
	margin-left: 0.5rem;
	position: sticky;
	right: 0;
	top: 0;
}

.search-container .form-actions {
	margin-top: 1rem;
	text-align: center;
}
