/* 1. Use a more-intuitive box-sizing model */
*, *::before, *::after {
  box-sizing: border-box;
}

/* 2. Remove default margin */
* {
  margin: 0;
}

/* 3. Enable keyword animations */
@media (prefers-reduced-motion: no-preference) {
  html {
    interpolate-size: allow-keywords;
  }
}

body {
  /* 4. Add accessible line-height */
  line-height: 1.5;
  /* 5. Improve text rendering */
  -webkit-font-smoothing: antialiased;
}

/* 6. Improve media defaults */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

/* 7. Inherit fonts for form controls */
input, button, textarea, select {
  font: inherit;
}

/* 8. Avoid text overflows */
p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

/* 9. Improve line wrapping */
p {
  text-wrap: pretty;
}
h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
}

/*
  10. Create a root stacking context
*/
#root, #__next {
  isolation: isolate;
}


body {
	background: #fff;
	color: #000;
	margin: 0px;
	padding: 0px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}
h1.main-header, h2.list-header {
	font-weight: bold;
	background: #999;
	color: #fff;
	padding: 0px 10px;

	background:
		linear-gradient(to bottom, rgba(17, 7, 7, 0.74) 0%, rgba(66, 0, 0, 0.9) 50%, rgba(17, 7, 7, 0.88) 100%);

}
h1.main-header {
	margin-bottom: 20px;
}
a {
	text-decoration: none;
	color: #333;
	font-weight: bold;
}
a:hover {
	color: #999;
}
a img {
	border: 0;
}
div.top {
	background:
		url('/assets/xms-logo.svg') no-repeat left top,
		linear-gradient(to bottom, rgba(120, 60, 60, 0.3) 0%, rgba(130, 0, 0, 0.9) 50%, rgba(0,0,0,0.9) 100%),
		repeating-linear-gradient(
			to bottom, #660202, #8D0304 3px, #660202 8px);
	background-size: 360px 360px, 360px 360px, auto;
	border-style: solid;
	border-color: #333;
	border-width: 0px 0px 3px 0px;
	margin-bottom: 20px;
	overflow: hidden;
	height: 140px;
}
.top .xrem {
	height: 80px;
	width: 140px;
	background: url('/assets/enigneered-by-xrem-net.svg') no-repeat left top;
	position: absolute;
	top: 10px;
	right: 20px;
	z-index: 9;
}
.menu {
	width: 20%;
	float: left;
	border: dashed 1px #666;
	border-width: 0px 1px 0px 0px;
	padding: 0 10px 20px;
}
.menu img, .list img {
	display: inline-block;
}
div.main {
	margin-left: 20%;
	padding: 0 10px 20px;
}
.login {
	margin: 100px auto;
	width: 600px;
	padding: 30px;
}
.login fieldset {
	padding: 20px;
}
.login .reqnote {
	text-align: center;
}
div.userinfo {
	font-weight: bold;
	text-align: right;
	color: #000;
	border-width: 0px 0px 3px 0px;
}
div.userinfo .small {
	color: #666;
}
input, select, textarea {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

div.filebox {
    margin: 10px;
    padding: 10px;
    text-align: center;
    width: 160px;
    height: 160px;
    float: left;
    background: #eee
}

form .row {
	display: flex;
	flex-direction: row;
	gap: 10px;
	align-items: center;
	flex-wrap: wrap;
}
 .row +  .row {
	margin-top: 10px;
}
form .label {
	width: 20%;
	flex: 0 0 auto;
}
form .element {
	width: 70%;
	flex: 0 0 auto;
}
label + input[type="radio"] {
	margin-left: 8px; /* this is when label for previous radio option is grouped together with a next radio option */
}
input[type="radio"] + label, input[type="checkbox"] + label {
	display: inline-block;
	padding: 0 5px;
}
input[type="text"].result {
	width: 40px;
}

input[type="text"].result + input[type="text"].result {
	margin-left: 5px;
}
input[type="file"] {
	color: transparent;
}

input[type="submit"], button, input[type="file"]::file-selector-button, select {
	padding: 5px 10px;
	border-radius: 6px;
	border: 1px solid #d3d3d3;
	background: #fafafa;
	color: #000000;
	cursor: pointer;
}
input[type="submit"]:disabled, button:disabled, input[type="file"]:disabled::file-selector-button, select {
	cursor: not-allowed;
	color: #cccccc;
}

input[type="submit"] + button, button + input[type="submit"], button + button, input[type="submit"] + input[type="submit"] {
	margin-left: 8px;
}

input[type="text"], input[type="password"], input[type="email"], input[type="number"], input[type="tel"], textarea {
	width: 100%;
}

input[type="text"]:invalid, input[type="password"]:invalid, input[type="email"]:invalid, input[type="number"]:invalid, input[type="tel"]:invalid, textarea:invalid {
	border: solid 2px #f00;
	background-color: #ff000026;
}

input[type="text"]:invalid:focus, input[type="password"]:invalid:focus, input[type="email"]:invalid:focus, input[type="number"]:invalid:focus, input[type="tel"]:invalid:focus, textarea:invalid:focus {
	outline: none;
}

input[type="text"], textarea, input[type="date"], input[type="time"], input[type="datetime-local"], input[type="password"], input[type="email"], input[type="number"], input[type="tel"], select {
	line-height: 13px;
	background: #fafafa;
	padding: 5px;
	color: #000000;
	border: solid 1px #d3d3d3;
	border-radius: 4px;
	box-sizing: border-box;
}

.upload-status {
	display: inline-block;
}

.toggle-switch {
	display: flex;
	overflow: hidden;
}

.toggle-switch input {
	position: absolute !important;
	clip: rect(0, 0, 0, 0);
	height: 1px;
	width: 1px;
	border: 0;
	overflow: hidden;
}

.toggle-switch label[for]:not([for=""]) {
	background-color: #e4e4e4;
	color: #00000080;
	line-height: 1;
	text-align: center;
	padding: 5px 10px;
	margin-right: -1px;
	border: 1px solid rgba(0, 0, 0, 0.2);
	box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px rgba(255, 255, 255, 0.1);
	transition: all 0.15s ease-in-out;
	filter: grayscale(100%);
}

.toggle-switch label:hover {
	cursor: pointer;
}

.toggle-switch input:checked + label[for]:not([for=""]) {
	box-shadow: none;
	color: #000000;
}

.toggle-switch label:first-of-type[for]:not([for=""]) {
	border-radius: 4px 0 0 4px;
}
.toggle-switch input:checked + label[for]:first-of-type[for]:not([for=""]):not([for=""]) {
	background-color: #a5dc86;
	filter: grayscale(0%);
}

.toggle-switch input:checked + label[for]:last-of-type[for]:not([for=""]):not([for=""]) {
	background-color: #f0a6a6;
	filter: grayscale(0%);
}

.toggle-switch label:last-of-type[for]:not([for=""]) {
	border-radius: 0 4px 4px 0;
}

form .row:not(fieldset .row) {
	padding: 20px;
}

form fieldset {
	padding: 5px 15px;
	border: solid 1px #d3d3d3;
	border-radius: 4px;
}
fieldset + fieldset {
	margin-top: 10px;
}
fieldset legend {
	color: #ccc;
	text-transform: uppercase;
}

.treeMenuNode {
	font-weight: bold;
	border: solid 1px #000;
	border-width: 1px 0px;
	margin-bottom: 3px;
	background: #666;
	color: #fff;
}
.treeMenuLeaf {
	font-weight: normal;
	border: solid 1px #ccc;
	border-width: 1px 0px;
	margin-bottom: 3px;
}
.treeMenuNode nobr, .treeMenuLeaf nobr {
	display: inline-flex;
	align-items: center;
}
.treeMenuLeaf a {
	font-weight: normal;
}
.treeMenuLeaf span {
	margin-left: 4px;
}
.treeMenuLeaf img, .treeMenuNode img, .list img {
	height: 16px;
	width: 16px;
}

form div.header {
	margin-top: 10px;
	margin-bottom: 5px;
}
form div.item {
	margin-bottom: 10px;
}
div.note {
	text-align: center;
}
.list {
	width: 100%;
	margin: 10px;
	max-width: 960px;
}
.list .item {
	border-style: solid;
	border-color: #eee transparent #ccc transparent;
	border-width: 1px 0px;
	padding: 0px 5px 2px 5px;
	height: 16px;
	margin-bottom: 1px;
	transition: background-color 0.1s ease-in-out, border-color 0.3s ease-in-out;
}

.list .item:hover {
	background-color: #ddd;
	border-color: #bbb transparent #666 transparent;
}

div.list .item {
	display: flex;
	height: 28px;
	align-items: center;
}
div.list .item .name {
	flex-grow: 1;
	flex-shrink: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.list .item a, .list .item .foo {
	display: block;
	margin: 0px 3px;
	flex-shrink: 0;
}
.foo {
	width: 16px;
	height: 16px;
	display: inline-block;
	vertical-align: middle;
	margin-right: 5px;
}

.list .round-item {
	height: 96px;
	border-color: #666 #fff;
	background: #eee;
	border-style: solid;
	border-width: 1px 0px;
	margin-top: 5px;
	margin-bottom: 1px;
	padding: 1px 3px;
}
.list .round-item .small {
	color: #000;
}
a.add {
	display: inline-block;
	margin: 20px 12px;
}
a.add img {
	display: inline-block;
}
.msg {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 450px;
	margin: 10px auto;
	padding: 5px 10px;
	padding-left: 35px;
	background-repeat: no-repeat;
	background-position: 10px 5px;
}
.msg.info {
	color: #060;
	border-color: #060;
	border-width: 1px 0px;
	border-style: solid;
	background-color: #cfc;
}
.msg.warning {
	color: #990;
	border-color: #cc0;
	border-width: 1px 0px;
	border-style: solid;
	background-color: #ff8;
}
.msg.error {
	color: #600;
	border-color: #333;
	border-width: 1px 0px;
	border-style: solid;
	background-color: #f66;
}

div.infoforeditors {
	float: right;
	width: 200px;
	padding: 5px 10px 5px 30px;
	color: #026;
	border-color: #348;
	border-width: 1px 0px;
	border-style: solid;
	background-color: #cdf;
	background-image: url('icons/information.gif');
	background-repeat: no-repeat;
	background-position: 10px 5px;

}
.small {
	color: #aaa;
	font-weight: normal;
	font-size: 12px;
	text-transform: uppercase;
}
.small.type {
	display: inline-block;
	width: 80px;
	text-align: center;
}
.alert, .error, .required {
	color: #c00;
}
.all {
	display: flex;
	gap: 20px;
}
.small-form {
	width: 30%;
	flex: 0 0 auto;
}
.small-items {
	flex-grow: 1;
}

.editorjs-holder {
	border: solid 1px #d3d3d3;
	border-radius: 4px;
	padding: 5px;
}
.editorjs-holder h1,
.editorjs-holder h2,
.editorjs-holder h3,
.editorjs-holder h4,
.editorjs-holder h5,
.editorjs-holder h6,
.editorjs-holder p,
.editorjs-holder ul,
.editorjs-holder ol,
.editorjs-holder li,
.editorjs-holder blockquote,
.editorjs-holder pre {
		background: transparent;
		color: #000;
}

.editorjs-holder ul,
.editorjs-holder ol {
    list-style: initial;
    margin-left: 1.5em;
}

.editorjs-holder li {
    margin-left: 0;
}

.editorjs-block-holder {
	border: solid 1px #d3d3d3;
	border-radius: 4px;
	padding: 5px;
	max-height: 300px;
	overflow-y: auto;
}

/* 1. Hide the real file input */
.hidden-file-input {
  display: none;
}

.uploader-container {
	display: flex;
	justify-content: center;
	align-items: center;
	position: fixed;
	bottom: 10px;
	right: 10px;
	width: 84px;
	height: 84px;
	background-color: #f9f9f9;
	border: 2px dashed #d3d3d3;
	border-radius: 50%;
	padding: 10px;
	z-index: 3;
	transition: all 0.2s ease-in-out;
	cursor: default;
	user-select: none;
}
.uploader-container label {
	cursor: pointer;
}
.uploader-container #upload-trigger-button {
	cursor: pointer;
}
.uploader-container:hover {
	background-color: #e9e9e9;
	border-color: #999;
	transform: scale(1.1);
}
.uploader-container input[type="file"]{
	display: none;
}
.upload-status {
	position: absolute;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	top: 0;
	left: -350px;
	width: 330px;
	height: 84px;
	font-size: 12px;
	background-color: #ffffffee;
	border-radius: 10px;
	padding: 5px;
	border: 2px dashed #d3d3d3;
}
.progress-bar {
	margin: 3px auto;
	width: 60%;
	height: 10px;
	background-color: #e3e3e3;
	border-radius: 4px;
}
#upload-status-progress-bar-fill {
	height: 100%;
	background-color: #387017;
	border-radius: 4px;
}
.upload-status-current {
	display: flex;
	align-items: center;
	gap: 5px;
}
#upload-status-current-filename {
	display: inline-block;
	max-width: 200px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
#upload-status-current-size {
	display: inline-block;
	font-size: 10px;
	color: #666;
}

