@import "./auth-theme.css";
@import "./header.css";
:root {
	/* Brand Colors - Electric Power */
	--primary: #0052cc;
	--primary-dark: #003d99;
	--primary-light: #deebff;
	--secondary: #f2a900;
	/* Gold */
	--secondary-dark: #d69400;
	--accent: #ce1126;
	/* Red */

	/* Backgrounds */
	--bg-main: #f8fafc;
	--bg-card: rgba(255, 255, 255, 0.85);
	--bg-card-solid: #ffffff;
	--bg-modal: rgba(255, 255, 255, 0.95);

	/* Text */
	--text-main: #0f172a;
	--text-muted: #64748b;
	--text-light: #94a3b8;
	--text-on-primary: #ffffff;

	/* UI Elements */
	--border: #e2e8f0;
	--border-light: rgba(226, 232, 240, 0.5);
	--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
	--shadow:
		0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
	--shadow-lg:
		0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
	--glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);

	/* Status Colors */
	--success: #10b981;
	--warning: #f59e0b;
	--danger: #ce1126;
	--info: #3b82f6;

	/* Layout */
	--header-height: 64px;
	--nav-height: 72px;
	--safe-top: env(safe-area-inset-top, 0px);
	--safe-bottom: env(safe-area-inset-bottom, 0px);
	--radius-sm: 8px;
	--radius: 12px;
	--radius-lg: 20px;
	--radius-full: 9999px;

	/* Spacing */
	--spacing-xs: 4px;
	--spacing-sm: 8px;
	--spacing-md: 16px;
	--spacing-lg: 24px;
	--spacing-xl: 32px;
}

/* Base Styles */
* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	-webkit-tap-highlight-color: transparent;
}

body {
	font-family:
		"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
		Arial, sans-serif;
	background-color: var(--bg-main);
	color: var(--text-main);
	line-height: 1.5;
	overflow: hidden;
	height: 100vh;
	height: 100dvh;
	width: 100vw;
}

/* Utilities */
.hidden {
	display: none !important;
}

.icon svg {
	width: 1em;
	height: 1em;
	vertical-align: middle;
	fill: currentColor;
}

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

.text-right {
	text-align: right;
}

.mt-sm {
	margin-top: var(--spacing-sm);
}

.mt-md {
	margin-top: var(--spacing-md);
}

.mt-lg {
	margin-top: var(--spacing-lg);
}

.mb-sm {
	margin-bottom: var(--spacing-sm);
}

.mb-md {
	margin-bottom: var(--spacing-md);
}

.mb-lg {
	margin-bottom: var(--spacing-lg);
}

.color-primary {
	color: var(--primary);
}

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

.color-danger {
	color: var(--danger);
}

.color-success {
	color: var(--success);
}

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

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
	font-weight: 700;
	color: var(--text-main);
	line-height: 1.2;
}

/* Glassmorphism Classes */
.glass-panel {
	background: var(--bg-card);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border: 1px solid var(--border-light);
	border-radius: var(--radius-lg);
	box-shadow: var(--glass-shadow);
}

.glass-header {
	background: rgba(25, 135, 84, 0.9);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	color: white;
}

/* Layout */
.main-app {
	display: flex;
	flex-direction: column;
	height: 100vh;
	height: 100dvh;
	min-height: 100vh;
	min-height: 100dvh;
	overflow: hidden;
}

.content {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	padding: var(--spacing-md);
	padding-bottom: calc(
		var(--nav-height) +
		max(var(--safe-bottom), 8px) +
		var(--spacing-md)
	);
	padding-top: calc(
		var(--header-height) +
		var(--safe-top) +
		var(--spacing-md) +
		8px
	);
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-y: contain;
}

/* Basic Grid/Flex */
.flex {
	display: flex;
}

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

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

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

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

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

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

/* Buttons */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--spacing-sm);
	padding: 12px 20px;
	border-radius: var(--radius);
	font-weight: 600;
	font-size: 15px;
	border: none;
	cursor: pointer;
	transition: all 0.2s ease;
	font-family: inherit;
	width: 100%;
}

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

.btn-primary {
	background: var(--primary);
	color: white;
	box-shadow: 0 4px 12px rgba(25, 135, 84, 0.3);
}

.btn-primary:active {
	background: var(--primary-dark);
	transform: scale(0.98);
}

.btn-secondary {
	background: var(--bg-card-solid);
	color: var(--text-main);
	border: 1px solid var(--border);
}

.btn-secondary:active {
	background: var(--bg-main);
	transform: scale(0.98);
}

.btn-danger {
	background: var(--danger);
	color: white;
}

.btn-outline {
	background: transparent;
	border: 2px solid var(--primary);
	color: var(--primary);
}

