@import "./themes.css";

* {
	box-sizing: border-box;
	transition:
		background-color 0.2s ease,
		border-color 0.2s ease;
}

body {
	background-color: var(--background);
	color: var(--text);
	padding: 24px 40px;
	font-size: 18px;
	line-height: 1.5;
	text-align: left;
	font-family:
		system-ui,
		-apple-system,
		BlinkMacSystemFont,
		"Segoe UI",
		Roboto,
		sans-serif;
	margin: 0;
}

/* RTL Global Mirroring Adjustments */
body.rtl {
	text-align: right;
}
body.rtl #top {
	right: auto;
	left: 20px;
}
body.rtl .prefBox,
body.rtl .outputTemplateItem,
body.rtl .ytdlpInfoItem,
body.rtl .configBox {
	flex-direction: row-reverse;
}

.main-header {
	margin-bottom: 30px;
	padding-bottom: 15px;
}

h1 {
	margin: 0;
	font-size: 2rem;
	font-weight: 700;
}

.settings-container {
	max-width: 900px;
	margin: 0 auto;
}

.settings-section {
	margin-bottom: 24px;
	background-color: var(--box-main);
	border-radius: 12px;
	padding: 4px 12px;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

/* Boxes Design System */
.prefBox,
.outputTemplateItem,
.ytdlpInfoItem {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin: 12px 0;
	padding: 12px;
	border-radius: 8px;
}

.title-box {
	background: transparent;
	padding-left: 0;
	padding-right: 0;
	font-size: 1.15rem;
	border-bottom: 1px solid var(--box-separation);
	border-radius: 0;
}

.outputTemplateItem,
.ytdlpInfoItem,
#ytDlpArgBox {
	background-color: var(--box-separation);
}

#ytDlpArgBox {
	padding: 8px;
	border-radius: 8px;
}

#outputTemplateBox {
	padding: 20px;
}

#outputTemplateTxt {
	margin: 0 0 16px 0;
	font-weight: bold;
	font-size: 1.35rem;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

/* Inputs Architecture */
input[type="text"],
.input {
	border-radius: 6px;
	padding: 8px 12px;
	outline: none;
	border: 1px solid var(--box-separation);
	background-color: var(--background);
	color: var(--text);
	width: 45%;
	height: 38px;
	font-size: 0.95rem;
}

input[type="text"]:focus,
select:focus,
textarea:focus {
	border-color: var(--blueBtn);
	box-shadow: 0 0 0 3px rgba(29, 140, 209, 0.15);
}

.input-num {
	width: 80px;
	text-align: center;
}

.input-action-group {
	display: flex;
	gap: 10px;
	width: 60%;
	justify-content: flex-end;
}

.input-action-group input {
	width: 70%;
}

/* Modern Styled Buttons Components */
.btn {
	padding: 12px 16px;
	border: none;
	border-radius: 6px;
	font-size: 1rem;
	font-weight: 500;
	color: white;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition:
		filter 0.2s,
		transform 0.1s;
	text-decoration: none;
}

.btn:hover {
	filter: brightness(1.1);
}

.btn:active {
	transform: scale(0.97);
}

.btn.sm {
	padding: 4px 10px;
	font-size: 0.85rem;
}

.blueBtn {
	background-color: var(--blueBtn);
}
.redBtn {
	background-color: var(--redBtn);
}
.greenBtn {
	background-color: var(--greenBtn);
}

/* Navigation Positioning Matrix */
#top {
	display: flex;
	gap: 8px;
	align-items: center;
}

/* Dropdown styling */
select {
	padding: 8px 16px;
	background-color: var(--select);
	color: var(--text);
	border: 1px solid var(--box-separation);
	border-radius: 6px;
	cursor: pointer;
	font-size: 0.95rem;
	outline: none;
	min-width: 180px;
}

/* Path Readouts */
.path-display,
.path {
	font-family: "JetBrains Mono", Consolas, monospace;
	font-size: 0.85rem;
	opacity: 0.8;
}

#pathConfig {
	display: flex;
	flex-direction: column;
	padding: 16px;
}

.configBox {
	display: flex;
	justify-content: space-between;
	align-items: center;
	width: 100%;
}

#configOpts {
	display: none;
	flex-direction: column;
	align-items: flex-start;
	width: 100%;
	margin-top: 15px;
	padding-top: 15px;
	border-top: 1px solid var(--box-separation);
	gap: 12px;
}

/* Custom Arguments Textarea Styles */
#customArgsInput {
	padding: 12px;
	width: 100%;
	margin-top: 10px;
	outline: none;
	font-family: "JetBrains Mono", monospace;
	background-color: var(--background);
	color: var(--text);
	border: 1px solid var(--box-separation);
	border-radius: 6px;
	resize: none;
}

