/**
 * Jibu POS - Modern Futuristic Theme
 * Clean, minimal design with glass morphism effects
 */

/* CSS Variables - Modern Theme */
:root {
	/* Primary colors - Modern Blue Gradient */
	--primary: #6366F1;
	--primary-dark: #4F46E5;
	--primary-light: #818CF8;
	--primary-bg: rgba(99, 102, 241, 0.1);
	--primary-gradient: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);

	/* Accent colors */
	--accent: #06B6D4;
	--accent-light: #22D3EE;

	/* Success/Error/Warning - Softer tones */
	--success: #10B981;
	--success-bg: rgba(16, 185, 129, 0.1);
	--error: #EF4444;
	--error-bg: rgba(239, 68, 68, 0.1);
	--warning: #F59E0B;
	--warning-bg: rgba(245, 158, 11, 0.1);
	--info: #3B82F6;
	--info-bg: rgba(59, 130, 246, 0.1);

	/* Neutral colors - Cooler grays */
	--white: #FFFFFF;
	--gray-50: #F8FAFC;
	--gray-100: #F1F5F9;
	--gray-200: #E2E8F0;
	--gray-300: #CBD5E1;
	--gray-400: #94A3B8;
	--gray-500: #64748B;
	--gray-600: #475569;
	--gray-700: #334155;
	--gray-800: #1E293B;
	--gray-900: #0F172A;
	--black: #000000;

	/* Background colors */
	--bg-primary: #FFFFFF;
	--bg-secondary: #F8FAFC;
	--bg-tertiary: #F1F5F9;
	--bg-glass: rgba(255, 255, 255, 0.8);

	/* Text colors */
	--text-primary: #0F172A;
	--text-secondary: #475569;
	--text-muted: #94A3B8;
	--text-inverse: #FFFFFF;

	/* Border colors */
	--border-color: #E2E8F0;
	--border-light: #F1F5F9;
	--border-dark: #CBD5E1;

	/* Shadows - Softer, more modern */
	--shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
	--shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
	--shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
	--shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);
	--shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.16);
	--shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.2);
	--shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);
	--shadow-card: 0 2px 8px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.06);

	/* Spacing - More generous */
	--spacing-xs: 4px;
	--spacing-sm: 8px;
	--spacing-md: 16px;
	--spacing-lg: 24px;
	--spacing-xl: 32px;
	--spacing-2xl: 48px;
	--spacing-3xl: 64px;

	/* Border radius - Rounder, more modern */
	--radius-sm: 6px;
	--radius: 12px;
	--radius-lg: 16px;
	--radius-xl: 24px;
	--radius-2xl: 32px;
	--radius-full: 9999px;

	/* Typography - Modern system fonts */
	--font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	--font-family-mono: 'JetBrains Mono', 'SF Mono', 'Monaco', monospace;

	--font-size-xs: 11px;
	--font-size-sm: 13px;
	--font-size-base: 14px;
	--font-size-md: 16px;
	--font-size-lg: 18px;
	--font-size-xl: 20px;
	--font-size-2xl: 24px;
	--font-size-3xl: 32px;
	--font-size-4xl: 40px;

	--font-weight-normal: 400;
	--font-weight-medium: 500;
	--font-weight-semibold: 600;
	--font-weight-bold: 700;
	--font-weight-extrabold: 800;

	--line-height-tight: 1.2;
	--line-height-normal: 1.5;
	--line-height-relaxed: 1.75;

	/* Transitions - Smooth and snappy */
	--transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
	--transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
	--transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
	--transition-spring: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);

	/* Z-index layers */
	--z-dropdown: 100;
	--z-sticky: 200;
	--z-modal-backdrop: 300;
	--z-modal: 400;
	--z-toast: 500;

	/* Layout */
	--header-height: 64px;
	--sidebar-width: 280px;
	--cart-width: 420px;
}

