/* * MINITUBE CSS FRAMEWORK
 * A lightweight, modern CSS framework inspired by minitube.tv
 * Updated with Glassmorphism, Shadows, Tables, Code Blocks, and enhanced States.
 */

/* =========================================
   VARIABLES & THEME
   ========================================= */
:root {
	/* Color Palette */
	--bg-base: #000000;
	--bg-surface: #0f0f0f;
	--bg-surface-elevated: #1a1a1a;
	--bg-surface-hover: #3a3a3a;

	/* Glass colors */
	--glass-bg: rgba(20, 20, 20, 0.4);
	--glass-border: rgba(255, 255, 255, 0.08);

	--text-primary: #ffffff;
	--text-secondary: #aaaaaa;
	--text-muted: #717171;

	--accent-primary: #ffffff;
	--accent-primary-text: #000000;

	/* Semantic Colors */
	--accent-success-bg: rgba(46, 204, 113, 0.15);
	--accent-success-text: #2ecc71;
	--accent-success-border: rgba(46, 204, 113, 0.3);

	--accent-info-bg: rgba(52, 152, 219, 0.15);
	--accent-info-text: #3498db;
	--accent-info-border: rgba(52, 152, 219, 0.3);

	--accent-warning-bg: rgba(241, 196, 15, 0.15);
	--accent-warning-text: #f1c40f;
	--accent-warning-border: rgba(241, 196, 15, 0.3);

	--accent-error-bg: rgba(200, 50, 50, 0.2);
	--accent-error-text: #ff6b6b;
	--accent-error-border: rgba(255, 107, 107, 0.2);
	--accent-red: #cc0000;

	/* Typography */
	--font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;

	/* Typography Scale */
	--font-size-xs: 0.75rem; /* 12px */
	--font-size-sm: 0.875rem; /* 14px */
	--font-size-base: 1rem; /* 16px */
	--font-size-md: 1.125rem; /* 18px */
	--font-size-lg: 1.25rem; /* 20px */
	--font-size-xl: 1.5rem; /* 24px */
	--font-size-xxl: 2rem; /* 32px */
	--font-size-xxxl: 2.5rem; /* 40px */
	--font-weight-bold: 700;

	/* Borders & Radius */
	--radius-sm: 6px;
	--radius-md: 12px;
	--radius-lg: 16px;
	--radius-pill: 9999px;

	/* Shadows */
	--shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
	--shadow-md: 0 8px 24px rgba(0, 0, 0, 0.6);
	--shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.8);
	--shadow-glow: 0 0 16px rgba(255, 255, 255, 0.1);

	/* Transitions */
	--transition-fast: 0.15s ease;
	--transition-normal: 0.3s ease;
	--transition-slow: 0.5s ease;

	/* Spacing Scale (8px grid based) */
	--space-xs: 4px;
	--space-sm: 8px;
	--space-md: 16px;
	--space-lg: 24px;
	--space-xl: 32px;
	--space-xxl: 48px;

	/* Z-Index Stack */
	--z-neg: -1;
	--z-base: 0;
	--z-float: 10;
	--z-modal: 1000;
	--z-toast: 10000;
	--z-tooltip: 11000;

	/* Opacity Steps */
	--op-low: 0.1;
	--op-glass: 0.4;
	--op-mid: 0.5;
	--op-high: 0.75;

	/* Icon Sizes */
	--icon-size-sm: 18px;
	--icon-size-md: 24px;
	--icon-size-lg: 32px;
}

/* Custom Selection Color */
::selection {
	background-color: var(--accent-primary);
	color: var(--accent-primary-text);
}

/* =========================================
   RESET & BASE
   ========================================= */

/* Global Scrollbar Styling */
::-webkit-scrollbar {
	width: 6px;
	height: 6px;
}
::-webkit-scrollbar-track {
	background: transparent;
}
::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.1);
	border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
	background: rgba(255, 255, 255, 0.2);
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

body {
	scroll-behavior: smooth;
	margin: 0;
	padding: 0;
	background-color: var(--bg-base);
	color: var(--text-primary);
	font-family: var(--font-family);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin-top: 0;
	margin-bottom: 0.5rem;
	font-weight: var(--font-weight-bold);
	line-height: 1.2;
}

h1 {
	font-size: var(--font-size-xxxl);
}

h2 {
	font-size: var(--font-size-xxl);
}

h3 {
	font-size: var(--font-size-xl);
}

h4 {
	font-size: var(--font-size-lg);
}

h5 {
	font-size: var(--font-size-base);
}

h6 {
	font-size: var(--font-size-sm);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--text-secondary);
}

/* =========================================
   TYPOGRAPHY
   ========================================= */

