@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');
@import url(reset.css);
@import url(navigation.css);

* {
	transition: inherit;
	color: inherit;
}

html, body {
	width: 100%;
	height: 100%;
	overflow: hidden;
}

html {
	/* font-size: 1.25rem; */
	font-size: 1rem;
	background-color: var(--bg1);
	transition: none;
	color: var(--fg1);
}

body::after {
	content: "";
	position: absolute;
	width: 100%;
	height: 100%;
	top: 1px; /* prevent bleed at top of page */
	left: 0;
	backdrop-filter: opacity(100%) blur(2.5rem); /* change opactiy if needed */
	z-index: -10;
}

.blur {
	position: relative;
	z-index: -30;
}

.material-symbols-sharp {
	font-variation-settings:
	'FILL' 0,
	'wght' 500,
	'GRAD' 0,
	'opsz' 24;
	font-size: 1rem;
	line-height: 1rem;
	text-align: center;
}

h1 {
	font-family: 'Roboto', sans-serif;
	font-weight: 700;
	font-size: 3rem;
	letter-spacing: 0.025em;
	line-height: 3.95rem;
}

h2 {
	font-family: 'Roboto', sans-serif;
	font-weight: 700;
	font-size: 1.5rem;
	letter-spacing: 0.025em;
}

h3 {
	font-family: 'Roboto', sans-serif;
	font-weight: 700;
	font-size: 1rem;
	letter-spacing: 0.025em;
}

p {
	font-family: 'Roboto', sans-serif;
	font-weight: 400;
	font-size: 0.75rem;
	letter-spacing: 0;
	line-height: 1rem;
}

small {
	font-family: 'JetBrains Mono', monospace;
	font-weight: 400;
	font-size: 0.75rem;
	letter-spacing: 0;
	line-height: 1rem;
	font-style: italic;
	color: var(--fg2);
}

button {
	display: flex;
    border: 0;
    background-color: transparent;
    cursor: pointer;
	gap: 1rem;
    justify-content: center;
    align-items: center;
}

.button {
	display: flex;
	border: 0;
	background-color: transparent;
	cursor: pointer;
	font-family: 'Roboto', sans-serif;
	font-weight: 500;
	text-transform: uppercase;
	font-size: 0.75rem;
	letter-spacing: 0.05em;
	line-height: 1rem;
	text-decoration: none;
	gap: 1rem;
	justify-content: center;
	align-items: center;
	box-sizing: border-box;
	height: 3rem;
	padding: 1rem;
	user-select: none;
	-webkit-user-select: none;
	-webkit-touch-callout: none;
}

.button.t1 {
	background-color: var(--bg3);
	color: var(--fg3);
	line-height: 1rem;
}

.fill, .fill span {
	font-variation-settings:
	'FILL' 1,
	'wght' 500,
	'GRAD' 0,
	'opsz' 24;
}

.select {
	color: var(--fg1);
	font-family: 'Roboto', sans-serif;
	font-weight: 500;
	font-size: 0.75rem;
	text-transform: lowercase;
	letter-spacing: 0.05em;
	line-height: 1rem;
	z-index: 100;
	height: fit-content;
	transition: background-color .3s;
	user-select: none;
	-webkit-user-select: none;
	-webkit-touch-callout: none;
}

.select select {
	display: none;
}

.select-selected {
	position: relative;
	background-color: transparent;
	height: 1rem;
	padding: 1rem;
}

.select-selected::after {
	transition: transform .3s;
	position: absolute;
	right: 1rem;
	top: 50%;
	transform: translateY(-50%);
	content: "expand_more";
	font-family: 'Material Symbols Sharp';
	font-size: 1rem;
	font-variation-settings:
	'FILL' 0,
	'wght' 500,
	'GRAD' 0,
	'opsz' 24;
}

.select-items {
	opacity: 0;
	visibility: hidden;
	overflow-x: hidden;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	justify-content: start;
	align-items: stretch;
	max-height: 0;
	padding: 0 1rem;
	gap: 1rem;
	font-weight: 300;
	transition: .3s;
	box-sizing: border-box;
	-ms-overflow-style: none;
	scrollbar-width: none;
}

.select-items::-webkit-scrollbar {
	display: none;
}

.select-items div {
	cursor: pointer;
	padding-right: 2rem;
}

.select:hover {
	background-color: var(--bg2);
}

.select:hover .select-selected::after {
	transform: translateY(-50%) rotate(180deg);
}

.select:hover .select-items {
	opacity: 1;
	visibility: visible;
	max-height: calc(var(--numOptions) * 2rem);
	padding: 0 1rem 1rem 1rem;
}

.search {
	/*margin-right: 3rem;*/
	height: 1rem;
	padding: 1rem;
	display: flex;
	flex-direction: row;
	justify-content: flex-start;
	gap: 1rem;
	background-color: var(--bg2);
	width: fit-content;
	flex-shrink: 1;
	/*width: 100%;*/
	/*max-width: 26rem;*/
}