input[type=submit]:hover, input[type=button]:hover {
	background-color: #45a049;
}

#modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.4);
  justify-content: center;
  align-items: center;
  /* Prevent scrolling when modal is open */
  overscroll-behavior: contain;
  touch-action: none;
  pointer-events: auto;
}

.modal-content {
  background-color: #fefefe;
	position: relative;
  margin: auto;
  border: 1px solid #888;
  width: 80%;
  height: 80%;
	overflow-y: auto;
  box-shadow:
		0 8px 32px 10px rgba(60, 60, 80, 0.3),
		0 1.5px 6px 8px rgba(60, 60, 80, 0.2);
}

.modal-header, .modal-footer {
  padding: 20px;
  flex-shrink: 0;
	position: sticky;
	background-color: #fefefe;
	z-index: 10;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
	top: 0;
	padding-bottom: 10px;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.modal-close-button {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-body {
  flex-grow: 1;
  overflow-y: auto;
  padding: 20px;
}

.modal-breadcrumbs {
  padding: 10px;
  border-bottom: 1px solid #eee;
  margin-bottom: 10px;
}

.modal-breadcrumbs a {
  text-decoration: none;
}

.modal-files-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.media-tile {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  position: relative;
}

.media-tile:hover {
  background-color: #f0f0f0;
}

.media-tile.selected {
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0,123,255,.25);
}

.media-tile.disallowed {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: #f8f9fa;
}

.media-tile img {
  max-width: 100%;
  height: 80px;
  object-fit: cover;
  margin-bottom: 5px;
}

.media-tile .icon {
  font-size: 48px;
  line-height: 80px;
  height: 80px;
}

.media-tile .name {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #eee;
  padding-top: 10px;
	bottom: 0;
}

.modal-footer button,
#modal-create-dir-form button {
  margin-left: 10px;
}

.modal-footer button:first-child,
#modal-create-dir-form button:first-child {
  margin-left: 0;
}

#modal-footer-left, #modal-footer-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

#modal-create-dir-form {
  display: flex;
  gap: 5px;
}

.image-preview-container {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	justify-content: flex-start;
	align-items: center;
}
.img-thumbnail {
	display: block;
	margin: 10px 0;
	border: solid 1px #d3d3d3;
	border-radius: 4px;
	box-sizing: border-box;
	padding: 5px;
}
.image-preview-container img.img-thumbnail {
	max-width: 100%;
	max-height: 100px;
	object-fit: cover;
	border-radius: 4px;
}
.files-preview-container {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: flex-start;
	align-items: center;
}
.files-preview-container .file-item {
	border: solid 1px #d3d3d3;
	border-radius: 4px;
	padding: 5px;
	display: flex;
	align-items: center;
	gap: 3px;
	font-size: 12px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	width: 250px;
	margin: 10px 0;
}