/* Dark theme - Modern dark mode */
[data-theme="dark"] {
	--primary: #818CF8;
	--primary-dark: #6366F1;
	--primary-light: #A5B4FC;
	--primary-bg: rgba(129, 140, 248, 0.15);

	--bg-primary: #0F172A;
	--bg-secondary: #1E293B;
	--bg-tertiary: #334155;
	--bg-glass: rgba(15, 23, 42, 0.9);

	--text-primary: #F8FAFC;
	--text-secondary: #CBD5E1;
	--text-muted: #64748B;

	--border-color: #334155;
	--border-light: #1E293B;
	--border-dark: #475569;

	--shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
	--shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
	--shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* Reset */
*, *::before, *::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	font-size: var(--font-size-base);
	-webkit-text-size-adjust: 100%;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

body {
	font-family: var(--font-family);
	font-size: var(--font-size-base);
	line-height: var(--line-height-normal);
	color: var(--text-primary);
	background: linear-gradient(135deg, #F8FAFC 0%, #E2E8F0 100%);
	min-height: 100vh;
	overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
	font-weight: var(--font-weight-bold);
	line-height: var(--line-height-tight);
	color: var(--text-primary);
	letter-spacing: -0.02em;
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-md); }

p {
	margin-bottom: var(--spacing-md);
	color: var(--text-secondary);
}

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

a:hover {
	color: var(--primary-dark);
}

/* Modern Buttons */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--spacing-sm);
	padding: 12px 20px;
	font-family: inherit;
	font-size: var(--font-size-base);
	font-weight: var(--font-weight-semibold);
	line-height: 1;
	text-align: center;
	white-space: nowrap;
	vertical-align: middle;
	cursor: pointer;
	user-select: none;
	border: none;
	border-radius: var(--radius);
	transition: all var(--transition);
	position: relative;
	overflow: hidden;
}

.btn::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(rgba(255,255,255,0.2), transparent);
	opacity: 0;
	transition: opacity var(--transition-fast);
}

.btn:hover::before {
	opacity: 1;
}

.btn:focus {
	outline: none;
	box-shadow: 0 0 0 3px var(--primary-bg), var(--shadow);
}

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

.btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	transform: none;
}