.search > * {
	padding: 0;
	background-color: transparent;
	color: var(--fg1);
	font-family: 'Roboto', sans-serif;
	font-weight: 500;
	font-size: 0.75rem;
	letter-spacing: 0.05em;
	line-height: 1rem;
}

.search input {
	border: none;
	outline: none;
	flex-grow: 1;
}

.search .divider, .search input::placeholder {
	color: var(--fg2);
}

#query-input {
	flex-shrink: 1;
	flex-basis: 20rem;
	width: 20rem;
	min-width: 10rem;
}

#id-input {
	font-family: 'JetBrains Mono', monospace;
	text-transform: lowercase;
	font-weight: 600;
	flex-grow: 0;
	width: calc(9ch + 0.4rem); /* GENIUS hack, 9 chars + 8 x letter spacing */
	box-sizing: content-box;
}

#season-input, #episode-input {
	font-family: 'JetBrains Mono', monospace;
	text-transform: lowercase;
	font-weight: 600;
	flex-grow: 0;
	width: calc(3ch + 0.1rem); /* GENIUS hack, 3 chars + 2 x letter spacing */
	box-sizing: content-box;
}

.main-container {
	padding: 6rem 7rem 0 7rem;
	height: calc(100% - 6rem);
	width: calc(100vw - 14rem);
	overflow: hidden;
	/*overflow-y: scroll;
	overflow-x: hidden;*/
}

#main {
	height: 100%;
	width: 100%;
}

.scroll {
	flex-direction: column;
	overflow-x: hidden;
	overflow-y: auto;
	padding-bottom: 6rem;
	-ms-overflow-style: none;
	scrollbar-width: none;
}

.scroll::-webkit-scrollbar {
	display: none;
}

.item-container {
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	align-items: stretch;
	gap: 1.5rem;
}

.bar {
	width: 100%;
	height: 3rem;
	display: flex;
	flex-direction: row;
	gap: 1.5rem;
}

.bar > button {
	height: 3rem;
	padding: 1rem;
}

.bar, .bar.left {
	justify-content: left;
}

.bar.center {
	justify-content: center;
}

.bar.right {
	justify-content: right;
}

.bar.right {
	justify-content: flex-end;
}

.poster {
	display: block;
	aspect-ratio: 1 / 1.5;
	background-color: var(--bg2);
	background-size: cover;
	background-repeat: no-repeat;
	user-select: none;
	-webkit-user-select: none;
	-webkit-touch-callout: none;
}

.poster .blur {
	background-color: transparent;
	background-image: inherit;
	height: 100%;
	width: 100%;
}

.cover {
	display: block;
	aspect-ratio: 16 / 9;
	background-color: var(--bg2);
	background-size: cover;
	background-repeat: no-repeat;
}

.favorite.toggled span {
	font-variation-settings:
	'FILL' 1,
	'wght' 500,
	'GRAD' 0,
	'opsz' 24;
	color: red;
}

#card-container {
	flex-direction: row;
	justify-content: stretch;
	flex-wrap: wrap;
}

#card-container .card {
	width: var(--cardWidth);
}

.card {
	display: grid;
	aspect-ratio: 1 / 1.5;
	background-color: transparent;
	text-decoration: none;
	transition: background-color .3s;
	user-select: none;
	-webkit-user-select: none;
	-webkit-touch-callout: none;
	align-items: start; /* fixes episode pane size on chrome */
}

.card > * {
	background-color: var(--bg2);
	position: relative;
	transition: opacity 0.3s;
	grid-column: 1;
	grid-row: 1;
}

.card .poster, .card .cover {
	pointer-events: none;
	opacity: 1;
	/* height: 100%; */
	width: 100%;
}

.card .info {
	padding: 1rem;
	width: calc(100% - 2rem);
	height: calc(100% - 2rem);
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	align-items: start;
	gap: 1rem;
	position: relative;
	color: var(--fg1);
	overflow: hidden;
}

.card .title {
	margin-top: auto;
	overflow: hidden;
	width: 100%;
	word-wrap: break-word;
}

.card .context {
	opacity: 1;
	position: absolute;
	bottom: 1rem;
}

.card .info > span, .card:hover .context {
	opacity: 0;
}

/*.card:hover {
	background-color: var(--bg2);
}*/

.card:hover .poster, .card:hover .cover {
	opacity: 0;
}

.card:hover .info > span {
	opacity: 1;
}

#details {
	width: 100%;
	height: calc(100% - 6rem);
	padding-bottom: 6rem;
	display: flex;
	flex-direction: row;
	/*column-gap: 3rem;
	row-gap: 1.5rem;*/
	gap: 3rem;
	justify-content: flex-start;
	flex-wrap: wrap;

	/* unsure abt this */
	max-width: calc((100vh - 12rem) / 1.5 + 76rem); /* first part is poster width */ /* 76 = 6rem (gaps) + 30rem (max width text) + 40rem (max with episodes) */
	margin: 0 auto;
}

#details > * {
	height: 100%;
}

#details > .item-container {
	flex-grow: 1;
}

