/*
 * impellikBites - Mobile-First CSS
 * Base styles are for PHONE (320px-480px)
 * Progressive enhancement for tablet (768px+) and desktop (1024px+)
 */

/* ===== RESET & BASE (PHONE) ===== */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

:root {
	--color-primary: #5B8FD8;
	--color-primary-dark: #336699;
	--color-accent: #E67E22;
	--color-accent-dark: #CC6C1D;
	--color-danger: #ef4444;
	--color-warning: #f59e0b;
	--color-gray-50: #F4F6F7;
	--color-gray-100: #f3f4f6;
	--color-gray-200: #e5e7eb;
	--color-gray-300: #BDC3C7;
	--color-gray-600: #4A4948;
	--color-gray-800: #272A2E;
	--color-gray-900: #1D2632;

	--spacing-xs: 0.5rem;
	--spacing-sm: 0.75rem;
	--spacing-md: 1rem;
	--spacing-lg: 1.5rem;
	--spacing-xl: 2rem;

	--touch-target: 44px;
	--border-radius: 12px;
	--font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
	font-family: var(--font-sans);
	font-size: 16px;
	line-height: 1.5;
	color: var(--color-gray-900);
	background: var(--color-gray-50);
	padding-bottom: 70px;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* ===== LAYOUT (PHONE) ===== */
.container {
	width: 100%;
	padding: 0 var(--spacing-md);
	max-width: 100%;
}

.page-content {
	padding: var(--spacing-md);
	min-height: calc(100vh - 70px);
}

/* ===== TYPOGRAPHY (PHONE) ===== */
h1 {
	font-size: 1.75rem;
	font-weight: 700;
	line-height: 1.2;
	margin-bottom: var(--spacing-md);
	color: var(--color-gray-900);
}

h2 {
	font-size: 1.5rem;
	font-weight: 600;
	line-height: 1.3;
	margin-bottom: var(--spacing-sm);
}

h3 {
	font-size: 1.25rem;
	font-weight: 600;
	margin-bottom: var(--spacing-sm);
}

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

.text-muted {
	color: var(--color-gray-600);
	font-size: 0.875rem;
}

.text-small {
	font-size: 0.875rem;
}

/* ===== BUTTONS (PHONE - THUMB FRIENDLY) ===== */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: var(--touch-target);
	padding: 0 var(--spacing-lg);
	border: none;
	border-radius: var(--border-radius);
	font-size: 1rem;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: all 0.2s;
	-webkit-tap-highlight-color: transparent;
	width: 100%;
	margin-bottom: var(--spacing-sm);
	text-align: center;
}

.btn i {
	line-height: 1;
}

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

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

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

.btn-outline {
	background: white;
	color: var(--color-gray-800);
	border: 2px solid var(--color-gray-300);
}

.btn-outline:active {
	background: var(--color-gray-100);
}

.btn-large {
	min-height: 56px;
	font-size: 1.125rem;
}

.btn i {
	margin-right: var(--spacing-xs);
}

/* ===== BOTTOM TAB NAVIGATION (PHONE) ===== */
.bottom-nav {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	height: 60px;
	background: white;
	border-top: 1px solid var(--color-gray-200);
	display: flex;
	justify-content: space-around;
	align-items: center;
	z-index: 1000;
	box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.bottom-nav a {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 100%;
	color: var(--color-gray-600);
	text-decoration: none;
	font-size: 0.75rem;
	gap: 2px;
	-webkit-tap-highlight-color: transparent;
}

.bottom-nav a i {
	font-size: 1.5rem;
}

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

.bottom-nav a:active {
	background: var(--color-gray-50);
}

/* Hide bottom nav on tablet/desktop */
@media (min-width: 768px) {
	.bottom-nav {
		display: none;
	}
	body {
		padding-bottom: 0;
	}
}

/* ===== TOP NAVIGATION (TABLET/DESKTOP ONLY) ===== */
.top-nav {
	display: none;
	background: white;
	border-bottom: 1px solid var(--color-gray-200);
	padding: var(--spacing-md);
	margin-bottom: var(--spacing-lg);
}

.top-nav .nav-brand {
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--color-primary);
	text-decoration: none;
}

@media (min-width: 768px) {
	.top-nav {
		display: flex;
		justify-content: space-between;
		align-items: center;
	}
}