a {
	color: var(--text-primary);
	text-decoration: none;
	transition: color var(--transition-fast);
}

a:hover {
	color: var(--text-secondary);
}

p {
	margin-top: 0;
	margin-bottom: 1.5rem;
}

hr {
	border: 0;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	margin: 2rem 0;
}

/* --- Typography Extensions --- */
.text-bold {
	font-weight: var(--font-weight-bold);
}

.text-muted {
	color: var(--text-muted);
}

.text-secondary {
	color: var(--text-secondary);
}

.text-error {
	color: var(--accent-error-text);
}

.text-small {
	font-size: var(--font-size-sm);
}

.video-title {
	font-size: var(--font-size-lg);
	font-weight: var(--font-weight-bold);
	letter-spacing: -0.02em;
}

blockquote {
	margin: 0 0 1.5rem 0;
	padding: var(--space-sm) var(--space-md);
	border-left: 4px solid var(--accent-primary);
	color: var(--text-secondary);
	font-style: italic;
	background-color: var(--bg-surface-elevated);
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

ul,
ol {
	margin-top: 0;
	margin-bottom: 1.5rem;
	padding-left: 1.5rem;
}

li {
	margin-bottom: 0.5rem;
}

code {
	padding: 0.2em 0.4em;
	margin: 0;
	font-size: 0.85em;
	background-color: var(--bg-surface-elevated);
	border-radius: var(--radius-sm);
	font-family: var(--font-mono);
	color: #ff8a65;
}

pre {
	display: block;
	padding: var(--space-md);
	margin: 0 0 1.5rem 0;
	font-size: var(--font-size-sm);
	line-height: 1.5;
	color: var(--text-primary);
	background-color: var(--bg-surface-elevated);
	border: 1px solid rgba(255, 255, 255, 0.05);
	border-radius: var(--radius-md);
	overflow: auto;
	font-family: var(--font-mono);
}

pre code {
	padding: 0;
	background-color: transparent;
	color: inherit;
}

/* =========================================
   LAYOUT & GRID
   ========================================= */
.container {
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 var(--space-md);
}

.row {
	display: flex;
	flex-wrap: wrap;
	margin: -10px;
}

.col {
	flex: 1;
	padding: 10px;
	min-width: 250px;
}

/* Column Sizing (Flex Multipliers) */
.col-1 {
	flex: 1 !important;
}
.col-2 {
	flex: 2 !important;
}
.col-3 {
	flex: 3 !important;
}
.col-4 {
	flex: 4 !important;
}
.col-5 {
	flex: 5 !important;
}
.col-6 {
	flex: 6 !important;
}

/* Tablet Multipliers (768px and up) */
@media (min-width: 768px) {
	.col-sm-1 {
		flex: 1 !important;
	}
	.col-sm-2 {
		flex: 2 !important;
	}
	.col-sm-3 {
		flex: 3 !important;
	}
	.col-sm-4 {
		flex: 4 !important;
	}
	.col-sm-5 {
		flex: 5 !important;
	}
	.col-sm-6 {
		flex: 6 !important;
	}

	.w-sm-25 {
		width: 25% !important;
	}
	.w-sm-33 {
		width: 33.333% !important;
	}
	.w-sm-50 {
		width: 50% !important;
	}
	.w-sm-75 {
		width: 75% !important;
	}
	.w-sm-100 {
		width: 100% !important;
	}
	.w-sm-auto {
		width: auto !important;
	}
}

/* Large Desktop Multipliers (1200px and up) */
@media (min-width: 1200px) {
	.col-lg-1 {
		flex: 1 !important;
	}
	.col-lg-2 {
		flex: 2 !important;
	}
	.col-lg-3 {
		flex: 3 !important;
	}
	.col-lg-4 {
		flex: 4 !important;
	}
	.col-lg-5 {
		flex: 5 !important;
	}
	.col-lg-6 {
		flex: 6 !important;
	}

	.w-lg-25 {
		width: 25% !important;
	}
	.w-lg-33 {
		width: 33.333% !important;
	}
	.w-lg-50 {
		width: 50% !important;
	}
	.w-lg-75 {
		width: 75% !important;
	}
	.w-lg-100 {
		width: 100% !important;
	}
	.w-lg-auto {
		width: auto !important;
	}
}

.flex {
	display: flex;
}

.flex-col {
	display: flex;
	flex-direction: column;
}

.align-first {
	align-items: first baseline;
}

.align-last {
	align-items: last baseline;
}

.align-center {
	align-items: center;
}

.justify-start {
	justify-content: flex-start;
}

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

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

.justify-between {
	justify-content: space-between;
}

.justify-around {
	justify-content: space-around;
}

.justify-evenly {
	justify-content: space-evenly;
}

.gap-sm {
	gap: var(--space-sm);
}

.gap-md {
	gap: var(--space-md);
}

.gap-lg {
	gap: var(--space-lg);
}

.w-100 {
	width: 100%;
}

/* =========================================
   BUTTONS
   ========================================= */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: var(--space-sm) var(--space-lg);
	font-family: var(--font-family);
	font-size: 0.9rem; /* Slightly smaller than base for buttons */
	font-weight: 600;
	border: 1px solid rgba(255, 255, 255, 0.05);
	border-radius: var(--radius-pill);
	background-color: var(--bg-surface-elevated);
	color: var(--text-primary);
	cursor: pointer;
	transition: all var(--transition-fast);
	white-space: nowrap;
	outline: none;
}
.btn:hover {
	background-color: var(--bg-surface-hover);
	border-color: rgba(255, 255, 255, 0.1);
}
.btn:active {
	transform: scale(0.97);
}