#details > #details-information {
	flex-basis: 20rem;
	min-width: 20rem;
	max-width: 30rem;
}

#details > #details-seasons {
	flex-basis: 23rem;
	min-width: 23rem;
	max-width: 40rem;
}

#details > .wrap {
	height: auto;
	width: 100%;
	flex-shrink: 0;
	flex-basis: 100% !important;
	min-width: unset !important;
	max-width: 100% !important;
}

#details > .wrap .bar.right {
	justify-content: left;
}

#details-information .summary {
	flex-grow: 1;
	min-width: 20rem;
}

#season-container {
	padding: 0;
}

.pane {
	display: grid;
	grid-template-columns: min-content auto;
	grid-template-rows: auto;
	grid-column-gap: 1.5rem;
	height: 7rem;
	width: 100%;
	text-decoration: none;
	flex-shrink: 0;
	position: relative;
	transition: background-color .3s;
	/*transition: all 1s;*/
}

.pane .cover, .pane .poster {
	position: relative;
	grid-area: 1 / 1 / 2 / 2;
	height: 7rem;
	width: auto;
	transition: opacity .3s;
	opacity: 1;
}

.pane .info {
	grid-area: 1 / 2 / 2 / 3;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	align-content: flex-start;
	gap: .5rem 1rem;
	box-sizing: border-box;
	height: 7rem;
}

.pane .summary {
	flex-grow: 1;
	overflow: hidden;
}

.pane .play {
	position: absolute;
	left: 1rem;
}

.pane .summary, .pane .play, .pane:hover .poster, .pane:hover .number, .pane:hover .meta {
	display: none;
}

.pane:hover {
	background-color: var(--bg2);
}

.pane:hover .info {
	grid-area: 1 / 1 / 2 / 3;
	padding: 1rem 1rem 1rem 3rem;
}

.pane:hover .cover {
	opacity: 0;
}

.pane:hover .summary, .pane:hover .play {
	display: block;
}

.torrent {
	background-color: var(--bg2);
	width: 100%;
	height: 5rem;
	display: flex;
	align-items: center;
	padding: 1rem;
	box-sizing: border-box;
	gap: 1rem;
}

.torrent .score {
	position: relative;
	height: 3rem;
	width: 3rem;
	text-align: center;
	line-height: 3rem;

	--p: 1;
	--b: .4rem;
	--c: var(--fg1);

	font-family: 'JetBrains Mono', monospace;
	font-weight: 400;
	font-size: 0.75rem;
	letter-spacing: 0;
	color: var(--fg1);
	flex-shrink: 0;
}

.torrent .score::before {
	content: "";
	position: absolute;
	border-radius: 50%;
	width: 3rem;
	height: 3rem;
	inset: 0;
	background:
		radial-gradient(farthest-side, var(--c) 98%, #0000) top / var(--b) var(--b) no-repeat,
		conic-gradient(var(--c) calc(var(--p) * 100%), #0000 0);
	-webkit-mask: radial-gradient(farthest-side, #0000 calc(99% - var(--b)), #000 calc(100% - var(--b))); /* we should generate stuff like this automatically */
	mask: radial-gradient(farthest-side, #0000 calc(99% - var(--b)), #000 calc(100% - var(--b)));
	background-size: 0 0, auto;
}

.torrent .info {
	flex-grow: 1;
	display: flex;
	gap: .25rem;
	flex-direction: column;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

/* temp fix */

.settings {
	font-family: 'Roboto', sans-serif;
	background-color: var(--bg2);
	width: 100%;
	height: 5rem;
	display: flex;
	align-items: center;
	padding: 1rem;
	box-sizing: border-box;
	gap: 1rem;
}

.settings>.title {
	flex-grow: 1;
}

.settings>span {
	padding: 1rem;
}

.settings>input {
	height: 1rem;
	padding: 1rem;
	font-size: 1rem;
	display: flex;
	flex-direction: row;
	justify-content: flex-start;
	gap: 1rem;
	background-color: var(--bg1);
	width: fit-content;
	flex-shrink: 1;
	border: none;
	min-width: 3rem;
}

.bar > span {
	margin-right: auto;
	padding: 1rem;
	font-family: 'Roboto', sans-serif;
	font-size: 1rem;
	line-height: 1rem;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

#details-button, #autoplay_button, #next-button {
	flex-shrink: 0;
}

#next-button.r {
	margin-left: auto;
}

@media (max-width: 600px) or (max-height: 600px) {
	html {
		font-size: 0.8rem;
	}
	.navigation {
		grid-template-columns: 5rem auto 5rem;
		grid-template-rows: 4.3rem auto auto 4.3rem;
	}
	.main-container {
		padding: 4.3rem 5rem 0 5rem;
		height: calc(100% - 4.3rem);
		width: calc(100vw - 10rem);
	}
}
@media (max-width: 700px) {
	.torrent>.button {
		font-size: 0;
		gap: 0;
	}
	.torrent {
		gap: 0.6rem;
	}
}