.btn-floating {
	position: fixed;
	bottom: calc(var(--nav-height) + var(--spacing-md));
	right: var(--spacing-md);
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: var(--danger);
	color: white;
	box-shadow: 0 4px 15px rgba(206, 17, 38, 0.4);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
	border: none;
	z-index: 50;
	transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-floating:active {
	transform: scale(0.9);
}

.btn-icon {
	width: 40px;
	height: 40px;
	padding: 0;
	border-radius: 50%;
}

/* Page Header */
.page-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.page-title {
	font-size: 1.25rem;
	font-weight: 800;
	color: var(--text-primary);
}

/* Empty State */
.empty-state {
	text-align: center;
	padding: 3rem 1rem;
	color: var(--text-secondary);
}

.empty-state i {
	font-size: 3rem;
	opacity: 0.5;
	margin-bottom: 1rem;
}

.empty-state p {
	margin-bottom: 1rem;
}

/* Menu Item */
.menu-item {
	display: flex;
	align-items: center;
	gap: 1rem;
	width: 100%;
	padding: 1rem;
	border: none;
	background: var(--surface);
	border-radius: var(--radius-md);
	color: var(--text-primary);
	font-size: 0.875rem;
	font-weight: 500;
	text-align: left;
	cursor: pointer;
	transition: background 0.2s;
}

.menu-item:hover {
	background: var(--bg-secondary);
}

/* Form Inputs */
.form-group {
	margin-bottom: var(--spacing-md);
}

.form-label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--text-muted);
	margin-bottom: 6px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.form-input,
.form-select {
	width: 100%;
	padding: 14px 16px;
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	font-size: 16px;
	color: var(--text-main);
	font-family: inherit;
	transition: all 0.2s ease;
	box-shadow: var(--shadow-sm);
	appearance: none;
}

.form-input:focus,
.form-select:focus {
	outline: none;
	border-color: var(--primary);
	box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.1);
}

/* Header */
.header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	min-height: calc(var(--header-height) + var(--safe-top) + 8px);
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	padding: calc(var(--safe-top) + 8px) var(--spacing-md) 8px;
	z-index: 100;
	background: var(--primary);
	color: white;
	box-shadow: var(--shadow);
}

.header-title {
	font-size: 20px;
	font-weight: 700;
	letter-spacing: -0.5px;
}

.header-actions {
	display: flex;
	gap: var(--spacing-sm);
}

.header-btn {
	background: rgba(255, 255, 255, 0.15);
	border: none;
	color: white;
	width: 40px;
	height: 40px;
	border-radius: var(--radius-full);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	cursor: pointer;
	transition: background 0.2s;
}

.header-btn:active {
	background: rgba(255, 255, 255, 0.25);
}

/* Bottom Navigation */
.bottom-nav {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	height: calc(var(--nav-height) + max(var(--safe-bottom), 8px));
	background: var(--bg-card);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	border-top: 1px solid var(--border-light);
	display: flex;
	justify-content: space-around;
	align-items: center;
	padding-bottom: max(var(--safe-bottom), 8px);
	z-index: 100;
	box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.05);
}

.nav-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	background: none;
	border: none;
	color: var(--text-muted);
	font-size: 11px;
	font-weight: 600;
	width: 20%;
	height: 100%;
	cursor: pointer;
	transition: all 0.2s ease;
}

.nav-item i {
	font-size: 24px;
	transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-item.active {
	color: var(--primary);
}

.nav-item.active i {
	transform: translateY(-2px);
}

/* Side Menu */
.side-menu {
	position: fixed;
	inset: 0;
	z-index: 200;
	background: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
}

.side-menu:not(.hidden) {
	opacity: 1;
	pointer-events: auto;
}

.side-menu-content {
	position: absolute;
	top: 0;
	bottom: 0;
	right: 0;
	width: 280px;
	background: var(--bg-card-solid);
	transform: translateX(100%);
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	display: flex;
	flex-direction: column;
	box-shadow: -4px 0 15px rgba(0, 0, 0, 0.1);
}

.side-menu:not(.hidden) .side-menu-content {
	transform: translateX(0);
}

.side-menu-header {
	background: var(--primary);
	color: white;
	padding: var(--spacing-lg) var(--spacing-md);
	padding-top: calc(var(--spacing-lg) + env(safe-area-inset-top));
}

.menu-user {
	display: flex;
	align-items: center;
	gap: var(--spacing-md);
}

.user-avatar {
	width: 48px;
	height: 48px;
	background: rgba(255, 255, 255, 0.2);
	border-radius: var(--radius-full);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
}

.user-details h3 {
	font-size: 16px;
	margin: 0;
}

.user-details p {
	font-size: 12px;
	opacity: 0.8;
	margin: 0;
}

.side-menu-nav {
	flex: 1;
	overflow-y: auto;
	padding: var(--spacing-md) 0;
}

.side-menu-nav button {
	display: flex;
	align-items: center;
	gap: var(--spacing-md);
	width: 100%;
	padding: 16px var(--spacing-lg);
	background: none;
	border: none;
	color: var(--text-main);
	font-size: 16px;
	font-weight: 500;
	text-align: left;
	transition: background 0.2s;
}

.side-menu-nav button:active {
	background: var(--bg-main);
}

.side-menu-nav button i {
	font-size: 22px;
	color: var(--text-muted);
}

.divider {
	height: 1px;
	background: var(--border);
	margin: var(--spacing-sm) 0;
}

/* Modal */
.modal-container {
	position: fixed;
	inset: 0;
	z-index: 300;
	display: flex;
	align-items: flex-end;
	justify-content: center;
}

.modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.6);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.modal-container:not(.hidden) .modal-backdrop {
	opacity: 1;
}