/* Updated Focus State: More subtle than standard outline */
.btn:focus-visible {
	box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

/* States: Disabled & Active */
.btn:disabled,
.btn.disabled {
	opacity: 0.4;
	filter: grayscale(0.5);
	pointer-events: none;
	user-select: none;
	background-color: rgba(255, 255, 255, 0.05) !important;
	color: var(--text-secondary) !important;
	border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.btn.active {
	background-color: rgba(255, 255, 255, 0.12);
	border-color: var(--accent-primary);
	color: var(--accent-primary);
	box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.05);
}
.btn.active:hover {
	background-color: rgba(255, 255, 255, 0.18);
	box-shadow:
		inset 0 0 8px rgba(255, 255, 255, 0.1),
		0 0 12px rgba(255, 255, 255, 0.05);
}
.btn.active i {
	color: inherit;
}

/* Primary Button Updates */
.btn-primary {
	background-color: var(--accent-primary);
	color: var(--accent-primary-text);
}
.btn-primary:hover {
	background-color: #d1d1d1;
	box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
}
.btn-primary:active {
	background-color: #aaaaaa;
	transform: scale(0.95); /* Deeper press feel */
}

/* Secondary Button */
.btn-secondary {
	background-color: var(--bg-surface-elevated);
	color: var(--text-primary);
	border: 1px solid rgba(255, 255, 255, 0.1);
}
.btn-secondary:hover {
	background-color: var(--bg-surface-hover);
}
.btn-secondary:active {
	background-color: #333;
	transform: scale(0.95);
}

/* Error Button Updates */
.btn-error {
	background-color: var(--accent-error-bg);
	color: var(--accent-error-text);
	border: 1px solid rgba(255, 107, 107, 0.2);
}
.btn-error:hover {
	background-color: rgba(200, 50, 50, 0.3);
}
.btn-error:active {
	background-color: var(--accent-red); /* High contrast active state */
	color: white;
	transform: scale(0.95);
}

/* Icon Button Updates */
.btn-icon {
	width: 44px;
	height: 44px;
	padding: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.05); /* Premium glass default */
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	color: var(--text-primary);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid rgba(255, 255, 255, 0.08);
	cursor: pointer;
	transition: all var(--transition-fast);
}
.btn-icon:hover {
	background: rgba(255, 255, 255, 0.12);
	border-color: rgba(255, 255, 255, 0.2);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.btn-icon:active {
	background-color: var(--accent-primary);
	color: var(--accent-primary-text);
	transform: scale(0.9);
	border-color: transparent;
}
.btn-icon:focus-visible {
	box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

/* Icon Button Specific States */
.btn-icon:disabled,
.btn-icon.disabled {
	opacity: 0.5;
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.15);
	pointer-events: none;
}

.btn-icon.active {
	background: rgba(255, 255, 255, 0.15);
	border-color: var(--accent-primary);
	color: var(--accent-primary);
	box-shadow: 0 0 12px rgba(255, 255, 255, 0.1);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
}
.btn-icon.active:hover {
	background: rgba(255, 255, 255, 0.2);
	color: var(--accent-primary);
}

/* =========================================
   BADGES
   ========================================= */
.badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 2px 10px;
	font-size: 0.7rem;
	font-weight: 800;
	line-height: 1.2;
	border-radius: var(--radius-pill);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	white-space: nowrap;
	border: 1px solid var(--glass-border);
	background-color: var(--bg-surface-elevated);
	color: var(--text-primary);
}

.badge-primary {
	background-color: var(--accent-primary);
	color: var(--accent-primary-text);
	border-color: transparent;
}

.badge-secondary {
	background-color: rgba(255, 255, 255, 0.1);
	color: var(--text-primary);
}