.btn--primary {
	color: var(--white);
	background: var(--primary-gradient);
	box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn--primary:hover:not(:disabled) {
	box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
	transform: translateY(-1px);
}

.btn--secondary {
	color: var(--text-primary);
	background-color: var(--white);
	border: 1px solid var(--border-color);
	box-shadow: var(--shadow-xs);
}

.btn--secondary:hover:not(:disabled) {
	background-color: var(--bg-secondary);
	border-color: var(--border-dark);
}

.btn--danger {
	color: var(--white);
	background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
	box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

.btn--success {
	color: var(--white);
	background: linear-gradient(135deg, #10B981 0%, #059669 100%);
	box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.btn--large {
	padding: 16px 28px;
	font-size: var(--font-size-md);
	border-radius: var(--radius-lg);
}

.btn--small {
	padding: 8px 14px;
	font-size: var(--font-size-sm);
}

.btn--icon {
	width: 44px;
	height: 44px;
	padding: 0;
	border-radius: var(--radius);
}

/* Modern Form elements */
input, select, textarea {
	font-family: inherit;
	font-size: var(--font-size-base);
	line-height: var(--line-height-normal);
	color: var(--text-primary);
	background-color: var(--white);
	border: 2px solid var(--border-color);
	border-radius: var(--radius);
	padding: 12px 16px;
	transition: all var(--transition-fast);
}

input:focus, select:focus, textarea:focus {
	outline: none;
	border-color: var(--primary);
	box-shadow: 0 0 0 4px var(--primary-bg);
}

input:disabled, select:disabled, textarea:disabled {
	background-color: var(--bg-tertiary);
	cursor: not-allowed;
	opacity: 0.7;
}

input[type="number"] {
	-moz-appearance: textfield;
	font-weight: var(--font-weight-semibold);
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* Modern Loading spinner */
.spinner {
	display: inline-block;
	width: 24px;
	height: 24px;
	border: 3px solid var(--border-color);
	border-top-color: var(--primary);
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

.spinner--large {
	width: 40px;
	height: 40px;
	border-width: 4px;
}

@keyframes spin {
	to { transform: rotate(360deg); }
}

/* Skeleton loading - Smoother */
.skeleton {
	background: linear-gradient(
		90deg,
		var(--bg-tertiary) 0%,
		var(--bg-secondary) 50%,
		var(--bg-tertiary) 100%
	);
	background-size: 200% 100%;
	animation: shimmer 1.5s ease-in-out infinite;
	border-radius: var(--radius);
}

@keyframes shimmer {
	0% { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

/* Modern Scrollbar */
::-webkit-scrollbar {
	width: 6px;
	height: 6px;
}

::-webkit-scrollbar-track {
	background: transparent;
}

::-webkit-scrollbar-thumb {
	background: var(--gray-300);
	border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
	background: var(--gray-400);
}

/* Selection */
::selection {
	background-color: var(--primary);
	color: var(--white);
}

/* App container */
#jibu-pos-app {
	min-height: 100vh;
	background: linear-gradient(135deg, var(--bg-secondary) 0%, #E2E8F0 100%);
}

/* View transitions - Smoother */
.view {
	animation: slideUp var(--transition-slow) ease-out;
}

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

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

@keyframes scaleIn {
	from {
		opacity: 0;
		transform: scale(0.95);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

@keyframes pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.5; }
}

/* App error */
.app-error {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	padding: var(--spacing-xl);
	text-align: center;
}

.app-error__icon {
	width: 80px;
	height: 80px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--error-bg);
	border-radius: var(--radius-full);
	color: var(--error);
	margin-bottom: var(--spacing-lg);
}

.app-error h1 {
	margin-bottom: var(--spacing-sm);
	font-size: var(--font-size-2xl);
}

.app-error p {
	color: var(--text-secondary);
	max-width: 400px;
	margin-bottom: var(--spacing-lg);
}

/* Update notification - Modern toast */
.update-notification {
	position: fixed;
	bottom: var(--spacing-lg);
	left: 50%;
	transform: translateX(-50%) translateY(100px);
	display: flex;
	align-items: center;
	gap: var(--spacing-md);
	padding: var(--spacing-md) var(--spacing-lg);
	background: var(--gray-900);
	color: var(--white);
	border-radius: var(--radius-xl);
	box-shadow: var(--shadow-lg);
	z-index: var(--z-toast);
	opacity: 0;
	transition: all var(--transition-slow);
	backdrop-filter: blur(10px);
}

.update-notification--visible {
	transform: translateX(-50%) translateY(0);
	opacity: 1;
}

/* Badge styles */
.badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 4px 10px;
	font-size: var(--font-size-xs);
	font-weight: var(--font-weight-semibold);
	border-radius: var(--radius-full);
	white-space: nowrap;
}

.badge--primary {
	background: var(--primary-bg);
	color: var(--primary);
}

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

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

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

/* Card base style */
.card {
	background: var(--white);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-card);
	overflow: hidden;
}

/* Glass effect */
.glass {
	background: rgba(255, 255, 255, 0.7);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Utility classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-warning { color: var(--warning); }

.font-mono { font-family: var(--font-family-mono); }
.font-bold { font-weight: var(--font-weight-bold); }
.font-semibold { font-weight: var(--font-weight-semibold); }

.bg-primary { background-color: var(--bg-primary); }
.bg-secondary { background-color: var(--bg-secondary); }

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }

/* Responsive utilities */
@media (max-width: 768px) {
	:root {
		--font-size-base: 14px;
		--spacing-md: 12px;
		--spacing-lg: 20px;
		--radius: 10px;
		--radius-lg: 14px;
	}
}