/* Interactive Sliders (Replacing Checkboxes for Premium Experience) */
.switch {
	position: relative;
	display: inline-block;
	width: 46px;
	height: 24px;
}

.switch input {
	opacity: 0;
	width: 0;
	height: 0;
}

.slider {
	position: absolute;
	cursor: pointer;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: var(--box-separation);
	transition: 0.3s;
	border-radius: 24px;
	border: 1px solid rgba(0, 0, 0, 0.05);
}

.slider:before {
	position: absolute;
	content: "";
	height: 16px;
	width: 16px;
	left: 3px;
	bottom: 3px;
	background-color: white;
	transition: 0.3s;
	border-radius: 50%;
}

input:checked + .slider {
	background-color: var(--greenBtn);
}

input:checked + .slider:before {
	transform: translateX(22px);
}

/* Miscellaneous Contexts UI Components */
.label-group {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.badge {
	background-color: var(--blueBtn);
	color: white;
	padding: 4px 8px;
	border-radius: 4px;
	font-size: 0.85rem;
}

.info-icon {
	cursor: help;
	margin-left: 6px;
	opacity: 0.7;
}

.link-info {
	color: var(--blueBtn);
	text-decoration: none;
	cursor: pointer;
}
.link-info:hover {
	text-decoration: underline;
}

#flatpakTxt {
	margin: 12px 0;
	color: var(--blueBtn);
	cursor: pointer;
	text-decoration: underline;
	display: none;
}

/* Global Popups Animation Elements */
.popup-container {
	position: fixed;
	bottom: 30px;
	left: 30px;
	z-index: 9999;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.popup-item {
	color: #fff;
	padding: 12px 24px;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	font-weight: 600;
	font-size: 14px;
	opacity: 1;
	transform: translateY(0);
	transition:
		opacity 0.3s,
		transform 0.3s;
	animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
	from {
		transform: translateY(20px);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}

/* ==========================================================================
   TABS & SEARCH SYSTEM EXTENSIONS
   ========================================================================== */

/* Header flex normalization */
.header-core {
	display: flex;
	justify-content: space-between; /* Evenly spaces Title, Search, and Buttons */
	align-items: center;
	flex-wrap: wrap;
	gap: 20px;
	margin-bottom: 20px;
	width: 100%;
}

/* Tab Management UI Strip */
.tab-container {
	display: flex;
	gap: 6px;
	border-bottom: 2px solid var(--box-separation);
	padding-bottom: 1px;
	margin-bottom: 10px;
}

.tab-container.search-active {
	opacity: 0.3;
	pointer-events: none;
	filter: blur(1px);
}

.tab-btn {
	background: transparent;
	border: none;
	color: var(--text);
	padding: 10px 20px;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	border-radius: 6px 6px 0 0;
	position: relative;
	opacity: 0.6;
	transition:
		opacity 0.2s ease,
		color 0.2s ease;
}

.tab-btn:hover {
	opacity: 1;
	background-color: var(--box-separation);
}

.tab-btn.active {
	opacity: 1;
	color: var(--blueBtn);
}

/* Modern Sliding underline decoration indicator */
.tab-btn.active::after {
	content: "";
	position: absolute;
	bottom: -2px;
	left: 0;
	right: 0;
	height: 3px;
	background-color: var(--blueBtn);
	border-radius: 4px;
}

/* Visibility Control Layer System */
.tab-content {
	display: none;
}

.tab-content.active {
	display: block;
	animation: fadeInTab 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Search Override: Forces everything visible to scan cross-categories */
.tab-content.search-override {
	display: block !important;
	animation: none !important;
}

.item-hidden {
	display: none !important;
}

@keyframes fadeInTab {
	from {
		opacity: 0;
		transform: translateY(4px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Search Bar Wrapper Contexts */
.search-wrapper {
	position: relative;
	width: 320px;
	max-width: 100%;
}

#settingsSearch {
	width: 100%;
	height: 38px;
	padding: 6px 12px 6px 36px;
	border-radius: 20px;
	border: 1px solid var(--box-separation);
	background-color: var(--box-main);
	color: var(--text);
	font-size: 0.9rem;
	outline: none;
}

#settingsSearch:focus {
	border-color: var(--blueBtn);
	box-shadow: 0 0 0 3px rgba(29, 140, 209, 0.15);
}

.search-icon {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 0.9rem;
	opacity: 0.5;
	pointer-events: none;
}

/* Fixes for Action Alignment Layout Boxes */
.path-readout {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin-top: 5px;
}

body.rtl .search-icon {
	left: auto;
	right: 14px;
}

body.rtl #settingsSearch {
	padding: 6px 36px 6px 12px;
}

body.rtl .header-core {
	flex-direction: row-reverse;
}