.badge-success {
	background-color: var(--accent-success-bg);
	color: var(--accent-success-text);
	border-color: var(--accent-success-border);
}

.badge-info {
	background-color: var(--accent-info-bg);
	color: var(--accent-info-text);
	border-color: var(--accent-info-border);
}

.badge-warning {
	background-color: var(--accent-warning-bg);
	color: var(--accent-warning-text);
	border-color: var(--accent-warning-border);
}

.badge-error {
	background-color: var(--accent-error-bg);
	color: var(--accent-error-text);
	border-color: var(--accent-error-border);
}

/* =========================================
   ICONS (Tabler Icons Support)
   ========================================= */
.ti {
	display: inline-block;
	line-height: 1;
	font-size: var(--icon-size-md); /* Default size */
	vertical-align: middle;
}

.icon-sm {
	font-size: var(--icon-size-sm);
}
.icon-md {
	font-size: var(--icon-size-md);
}
.icon-lg {
	font-size: var(--icon-size-lg);
}

/* Ensure icons inside btn-icon are sized correctly (Optimal size for 44px button) */
/*.btn-icon .ti {
	ont-size: 20px;
}*/

/* =========================================
   FORMS & INPUTS
   ========================================= */
.form-group {
	margin-bottom: 1rem;
}

.form-label {
	display: block;
	margin-bottom: var(--space-xs);
	font-size: var(--font-size-sm);
	font-weight: 600;
	color: var(--text-secondary);
}

.form-control {
	width: 100%;
	min-width: 0; /* Prevents input from forcing flex container to expand */
	padding: var(--space-sm) var(--space-md);
	background-color: var(--bg-surface-elevated);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: var(--radius-md);
	color: var(--text-primary);
	font-family: var(--font-family);
	font-size: var(--font-size-base);
	transition: all var(--transition-fast);
}
.form-control:hover {
	border-color: rgba(255, 255, 255, 0.2);
}
.form-control:focus {
	outline: none;
	border-color: var(--accent-primary);
	background-color: var(--bg-surface-hover);
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}
.form-control::placeholder {
	color: var(--text-muted);
}

textarea.form-control {
	min-height: 100px;
	resize: vertical;
}

select.form-control {
	appearance: none;
	background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
	background-repeat: no-repeat;
	background-position: right 1rem center;
	background-size: 1em;
	padding-right: 2.5rem;
}

/* Custom Checkbox & Radio */
.form-check {
	display: flex;
	align-items: center;
	gap: var(--space-sm);
	margin-bottom: var(--space-xs);
	cursor: pointer;
}
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
	appearance: none;
	width: 18px;
	height: 18px;
	background-color: var(--bg-surface-elevated);
	border: 1px solid rgba(255, 255, 255, 0.2);
	display: grid;
	place-content: center;
	cursor: pointer;
	transition: all var(--transition-fast);
}

.form-check input[type="checkbox"] {
	border-radius: 4px;
}

.form-check input[type="radio"] {
	border-radius: 50%;
}

.form-check input[type="checkbox"]::before {
	content: "";
	width: 10px;
	height: 10px;
	box-shadow: inset 1em 1em var(--bg-base);
	transform-origin: bottom left;
	clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
	transform: scale(0);
	transition: 120ms transform ease-in-out;
}

.form-check input[type="radio"]::before {
	content: "";
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background-color: var(--bg-base);
	transform: scale(0);
	transition: 120ms transform ease-in-out;
}

.form-check input:checked {
	background-color: var(--accent-primary);
	border-color: var(--accent-primary);
}

.form-check input:checked::before {
	transform: scale(1);
}

/* Toggle Switch */
.toggle-switch {
	position: relative;
	display: inline-block;
	width: 44px;
	height: 24px;
	flex-shrink: 0;
}

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

.toggle-slider {
	position: absolute;
	cursor: pointer;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: var(--bg-surface-elevated);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: var(--radius-pill);
	transition: 0.3s;
}

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

.toggle-switch input:checked + .toggle-slider {
	background-color: var(--accent-primary);
	border-color: var(--accent-primary);
}

.toggle-switch input:checked + .toggle-slider:before {
	transform: translateX(20px);
	background-color: var(--bg-base);
}