/* ===== CARDS (PHONE) ===== */
.card {
	background: white;
	border-radius: var(--border-radius);
	padding: var(--spacing-md);
	margin-bottom: var(--spacing-md);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card-stat {
	text-align: center;
	padding: var(--spacing-lg);
}

.card-stat .stat-value {
	font-size: 2.5rem;
	font-weight: 700;
	color: var(--color-primary);
	line-height: 1;
	margin-bottom: var(--spacing-xs);
}

.card-stat .stat-label {
	font-size: 0.875rem;
	color: var(--color-gray-600);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.card-stat .stat-detail {
	font-size: 0.75rem;
	color: var(--color-gray-600);
	margin-top: var(--spacing-xs);
}

/* ===== FOOD LOG CARD (PHONE) ===== */
.food-card {
	display: flex;
	gap: var(--spacing-md);
	padding: var(--spacing-md);
	background: white;
	border-radius: var(--border-radius);
	margin-bottom: var(--spacing-sm);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.food-card-image {
	width: 80px;
	height: 80px;
	border-radius: 8px;
	object-fit: cover;
	flex-shrink: 0;
}

.food-card-content {
	flex: 1;
	min-width: 0;
}

.food-card-title {
	font-weight: 600;
	font-size: 1rem;
	margin-bottom: var(--spacing-xs);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.food-card-calories {
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--color-primary);
	margin-bottom: var(--spacing-xs);
}

.food-card-meta {
	font-size: 0.75rem;
	color: var(--color-gray-600);
}

/* ===== BADGES (PHONE) ===== */
.badge {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 6px;
	font-size: 0.75rem;
	font-weight: 600;
	margin-right: var(--spacing-xs);
}

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

.badge-secondary {
	background: var(--color-gray-200);
	color: var(--color-gray-800);
}

/* ===== FORMS (PHONE) ===== */
.form-group {
	margin-bottom: var(--spacing-md);
}

.form-label {
	display: block;
	font-weight: 600;
	margin-bottom: var(--spacing-xs);
	font-size: 0.875rem;
}

.form-input,
.form-select,
.form-textarea {
	width: 100%;
	min-height: var(--touch-target);
	padding: var(--spacing-sm) var(--spacing-md);
	border: 2px solid var(--color-gray-300);
	border-radius: var(--border-radius);
	font-size: 1rem;
	font-family: var(--font-sans);
	-webkit-appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
	outline: none;
	border-color: var(--color-primary);
}

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

/* ===== ALERTS (PHONE) ===== */
.alert {
	padding: var(--spacing-md);
	border-radius: var(--border-radius);
	margin-bottom: var(--spacing-md);
}

.alert-info {
	background: #dbeafe;
	color: #1e40af;
}

.alert-danger {
	background: #fee2e2;
	color: #991b1b;
}

.alert-success {
	background: #d1fae5;
	color: #065f46;
}

/* ===== LOADING SPINNER (PHONE) ===== */
.loading {
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 3px solid var(--color-gray-300);
	border-top-color: var(--color-primary);
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

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

/* ===== CAMERA CAPTURE INTERFACE (PHONE) ===== */
.camera-container {
	position: relative;
	width: 100%;
	background: black;
	border-radius: var(--border-radius);
	overflow: hidden;
	margin-bottom: var(--spacing-md);
}

.camera-preview {
	width: 100%;
	height: auto;
	display: block;
}

.camera-controls {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	padding: var(--spacing-lg);
	display: flex;
	justify-content: center;
	gap: var(--spacing-lg);
	background: linear-gradient(transparent, rgba(0,0,0,0.7));
}

.camera-btn {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: white;
	border: 4px solid var(--color-primary);
	cursor: pointer;
}

/* ===== PROGRESSIVE ENHANCEMENT: TABLET (768px+) ===== */
@media (min-width: 768px) {
	.container {
		max-width: 720px;
		margin: 0 auto;
		padding: 0 var(--spacing-lg);
	}

	h1 {
		font-size: 2.25rem;
	}

	.btn {
		width: auto;
		min-width: 120px;
		margin-right: var(--spacing-sm);
	}

	.card-grid {
		display: grid;
		grid-template-columns: repeat(2, 1fr);
		gap: var(--spacing-md);
	}
}

/* ===== PROGRESSIVE ENHANCEMENT: DESKTOP (1024px+) ===== */
@media (min-width: 1024px) {
	.container {
		max-width: 960px;
	}

	.card-grid {
		grid-template-columns: repeat(3, 1fr);
	}

	h1 {
		font-size: 2.5rem;
	}
}

/* ===== OAUTH PROVIDERS (PHONE) ===== */
.oauth-providers {
	display: flex;
	justify-content: center;
	gap: var(--spacing-md);
	flex-wrap: wrap;
}

.oauth-btn {
	width: 64px;
	height: 64px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 2px solid var(--color-gray-300);
	border-radius: var(--border-radius);
	background: white;
	font-size: 2rem;
	text-decoration: none;
	transition: all 0.2s;
	-webkit-tap-highlight-color: transparent;
}

.oauth-btn:hover {
	border-color: var(--color-gray-600);
	background: var(--color-gray-50);
}

.oauth-btn:active {
	transform: scale(0.95);
	background: var(--color-gray-100);
}

.oauth-icon-google {
	color: #DB4437;
}

.oauth-icon-github {
	color: #181717;
}

.oauth-icon-microsoft {
	color: #00A4EF;
}

.oauth-icon-facebook {
	color: #1877F2;
}

.oauth-icon-linkedin {
	color: #0A66C2;
}

/* ===== UTILITY CLASSES ===== */
.hidden {
	display: none;
}

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

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }
