:root {
	--primary: #2563eb;
	--primary-dark: #1d4ed8;
	--bg: #0f172a;
	--card: #1e293b;
	--card-hover: #334155;
	--text: #f1f5f9;
	--text-muted: #94a3b8;
	--accent: #22d3ee;
	--bus: #f97316;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
	font-family: 'Inter', sans-serif;
	background: var(--bg);
	color: var(--text);
	min-height: 100vh;
	background-image: 
	radial-gradient(ellipse at top, #1e3a5f 0%, transparent 50%),
	radial-gradient(ellipse at bottom right, #1e293b 0%, transparent 50%);
}

.container {
	max-width: 480px;
	margin: 0 auto;
	padding: 20px;
	min-height: 100vh;
}

header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 24px;
	padding-bottom: 16px;
	border-bottom: 1px solid rgba(255,255,255,0.1);
}

header h1 {
	font-size: 24px;
	font-weight: 700;
	background: linear-gradient(135deg, var(--text), var(--accent));
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

.location-btn {
	background: var(--card);
	border: 1px solid rgba(255,255,255,0.1);
	color: var(--text);
	padding: 10px 16px;
	border-radius: 12px;
	cursor: pointer;
	font-size: 14px;
	display: flex;
	align-items: center;
	gap: 8px;
	transition: all 0.2s;
}

.location-btn:hover { background: var(--card-hover); border-color: var(--primary); }
.location-btn.active { background: var(--primary); border-color: var(--primary); }
.location-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.location-btn svg { width: 18px; height: 18px; }

.search-box { position: relative; margin-bottom: 20px; }

.search-box input {
	width: 100%;
	background: var(--card);
	border: 1px solid rgba(255,255,255,0.1);
	color: var(--text);
	padding: 14px 16px 14px 44px;
	border-radius: 14px;
	font-size: 16px;
	outline: none;
	transition: all 0.2s;
}

.search-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2); }

.search-box svg {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	width: 20px;
	height: 20px;
	color: var(--text-muted);
}

.nearest-stop {
	background: linear-gradient(135deg, var(--primary), var(--primary-dark));
	border-radius: 16px;
	padding: 20px;
	margin-bottom: 24px;
	cursor: pointer;
	transition: transform 0.2s, box-shadow 0.2s;
}

.nearest-stop:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3); }

.nearest-stop-label { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; opacity: 0.8; margin-bottom: 8px; }
.nearest-stop-name { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.nearest-stop-distance { font-size: 14px; opacity: 0.9; }

.section-title { font-size: 18px; font-weight: 600; margin-bottom: 16px; }

.stops-list { display: flex; flex-direction: column; gap: 8px; }

.stop-item {
	background: var(--card);
	border-radius: 12px;
	padding: 16px;
	cursor: pointer;
	transition: all 0.2s;
	border: 1px solid transparent;
}

.stop-item:hover, .stop-item.active { background: var(--card-hover); border-color: var(--primary); }

.stop-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.stop-name { font-weight: 500; }
.stop-distance { font-size: 13px; color: var(--text-muted); }
.stop-routes { display: flex; flex-wrap: wrap; gap: 6px; }

.route-badge {
	background: var(--bus);
	color: white;
	padding: 4px 10px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 500;
}

.back-btn {
	background: var(--card);
	border: 1px solid rgba(255,255,255,0.1);
	color: var(--text);
	padding: 10px 16px;
	border-radius: 12px;
	cursor: pointer;
	font-size: 14px;
	display: flex;
	align-items: center;
	gap: 8px;
	transition: all 0.2s;
	margin-bottom: 20px;
}

.back-btn:hover { background: var(--card-hover); border-color: var(--primary); }
.back-btn svg { width: 18px; height: 18px; }

.arrivals-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.arrivals-title { font-size: 20px; font-weight: 600; }

.refresh-btn {
	background: var(--card);
	border: 1px solid rgba(255,255,255,0.1);
	color: var(--text);
	padding: 10px;
	border-radius: 10px;
	cursor: pointer;
	transition: all 0.2s;
}

.refresh-btn:hover { background: var(--card-hover); border-color: var(--primary); }
.refresh-btn svg { width: 20px; height: 20px; display: block; }
.refresh-btn.loading svg { animation: spin 1s linear infinite; }

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


@media (max-width: 460px) {
	.location-btn span { display: none; }
}

.arrival-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px;
	background: rgba(255,255,255,0.03);
	border-radius: 12px;
	margin-bottom: 8px;
}

.arrival-route { display: flex; align-items: center; gap: 12px; }

.route-number {
	background: var(--bus);
	color: white;
	padding: 6px 12px;
	border-radius: 8px;
	font-weight: 600;
	min-width: 50px;
	text-align: center;
}

.arrival-time { font-size: 24px; font-weight: 700; color: var(--accent); }
.arrival-time.soon { color: #ef4444; }
.arrival-time-label { font-size: 12px; color: var(--text-muted); }
.arrival-info { text-align: right; }

.schedule-section { margin-top: 24px; }
.schedule-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; color: var(--text-muted); }

.schedule-route-header {
	background: var(--card);
	border-radius: 10px;
	padding: 12px;
	margin-bottom: 8px;
}

.schedule-route-name {
	font-weight: 600;
	font-size: 15px;
	margin-bottom: 4px;
}

.schedule-route-direction {
	font-size: 13px;
	color: var(--text-muted);
}

.schedule-times {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 10px;
}

.schedule-time {
	background: rgba(255,255,255,0.05);
	padding: 6px 10px;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 500;
}

.no-arrivals { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.loading { display: flex; align-items: center; justify-content: center; padding: 40px; }

.spinner {
	width: 40px;
	height: 40px;
	border: 3px solid rgba(255,255,255,0.1);
	border-top-color: var(--primary);
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

.error {
	background: rgba(239, 68, 68, 0.1);
	border: 1px solid #ef4444;
	color: #ef4444;
	padding: 16px;
	border-radius: 12px;
	text-align: center;
}

.geo-error {
	background: rgba(245, 158, 11, 0.1);
	border: 1px solid #f59e0b;
	color: #f59e0b;
	padding: 12px 16px;
	border-radius: 10px;
	font-size: 14px;
	margin-bottom: 20px;
	display: none;
}

.geo-error.visible { display: block; }

.page { display: none; }
.page.active { display: block; }