.toggle-switch input:focus + .toggle-slider {
	box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

/* =========================================
   UI PANELS & GLASSMORPHISM
   ========================================= */

.surface-panel {
	background-color: var(--bg-surface);
	border: 1px solid rgba(255, 255, 255, 0.05);
	border-radius: var(--radius-lg);
	padding: var(--space-lg);
}

/* Glassmorphism Utilities */
.glass {
	background: var(--glass-bg);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	border: 1px solid var(--glass-border);
}
.glass-panel {
	border-radius: var(--radius-lg);
	padding: var(--space-lg);
	background: var(--glass-bg);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	border: 1px solid var(--glass-border);
	box-shadow: var(--shadow-md);
}

.glass-card {
	background: rgba(255, 255, 255, 0.03);
	backdrop-filter: blur(24px);
	-webkit-backdrop-filter: blur(24px);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: var(--radius-lg);
	padding: var(--space-lg);
	box-shadow:
		0 8px 32px rgba(0, 0, 0, 0.3),
		inset 0 0 0 1px rgba(255, 255, 255, 0.05);
	transition:
		transform var(--transition-normal),
		box-shadow var(--transition-normal),
		background var(--transition-normal);
}

.glass-card:hover {
	background: rgba(255, 255, 255, 0.06);
	border-color: rgba(255, 255, 255, 0.25);
	box-shadow:
		0 12px 48px rgba(0, 0, 0, 0.5),
		inset 0 0 0 1px rgba(255, 255, 255, 0.1);
	transform: translateY(-2px);
}

/* Shadows Utilities */
.shadow-sm {
	box-shadow: var(--shadow-sm);
}
.shadow-md {
	box-shadow: var(--shadow-md);
}
.shadow-lg {
	box-shadow: var(--shadow-lg);
}

/* List Items */
.list-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: var(--space-sm) var(--space-md);
	border-radius: 0 var(--radius-md) var(--radius-md) 0;
	border-left: 4px solid transparent;
	cursor: pointer;
	transition: all var(--transition-fast);
}
.list-item:hover {
	background-color: var(--bg-surface-hover);
	border-left-color: rgba(255, 255, 255, 0.2);
	transform: translateX(4px);
}
.list-item.active {
	background-color: var(--bg-surface-elevated);
	border-left: 4px solid var(--accent-primary);
	color: var(--accent-primary);
}

/* =========================================
   TABLES
   ========================================= */
.table-wrapper {
	overflow-x: auto;
	margin-bottom: 1.5rem;
}

.table {
	width: 100%;
	border-collapse: collapse;
	text-align: left;
}

.table th,
.table td {
	padding: var(--space-sm) var(--space-md);
	border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.table th {
	font-weight: 600;
	color: var(--text-secondary);
	background-color: var(--bg-surface-elevated);
}

.table tbody tr {
	transition: background-color var(--transition-fast);
}

.table tbody tr:hover {
	background-color: var(--bg-surface-hover);
}

/* =========================================
   MODALS & OVERLAYS
   ========================================= */
.modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: var(--z-modal);
	opacity: 0;
	visibility: hidden;
	transition: all var(--transition-normal);
	padding: var(--space-lg);
}

.modal-overlay.is-open {
	opacity: 1;
	visibility: visible;
}

.modal-panel {
	display: none;
	width: 100%;
	max-width: 500px;
	transform: scale(0.9);
	transition: all var(--transition-normal);
	/* Standard Panel Look */
	background-color: var(--bg-surface);
	border: 1px solid var(--glass-border);
	border-radius: var(--radius-lg);
	padding: var(--space-lg);
	box-shadow: var(--shadow-lg);
}

.modal-panel.is-active {
	display: block;
}

.modal-overlay.is-open .modal-panel.is-active {
	transform: scale(1);
}

.modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 24px;
}

.modal-footer {
	display: flex;
	justify-content: flex-end;
	gap: 12px;
	margin-top: 32px;
}

/* Locked state: Hide close buttons if interaction is prevented */
.modal-panel.is-locked [data-modal-close],
.modal-panel.is-locked .close-btn {
	display: none !important;
}

/* =========================================
   TOAST NOTIFICATIONS
   ========================================= */
.toast-container {
	position: fixed;
	top: var(--space-lg);
	right: var(--space-lg); /* Replace 'right' with 'left' here for left alignment */
	z-index: var(--z-toast);
	display: flex;
	flex-direction: column;
	gap: var(--space-md);
	pointer-events: none;
}

.toast {
	pointer-events: auto;
	min-width: 280px;
	max-width: 420px;
	padding: var(--space-sm) var(--space-md);
	position: relative; /* Needed for absolute positioning of progress bar */
	overflow: hidden; /* Clips progress bar to asymmetric border radius */
	border-radius: 0 var(--radius-md) var(--radius-md) 0;
	background: rgba(15, 15, 15, 0.85);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	border: 1px solid var(--glass-border);
	color: var(--text-primary);
	box-shadow: var(--shadow-lg), var(--shadow-glow);
	font-size: var(--font-size-sm);
	font-weight: 500;
	line-height: 1.4;
	display: flex;
	align-items: center;
	opacity: 0;
	transform: translateX(40px);
	transition:
		opacity var(--transition-normal),
		transform var(--transition-normal),
		background var(--transition-fast);
	border-left: 4px solid var(--accent-primary);
}