.modal-content {
	position: relative;
	width: 100%;
	max-height: 90vh;
	background: var(--bg-card-solid);
	border-radius: 24px 24px 0 0;
	padding: var(--spacing-lg) var(--spacing-md);
	padding-bottom: calc(var(--spacing-lg) + env(safe-area-inset-bottom));
	transform: translateY(100%);
	transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.1);
	display: flex;
	flex-direction: column;
}

.modal-container:not(.hidden) .modal-content {
	transform: translateY(0);
}

.modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: var(--spacing-md);
}

.modal-body {
	overflow-y: auto;
	padding-bottom: var(--spacing-md);
}

.modal-handle {
	width: 40px;
	height: 4px;
	background: #cbd5e1;
	border-radius: 2px;
	margin: 0 auto 16px;
}

/* Splash Screen */
.splash-screen {
	position: fixed;
	inset: 0;
	background: var(--primary);
	color: white;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1000;
	transition: opacity 0.5s ease;
}

.splash-content {
	text-align: center;
	animation: bounceIn 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.splash-icon {
	font-size: 72px;
	margin-bottom: 16px;
	color: var(--secondary);
	filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.splash-title {
	font-size: 32px;
	font-weight: 800;
	letter-spacing: -1px;
	margin-bottom: 8px;
}

.splash-subtitle {
	font-size: 16px;
	opacity: 0.9;
	font-weight: 500;
}

.splash-loader {
	width: 40px;
	height: 4px;
	background: rgba(255, 255, 255, 0.3);
	border-radius: 2px;
	margin: 32px auto 0;
	overflow: hidden;
	position: relative;
}

.splash-loader::after {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	height: 100%;
	width: 40%;
	background: var(--secondary);
	border-radius: 2px;
	animation: loading 1.5s infinite ease-in-out;
}

/* Auth Screen — handled by shared auth-theme.css */

/* Cards */
.card {
	background: var(--bg-card-solid);
	border-radius: var(--radius-lg);
	padding: var(--spacing-md);
	box-shadow: var(--shadow-sm);
	border: 1px solid var(--border-light);
	margin-bottom: var(--spacing-md);
}

.card-title {
	font-size: 16px;
	font-weight: 600;
	color: var(--text-main);
	margin-bottom: var(--spacing-sm);
	display: flex;
	justify-content: space-between;
	align-items: center;
}

/* App-Specific UI Cards */
.summary-card {
	background: linear-gradient(
		135deg,
		var(--primary) 0%,
		var(--primary-dark) 100%
	);
	color: white;
	padding: var(--spacing-lg);
	border-radius: var(--radius-lg);
	box-shadow: 0 10px 20px rgba(25, 135, 84, 0.2);
	margin-bottom: var(--spacing-lg);
	position: relative;
	overflow: hidden;
}

.summary-card::after {
	content: "";
	position: absolute;
	top: -20px;
	right: -20px;
	width: 100px;
	height: 100px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.1);
}

.summary-amount {
	font-size: 36px;
	font-weight: 800;
	letter-spacing: -1px;
	margin: 8px 0;
	display: flex;
	align-items: baseline;
	gap: 4px;
}

.summary-currency {
	font-size: 18px;
	font-weight: 500;
	opacity: 0.9;
}

/* Animations */
@keyframes bounceIn {
	0% {
		transform: scale(0.8);
		opacity: 0;
	}

	50% {
		transform: scale(1.05);
	}

	100% {
		transform: scale(1);
		opacity: 1;
	}
}

@keyframes loading {
	0% {
		transform: translateX(-100%);
	}

	100% {
		transform: translateX(250%);
	}
}

@keyframes slideUpFade {
	0% {
		transform: translateY(10px);
		opacity: 0;
	}

	100% {
		transform: translateY(0);
		opacity: 1;
	}
}

.animate-slide-up {
	animation: slideUpFade 0.4s ease forwards;
}