.toast.show {
	opacity: 1;
	transform: translateX(0);
}

.toast.hiding {
	opacity: 0;
	transform: translateX(40px);
	transform: scale(0.9) translateY(-20px);
	pointer-events: none;
}

.toast.is-dismissible {
	cursor: pointer;
}
.toast.is-dismissible:hover {
	background: rgba(45, 45, 45, 0.9);
	border-color: rgba(255, 255, 255, 0.2);
}

/* Pause the progress bar animation when the toast is hovered */
.toast:hover .toast-progress {
	animation-play-state: paused;
}

.toast.success {
	border-left-color: var(--accent-success-text);
}
.toast.error {
	border-left-color: var(--accent-error-text);
	color: var(--accent-error-text);
}
.toast.info {
	border-left-color: var(--accent-info-text);
}
.toast.warning {
	border-left-color: var(--accent-warning-text);
}

/* Progress Bar */
.toast-progress {
	position: absolute;
	bottom: 0;
	left: 0;
	height: 3px;
	width: 100%;
	background: rgba(255, 255, 255, 0.2);
	transform-origin: left;
	animation: toastProgress linear forwards;
}

@keyframes toastProgress {
	from {
		transform: scaleX(1);
	}
	to {
		transform: scaleX(0);
	}
}

/* =========================================
   TOOLTIPS
   ========================================= */
[data-tooltip] {
	position: relative;
}

[data-tooltip]::after {
	content: attr(data-tooltip);
	position: absolute;
	padding: var(--space-xs) var(--space-sm);
	background: var(--glass-bg);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	border: 1px solid var(--glass-border);
	color: var(--text-primary);
	font-size: var(--font-size-xs);
	font-weight: 700;
	line-height: 1.4;
	border-radius: var(--radius-sm);
	white-space: pre-wrap; /* Allows manual line breaks and automatic wrapping, alt: "white-space: normal;" */
	width: fit-content; /* Container width adapts to the text length, alt: REMOVE */
	max-width: 90vw; /* Safety cap to prevent overflow on mobile, alt: "max-width: 250px;" */
	text-align: center;
	z-index: var(--z-tooltip);
	box-shadow: var(--shadow-md);
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
	transition:
		opacity var(--transition-fast) 0s,
		transform var(--transition-fast) 0s,
		visibility var(--transition-fast) 0s;
}

/* Position: Top (Default) */
[data-tooltip]::after,
[data-tooltip-position="top"]::after {
	bottom: calc(100% + 10px);
	left: 50%;
	transform: translateX(-50%) translateY(10px);
}
[data-tooltip]:hover::after,
[data-tooltip].is-touched::after,
[data-tooltip-position="top"]:hover::after {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
	transition-delay: 0.4s; /* Delay before showing */
}

/* Position: Bottom */
[data-tooltip-position="bottom"]::after {
	bottom: auto;
	top: calc(100% + 10px);
	left: 50%;
	transform: translateX(-50%) translateY(-10px);
}
[data-tooltip-position="bottom"]:hover::after,
[data-tooltip-position="bottom"].is-touched::after {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
	transition-delay: 0.4s;
}

/* Position: Left */
[data-tooltip-position="left"]::after {
	bottom: auto;
	left: auto;
	top: 50%;
	right: calc(100% + 10px);
	transform: translateY(-50%) translateX(10px);
}
[data-tooltip-position="left"]:hover::after,
[data-tooltip-position="left"].is-touched::after {
	opacity: 1;
	visibility: visible;
	transform: translateY(-50%) translateX(0);
	transition-delay: 0.4s;
}

/* Position: Right */
[data-tooltip-position="right"]::after {
	bottom: auto;
	left: calc(100% + 10px);
	top: 50%;
	transform: translateY(-50%) translateX(-10px);
}
[data-tooltip-position="right"]:hover::after,
[data-tooltip-position="right"].is-touched::after {
	opacity: 1;
	visibility: visible;
	transform: translateY(-50%) translateX(0);
	transition-delay: 0.4s;
}

/* Position: Mouse (Requires setupTooltips JS to update --tooltip-x/y variables) */
[data-tooltip-position="mouse"]::after {
	bottom: auto;
	left: var(--tooltip-x, 0);
	top: var(--tooltip-y, 0);
	transform: translate(15px, 15px); /* Offset from cursor */
}
[data-tooltip-position="mouse"]:hover::after,
[data-tooltip-position="mouse"].is-touched::after {
	opacity: 1;
	visibility: visible;
	transition-delay: 0.4s;
}

/* Force-hide tooltip when the 'tooltip-hidden' class is applied via JS (e.g. on click) */
[data-tooltip].tooltip-hidden::after {
	opacity: 0 !important;
	visibility: hidden !important;
	transition-delay: 0s !important;
}

/* =========================================
   UTILITIES & HELPERS
   ========================================= */

/* Display & Layout Aliases */
.d-none,
.hidden {
	display: none !important;
}
.d-block,
.block {
	display: block !important;
}
.d-inline,
.inline {
	display: inline !important;
}
.d-inline-block,
.inline-block {
	display: inline-block !important;
}
.d-flex,
.flex-display {
	display: flex !important;
}
.d-iflex,
.inline-flex {
	display: inline-flex !important;
}

/* Positioning */
.pos-rel,
.relative {
	position: relative !important;
}
.pos-abs,
.absolute {
	position: absolute !important;
}
.pos-fixed,
.fixed {
	position: fixed !important;
}

/* Sizing */
.w-25 {
	width: 25% !important;
}
.w-33 {
	width: 33.333% !important;
}
.w-50 {
	width: 50% !important;
}
.w-75 {
	width: 75% !important;
}
.w-100,
.w-full,
.full-width {
	width: 100% !important;
}
.h-100,
.h-full,
.full-height {
	width: 100% !important;
}
.w-auto {
	width: auto !important;
}
.h-auto {
	height: auto !important;
}

/* Text Alignment & Style */
.text-left {
	text-align: left !important;
}
.text-center {
	text-align: center !important;
}
.text-right {
	text-align: right !important;
}
.text-uppercase {
	text-transform: uppercase !important;
}
.text-lowercase {
	text-transform: lowercase !important;
}
.text-capitalize {
	text-transform: capitalize !important;
}
.text-bold {
	font-weight: 700 !important;
}
.text-muted {
	color: var(--text-muted) !important;
}
.text-secondary {
	color: var(--text-secondary) !important;
}
.text-success,
.success {
	color: var(--accent-success-text) !important;
}
.text-info,
.info {
	color: var(--accent-info-text) !important;
}
.text-warning,
.warning {
	color: var(--accent-warning-text) !important;
}
.text-error,
.error {
	color: var(--accent-error-text) !important;
}
.text-truncate {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	display: block;
}

/* User Interaction */
.select-none,
.unselectable {
	user-select: none !important;
}
.pointer-none,
.no-pointer {
	pointer-events: none !important;
}
.cursor-pointer,
.pointer {
	cursor: pointer !important;
}
.cursor-default {
	cursor: default !important;
}
.cursor-none {
	cursor: none !important;
}

/* Overflow Helpers */
.overflow-hidden,
.o-hidden {
	overflow: hidden !important;
}
.overflow-auto,
.o-auto {
	overflow: auto !important;
}
.overflow-scroll,
.o-scroll {
	overflow: scroll !important;
}
.overflow-visible,
.o-visible {
	overflow: visible !important;
}
.overflow-x-hidden,
.ox-hidden {
	overflow-x: hidden !important;
}
.overflow-x-auto,
.ox-auto {
	overflow-x: auto !important;
}
.overflow-y-hidden,
.oy-hidden {
	overflow-y: hidden !important;
}
.overflow-y-auto,
.oy-auto {
	overflow-y: auto !important;
}

/* Opacity Helpers */
.opacity-0 {
	opacity: 0 !important;
}
.opacity-10 {
	opacity: var(--op-low) !important;
}
.opacity-25 {
	opacity: 0.25 !important;
}
.opacity-40 {
	opacity: var(--op-glass) !important;
} /* Matches glass-bg alpha */
.opacity-50 {
	opacity: var(--op-mid) !important;
}
.opacity-75 {
	opacity: var(--op-high) !important;
}
.opacity-100 {
	opacity: 1 !important;
}

/* Z-Index Helpers */
.z-neg {
	z-index: var(--z-neg) !important;
}
.z-0 {
	z-index: var(--z-base) !important;
}
.z-10 {
	z-index: var(--z-float) !important;
}
.z-20 {
	z-index: 20 !important;
}
.z-50 {
	z-index: 50 !important;
}
.z-100 {
	z-index: 100 !important;
}
.z-modal {
	z-index: var(--z-modal) !important;
}
.z-toast {
	z-index: var(--z-toast) !important;
}
.z-tooltip {
	z-index: var(--z-tooltip) !important;
}
.z-auto {
	z-index: auto !important;
}

/* Spacing Helpers */
.m-0,
.m-none {
	margin: 0 !important;
}
.mt-0,
.mt-none {
	margin-top: 0 !important;
}
.mb-0,
.mb-none {
	margin-bottom: 0 !important;
}
.ml-0,
.ml-none {
	margin-left: 0 !important;
}
.mr-0,
.mr-none {
	margin-right: 0 !important;
}
.mx-0,
.mx-none {
	margin-left: 0 !important;
	margin-right: 0 !important;
}
.my-0,
.my-none {
	margin-top: 0 !important;
	margin-bottom: 0 !important;
}

/* Semantic Spacing Aliases */
.m-xs {
	margin: var(--space-xs) !important;
}
.m-sm {
	margin: var(--space-sm) !important;
}
.m-md {
	margin: var(--space-md) !important;
}
.m-lg {
	margin: var(--space-lg) !important;
}

/* Side-specific Semantic Aliases */
.mt-xs {
	margin-top: var(--space-xs) !important;
}
.mr-xs {
	margin-right: var(--space-xs) !important;
}
.mb-xs {
	margin-bottom: var(--space-xs) !important;
}
.ml-xs {
	margin-left: var(--space-xs) !important;
}

.mt-sm,
.mt-10 {
	margin-top: var(--space-sm) !important;
}
.mr-sm {
	margin-right: var(--space-sm) !important;
}
.mb-sm,
.mb-10 {
	margin-bottom: var(--space-sm) !important;
}
.ml-sm {
	margin-left: var(--space-sm) !important;
}

.mt-md,
.mt-20 {
	margin-top: var(--space-md) !important;
}
.mr-md {
	margin-right: var(--space-md) !important;
}
.mb-md,
.mb-20 {
	margin-bottom: var(--space-md) !important;
}
.ml-md {
	margin-left: var(--space-md) !important;
}

.mt-lg {
	margin-top: var(--space-lg) !important;
}
.mr-lg {
	margin-right: var(--space-lg) !important;
}
.mb-lg {
	margin-bottom: var(--space-lg) !important;
}
.ml-lg {
	margin-left: var(--space-lg) !important;
}

.mt-xl {
	margin-top: var(--space-xl) !important;
}
.mb-xl {
	margin-bottom: var(--space-xl) !important;
}

.p-0,
.p-none {
	padding: 0 !important;
}
.pt-0,
.pt-none {
	padding-top: 0 !important;
}
.pb-0,
.pb-none {
	padding-bottom: 0 !important;
}
.pl-0,
.pl-none {
	padding-left: 0 !important;
}
.pr-0,
.pr-none {
	padding-right: 0 !important;
}
.px-0,
.px-none {
	padding-left: 0 !important;
	padding-right: 0 !important;
}
.py-0,
.py-none {
	padding-top: 0 !important;
	padding-bottom: 0 !important;
}

/* Semantic Padding Aliases */
.p-xs {
	padding: var(--space-xs) !important;
}
.p-sm,
.p-10 {
	padding: var(--space-sm) !important;
}
.p-md,
.p-20 {
	padding: var(--space-md) !important;
}
.p-lg {
	padding: var(--space-lg) !important;
}

/* Flexbox Extras */
.flex-1 {
	flex: 1 !important;
}
.flex-shrink-0 {
	flex-shrink: 0 !important;
}
.flex-wrap {
	flex-wrap: wrap !important;
}
.flex-center {
	display: flex !important;
	justify-content: center !important;
	align-items: center !important;
}
.items-center {
	align-items: center !important;
}
.justify-between,
.between {
	justify-content: space-between !important;
}

/* Animations */
.fade-in {
	animation: fadeIn var(--transition-normal) forwards;
}
.slide-up {
	animation: slideUp var(--transition-normal) forwards;
}

@keyframes fadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

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

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 767px) {
	html {
		font-size: 14px;
	}

	.container {
		padding-left: 15px;
		padding-right: 15px;
	}

	/* Grid Collapse */
	.row {
		flex-direction: column;
		margin: 0;
	}
	.col {
		width: 100% !important;
		padding: 10px 0;
		min-width: 0;
	}

	/* Typography Scaling */
	h1 {
		font-size: 1.8rem;
	}
	h2 {
		font-size: 1.5rem;
	}
	h3 {
		font-size: 1.2rem;
	}

	/* Components */
	.btn {
		padding: 8px 16px;
		font-size: 0.85rem;
	}
	.btn-icon {
		width: 40px;
		height: 40px;
	}

	/* Helpers */
	.hide-mobile {
		display: none !important;
	}
	.show-mobile {
		display: block !important;
	}

	.modal-panel {
		max-width: 95%;
		padding: 20px;
	}
}

@media (min-width: 769px) {
	.show-mobile {
		display: none !important;
	}
}
